"4173187","1","4173644","","2010-11-13 15:14:30","1","3345","<p>I'm trying to get familiar with Android and its database API.I've created a class that inherits from SQLiteOpenHelper and thisis how I create the table in the database</p><pre><code> @Override public void onCreate(SQLiteDatabase db) {  try {   db.execSQL(""CREATE TABLE "" + FUELS_TABLE_NAME + "" (""     + ""_ID INTEGER PRIMARY KEY AUTOINCREMENT, ""     + ""DATE_OF_FUELS DATE DEFAULT CURRENT_TIME,""
     + ""SELLER_POSITION TEXT DEFAULT 'unknown',""
     + ""AMOUNT REAL""     + "");""     );  } catch (SQLException e) {   Log.e(DATABASE_NAME, e.toString());  } }</code></pre><p>The function used to add data to the DB is the following implemeneted withinthe same class is</p><pre><code>   public void addNewFuel(float amount) {  // Create the content to insert into the database  ContentValues newEntry = new ContentValues();  newEntry.put(""amount"", amount);  // Get database handler  try {   db = getWritableDatabase();  } catch (SQLException e) {   Log.e(DATABASE_NAME, e.toString());   return;  }  // Begin transaction and insert data  long returnedValue;  db.beginTransaction();  try {   returnedValue = db.insertOrThrow(FUELS_TABLE_NAME, null, newEntry);   Log.v(DATABASE_NAME, ""return value "" + returnedValue);  } catch (SQLException e) {   Log.e(DATABASE_NAME, e.toString());  } finally {   db.endTransaction();  }   db.close(); }</code></pre><p>but apparently no data is added. The returnValue is always 1. The method doesn't throw,and when I pull out the DB with adb and look at it's content is totally empty.</p><p>I just can't understand what I'm missing.</p><p>Any suggestion would be appreciated.</p><p>Thanks,S</p>","323148","","","","","2011-12-13 10:03:57","SQLiteDatabase.insertOrThrow doesn't throw but not data is inserted","<android><sqlite>","2","0","1","",""
"4173204","1","4173253","","2010-11-13 15:18:51","0","3904","<p>I am developing an app which uses the phone's default camera application to capture an image and then allow the user to perform some basic editing.</p><p>I use the following snippet...</p><pre><code>Intentintent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,*&lt;file&gt;*);startActivityForResult(intent, TAKE_PHOTO_CODE);</code></pre><p>I want the image captured to be saved in a location that is consistent with the stock camera application.  Can I use the DCIM folder and assume all phones will use that location?</p>","481009","","","","","2010-12-21 19:18:36","Do all Android phones with a built-in camera use a folder called ""DCIM"" to store captured images?","<android><camera><android-camera><android-camera-intent><android-capture>","2","1","","",""
"4173304","1","4173363","","2010-11-13 15:41:05","2","2824","<p>I am developing one android application which select wifi access point from list of wifi. I used following code..</p><pre><code> WifiConfiguration wifiConfiguration = new WifiConfiguration(); wifiConfiguration.SSID = hotSpotSsid; wifiConfiguration.allowedKeyManagement.set(KeyMgmt.NONE); wifiConfiguration.BSSID = hotSpotBssid; wifiConfiguration.hiddenSSID = false; </code></pre><p>// wifiConfiguration.priority = 1; </p><pre><code>// add this to the configured networks int inetId = wifiManager.addNetwork(wifiConfiguration); Log.i(TAG,""INetId :""+inetId); configs = wifiManager.getConfiguredNetworks(); Log.e(TAG,""After adding config :""+configs); if(inetId &lt; 0) {     Log.i(TAG,""Unable to add network configuration for SSID: ""+hotSpotSsid);     return; }else {     message=""\t Successfully added to configured Networks"";     Log.i(TAG,message); } </code></pre><p>My problem is i am not able select wifi access point..Every time it shows previous configured wifi details. </p>","405640","","","","","2012-03-29 15:12:09","Select WiFi Access point in Android?","<android><wifi>","2","1","2","",""
"4173308","1","4173329","","2010-11-13 15:41:58","5","248","<p>My concern is, how long will our activity be there in the stack?    </p><p>What I mean is, when the home button is pressed from my app and then my app is launched again by clicking its icon, it will regain the correct place from where I pressed the home button without writing any special code for this.<br>I don't know whether I'm right, I think that my app is pushed to a stack, and when I launched it, it's pulled from the server.<br>I want to know how long will be in that stack or any other place where it is stored? Will it be replaced by some other app after pressing the home button and using many other apps?</p>","477754","","307705","","2011-07-01 03:06:58","2011-07-01 03:06:58","android how long will our activity be there in the stack","<android><activity><lifecycle>","2","0","","",""
"4173309","1","4173331","","2010-11-13 15:42:01","2","1707","<pre><code>keytool -list -alias androiddebugkey -keystore ~/.android/debug.keystore. -storepass android -keypass android</code></pre><p>gives me the error:</p><pre><code>keytool error: java.lang.Exception: Keystore file does not exist: /Users/syalam/.android/debug.keystore.</code></pre><p>I'm not sure how I can sign my debugkey so that I can use Google Maps. I have verified in Eclipse that this is where my debugkey is stored.</p>","19875","","19875","","2010-11-13 15:47:34","2011-03-17 10:01:52","Problem getting MD5 fingerprint of certificate for Google Maps API","<java><android><google-maps><md5><keytool>","1","0","","",""
"4173438","1","4173529","","2010-11-13 16:17:49","0","586","<p>I'm trying to make a bitmap rotate and point towards the mouse but I get strange results: </p><p>Video: <a href=""http://www.truploader.com/view/993341"" rel=""nofollow"">http://www.truploader.com/view/993341</a></p><p>The mouse isn't visible it does rotate, however it doesn't rotate to the tip of the mouse point.</p><p>Code:</p><pre><code>     /**    * Rotates the object based on a point    */ public void setRotation(float x, float y) {  float XDistance = this.xPos - x;        float YDistance = this.yPos - y;        float Radians =  (float) Math.atan2(YDistance, XDistance);        this.degrees = Math.round((Radians*180/Math.PI));       this.moveObject();       this.r.setRotate(this.degrees, this.picture.getWidth() / 2, this.picture.getHeight());  //origin of the base  // this.r.setRotate(this.degrees, this.picture.getWidth() / 2, this.picture.getHeight() / 2);   }</code></pre><p>Mouse position is x, and y. Anyone any ideas?</p>","506828","","506828","","2010-11-13 16:31:47","2010-11-13 17:27:12","Android programming bitmap rotation","<java><android>","2","0","","",""
"4173446","1","4173902","","2010-11-13 16:19:36","2","1347","<p>My application is built on 2.2, but it is backwards compatible down to 1.6.  I've used reflection for the newer methods.</p><p>When I try to run it on an emulator in Eclipse, it only lists my 2.2 AVDs.  I need to test on 1.6 to ensure compatibility.</p><p>I've tried building with Android 2.2 and with Google APIs 2.2 with no luck. (what's the difference, anyway?)</p><p>I have set <code>&lt;uses-sdk android:minSdkVersion=""4""  targetSDK=""8""/&gt;</code> in my manifest. I also tried <code>targetSDK=""4""</code>.</p><p>Thanks.</p>","506796","","","","","2010-11-13 17:53:28","Android Device Chooser doesn't list emulators with older APIs than the build version","<android><android-emulator>","2","2","","",""
"4173569","1","","","2010-11-13 16:43:37","0","202","<p>The app is <a href=""http://www.FlashCardsMax.com"" rel=""nofollow"">Flash Cards Max</a> on the Android market. I recently updated my app with a 1.6 only feature. However, I still want the app to work with those that have Android 1.5.  I built it using Android 1.6 in Eclipse and I have the correct strings in the Android manifest file.</p><pre><code>&lt;uses-sdk     android:minSdkVersion=""3""    android:targetSdkVersion=""4"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.RECEIVE_BOOT_COMPLETED"" /&gt;</code></pre><p>Everything works in the emulator fine on 1.5 just want to be sure it shows up on the Android Market for those with 1.5. It does not.  This is a market filtering question.</p><p>Please see <a href=""http://stackoverflow.com/questions/4058954/using-eclipse-how-can-i-build-compile-an-android-project-targeted-for-1-5-that"">this thread</a> for info on what I changed and how I went about it thanks to several of your suggestions.</p><p>tl;dr</p><p>Why doesn't my app show up for 1.5 users?</p>","492174","","492174","","2010-11-13 20:39:54","2010-11-13 20:39:54","Why is my app not showing up for 1.5 users in the Android Market?","<android><google-play><android-1.5-cupcake>","1","3","","",""
"4173593","1","","","2010-11-13 16:49:14","0","91","<p>What should I write in php if I would like to use ""post"" in Android programming? For example, if I want to upload my name and age form my android phone to the server,what should I write in the server's php?There are many examples about the use ""post"" of android on the internet, but less about how to write the php.</p>","477821","","471559","","2010-11-13 16:55:56","2011-04-22 17:55:01","What should I write in php if I would like to use ""post"" in Android programming?","<php><android><http-post>","1","3","","",""
"4173673","1","4173981","","2010-11-13 17:05:19","0","2843","<p>I am making a custom view that has 2 elemnts: a background that consists of  a Bitmap like a map and a small resource image that acts like a pin, to indicate position on the map. On each gps position change my view get's update and the pin moves in the new position. </p><p>First it woks fine, after a while I get this error: </p><blockquote>  <p>ERROR/AndroidRuntime(416):  java.lang.OutOfMemoryError: bitmap  size exceeds VM budget</p></blockquote><p>It has something to do with redrawing the map all the time, I guess. Maybe you have any idea to help me ?</p><pre><code>public class MyMapView extends View {private int xPos = 0; private int yPos = 0;private Bitmap trackMap;private Paint backgroundPaint;private Bitmap resizedBitmap;private Bitmap position;private Matrix positionMatrix;private Paint positionPaint;private int space=0;public MyMapView(Context context) { super(context); init(context, null);}public MyMapView(Context context, AttributeSet attrs) { super(context, attrs); init(context, attrs);}public MyMapView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(context, attrs);}private void init(final Context context, AttributeSet attrs) { backgroundPaint = new Paint(); backgroundPaint.setFilterBitmap(true); position = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.position); positionMatrix = new Matrix(); positionPaint = new Paint(); positionPaint.setFilterBitmap(true);}@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {  setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec));}@Overrideprotected void onDraw(Canvas canvas) { int width = getMeasuredWidth(); int height = getMeasuredHeight();  if (trackMap!=null)  {    resizedBitmap = Bitmap.createScaledBitmap(trackMap, height, height, true);    space = (width - resizedBitmap.getWidth())/2;    canvas.drawBitmap(resizedBitmap, space, 0, backgroundPaint);   }     if (xPos != 0 &amp;&amp; yPos !=0)     {      canvas.save(Canvas.MATRIX_SAVE_FLAG);      canvas.translate(xPos+space-position.getWidth()/2, yPos-position.getHeight()/2);      canvas.drawBitmap(position, positionMatrix, positionPaint);      canvas.restore();     }} public void updatePosition(int xpos, int ypos, Bitmap trackImage) {  xPos=xpos;  yPos=ypos;  trackMap = trackImage;  invalidate(); }}</code></pre><p>@Fedor: I've tried something like this:</p><pre><code>if (trackMap!=null)  {   if (resizedBitmap != null) {    resizedBitmap.recycle();     }    resizedBitmap = Bitmap.createScaledBitmap(trackMap, height, height, true);    space = (width - resizedBitmap.getWidth())/2;    canvas.drawBitmap(resizedBitmap, space, 0, backgroundPaint);   }  }</code></pre><p>But still the same. I call updatePosition(..) from an activity each time GPS detects a location changed, so the onDraw get's called very often. The image map is 400x400 pixels</p><pre><code>11-13 20:29:42.121: ERROR/AndroidRuntime(213): Uncaught handler: thread main exiting due to uncaught exception11-13 20:29:42.150: ERROR/AndroidRuntime(213): java.lang.OutOfMemoryError: bitmap size exceeds VM budget11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.graphics.Bitmap.nativeCreate(Native Method)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.graphics.Bitmap.createBitmap(Bitmap.java:435)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at com.vorienteering.customcontrols.MyMapView.onDraw(MyMapView.java:71)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.View.draw(View.java:6274)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewGroup.drawChild(ViewGroup.java:1526)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewGroup.drawChild(ViewGroup.java:1524)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.View.draw(View.java:6277)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewGroup.drawChild(ViewGroup.java:1526)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.View.draw(View.java:6277)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewGroup.drawChild(ViewGroup.java:1526)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewGroup.drawChild(ViewGroup.java:1524)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.View.draw(View.java:6277)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.widget.FrameLayout.draw(FrameLayout.java:352)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1883)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewRoot.draw(ViewRoot.java:1332)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1097)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.os.Handler.dispatchMessage(Handler.java:99)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.os.Looper.loop(Looper.java:123)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at android.app.ActivityThread.main(ActivityThread.java:4203)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at java.lang.reflect.Method.invokeNative(Native Method)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at java.lang.reflect.Method.invoke(Method.java:521)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)11-13 20:29:42.150: ERROR/AndroidRuntime(213):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>@Peter Knego I edited like in your answer. It had problemes with finding positionRef and some others. I updated the code like this:</p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {     int width = getMeasuredWidth();     int height = getMeasuredHeight();     if (trackMapRef != null) {         Bitmap resizedBitmap = Bitmap.createScaledBitmap(trackMapRef.get(), width, height, true);         space = (width - resizedBitmap.getWidth()) / 2;         canvas.drawBitmap(resizedBitmap, space, 0, backgroundPaintRef.get());     }     if (xPos != 0 &amp;&amp; yPos != 0) {         canvas.save(Canvas.MATRIX_SAVE_FLAG);         positionRef = new WeakReference&lt;Bitmap&gt;(BitmapFactory.decodeResource(getContext().getResources(), R.drawable.position));         positionMatrixRef = new WeakReference&lt;Matrix&gt;(new Matrix());         Paint posPaint = new Paint();         posPaint.setFilterBitmap(true);         positionPaintRef = new WeakReference&lt;Paint&gt;(posPaint);         canvas.translate(xPos + space - positionRef.get().getWidth() / 2, yPos - positionRef.get().getHeight() / 2);         canvas.drawBitmap(positionRef.get(), positionMatrixRef.get(), positionPaintRef.get());         canvas.restore();     }}</code></pre><p>Now it works for a little longer. Double the time. But still gives the out of memory error.Thank you very much for your help.</p><p>I was thinking as Fedor mentioned, is there a way in which I draw the map image only on creation, and then only update the pin postion onDraw ? This would seem the more convenient way as redrawing the map only uses resources and it's the same all the time.</p><p>THANK YOU ALL for your help. This is the only thing stopping me to finish to project.</p>","379865","","379865","","2010-11-14 08:50:14","2011-05-04 05:01:01","Android custom view bitmap size exceeds VM budget","<android><out-of-memory>","3","0","","",""
"4173722","1","","","2010-11-13 17:15:46","0","1714","<p>I'm developing a simple application.I have some views:-1 for login;-1 for ""mystats"";-1 for post a pictures to a server.</p><p>I have some question.I designed all layout of these Views, and now I need to implement the code.At the moment, my problem is to pass the username and pass (from the edittext) to server.Any suggestions?</p><p>Thanks.</p>","496371","","","","","2010-11-16 00:06:03","Android Login Screen/Post Data","<android><login>","1","1","","",""
"4173976","1","4174687","","2010-11-13 18:07:51","0","1826","<p>I want to be able in Android to press on the menu button on the phone and get the menu that will enable the user to toggle on/off sound. I want different images for the on/off status.</p><p>I know how to create menus; however, I'm having difficultly changing the menu button from one image to another. Has anyone figured this out?</p><p>Thanks</p><p>Below is my code :</p><p>@Override  public boolean onCreateOptionsMenu(Menu menu) {</p><pre><code>  MenuInflater inflater = getMenuInflater();  inflater.inflate(R.layout.menu, menu);    return true;</code></pre><p>}</p><p>public boolean onOptionsItemSelected(MenuItem item) {</p><pre><code>  // Handle item selection  switch (item.getItemId()) {  case R.id.EnableDisableSounds:   if(musicflag == true)   {     HighScores db = new HighScores(this);   db.open();   if(this.soundflag == true)       db.insertSystem(""1"", ""off"", ""on"");   else    db.insertSystem(""1"", ""off"", ""off"");   db.close();   mp.pause();      musicflag =  false;   }   else   {    HighScores db = new HighScores(this);    db.open();    if(this.soundflag == true)        db.insertSystem(""1"", ""on"", ""on"");    else     db.insertSystem(""1"", ""on"", ""off"");    db.close();    mp.start();    musicflag = true;   }    break;  case R.id.EnableDisableMusic :   if(soundflag == true) {    HighScores db = new HighScores(this);    db.open();    if(this.musicflag == true)        db.insertSystem(""1"", ""on"", ""off"");    else      db.insertSystem(""1"", ""off"", ""off"");    db.close();       soundflag = false;   }   else if(soundflag == false) {    HighScores db = new HighScores(this);    db.open();    if(this.musicflag == true)        db.insertSystem(""1"", ""on"", ""on"");    else     db.insertSystem(""1"", ""off"", ""on"");    db.close();       soundflag = true;   }   break;  case R.id.DeleteScores:   HighScores db = new HighScores(this);   db.open();   db.DeleteDBTable();   db.close();   break;  default:      return super.onOptionsItemSelected(item);  }  return true;</code></pre><p>}  </p>","461176","","","","","2010-11-13 21:15:35","Android onCreateOptionsMenu change icon to enabled / disabled","<android>","1","1","","",""
"4174017","1","4174042","","2010-11-13 18:17:33","1","1629","<p>how do i make it so that when focus is brought to an input text field in my application that the numpad keyboard with the 9 number keys on them opens rather than the full qwerty keyboard?</p>","434885","","","","","2012-10-28 17:56:39","android numpad keyboard","<android><keyboard>","2","0","0","",""
"4174031","1","4174059","","2010-11-13 18:22:02","3","812","<p>I use Eclipse for everything. Python, Django, GWT, Android... But when you install all the plugins, Eclipse becomes very slow.</p><p>Is there a way that I can set it up so that there are two or more icons for Eclipse in the Applications directory, each for specific task?</p><p>Thanks</p>","244182","","","","","2010-11-13 18:29:48","Multiple installations of Eclipse on Mac OSX","<android><eclipse><gwt>","1","1","","",""
"4174160","1","","","2010-11-13 18:57:49","0","353","<p>I have a very unique situation. I need to introduce and upgrade on the Android market, but I have lost the key store I used at the time as I have changed machines.Now the Android market won't let me upload the update.What do I do to find the earlier key?</p>","434885","","63550","","2011-01-20 22:01:44","2012-07-14 08:28:58","Android key lost","<android>","2","0","","",""
"4174283","1","4174298","","2010-11-13 19:27:51","0","471","<p>I have a decent  <a href=""http://www.edbpriser.dk/Product/Details.aspx?q=lenovo+sl500&amp;pid=512013"" rel=""nofollow"">machine</a> but when it comes to running more than 2 android emulators they brutally exploit the resources (>15% cpu usage, ~250 mb RAM usage (even though set 20 mb) per emulator)</p><p>i mean i am not running some cad software or anything to do with graphics, so what is the reason for android emulators to be so resource hungry?</p><p>note: same goes for my friends' PCs.</p>","504024","","","","","2011-05-12 09:19:20","Android emulator, why so resource hungry?","<android><android-emulator>","1","6","","",""
"4174303","1","","","2010-11-13 19:33:15","2","532","<p>I'm not sure if I'm using the correct terminology here.. but if my package name is set up like this:</p><pre><code>com.example.fungame    -ClassA    -ClassB    -com.example.fungame.sprite        -ClassC        -ClassD</code></pre><p>How can I programmatically get an array (a <code>Class[]</code> I'm guessing) of all the classes in the <code>.sprite</code> subdirectory?</p>","408178","","","","","2010-11-13 20:13:01","Listing classes in a package's subdirectory","<java><android><package><subdirectory>","1","5","1","",""
"4174389","1","","","2010-11-13 19:55:05","12","10222","<p>There are 2 ways to get the 3 rotation values (azimuth, pitch, roll).</p><p>One is registering a listener of a type TYPE_ORIENTATION. It's the easiest way and I get a correct range of values from every rotation as the documentation says:azimuth: [0, 359]pitch: [-180, 180]roll: [-90, 90]</p><p>The other one, the most precise and complex to understand the first time you see it. Android recommends it, so I want to use it, but I get different values.</p><p>azimuth: [-180, 180]. -180/180 is S, 0 i N, 90 E and -90 W.<br/>pitch: [-90, 90]. 90 is 90, -90 is -90, 0 is 0 but -180/180 (lying with the screen downwards) is 0.<br/>roll: [-180, 180].</p><p>I should get the same values but with decimals, right?</p><p>I have the following code:</p><pre><code>aValues = new float[3];mValues = new float[3];sensorListener = new SensorEventListener (){    public void onSensorChanged (SensorEvent event){        switch (event.sensor.getType ()){            case Sensor.TYPE_ACCELEROMETER:                aValues = event.values.clone ();                break;            case Sensor.TYPE_MAGNETIC_FIELD:                mValues = event.values.clone ();                break;        }        float[] R = new float[16];        float[] orientationValues = new float[3];        SensorManager.getRotationMatrix (R, null, aValues, mValues);        SensorManager.getOrientation (R, orientationValues);        orientationValues[0] = (float)Math.toDegrees (orientationValues[0]);        orientationValues[1] = (float)Math.toDegrees (orientationValues[1]);        orientationValues[2] = (float)Math.toDegrees (orientationValues[2]);        azimuthText.setText (""azimuth: "" + orientationValues[0]);        pitchText.setText (""pitch: "" + orientationValues[1]);        rollText.setText (""roll: "" + orientationValues[2]);    }    public void onAccuracyChanged (Sensor sensor, int accuracy){}};</code></pre><p>Please help. It's very frustrating.</p><p>Do I have to treat with those values or I'm doing something wrong?</p><p>Thanks.</p>","458093","","","","","2013-06-01 17:13:37","Different values between sensors TYPE_ACCELEROMETER/TYPE_MAGNETIC_FIELD and TYPE_ORIENTATION","<android><orientation><sensor><device-orientation>","3","4","13","",""
"4174397","1","","","2010-11-13 19:56:16","1","1307","<p>i have created live wallpaper in android 2.1.X , now i want to call this code in my activity so that user can set my created live wallpaper through button click just like ""Set Wallpaper"" button.</p><p>As my livewallpaper code extends WallpaperService class so that i can't even call as an intent.</p>","405383","","405383","","2010-11-14 14:21:35","2011-07-12 09:14:42","set livewallpaper manually","<android><permissions><android-manifest>","1","0","","",""
"4174399","1","4174638","","2010-11-13 19:56:30","0","1392","<p>I am new to Android development. I am developing an app that upon receiving an SMS message with a unique string of text, the GPS is enabled and starts tracking the location of the phone. The issue I'm having is with the getSystemService() method.I receive the error ""The method getSystemService(String) is undefined for the type SmsReceiver"", I believe this is because it does not have a context. I have tried to add in a context with in my code with 'ctx', and that removes the error but my application crashes every time I run it on my phone. The code for recieving the SMS works fine, and the GPS location tracking code works fine if it's in my main class.I still don't fully understand contexts, can anyone help me out please?</p><pre><code>import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.os.Bundle;import android.telephony.gsm.SmsMessage;import android.widget.Toast;@SuppressWarnings(""deprecation"")public class SmsReceiver extends BroadcastReceiver {    LocationManager lm;    LocationListener loc;    Context ctx;    public SmsReceiver(Context c) { ctx = c; }     @Override    public void onReceive(Context context, Intent intent) {        //---get the SMS message passed in---        Bundle bundle = intent.getExtras();                SmsMessage[] msgs = null;        String str = """";                    if (bundle != null){            //---retrieve the SMS message received---            Object[] pdus = (Object[]) bundle.get(""pdus"");            msgs = new SmsMessage[pdus.length];                        for (int i=0; i&lt;msgs.length; i++){                msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                                                    str += msgs[i].getMessageBody().toString() + ""\n"";                    }            Toast.makeText(context, str, Toast.LENGTH_SHORT).show();            if (msgs[0].getMessageBody().toString() == ""Track""){                enableGPS();            }        }                             }    public void enableGPS() {          lm = (LocationManager)ctx.getSystemService(Context.LOCATION_SERVICE);        loc = new mylocationlistener();        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, loc);    }    public void disableGPS() {        lm.removeUpdates(loc);    }    private class mylocationlistener implements LocationListener {        @Override        public void onLocationChanged(Location location) {            String s = """";            s += ""\tTime: ""        + location.getTime() + ""\n"";            s += ""\tLatitude:  "" + location.getLatitude()  + ""°\n"";            s += ""\tLongitude: "" + location.getLongitude() + ""°\n"";            s += ""\tAccuracy:  "" + location.getAccuracy()  + "" metres\n"";            s += ""\tAltitude:  "" + location.getAltitude()  + "" metres\n"";            //Toast.makeText(SmsReceiver.this, s, Toast.LENGTH_SHORT).show();        }        @Override        public void onProviderDisabled(String arg0) { }        @Override        public void onProviderEnabled(String arg0) { }        @Override        public void onStatusChanged(String arg0, int arg1, Bundle arg2) { }    }}</code></pre>","506929","","248432","","2010-11-13 20:33:29","2010-11-13 20:52:14","Method undefined for type SmsReciever - context problem","<android><activity><sms><gps><context>","1","1","","",""
"4174449","1","","","2010-11-13 20:09:16","1","1918","<p>Is there a way to enable the USB Tethering option in Android 2.2 FRG22D using a shell command?</p><p>My goal is turn a Motorola Droid running Android 2.2 into a micro server. This device cannot connect to 3G and Wifi is not option. The device will always be connected via USB to a computer with a network connection. I have gotten the reverse tethering working, but I still have to manually check the USB Tethering check box (Settings->Wireless &amp; Networks -> Tethering -> USB Tethering) every time the USB connection resets (such as when the computer is rebooted, the cable is unplugged, etc). My goal is write a script that can be ran on the host computer to bring the USB Tethering up without having to touch the Droid (I have root access and the device will always be connected via USB so I can issue shell commands using ADB).</p><p>I have been searching for a shell command to do this but nothing has turned up. Another possible solution is that I could write a small app (either using the NDK or SDK) and call that from the script, but again I cannot find any information on how to change system settings (at least network level settings) via code.</p><p>Any suggestions? </p>","506939","","","","","2010-12-20 19:18:22","How to enable Android tethering via shell command(s)?","<android><shell><networking>","1","1","1","",""
"4174453","1","4174703","","2010-11-13 20:10:43","7","4419","<p>Using the ndk I have compiled a code written in C. The program is a ecm format files conversion, here the native code: <a href=""http://stackoverflow.com/questions/3473754/convert-c-to-java"">link</a> . I chose to do with JNI for reasons of optimization, because the program requires a large amount of CPU processing.</p><p>The files to convert can be very large, between 200mb and 700mb. Everything works perfectly, but when trying to convert files bigger than 600Mb, near the end of the conversion process, the application stops with the following error message:</p><pre><code>11-13 20:24:36.775: WARN/dalvikvm(1468): ReferenceTable overflow (max=512)11-13 20:24:36.775: WARN/dalvikvm(1468): Last 10 entries in JNI local reference table:11-13 20:24:36.775: WARN/dalvikvm(1468):   502: 0x465117b0 cls=Ljava/lang/Class; 'Lunecm4droid/kiio/es/mainUECM;' (164 bytes)11-13 20:24:36.775: WARN/dalvikvm(1468):   503: 0x465117b0 cls=Ljava/lang/Class; 'Lunecm4droid/kiio/es/mainUECM;' (164 bytes)11-13 20:24:36.775: WARN/dalvikvm(1468):   504: 0x465117b0 cls=Ljava/lang/Class; 'Lunecm4droid/kiio/es/mainUECM;' (164 bytes)11-13 20:24:36.775: WARN/dalvikvm(1468):   505: 0x465117b0 cls=Ljava/lang/Class; 'Lunecm4droid/kiio/es/mainUECM;' (164 bytes)11-13 20:24:36.775: WARN/dalvikvm(1468):   506: 0x465117b0 cls=Ljava/lang/Class; 'Lunecm4droid/kiio/es/mainUECM;' (164 bytes)11-13 20:24:36.775: WARN/dalvikvm(1468):   507: 0x465117b0 cls=Ljava/lang/Class; 'Lunecm4droid/kiio/es/mainUECM;' (164 bytes)11-13 20:24:36.775: WARN/dalvikvm(1468):   508: 0x465117b0 cls=Ljava/lang/Class; 'Lunecm4droid/kiio/es/mainUECM;' (164 bytes)11-13 20:24:36.786: WARN/dalvikvm(1468):   509: 0x465117b0 cls=Ljava/lang/Class; 'Lunecm4droid/kiio/es/mainUECM;' (164 bytes)11-13 20:24:36.786: WARN/dalvikvm(1468):   510: 0x465117b0 cls=Ljava/lang/Class; 'Lunecm4droid/kiio/es/mainUECM;' (164 bytes)11-13 20:24:36.786: WARN/dalvikvm(1468):   511: 0x465117b0 cls=Ljava/lang/Class; 'Lunecm4droid/kiio/es/mainUECM;' (164 bytes)11-13 20:24:36.786: WARN/dalvikvm(1468): JNI local reference table summary (512 entries):11-13 20:24:36.786: WARN/dalvikvm(1468):   512 of Ljava/lang/Class; 164B (1 unique)11-13 20:24:36.786: WARN/dalvikvm(1468): Memory held directly by tracked refs is 164 bytes11-13 20:24:36.786: ERROR/dalvikvm(1468): Failed adding to JNI local ref table (has 512 entries)11-13 20:24:36.786: INFO/dalvikvm(1468): ""Thread-9"" prio=5 tid=8 RUNNABLE11-13 20:24:36.786: INFO/dalvikvm(1468):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x46523c48 self=0x30e96011-13 20:24:36.786: INFO/dalvikvm(1468):   | sysTid=1506 nice=0 sched=0/0 cgrp=default handle=254261611-13 20:24:36.786: INFO/dalvikvm(1468):   | schedstat=( 200042694099 61087921121 333928 )11-13 20:24:36.786: INFO/dalvikvm(1468):   at unecm4droid.kiio.es.mainUECM.invokeNativeFunction(Native Method)11-13 20:24:36.786: INFO/dalvikvm(1468):   at unecm4droid.kiio.es.mainUECM.access$10(mainUECM.java:490)11-13 20:24:36.786: INFO/dalvikvm(1468):   at unecm4droid.kiio.es.mainUECM$11.run(mainUECM.java:735)11-13 20:24:36.786: ERROR/dalvikvm(1468): VM aborting11-13 20:24:36.795: INFO/DEBUG(121): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***11-13 20:24:36.795: INFO/DEBUG(121): Build fingerprint: 'google/passion/passion/mahimahi:2.2/FRF91/43546:user/release-keys'11-13 20:24:36.795: INFO/DEBUG(121): pid: 1468, tid: 1506  &gt;&gt;&gt; unecm4droid.kiio.es &lt;&lt;&lt;11-13 20:24:36.795: INFO/DEBUG(121): signal 11 (SIGSEGV), fault addr deadd00d11-13 20:24:36.795: INFO/DEBUG(121):  r0 00000026  r1 afd14699  r2 afd14699  r3 0000000011-13 20:24:36.795: INFO/DEBUG(121):  r4 802a3448  r5 802a3448  r6 0030e960  r7 0030e9b011-13 20:24:36.795: INFO/DEBUG(121):  r8 464c9b48  r9 43277fa4  10 43277f8c  fp 464c9ed811-13 20:24:36.795: INFO/DEBUG(121):  ip deadd00d  sp 464c9130  lr afd16155  pc 802424e0  cpsr 2000003011-13 20:24:36.795: INFO/DEBUG(121):  d0  643a64696f72646e  d1  647265676775626511-13 20:24:36.795: INFO/DEBUG(121):  d2  465117b046511767  d3  465117b04651170a11-13 20:24:36.795: INFO/DEBUG(121):  d4  465117b0465117b0  d5  465117b0465117b011-13 20:24:36.795: INFO/DEBUG(121):  d6  465117b0465117b0  d7  465117b0465117b011-13 20:24:36.795: INFO/DEBUG(121):  d8  4198000041b80000  d9  43e000000000000011-13 20:24:36.795: INFO/DEBUG(121):  d10 41dfffffffc00000  d11 c3e000000000000011-13 20:24:36.795: INFO/DEBUG(121):  d12 0000000000000000  d13 000000000000000011-13 20:24:36.795: INFO/DEBUG(121):  d14 0000000000000000  d15 000000000000000011-13 20:24:36.795: INFO/DEBUG(121):  d16 47d7202800000000  d17 c08318000000000011-13 20:24:36.795: INFO/DEBUG(121):  d18 4035000000000000  d19 000000000000000011-13 20:24:36.795: INFO/DEBUG(121):  d20 3ff0000000000000  d21 800000000000000011-13 20:24:36.795: INFO/DEBUG(121):  d22 c035000000000000  d23 ff0008000800070011-13 20:24:36.795: INFO/DEBUG(121):  d24 ff00080008000700  d25 ff0008000800070011-13 20:24:36.795: INFO/DEBUG(121):  d26 0100010001000100  d27 010001000100010011-13 20:24:36.795: INFO/DEBUG(121):  d28 0100010001000100  d29 3ff000000000000011-13 20:24:36.795: INFO/DEBUG(121):  d30 0000000000000000  d31 3ff000000000000011-13 20:24:36.795: INFO/DEBUG(121):  scr 8000001211-13 20:24:36.865: INFO/DEBUG(121):          #00  pc 000424e0  /system/lib/libdvm.so11-13 20:24:36.865: INFO/DEBUG(121):          #01  pc 0004655e  /system/lib/libdvm.so11-13 20:24:36.865: INFO/DEBUG(121):          #02  pc 000466f0  /system/lib/libdvm.so11-13 20:24:36.865: INFO/DEBUG(121):          #03  pc 00001110  /data/data/unecm4droid.kiio.es/lib/libndkfoo.so11-13 20:24:36.865: INFO/DEBUG(121):          #04  pc 000016da  /data/data/unecm4droid.kiio.es/lib/libndkfoo.so11-13 20:24:36.865: INFO/DEBUG(121):          #05  pc 00001bda  /data/data/unecm4droid.kiio.es/lib/libndkfoo.so11-13 20:24:36.865: INFO/DEBUG(121):          #06  pc 00001f2e  /data/data/unecm4droid.kiio.es/lib/libndkfoo.so11-13 20:24:36.865: INFO/DEBUG(121):          #07  pc 00017034  /system/lib/libdvm.so11-13 20:24:36.865: INFO/DEBUG(121):          #08  pc 00045744  /system/lib/libdvm.so11-13 20:24:36.865: INFO/DEBUG(121):          #09  pc 0004ae8e  /system/lib/libdvm.so11-13 20:24:36.865: INFO/DEBUG(121):          #10  pc 0001bf98  /system/lib/libdvm.so11-13 20:24:36.865: INFO/DEBUG(121):          #11  pc 00022bc4  /system/lib/libdvm.so11-13 20:24:36.865: INFO/DEBUG(121):          #12  pc 00021a60  /system/lib/libdvm.so11-13 20:24:36.865: INFO/DEBUG(121):          #13  pc 0005cf60  /system/lib/libdvm.so11-13 20:24:36.865: INFO/DEBUG(121):          #14  pc 0005d190  /system/lib/libdvm.so11-13 20:24:36.876: INFO/DEBUG(121):          #15  pc 000500d0  /system/lib/libdvm.so11-13 20:24:36.876: INFO/DEBUG(121):          #16  pc 00010f44  /system/lib/libc.so11-13 20:24:36.876: INFO/DEBUG(121):          #17  pc 00010a30  /system/lib/libc.so11-13 20:24:36.876: INFO/DEBUG(121): code around pc:11-13 20:24:36.876: INFO/DEBUG(121): 802424c0 20061861 f7d418a2 2000ea7c ebdaf7d4 11-13 20:24:36.876: INFO/DEBUG(121): 802424d0 58234808 b1036bdb f8df4798 2026c01c 11-13 20:24:36.876: INFO/DEBUG(121): 802424e0 0000f88c ec40f7d4 00060f8c fffe1ecc 11-13 20:24:36.876: INFO/DEBUG(121): 802424f0 fffe5140 000003a4 deadd00d f8dfb40e 11-13 20:24:36.876: INFO/DEBUG(121): 80242500 b503c02c bf00490a 188ba200 f853aa03 11-13 20:24:36.876: INFO/DEBUG(121): code around lr:11-13 20:24:36.876: INFO/DEBUG(121): afd16134 000ef9b0 22022100 ec98f7f7 463289a1 11-13 20:24:36.876: INFO/DEBUG(121): afd16144 5080f421 81a04629 000ef9b4 ec1ef7f7 11-13 20:24:36.876: INFO/DEBUG(121): afd16154 bf00bd70 4604b510 000ef9b0 ec06f7f7 11-13 20:24:36.876: INFO/DEBUG(121): afd16164 bfbe2800 f42389a3 81a35380 6d21db02 11-13 20:24:36.876: INFO/DEBUG(121): afd16174 6523180b bf00bd10 b085b5f0 bf004c41 11-13 20:24:36.876: INFO/DEBUG(121): stack:11-13 20:24:36.876: INFO/DEBUG(121):     464c90f0  000005a0  11-13 20:24:36.876: INFO/DEBUG(121):     464c90f4  afd146c9  /system/lib/libc.so11-13 20:24:36.876: INFO/DEBUG(121):     464c90f8  afd42498  /system/lib/libc.so11-13 20:24:36.876: INFO/DEBUG(121):     464c90fc  afd43bc8  /system/lib/libc.so11-13 20:24:36.876: INFO/DEBUG(121):     464c9100  00000000  11-13 20:24:36.876: INFO/DEBUG(121):     464c9104  afd156e3  /system/lib/libc.so11-13 20:24:36.876: INFO/DEBUG(121):     464c9108  afd14699  /system/lib/libc.so11-13 20:24:36.876: INFO/DEBUG(121):     464c910c  afd14699  /system/lib/libc.so11-13 20:24:36.876: INFO/DEBUG(121):     464c9110  afd146f0  /system/lib/libc.so11-13 20:24:36.876: INFO/DEBUG(121):     464c9114  802a3448  /system/lib/libdvm.so11-13 20:24:36.876: INFO/DEBUG(121):     464c9118  802a3448  /system/lib/libdvm.so11-13 20:24:36.876: INFO/DEBUG(121):     464c911c  0030e960  [heap]11-13 20:24:36.876: INFO/DEBUG(121):     464c9120  0030e9b0  [heap]11-13 20:24:36.876: INFO/DEBUG(121):     464c9124  afd146fd  /system/lib/libc.so11-13 20:24:36.876: INFO/DEBUG(121):     464c9128  df002777  11-13 20:24:36.876: INFO/DEBUG(121):     464c912c  e3a070ad  11-13 20:24:36.876: INFO/DEBUG(121): #00 464c9130  465117b0  /dev/ashmem/mspace/dalvik-heap/2 (deleted)11-13 20:24:36.876: INFO/DEBUG(121):     464c9134  80246563  /system/lib/libdvm.so11-13 20:24:36.876: INFO/DEBUG(121): #01 464c9138  000b4890  [heap]11-13 20:24:36.876: INFO/DEBUG(121):     464c913c  00000000  11-13 20:24:36.876: INFO/DEBUG(121):     464c9140  00000051  11-13 20:24:36.876: INFO/DEBUG(121):     464c9144  0030e960  [heap]11-13 20:24:36.876: INFO/DEBUG(121):     464c9148  000b4890  [heap]11-13 20:24:36.876: INFO/DEBUG(121):     464c914c  46512b88  /dev/ashmem/mspace/dalvik-heap/2 (deleted)11-13 20:24:36.876: INFO/DEBUG(121):     464c9150  43277fac  11-13 20:24:36.876: INFO/DEBUG(121):     464c9154  802466f5  /system/lib/libdvm.so</code></pre><p>I tried to debug a native process using gdb but I only give this message when app crash:</p><pre><code>Program received signal SIGSTOP, Stopped (signal).</code></pre><p>Does anyone could help me find more clues about the error?</p><p>Thx to all.</p>","506940","","","","","2010-11-13 21:17:09","Android: Native process provoke ReferenceTable overflow after a while (android-ndk)","<java><android><c>","1","0","2","",""
"4174613","1","4174656","","2010-11-13 20:47:10","6","5296","<p>Dianne Hackborn mentioned in a couple threads that you can detect when a layout as been resized, for example, when the soft keyboard opens or closes. Such a thread is this one... <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/d318901586313204/2b2c2c7d4bb04e1b"">http://groups.google.com/group/android-developers/browse_thread/thread/d318901586313204/2b2c2c7d4bb04e1b</a></p><p>However, I didn't understand her answer: ""By your view hierarchy being resized with all of the corresponding layout traversal and callbacks.""</p><p>Does anyone have a further description or some examples of how to detect this?  Which callbacks can I link into in order to detect this?</p><p>Thanks</p>","445348","","","","","2010-11-13 20:59:54","How to detect a layout resize?","<android><user-interface><layout><resize>","1","0","","",""
"4174636","1","4174654","","2010-11-13 20:52:00","0","1206","<p>In one LinearLayout there are many LinearLayouts nested and i want every one of them to share the screen space equally so the whole screen is filled and there is no free space on the screen vertically.Any ides on how to do this.</p><p>Thanks in advance</p>","494498","","","","","2010-11-13 20:56:49","LinearLayout height in Android","<android>","1","0","0","",""
"4174678","1","4271183","","2010-11-13 21:03:29","0","3128","<p>I am writing application that has service that provides real time data to subscribers via remote callback mechanism. Now I wanted to add a widget that visualizes essential part of this data but got error: ""IntentReceiver components are not allowed to bind to services"". So what's the right way to get data from that service?</p>","488489","","488489","","2010-11-14 11:24:14","2010-11-24 20:24:52","How to get data from service in widget without binding to it?","<android><android-widget>","1","2","","",""
"4174723","1","","","2010-11-13 21:13:21","5","2708","<p>When you create a LiveWallpaper in Android 2.2+ you get a canvas (or whatever the 3D equivalent is) to draw on. I'd like to draw some elements using the built-in Android UI tools rather than building everything from scratch using canvas commands or a loading a pre-rendered UI bitmap.</p><p>Converting a single View to a Bitmap works fine. i.e. this works great:</p><pre><code>// For example this works:TextView view = new TextView(ctx);view.layout(0, 0, 200, 100);view.setText(""test"");Bitmap b = Bitmap.createBitmap( 200, 100, Bitmap.Config.ARGB_8888);                Canvas tempC = new Canvas(b);view.draw(tempC);c.drawBitmap(b, 200, 100, mPaint);</code></pre><p>But, converting a LinearLayout with children causes problems. You <em>only</em> get the LinearLayout itself and none of it's children. For example, if I set the LinearLayout to have a white background I get a nicely rendered white box, but none of the TextView children are in the Bitmap. I've also tried using DrawingCache with similar results. </p><p>The code I'm using is the cube example with the only changes being an extra draw command. The LinearLayout works fine as a toast or as a regular view (i.e. everything nicely shows up), on the LiveWallpaper all I get is the LinearLayout's background rendered.</p><pre><code>inflater = (LayoutInflater)getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);layout = (LinearLayout) inflater.inflate(com.example.android.livecubes.R.layout.testLinearLayout, null);layout.layout(0, 0, 400, 200);Bitmap b = Bitmap.createBitmap( 400, 200, Bitmap.Config.ARGB_8888);Canvas tempC = new Canvas(b);layout.draw(tempC);c.drawBitmap(b, 10, 200, mPaint);</code></pre><p>Does anyone know if you need to do anything special to get the children rendered properly to my bitmap? i.e. do I need to somehow do something special to make the layout render the rest of the children? Should I write a function to recursively do something to all the children?</p><p>I could composite everything myself but, since the display is fairly static (i.e. I draw this once and keep a copy of the bitmap to draw on the background) this seems easier on me and still pretty efficient.</p><p><strong>Edit:</strong>While digging a bit more into the state of the Layout it looks as though the layout is not progressing down the view tree (i.e. the LinearLayout gets its layout computed when I call layout() but the children have a null (0x0) size). According to the Romain Guy's post in 2008 <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/8318671d0313024/e32c50aff962e0a2"" rel=""nofollow"">android developer post</a>. You have to wait for the layout pass or force the layout yourself. The problem is how can I wait for a layout pass from a wall paper engine for a LinearLayout that is not attached to the root view group? And how can I manually layout each child element if layout requires you to set the left, top, right, bottom when I don't know what these should be.</p><p>I've tried calling forceLayout on the children but it doesn't seem to help either. I'm not sure how the layout framework works behind the scenes (besides that it does a two pass layout). Is there a way to manually make it do the layout pass, i.e. right now? Since it's not an Activity I don't think a lot of the normal background stuff is happening quite the way I'd like.</p>","466254","","466254","","2010-11-14 20:07:22","2012-11-17 15:28:13","Using Layout resources in a LiveWallpaper on Android","<android><canvas><android-layout><android-linearlayout>","2","1","4","",""
"4174793","1","4174874","","2010-11-13 21:24:07","0","1014","<p>I've been working at this all day, and I'm really close but just can't get this to work. I have a button that pulls up an AlertDialog populated with saved entries that include Name and Price. Right now, I can click an item in the Dialog and have it automatically fill in the Name and Price fields in my activity. I want to also be able to long press an item and receive an option to delete it. This is my first try at an Android app, and a lot of this is repurposed from the Notepad Tutorial. Two things I can't figure out:</p><p>1) Is my registerForContextMenu sufficient/correct?</p><p>2) What am I doing wrong with my onCreateContextMenu?</p><p>Thanks.</p><pre><code>savedItems.setOnClickListener(new View.OnClickListener() {     public void onClick(View v) {      cDbHelper.open();      mNotesCursor = cDbHelper.fetchAllSaved();            startManagingCursor(mNotesCursor);            // Create an array of names and corresponding prices from db            String[] from = new String[]{SavedItemsDbAdapter.KEY_NAME, SavedItemsDbAdapter.KEY_PRICE};            // and an array of the fields we want to bind those fields to            int[] to = new int[]{R.id.text1, R.id.text2};            // Now create a simple cursor adapter and set it to display            SimpleCursorAdapter saved =                  new SimpleCursorAdapter(NewEntry.this, R.layout.saved_row, mNotesCursor, from, to);      // Build an AlertDialog to hold this list            AlertDialog.Builder builder = new AlertDialog.Builder(NewEntry.this);      builder.setTitle(""Choose from list"");      // IS THIS SUFFICIENT TO REGISTER FOR CONTEXT MENU?      registerForContextMenu(v);      builder.setAdapter(saved, new DialogInterface.OnClickListener() {       // When an item from the list is clicked, it automatically populates the name and price fields in activity       @Override       public void onClick(DialogInterface dialog, int item) { Cursor c = mNotesCursor;       c.moveToPosition(item); Intent i = new Intent(NewEntry.this, NewEntry.class);       i.putExtra(""name"", c.getString(          c.getColumnIndexOrThrow(SavedItemsDbAdapter.KEY_NAME)));       i.putExtra(""price"", c.getString(         c.getColumnIndexOrThrow(SavedItemsDbAdapter.KEY_PRICE)));       startActivityForResult(i, ACTIVITY_AUTO);       finish();}      // TRYING AND FAILING TO SET UP A CONTEXT MENU - the goal is to be able to long press,       // have a ""Delete?"" option pop up, which will delete the entry when clicked       @Override      public void onCreateContextMenu(ContextMenu menu, View v,    ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    menu.add(0, DELETE_ID, 0, R.string.menu_delete);   }   public boolean onContextItemSelected(MenuItem item) {    switch(item.getItemId()) {       case DELETE_ID:        AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();        mDbHelper.deleteItem(info.id);        return true;    }    return false;   }      });      AlertDialog alert = builder.create();         alert.show();        }     });    }</code></pre>","503185","","","","","2013-06-26 07:04:34","Please help me set up a Context Menu in an AlertDialog","<java><android><sqlite>","3","0","0","",""
"4174801","1","4175647","","2010-11-13 21:25:44","1","1026","<p>The stock Android lock screen will display your battery status while your phone is charging; does anyone know how to have it display your current battery status while it is not charging? </p><p>This doesn't seems like a super difficult task to accomplish, I'm just unsure where I need to start to get things going. It would be so awesome if someone would actually help me.</p>","420015","","","","","2010-11-14 01:19:23","Android: How to add battery stats to stock lock screen while not charging?","<java><android><lockscreen>","1","3","","",""
"4174958","1","4191804","","2010-11-13 22:00:13","0","389","<p>I have a simple Android app that does some math on 2 numbers that the user inputs and returns the result.Currently I have a 'calculate' button that needs to be pressed to do the math and return the value.</p><p>How can I get rid of this button and just get the app to run the math after the uses has changed either one of the 2 numbers?</p><p>Many thanks.</p>","497517","","497517","","2010-11-13 22:14:14","2010-11-16 10:40:10","How do I make my Calculate button redundant?","<android><math><input><automation>","4","3","","",""
"4174960","1","4175005","","2010-11-13 22:00:55","0","687","<p>I have an android app I am just experimenting things on and I cannot seem to figure out why my app force closes when I update a TextView via a while loop. When I comment out the updateText method it runs fine.</p><pre><code>    public class GameThread extends Thread { Thread t; private int i; private boolean running; private long sleepTime; GameView gv; public GameThread() {  t = new Thread(this);  t.start();  i = 0;  sleepTime = 1000; } public void initView(GameView v) {  this.gv = v; } public void setRunning(boolean b) {  this.running = b; } public boolean getRunning() {  return running; } public void run() {  while(running) {   i++;   update();   try {    t.sleep(sleepTime);   } catch(InterruptedException e) {   }  } } public void update() {  gv.setText(i); // when this is uncommented, it causes force close  Log.v(""Semajhan"", ""i = "" + i); }    public class GameView extends LinearLayout { public TextView tv; public GameView(Context c) {  super(c);  this.setBackgroundColor(Color.WHITE);  tv = new TextView(c);  tv.setTextColor(Color.BLACK);  tv.setTextSize(20);  this.addView(tv); } public void setText(int i) {  tv.setText(""i count: "" + i); }    public class Exp extends Activity { GameThread t; GameView v;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);        v = new GameView(this);        setContentView(v);        t = new GameThread();        t.setRunning(true);        t.initView(v);    } public boolean onTouchEvent(MotionEvent event) {  if (event.getAction() == MotionEvent.ACTION_DOWN) {   if (t.getRunning() == true) {    t.setRunning(false);    Log.v(""Semajhan"", ""STOPPED"");   } else {    t.setRunning(true);    Log.v(""Semajhan"", ""RESTART"");   }  }  return true; }    protected void onDestroy() {     Log.v(""Semajhan"", ""DESTROYING"");     super.onDestroy();    }    protected void onStop() {     Log.v(""Semajhan"", ""Stopping"");     super.onStop();    }</code></pre><p>I though i'd post the whole app since it is relatively small and so that I could get some help without confusion.</p>","507007","","321731","","2014-02-21 04:34:36","2014-02-21 04:34:36","Why does my app force close when I setText in an update method?","<java><android><textview>","3","0","","",""
"4174988","1","","","2010-11-13 22:08:39","7","5495","<p>I am running Android SDK 2.2 and am trying to get the adb to connect to the Google Nexus One phone. Its a new phone, shipped straight from Google - haven't installed any apps on it yet.(I have Windows XP)Here is what I have done so far:</p><ul><li><p>Followed the instructions on setting up the device for development as given on the Android Developer's site:<a href=""http://developer.android.com/guide/developing/device.html"">http://developer.android.com/guide/developing/device.html</a></p></li><li><p>added android:debuggable=""true"" to my application manifest</p></li><li><p>USB debuggable is checked on the phone</p></li><li><p>downloaded the Device Drivers For Windows Revision 3 (this supports Nexus One phones)</p></li><li><p>Went through the Hardware Installation wizard to install the device - the device shows up as ""Android Composite ADB Interface"".</p></li></ul><p>When I run adb devices on the shell, the device appears for a moment, then disappears.On the Eclipse console, I get the following message:[2010-11-13 11:54:42 - DeviceMonitor]Failed to start monitoring </p><p>I have rebooted the pc several times, uninstalled and reinstalled the drivers several times, but I get the same error each time. As I was researching this problem, someone had recommended rebooting the phone. I am a bit confused by that - is that a soft or hard reboot? Do I just power the phone off/on and is there something more complex involved? Do I have to hard reboot it to reset to factory version - even though its brand new?</p><p>Has anyone run into a similar problem? Any help on this would be great. I can't test my application on the device if the adb cannot view the device. Thanks so much in advance.</p>","494127","","","","","2012-10-26 11:34:59","Cannot connect Nexus One Phone to Android adb","<android><nexus-one>","7","2","2","",""
"4175026","1","4175114","","2010-11-13 22:15:29","1","2518","<p>I am trying to get a good grasp of UDP on Android, so I am writing a small test program to set up 2 sockets on the same machine, send a packet and receive it. I thought it would be straight-forward, but something is going wrong. My code is:</p><pre><code>DatagramSocket server;DatagramSocket client;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // Initialize a client socket and a server socket using UDP    try {     server = new DatagramSocket();     client = new DatagramSocket();} catch (SocketException e) {   // TODO Auto-generated catch block   e.printStackTrace();} // Server will now send some data  String data = ""This is a test"";  DatagramPacket sendPacket = new DatagramPacket(data.getBytes(), data.length(),       client.getInetAddress(), client.getLocalPort());  try {   server.send(sendPacket);  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }  // Client has to receive and read the data  byte[] buf = new byte[1024];  DatagramPacket receivePacket = new DatagramPacket(buf, buf.length);  try {   client.receive(receivePacket);   byte[] receivedData = receivePacket.getData();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }  server.disconnect();  client.disconnect();}</code></pre><p>When I debug my code, it goes into the last try, in ""<code>client.receive(receivePacket);</code>"" but it never comes back from that function call. The packet seems to be never received, but I have a hard time finding why that is.</p><p>I hope someone could please help me fix this problem.</p><p>EDIT: New code using threads. Calling ""recieve"" before actually sending the packet. Trying to use AsyncTask.</p><pre><code>public class udpexample extends Activity {    DatagramSocket server;    DatagramSocket client;    String data = ""This is a test"";    private static final String TAG = ""UDPExampleActivity"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Log.i(TAG, ""Starting"");        // Initialize a client socket and a server socket using UDP        try {            server = new DatagramSocket();            client = new DatagramSocket();        } catch (SocketException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        new ReceivePacket().execute();        try {            Thread.sleep(2000);        } catch (InterruptedException e1) {            // TODO Auto-generated catch block            e1.printStackTrace();        }        // Server will now send some data        DatagramPacket sendPacket = new DatagramPacket(data.getBytes(), data.length(),                client.getInetAddress(), client.getLocalPort());        try {            Log.i(TAG, ""About to send"");            server.send(sendPacket);        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    private class ReceivePacket extends AsyncTask&lt;Void, Void, Void&gt; {        // Thread used to receive a packet        @Override        protected Void doInBackground(Void... params) {            // Client has to receive and read the data            byte[] buf = new byte[1024];                        DatagramPacket receivePacket = new DatagramPacket(buf, buf.length);            try {                Log.i(TAG, ""About to receive"");                client.receive(receivePacket);                byte[] receivedData = receivePacket.getData();                // Verify that the packet is identical to the one being sent            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            return null;        }        protected void onPostExecute(Void result) {            server.disconnect();            client.disconnect();        }    } }</code></pre><p>Still having the same issue, it stops and waits on receive and nothing happens.</p><p>Thank you very much,</p><p>Jary</p>","505281","","505281","","2010-11-14 01:01:36","2010-11-14 01:01:36","Android: Issue with simple UDP program","<android><multithreading><udp><packet>","1","0","","",""
"4175046","1","4175061","","2010-11-13 22:19:28","7","4705","<p>I'm trying to get my current GPS accuracy by using <code>Location.getAccuracy()</code>.  However, this is returning 1 (or sometimes 2) which doesn't seem possible.  Google maps is telling me my current location accuracy is 40 meters.</p><p>Any thoughts?</p><pre><code>int accuracy = (int) loc.getAccuracy();// This will give me accuracy = 1</code></pre>","507016","","166712","","2010-11-13 22:23:12","2012-06-07 00:37:34","Android Location.getAccuracy() returns 1","<java><android><gps>","4","0","","",""
"4175066","1","4840251","","2010-11-13 22:25:59","10","5095","<p>I have the following problem:</p><p>I make a custom hosts file to test some features of my application and then push it to my android emulator. The thing is that these settings do not take effect immediately. I have to wait about 10 minutes before they become active.</p><p>So my question is: how to make the new hosts file active instantly? I have many different settings to test and I can't wait 10 minutes every time.</p>","476427","","","","","2014-03-25 07:10:46","Android hosts file usage","<android><hosts-file>","3","2","5","",""
"4175113","1","4179577","","2010-11-13 22:41:28","7","1722","<p>I am interested in implementing an Augmented Reality application for mobile phones using Adobe Flash Platform. Can you please let me know if any sources is available for me to find out how to start?</p><p>I'm not sure what software I need to use to implement AR but as I can understand I need:</p><p><strong>ARToolKit Marker Generator</strong> to create the marker matching with the 3D image, then <strong>FLARToolKit</strong> to analyze the image from the marker and <strong>Papervision3D</strong> to create an object that shares that same space with the marker.</p><p>Can you please let me know if what I wrote is correct and advise me how to start the implementation on Adobe Flash platform?</p><p>Thank you</p>","495296","","55164","","2010-11-15 18:18:03","2010-11-15 18:18:03","Augmented Reality on Mobile phones","<android><air><augmented-reality><papervision3d><flash-cs5>","1","1","1","",""
"4175156","1","4377387","","2010-11-13 22:52:51","1","1816","<p>I am having great deal of trouble trying to find the driver needed for the Lg Optimus (Sprint) so that I can begin using App Inventor program. I connect my phone but no notifications show that it is connected, only charging. I'd appreciate it if someone could help me out. </p><p><em>edit</em> Any details would be useful even if it's just to say that you are having trouble as well.</p>","507029","","507029","","2010-11-14 16:10:12","2010-12-07 13:59:21","Sprint Lg Optimus Driver","<android><driver><app-inventor>","2","0","","",""
"4175265","1","4175275","","2010-11-13 23:24:58","0","2529","<p>I am getting XML data from url and displaying using a custom list adapter in a <code>ListView</code>.</p><p>I need to display only 10 items in <code>ListView</code>. </p><p>How i can do this?</p><p>Please let me know</p><p>Thanks </p>","341443","","166712","","2010-11-13 23:29:53","2010-11-13 23:29:53","How to limit list items display in ListView","<android>","2","1","","",""
"4175398","1","","","2010-11-13 23:57:52","47","64653","<p>In Android how can I make an <code>EditText</code> clear when it's clicked?</p><p>ie if I have an <code>EditText</code> with some characters in, such as <code>'Enter Name'</code>, when the user clicks on it these characters disappear.</p><p>Cheers</p>","497517","","166712","","2010-11-14 00:01:07","2013-12-04 09:41:51","Clear EditText on click","<android><edittext>","10","2","13","",""
"4175421","1","","","2010-11-14 00:04:44","1","1105","<p>I am using GPS on Android phone, and trying to get GPS coordinates from satellite. I have disabled wifi on my phone.</p><p>I am using the following code snippet,</p><pre><code>mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, (float)0.0, mlocListener); </code></pre><p>the <code>onLocationChanged</code> function will get called everytime as I have set my <code>minTime</code> and <code>minDistance</code> as <code>0</code>.(i am able to see this on the phone)</p><p>However I want GPS coordinates to be updated only when I change my distance by 1m.Thus I use,</p><pre><code>mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, (float)1.0, mlocListener);</code></pre><p>Now the <code>onLocationChanged</code> function is getting called only for the first time when application starts, however if I move my even more than 10metres the <code>onLocationChanged</code>  does not get called.</p><p>The function prototype is ,</p><pre><code>public void requestLocationUpdates (String provider, long minTime, float minDistance, LocationListener listener) </code></pre><p>Can someone please tell me a solution.</p><p>Thanks</p>","507050","","166712","","2010-11-14 00:08:06","2010-11-14 00:08:06","onLocationChanged not getting called other than the first time for GPS","<android>","0","1","","",""
"4175432","1","4175457","","2010-11-14 00:07:28","4","7996","<p>how do i change the default blue animated marker for MyLocationOverlay in google maps?</p>","448192","","866761","","2013-12-27 05:57:14","2013-12-27 05:57:14","myLocationOverlay change the marker","<java><android><google-maps><maps><marker>","2","0","6","",""
"4175737","1","4177617","","2010-11-14 01:43:31","0","1042","<p>I'm having a BIG touble when adding duplicate contact fields in Android 2.1 update 1</p><p>please have a look at my code:</p><pre><code>      ArrayList&lt;ContentProviderOperation&gt; op_list = new ArrayList&lt;ContentProviderOperation&gt;();  op_list.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)         .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, null)         .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, null)         .build());  // first and last names       op_list.add(ContentProviderOperation.newInsert(Data.CONTENT_URI)   .withValueBackReference(Data.RAW_CONTACT_ID, 0)         .withValue(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE)         .withValue(StructuredName.GIVEN_NAME, ""MyFirstName"")         .withValue(StructuredName.FAMILY_NAME, ""MyLastName"")         .build());  try{   ContentProviderResult[] results = cResolver.applyBatch(ContactsContract.AUTHORITY, op_list);  }catch(Exception e){   e.printStackTrace();  }</code></pre><p>Try to run this piece of code in a 20 iteration loop, then go to the contacts applicationyou will see only 8 contacts hanging there!!This problem happens when also when I insert duplicate emails, phones, organizations.Try it in a loop from 0->200, android will go crazy!</p><p>is there a problem in my code? is there any solution to this?</p><p>any help will be really appreciated ...Thanks!</p>","445548","","445548","","2010-11-14 01:52:50","2010-11-19 02:38:19","Android not adding all contacts with duplicate fields","<android><duplicates><contacts>","3","0","1","",""
"4175738","1","4175777","","2010-11-14 01:44:29","0","954","<p>I'm going through a tutorial here: <a href=""http://mobile.tutsplus.com/tutorials/android/android-sdk-development/"" rel=""nofollow"">http://mobile.tutsplus.com/tutorials/android/android-sdk-development/</a>.</p><p>I have finished the tutorial and I've set up my debug configuration. When I actually try to run the debugger I see a popup that says: ""Your project contains errors. Please fix them before running your application.""</p><p>In the ""Problems"" tab of eclipse, It says Errors 1 Item: Unparsed aapt error(s)! Check the Console for output. The location of the error is listed as unknown. When i switch to console, this is what's in there:</p><pre><code>[2010-11-13 19:34:36 - SDK Manager] Warning: Error parsing 'C:\Users\Owner\Desktop\android-sdk_r07-windows\android-sdk-windows\platforms\android-2\sdk.properties': java.io.FileNotFoundException: C:\Users\Owner\Desktop\android-sdk_r07-windows\android-sdk-windows\platforms\android-2\sdk.properties (The system cannot find the file specified).[2010-11-13 19:34:36 - SDK Manager] Warning: Error parsing 'C:\Users\Owner\Desktop\android-sdk_r07-windows\android-sdk-windows\platforms\android-5\sdk.properties': java.io.FileNotFoundException: C:\Users\Owner\Desktop\android-sdk_r07-windows\android-sdk-windows\platforms\android-5\sdk.properties (The system cannot find the file specified).[2010-11-13 19:34:36 - SDK Manager] Warning: Error parsing 'C:\Users\Owner\Desktop\android-sdk_r07-windows\android-sdk-windows\platforms\android-6\sdk.properties': java.io.FileNotFoundException: C:\Users\Owner\Desktop\android-sdk_r07-windows\android-sdk-windows\platforms\android-6\sdk.properties (The system cannot find the file specified).[2010-11-13 19:35:25 - SDK Manager] Created AVD 'FirstAndroid' based on Android 2.2,[2010-11-13 19:35:25 - SDK Manager] with the following hardware config:[2010-11-13 19:35:25 - SDK Manager] hw.lcd.density=160</code></pre><p>I'm not sure what to do about this. Where would i get those files/What's the next step?</p>","336384","","","","","2010-11-14 02:47:48","Beginner Asking: How do I get my android app to compile in Eclipse?","<java><android><eclipse>","2","1","","",""
"4175805","1","","","2010-11-14 01:58:50","3","2014","<p>I have some design questions that I want to discuss with people interested in helping me. I am planning to develop a simple VoIP program that allows two Android phones in the same network to use VoIP. My goal is simply to capture sound, send the data with UDP, receive UDP data and play sound.</p><p>My current design is to have 2 threads: one captures the microphone and sends the data; the other one receives bytes and plays them.</p><p>I was starting to implement that using MediaPlayer and MediaRecorder. The issue that came up is how do I record and play sound? By that, I would like to know if I need to use a file, although that seems slow, or if there is anyway to have the recording automatically sent to my UDP socket please?</p><p>Basically, I wonder if I have to record to a file, then to be able to play it, or if I could just pass a socket (for recording and playing).</p><p>Does anyone has any suggestion please?</p><p>Thank you very much</p>","505281","","505281","","2010-11-14 02:06:08","2011-04-03 20:49:10","Android: Implementing a VoIP program","<android><udp><voip><skype>","2","2","1","",""
"4175868","1","4175923","","2010-11-14 02:21:03","0","2424","<p>I don't consider myself a beginner, but my copy and pasting has left me lost in auto-generated errors. Here's my dilemma, if I remove the comments below the program crashes unexpectedly; with comments it displays just fine.</p><pre><code>//////// Options.java /////  public class Options extends Activity {  /** Called when the activity is first created. */      @Override      public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.reclayout);          //Button STO = (Button)findViewById(R.id.StopBut);          //Button REC = (Button)findViewById(R.id.RecButton);      }  }  ///////reclayout.xml/////  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;LinearLayout      xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_height=""fill_parent""      android:layout_width=""fill_parent""      android:orientation=""vertical""      android:gravity=""center_vertical""&gt;    &lt;Spinner           android:id=""@+id/Spinner01""          android:layout_height=""wrap_content""          android:layout_width=""fill_parent""          android:contentDescription=""Classes""/&gt;      &lt;EditText          android:layout_height=""wrap_content""           android:layout_width=""fill_parent""           android:lines=""3""           android:id=""@+id/DescriptionText""           android:text=""Class Description""/&gt;      &lt;LinearLayout          android:layout_height=""wrap_content""           android:id=""@+id/ButtonLayout""           android:orientation=""horizontal""           android:layout_width=""fill_parent""&gt;          &lt;ImageButton              android:layout_height=""wrap_content""               android:layout_width=""fill_parent""               android:layout_weight=""3""               android:id=""@+id/RecButton""               android:focusableInTouchMode=""true""               android:src=""@drawable/rec""/&gt;          &lt;ImageButton               android:layout_height=""wrap_content""               android:layout_width=""fill_parent""               android:layout_weight=""3""               android:id=""@+id/PauseButton""               android:src=""@drawable/pause""/&gt;          &lt;ImageButton               android:layout_height=""wrap_content""               android:layout_width=""fill_parent""               android:layout_weight=""3""               droid:src=""@drawable/stop""               android:id=""@+id/StopBut""/&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;`  </code></pre>","507120","","507120","","2010-11-14 02:34:19","2012-12-08 06:27:26","findViewById() question","<android>","6","1","","",""
"4176095","1","","","2010-11-14 03:38:25","4","1653","<p>I am currently writing a program that is a sort of VoIP client. I am trying to establish a connection between 2 clients and send and receive data, that is recorded from microphone.</p><p>I am currently using files but it looks like an awful implementation:</p><p>The recorder starts recording to a temporary file. A timer kicks in, stop the recorder, look at the file size, to then send the content using a DatagramPacket.</p><p>It seems awfully bad. I wonder if the MediaRecorder and MediaPlayer class have a way to take a UPD socket as it's file output and input respectively (that is, a DatagramSocket).</p><p>I can use a file descriptor from a socket, but sockets uses TCP. I wanted to use UDP, so I guess DatagramSocket, but I can't seem to find a way to use it in my MediaRecorder and MediaPlayer class.</p><p>Does anyone please have a good solution for this?</p><p>Thank you very much</p>","505281","","229044","","2010-12-05 05:47:07","2012-01-26 15:16:34","MediaRecorder and UDP (DatagramSocket) in Android","<android><udp><media-player><voip><datagram>","2","0","3","",""
"4176117","1","","","2010-11-14 03:50:08","1","878","<p>I am trying to write client for Android which is supposed to communicate with PC server application on local network. Server app is written by my friend in C#. Currently there is an iPhone app that is using this server application with no problems. </p><p>I have very simple code for TCP client:</p><pre><code>1. Socket s = new Socket(server, port);2. OutputStream out = s.getOutputStream(); 3. PrintWriter output = new PrintWriter(out); 4. output.println(""ACTION=Next&amp;VALUE=0&amp;""); 5. BufferedReader input = new BufferedReader(new nputStreamReader(s.getInputStream())); 6. String st = input.readLine(); </code></pre><p>I went through many TCP implementation examples, and they are all similar. Pretty much like my code above. My app freezes on line 6 when I try to read response from the server. It doesn't cause any errors (no exceptions), nothing shows in debugger, just timeout error after awhile. Server is supposed to return string  after executing my action in line 4. I don't understand why this code hangs. Input is not NULL (I've checked it). I would expect some exception to be thrown or simply empty string to be returned. </p><p>So? What am I missing? Could it be problem with some special characters that server app is sending and android can't handle that? Do I need any special permission in my manifest?</p><p>I am positive that I have correct IP address and correct port number. I can see that on server application running on my PC. </p><p>Thanks.</p>","507153","","","","","2011-06-20 10:26:00","TCP problem - hangs when reading server's response","<android><tcp><tcpclient>","2","2","1","",""
"4176159","1","4176294","","2010-11-14 04:15:23","0","771","<p>I have two textviews, a listview (this is a listactivity, by the way) and a datepicker. All is supposed to be displayed in this order, vertically.</p><p>The problem is that the ListView is pushing the datepicker below the screen, to the depths of the unseen world. I want the datepicker to have its own space, fixed at the bottom, while the listview grows as needed, but still allowing datepicker to have its own space.</p><p>+/- like this:</p><pre><code>~~~~~~~~~~~~~~~ screen topTextView 1TextView 2|||| ListView [*]|||DatePicker (stays here no matter how much List grows or shrinks~~~~~~~~~~~~~~~ screen bottom</code></pre><p>[*] -> This listview will scroll a lot, but won't hide datepicker!</p><p>I know it's very lazy to ask for ready code, but could you guys share a light? This is driving me crazy. I've tried millions of combinations I believe.</p><p>Thank you a lot. This is all I need to finish my first app! :-(</p>","489607","","229106","","2010-11-14 04:26:03","2010-11-14 05:15:56","Layout problem: Listview pushes View outside screen","<android><listview><layout><screen>","1","0","","",""
"4176221","1","4176286","","2010-11-14 04:47:41","0","4719","<p>I have a class within an Activity called Pdj . . . </p><pre><code>        private class ButtonListener implements View.OnClickListener {        public void onClick(View v) {            ListView myListView = (ListView)findViewById(R.id.pdjListView);            EditText screen2EditText = (EditText)findViewById(R.id.pdjEditText);                    ArrayList&lt;String&gt; todoArrayList = new ArrayList&lt;String&gt;();                            // array adapter to bind the array to the list view            ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(this,                                          android.R.layout.simple_list_item_1,                                          todoArrayList);       . . . </code></pre><p>The last line generates the build error ""The constructor ArrayAdapter(Pdj.ButtonListener, int, ArrayList) is undefined""</p><p>Someone else on StackOverflow reported this problem an was told to try . . . </p><pre><code>                ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(this.getContext(),                                          android.R.layout.simple_list_item_1,                                          todoArrayList);</code></pre><p>... but that just produces ""The method getContext() is undefined for the type Pdj.ButtonListener""</p><p>Thanks in advance!!</p>","424690","","","","","2010-11-14 05:12:49","Build error for ArrayAdapter (Android, noob)","<android>","2","0","","",""
"4176251","1","","","2010-11-14 04:58:20","0","1154","<p>I've created an app in Flash Builder ""Burrito"". When I run the application there are no project warnings or errors. The .apk was compiled successfully.  The emulator is running Andorid 2.2. However, when I push the .apk to the emulator I get ""Invalid Apk"" error. I tried installing  it into Galaxy Phone (Android 2.2) , de time i got ""Parse error ""any1 had the same problem resolved ?</p>","507173","","","","","2011-12-14 14:51:27","Flash Builder ""Burrito"" : apk : invalid_apk , ""parse error""","<android>","3","0","1","",""
"4176283","1","4177142","","2010-11-14 05:10:28","3","879","<p><img src=""http://i.stack.imgur.com/acCF3.png"" alt=""alt text""></p><p>Why does the zoom control show like this? It only happens on QVGA resolution smulator. It works perfectly on HVGA resolution.</p><p>This is the code that I used.</p><pre><code>    ZoomControls zoomControls = (ZoomControls) findViewById(R.id.zoomcontrols);    zoomControls.setOnZoomInClickListener(new View.OnClickListener() {        public void onClick(View v) {                mc.zoomIn();        }    });    zoomControls.setOnZoomOutClickListener(new View.OnClickListener() {        public void onClick(View v) {                mc.zoomOut();        }    });</code></pre><p><code>zoomcontrols</code> defined in xml as:</p><pre><code>&lt;ZoomControls android:id=""@+id/zoomcontrols""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:layout_alignParentBottom=""true""    android:layout_centerHorizontal=""true""/&gt;</code></pre>","481239","","","","","2010-11-14 10:43:20","Android: Why is the zoom control like this?","<android><maps><zoom>","1","0","","",""
"4176734","1","4176836","","2010-11-14 08:25:51","1","675","<p>I'm using a Android Wildfire and I used the following code to lookup the contact name of an existing phone number.</p><pre><code>private String getContactNameFromNumber(String number) {    String[] projection = new String[] { Contacts.Phones.DISPLAY_NAME,             Contacts.Phones.NUMBER };    Uri contactUri = Uri.withAppendedPath(Contacts.Phones.CONTENT_FILTER_URL, Uri.encode(number));    Log.d(TAG, contactUri.toString());    // query time    Cursor c = context.getContentResolver().query(contactUri, projection, null,            null, null);    // if the query returns 1 or more results    // return the first result    if (c.moveToFirst()) {        String name = c.getString(c.getColumnIndex(Contacts.Phones.DISPLAY_NAME));        Log.d(TAG, name);        return name;    }    // return null if no match was found    return null;}</code></pre><p>I am unable to resolve the contact name. I'm new to this topic any assistance will be appreciated. Many thanks in advance. The logcat output shows the following</p><pre><code>11-14 13:45:35.879: DEBUG/Test(3342): content://contacts/phones/filter/%2B919773653345</code></pre>","421372","","","","","2010-11-14 09:03:48","Unable to resolve contact name from number","<android>","2","2","","",""
"4176739","1","","","2010-11-14 08:27:25","0","1159","<p>I need to filter List View as per the user's input in the Edit Text Field.If the user Enter the letter 'a' i need to show the list items starts with 'a'.Can anyone give some ideas to me to solve this ? Thanks in advance?  </p><pre><code>void searchEngine(final String[] strArr){      LinearLayout llay=new LinearLayout(this);      llay.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));              llay.setOrientation(LinearLayout.VERTICAL);      final ListView lv=new ListView(this);              lv.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_checked, strArr));            final EditText ed=new EditText(searcher.this);      ed.setWidth(80);      ed.setOnEditorActionListener(new OnEditorActionListener() {        @Override        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {            // TODO Auto-generated method stub             lv.setTextFilterEnabled(true);             String strfilter=ed.getText().toString();             lv.setFilterText(strfilter);            return false;        }    });      llay.addView(ed);      llay.addView(lv);    setContentView(llay);}</code></pre>","482568","","","","","2010-11-14 13:25:15","Filter ListView Based on user input's in Android?","<android>","2","2","","",""
"4176808","1","4376632","","2010-11-14 08:52:58","2","5354","<p>I would like to set to my EditText <a href=""http://img9.imageshack.us/f/backgroundtext.png/"" rel=""nofollow"">background</a> . </p><p>Hm ... I don't know even how to explain ....When there is a lot of text vertical scroll enables ... I need to 'scroll' the background when user scrolls the text (Now I have that when user scrolls the text background is fixed, so text became crossed by lines of background)</p><p>Have you any ideas?</p>","332311","","","","","2010-12-07 12:35:45","android EditText's background","<android><background><edittext>","2","0","","",""
"4176817","1","","","2010-11-14 08:56:21","1","502","<p>I have problem with using bluetooth gps on android.I have an application which just takes position and calculates how much i have moved since first position. It is very simple app.I am using gps bluetooth programs from market to connect to gps and get position. I tried three of them and the same problem comes with all.App starts and works fine.After some time, but not always, bluetooth data receiving program loses its connection.If then I try to reconnect or simply turn off bluetooth the phone starts vibrating and it crashes and reboots.</p><p>Now I also realized that the gps in the phone doesn't work any more. It gets satellites ( used gps status program) but has no position fix.</p><p>My phone is lg optimus gt540.</p><p>Thanx!</p>","507258","","","","","2010-11-14 08:56:21","Android crashing while using bluetooth GPS","<android><crash><bluetooth><gps><reboot>","0","1","","2010-11-14 14:40:21",""
"4176947","1","4177683","","2010-11-14 09:38:36","1","934","<pre><code>   can any body have any idea if we can add a context menu or spinner when u click on an item on Option menu?</code></pre><p>thanks</p>","397901","","","","","2010-12-24 15:18:29","adding context menu or spinner on OPtion Menu in android","<android><contextmenu><spinner><optionmenu>","2","0","","",""
"4177081","1","4177198","","2010-11-14 10:22:31","3","1761","<p>i can use an XML file like below</p><pre><code>&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""      android:interpolator=""@android:anim/decelerate_interpolator""&gt; &lt;translate android:fromXDelta=""100%"" android:toXDelta=""0%"" android:duration=""500"" /&gt;&lt;/set&gt;</code></pre><p>and load this xml from code likeAnimationUtils.loadAnimation(mContext, com.....R.anim.slidein)</p><p>everything works fine</p><p>But now for some reason i need to do that same thing without using XMLhow do i create the same animation using just code i tried something like this</p><pre>TranslateAnimation in = new TranslateAnimation(1.0f,0.0f,0.0f,0.0f);    in.setInterpolator(AnimationUtils.loadInterpolator(mContext,                        android.R.anim.accelerate_interpolator));    in.setDuration(500);</pre><p>but didnt work, nothing animates</p><p>i think the problem is with percentages, in the xml i have specified percentages but in the TranslateAnimation constructor how do i specify percentages</p>","507291","","507291","","2010-11-14 10:55:38","2010-11-14 11:05:58","Creating animation at runtime in Android","<android>","1","3","","",""
"4177085","1","4177108","","2010-11-14 10:22:40","0","625","<p>in my android application i have address, when i click a button i have to call google map api and show the exact location of that address.how to use that google map api in android , and also how to send the addess to the particular api to locate it?</p>","430652","","1048862","","2013-07-02 20:35:00","2013-07-02 20:35:00","locating an address in android phone","<android><api><google-maps><location><street-address>","1","0","","",""
"4177180","1","","","2010-11-14 10:57:49","7","1400","<p>friends, </p><p>i have read complete article related to avoiding memory leaks in android.<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>right now</p><p>1)  i am using private nested class not static</p><p>if i make that nested class static will it be usefull?</p><p>2) article saysIf you're about to use Inner Classes or Anonymous Classes think carefully. Don't use Anonymous Classes until you're very sure and can prove that they are not causing a Memory Leak.</p><p>can any one give me example of that? which one is good approach and which one bad for memory leaks.</p><p>any help would be appreciated.</p>","249991","","","","","2011-01-28 20:28:59","android memory leaks points are not clear!","<android>","1","2","3","",""
"4177227","1","4178931","","2010-11-14 11:21:19","3","2231","<p>I have a login database, from my Android client I have to pass the password in a secure manner. I want to implement a login screen which is capable of doing encryption.</p><p>How to implement the security encryption in my application?</p>","430652","","418183","","2011-08-05 19:55:38","2011-08-05 19:55:38","How to implement encrypted Android login authentication?","<java><android><security><authentication>","1","2","6","",""
"4177252","1","","","2010-11-14 11:28:39","2","1225","<p>I am trying to post data to the Blob Store on google's app engine, this code runs without throwing any exceptions, but on the blobstore end there is no log on the post request at all. The server side stuff works when i post using a form (albeit with mime data). I have allowed my android app to use internet. This is a stab in the dark but if any of you folks might have had an issue like this before perhaps the problem i am having might ring a bell!</p><pre><code>public void sendVideo() throws IOException {  // Create a new HttpClient and Post Header  HttpClient httpclient = new DefaultHttpClient();  HttpPost httpPost = new HttpPost(""http://www.theurliampostingto.com/au813rsadjfaruh);  // Add your data  List&lt;NameValuePair&gt; pairs = new ArrayList&lt;NameValuePair&gt;();  pairs.add(new BasicNameValuePair(""key1"", ""value1""));  pairs.add(new BasicNameValuePair(""key2"", ""value2""));  httpPost.setEntity(new UrlEncodedFormEntity(pairs));  // Execute HTTP Post Request  HttpResponse response = httpclient.execute(httpPost); }</code></pre>","307039","","33006","","2010-12-29 15:53:07","2010-12-29 15:53:07","Using HTTP Post on an android device to put data on google app engine's blob store","<java><android><http><post><blobstore>","1","1","","",""
"4177305","1","4177697","","2010-11-14 11:44:09","12","16080","<p>I'm trying to make something like this: I have a mapactivity and when the user taps the map it shows the coordinates of that location. I already overrided the onclick method but it isn't even called. Any Idea?</p><pre><code>public class MapPoint extends MapActivity implements OnClickListener {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.mappoints);    MapView map = (MapView)findViewById(R.id.mapview);    map.setOnClickListener(this);    map.setBuiltInZoomControls(true);    map.getController().setZoom(18);    map.getController().setCenter(new GeoPoint(39735007, -8827330));}@Overrideprotected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;}public void onClick(View arg0) {        Toast.makeText(this, ""text"", Toast.LENGTH_SHORT);}</code></pre><p>}</p>","320586","","","","","2014-04-12 20:14:50","Get coordinates on tapping map in android","<android><map><touch><coordinates><tap>","6","1","6","",""
"4177319","1","","","2010-11-14 11:46:50","0","661","<p>Greetings I tried to integrate <a href=""http://mapas.sapo.pt/api"" rel=""nofollow"">http://mapas.sapo.pt/api</a> in android with phonegap but all that I was getting was a Blank Space.</p><p>I am noob into phone gap and I would be very please if someone could give me a little explanation why does it happen ;)</p><p>thanks in advance</p>","180699","","","","","2011-05-16 19:41:53","Can't display a map api in phonegap","<android><phonegap>","1","2","","",""
"4177401","1","6266577","","2010-11-14 12:09:09","11","9509","<p>I can use the following XML just fine</p><pre><code>&lt shape android:shape=""rectangle"" xmlns..."">     &lt gradient         android:startColor=""#255779""         android:centerColor=""#3e7492""         android:endColor=""#a6c0cd""         android:angle=""90"" />    &lt stroke android:width=""1dp"" android:color=""#0d202e"" />&lt/shape></code></pre><p>the gradient come up nicely</p><p>i am trying to do the same thing just using code (no XMLs)</p><pre>int colors[] = { 0xff255779 , 0xff3e7492, 0xffa6c0cd };GradientDrawable g = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, colors);setBackgroundDrawable(g);</pre><p>The gradient DOES come up but its not the same as the one the one from XML, i mean the colors are same but gradient is not same, i think it has to do with the start,middle,end colors in the xml</p><p>also how do i add a stroke</p><p>any help will be greatly appreciated</p>","507291","","507291","","2010-11-14 13:12:14","2011-06-07 14:16:26","GradientDrawable in Code","<android>","1","0","2","",""
"4177409","1","4177484","","2010-11-14 12:13:34","4","5248","<p>how i can do that?</p>","472537","","","","","2014-04-14 10:35:08","Java/android how to start an AsyncTask after 3 seconds of delay?","<java><android><android-asynctask>","3","0","","",""
"4177488","1","","","2010-11-14 12:39:43","1","1176","<p>i have a gles based game that takes quite some time to load because of the huge amount of textures.</p><p>now i want to display a loading-text or loading-bar as soon as possible as the application is starting up.</p><p>what is the fastest way to display a text like this? should i do it in gles as well or should i use an alert or view?</p>","97688","","111307","","2010-11-14 19:57:04","2010-11-14 19:57:04","android: fastest way to display loading screen","<android><opengl-es>","1","0","","",""
"4177507","1","4177582","","2010-11-14 12:43:09","16","3075","<p>What is the difference between these two listeners,documentation says :</p><p>OnItemSelectedListener - Interface definition for a callback to be invoked when an item in this view has been selected.</p><p>OnItemClickListener - Interface definition for a callback to be invoked when an item in this AdapterView has been clicked.</p><p>Selection,Click aren't these equal on touch screen?</p>","110024","","932225","","2012-07-13 09:29:29","2014-02-11 04:42:57","Difference between onItemClickListener and OnItemSelectedListener of AdapterView","<android><android-adapterview>","2","1","2","",""
"4177546","1","","","2010-11-14 12:53:47","1","3063","<p>When I download a file from web in android, then I want to show a progress bar in notification area of status bar through service, but I am not able to do this. How can i do it? I am not able to pass the file length in service. I am giving URL in EditText, and I am clicking Download Button. After Click A class will be called on Click Listener, this class is having a function. In that function I am doing processing or functionality of downloading, Now I want to show the progress bar in Notification Area Through service, but I can not able to do this. Please help me. Thanks in advance.</p>","493397","","492773","","2010-11-14 12:55:19","2010-11-14 13:55:10","File Downloading in android with service in Background","<android>","2","0","2","",""
"4177556","1","4177703","","2010-11-14 12:56:01","3","5851","<p>Is there a way, to try my project on a samsung galaxy emulator, or something like that? </p><p>My project work on HTC Legend, but its crashes on that device. How i can set up a samsung galaxy s on android/eclipse?</p><p>I set up a W800/854 2.2 AVD but it work.. but on the samsung phone it was a crash..</p>","472537","","69802","","2010-11-14 13:01:04","2010-11-14 13:39:09","Android/samsung galaxy S emulator","<android><android-emulator>","1","0","3","",""
"4177642","1","4177670","","2010-11-14 13:20:42","0","1676","<p>In my layout xml file I have set the android:onClick attribute for a Button element to a function in my activity.  So when I click the button the function is called with a View as its argument.  Are there any information in that View argument that has the id of the button being clicked?  I'm trying to figure out if I have to have one onClick function for every element or if I can use one function and switch depending on the id of the element being clicked.</p>","324943","","","","","2011-04-11 04:35:14","OnClick listener - one function for all clicks","<android>","2","1","","",""
"4177652","1","","","2010-11-14 13:24:02","0","912","<p>every one .now I am in a project upon android system application source code with the Android v 2.1r1 : Contacts .I have modify the source code and run it on the emulator successfully..</p><p>but i get a problem on publishing it to my android phone with the same system version because of without signing it.   how can i do if i want to publish it to my android phone after modifying it?  do i need to resign the Contacts.apk built by mm ?  can i just signing the Contacts.apk built by mm?  thx for your reading and replies ! </p>","507361","","20402","","2010-11-14 15:03:21","2010-11-14 15:48:19","How to re-sign an existing android app after modifing it","<android>","2","5","","",""
"4177711","1","4178199","","2010-11-14 13:41:23","0","749","<p>I get this error when i try to install my app from eclipse on my htc magic.</p><p>Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARYPlease check logcat output for more details.Launch canceled!</p><p>Logcat says:at.tomtasche.altitude requires unavailable shared library com.google.android.maps; failing!</p><p>I developed an app with google maps before and there it works fine.And yes i have the</p><blockquote>  <p>uses-library android:name=""com.google.android.maps""</p></blockquote><p>in the application tag of my manifest. It also works in the emulator, just my device dont install it.</p>","401171","","401171","","2013-11-22 11:28:07","2013-11-22 11:28:07","Failed to install App on device. (with maps api)","<java><android><google-maps><maps>","1","4","","",""
"4177731","1","4177776","","2010-11-14 13:45:55","3","11319","<p>I am currently trying to call a method from a utility class that will reference a new cursor created for this utility method.  Unfortunately, my new class will not let me create the cursor without context.  I have tried numerous ways of passing context from the calling activity, but get null pointer exceptions in most cases.</p><p>Here is the portion of my code:</p><pre><code>findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                        Tools.pickRandomItem();                    }});</code></pre><p>and in the Tools Class:</p><pre><code>     public static void pickRandomItem() {       Cursor cur = getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null,                null, null,MediaColumns.TITLE + "" ASC"");}</code></pre><p>Using the above code it throws an error on getContentResolver(), and all attempts I've made to pass context have failed.</p><p>I am fairly new to programming for Android, and don't fully understand the concept of contexts. Any help you guys could provide would be greatly appreciated!</p><p>Thanks,Josh</p>","453305","","","","","2010-11-14 14:57:07","Android : How to call method from another class without passing context?","<android><context>","2","0","1","",""
"4177798","1","","","2010-11-14 13:59:36","0","124","<p>I am writing a simple little game. I would do in her dialogue with the character in the game.Is it possible to display the text without the use of XML? I also want to be able to move my text to any location on the screen.Is there a way?</p>","500054","","462307","","2010-11-14 15:13:35","2010-11-14 15:13:35","display the text without the use of XML","<android><android-layout>","2","0","","",""
"4177822","1","4177900","","2010-11-14 14:04:12","1","163","<p>I have an Activity which is an OpenGL view.  I also have an xml layout to use for preferences.  Until now, to show the preference menu, I just brought it to front by setContentView().  And the same to get back to the OpenGL view.</p><p>But is this a case where I should give the preference menu its own Activity?</p><p>I guess this would make a few things much easier.  For example, the back button would just work, opposed to now where I have to code it or it will just exits the application.</p><p>And if this is a good idea, how do I pass data both ways?  I have a class that store all preferences.  Can I send it to the Activity and back again?  Or is the best way to store the preferences in a sqlite database and then use it for passing data?</p>","324943","","118391","","2010-11-14 16:02:46","2010-11-14 16:02:46","When to use more Activities","<android><user-interface><android-layout>","2","0","","",""
"4177851","1","","","2010-11-14 14:10:10","0","2608","<p>I'm a android application developer novice. </p><p>I'm try to get latitude and longitude value via android.Location class, but sometime my system can't to get The correct value is lat: 0.00 and lng: 0.00, Perhaps It's return incorrect value because Android detect by GPS only.</p><p>Now, I know that location value can detect by GPRS/WIFI, and how do I get It ?</p><p>ps. I'm a novice in English too.</p>","442748","","","","","2010-11-14 14:13:06","Android, How I get the location value from GPS and GPRS?","<android><gps><location><gprs>","1","0","","",""
"4177992","1","4178332","","2010-11-14 14:53:41","0","501","<p>I was wondering how I can mimic the action that occurs on an auto-linked email address via an intent.  I tried using this method, <a href=""http://stackoverflow.com/questions/3453490/messaging-and-email-intents-in-android/3453559#3453559"">Messaging and email intents in Android?</a> and ran in on my phone and in my emulator and the message window opened but did not have the email address.  And the composer window for the auto-link looks different than the composer for the following code.  Any ideas?</p><p>Here is the code from the link above so you dont have to click:</p><pre><code>Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {""foo@bar.com""});emailIntent.setType(""text/plain"");startActivity(Intent.createChooser(emailIntent, ""Send a mail ...""));</code></pre>","411435","","411435","","2010-11-14 15:02:31","2010-11-14 16:08:31","Android Mimic Auto-Link Intent for Email- Missing Address","<android><email><android-intent>","1","0","","",""
"4177998","1","4178335","","2010-11-14 14:54:52","1","572","<p>I am working on an application that displays information about countries of the world (I'm learning with something real and I already have this data).  Part of my layout is a LinearLayout which contains the country's flag and some basic information.  There are five rows of information in the table to the right of the flag.  The trouble is the LinearLayout is only using the height of the flag for it total height.  Most flags are 2.5 rows high so some of my information is cut off. Why isn't the LiniearLayout's height the largest of its two elements?  Any suggestions for what I can do to make this work?</p><p>Here is the definition of the LinearLayout in question:</p><pre><code>        &lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""horizontal""&gt;        &lt;ImageView            android:id=""@+id/flag""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:adjustViewBounds=""true""            android:src=""@drawable/noflag"" /&gt;        &lt;TableLayout            android:id=""@+id/info1""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:layout_marginLeft=""10dip""&gt;            &lt;TableRow&gt;                &lt;TextView                    android:id=""@+id/capitallabel""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:text=""@string/capital_label""                    style=""?infoLabel""/&gt;                &lt;TextView                    android:id=""@+id/capitalvalue""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginLeft=""4dip""                    style=""?infoValue""/&gt;            &lt;/TableRow&gt;            &lt;TableRow&gt;                &lt;TextView                    android:id=""@+id/capitaltimelabel""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:text=""@string/capital_time_label""                    style=""?infoLabel""/&gt;                &lt;TextView                    android:id=""@+id/capitaltimevalue""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginLeft=""4dip""                    style=""?infoValue""/&gt;            &lt;/TableRow&gt;            &lt;TableRow&gt;                &lt;TextView                    android:id=""@+id/landarealabel""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:text=""@string/land_area_label""                    style=""?infoLabel""/&gt;                &lt;TextView                    android:id=""@+id/landareavalue""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginLeft=""4dip""                    style=""?infoValue""/&gt;            &lt;/TableRow&gt;            &lt;TableRow&gt;                &lt;TextView                    android:id=""@+id/waterarealabel""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:text=""@string/water_area_label""                    style=""?infoLabel""/&gt;                &lt;TextView                    android:id=""@+id/waterareavalue""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginLeft=""4dip""                    style=""?infoValue""/&gt;            &lt;/TableRow&gt;            &lt;TableRow&gt;                &lt;TextView                    android:id=""@+id/coastlinelabel""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:text=""@string/coast_line_label""                    style=""?infoLabel""/&gt;                &lt;TextView                    android:id=""@+id/coastlinevalue""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginLeft=""4dip""                    style=""?infoValue""/&gt;            &lt;/TableRow&gt;        &lt;/TableLayout&gt;    &lt;/LinearLayout&gt;</code></pre><p>I tried reversing the table and the image view so the flag was on the right and the information on the left.  I was hoping that the height of the LiniearLayout would now be the height of the information table.  No luck it was still the height of the flag.</p><p>Any help would be appreciated.</p><p>Thanks,</p><p>Ian</p>","199818","","","","","2010-11-14 16:09:35","Why is my horizontal LinearLayout not reserving enough height for its contents?","<android><android-layout><android-linearlayout>","1","0","","",""
"4178081","1","4178104","","2010-11-14 15:14:53","1","2773","<p>HiI want to get x and y position of screen where the user has touched. How can I do that?</p>","499773","","","","","2010-11-14 15:21:24","How to get x y position where user has touched on screen in android?","<android>","1","0","","",""
"4178150","1","","","2010-11-14 15:29:59","0","1665","<p>I have an app I'm trying to debug on an issue on regarding use of the media player.  I have an Activity displayed with a service polling a server behind it.  The Activity is displaying dynamic status that the service is collecting from the server.  That was working great.  I then added some code in a class the service uses to play an audio file if it sees a particular data item.  That works fine for the first few times, but then the app will freeze and can even eventually get to the dreaded force close.<br>I am seeing the following in the log file.  Its the warning that concern me and I can't seem to find any info on them.</p><pre><code>11-14 10:12:29.742: WARN/AV(28909): #### Attempting to play audio ####11-14 10:12:29.742: WARN/com.me.messaging.MessageMediator@43c0c518(28909): #### AV - Playing audio ####11-14 10:12:29.772: INFO/QC_CORE(103): OMXCORE API - OMX_Init 11-14 10:12:29.772: INFO/QC_CORE(103): OMXCORE API - OMX_ComponentNameEnum 5bf30 128 011-14 10:12:29.772: INFO/QC_CORE(103): GetRolesOfComponent OMX.qcom.video.decoder.avc11-14 10:12:29.772: INFO/QC_CORE(103): GetRolesOfComponent OMX.qcom.video.decoder.avc11-14 10:12:29.772: INFO/QC_CORE(103): OMXCORE API - OMX_ComponentNameEnum 5bf30 128 111-14 10:12:29.772: INFO/QC_CORE(103): GetRolesOfComponent OMX.qcom.video.decoder.mpeg411-14 10:12:29.772: INFO/QC_CORE(103): GetRolesOfComponent OMX.qcom.video.decoder.mpeg411-14 10:12:29.772: INFO/QC_CORE(103): OMXCORE API - OMX_ComponentNameEnum 5bf30 128 211-14 10:12:29.772: INFO/QC_CORE(103): GetRolesOfComponent OMX.qcom.video.decoder.h26311-14 10:12:29.772: INFO/QC_CORE(103): GetRolesOfComponent OMX.qcom.video.decoder.h26311-14 10:12:29.772: INFO/QC_CORE(103): OMXCORE API - OMX_ComponentNameEnum 5bf30 128 311-14 10:12:29.772: INFO/QC_CORE(103): GetRolesOfComponent OMX.qcom.video.encoder.mpeg411-14 10:12:29.772: INFO/QC_CORE(103): GetRolesOfComponent OMX.qcom.video.encoder.mpeg411-14 10:12:29.772: INFO/QC_CORE(103): OMXCORE API - OMX_ComponentNameEnum 5bf30 128 411-14 10:12:29.772: INFO/QC_CORE(103): GetRolesOfComponent OMX.qcom.video.encoder.h26311-14 10:12:29.782: INFO/QC_CORE(103): GetRolesOfComponent OMX.qcom.video.encoder.h26311-14 10:12:29.782: INFO/QC_CORE(103): OMXCORE API - OMX_ComponentNameEnum 5bf30 128 511-14 10:12:29.862: WARN/MediaPlayer(28909): info/warning (1, 44)11-14 10:12:29.862: INFO/MediaPlayer(28909): Info (1,44)</code></pre><p>I am using the media player like this:</p><pre><code>private void playMedia(int     audioResource,                       boolean vibrate)   {       Log.i(""AV"", ""#### Attempting to play audio ####"");       if (this.lastAlert + VIBRATION_LENGTH &lt;= System.currentTimeMillis())       {           this.lastAlert = System.currentTimeMillis();           Log.i(this.toString(), ""#### AV - Playing audio ####"");           try           {                  MediaPlayer mediaPlayer = new MediaPlayer();              AssetFileDescriptor assetFileDescriptor                  = this.context.getResources().openRawResourceFd(audioResource);              mediaPlayer.setOnCompletionListener(this);              mediaPlayer.setDataSource(assetFileDescriptor.getFileDescriptor(),                                        assetFileDescriptor.getStartOffset(),                                        assetFileDescriptor.getLength());              mediaPlayer.prepare();              mediaPlayer.start();           }           catch (Exception e)           {               Log.e(this.toString(), e.toString());               e.printStackTrace();           }           if (vibrate)           {              if ( null != this.vibrator )              {                 this.vibrator.vibrate(VIBRATION_LENGTH);              }           }       }       else       {           Log.w(this.toString(), ""##### AV - Audio is already playing #####"");       }   }// end playMedia   @Override   public void onCompletion(MediaPlayer mediaPlayer)   {      mediaPlayer.reset();      mediaPlayer.release();      Log.i(this.toString(), ""#### ################################### ####"");      Log.i(this.toString(), ""#### AV - reset and release media player ####"");   }</code></pre><p>The audio files are mp3 format.</p>","418714","","418714","","2010-11-14 15:40:44","2011-03-04 13:07:53","Android MediaPlayer eventually causing app to stop","<android><media-player>","1","0","","",""
"4178155","1","4183820","","2010-11-14 15:31:02","4","4750","<p>I am making a application that uses the GPS receiver. The application will work on all versions starting from 1.6. I have a satellite Icon in which I tell the users the current status:</p><blockquote>  <ul>  <li>if icon is red - gps disabled </li>  <li>if icon is orange - gps is enabled and trying to fix on the satellites</li>  <li>if icon is green - gps is fixed and running fine.</li>  </ul></blockquote><p>After reading around here, I've found that some events for onLocationChanged trigger on 1.6 version but not later, so taking the advice I implemented a GPS listener. I have some really weird behavior as the status of the icon gets messed out. For instance I enable GPS and gets orange... after a fix get's green.. after a few seconds gets read after a second orange and so on...</p><p>Here is the code I use. Please suggest what to change</p><pre><code>public class TrackExecutionActivity extends Activity{protected static final long GPS_UPDATE_TIME_INTERVAL=3000;  //millisprotected static final float GPS_UPDATE_DISTANCE_INTERVAL=0; //metersprivate LocationManager mlocManager;private MyGPSListener mGpsListener;private LocationListener mlocListener; @Overridepublic void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.trackexecution);        imgGpsState = (ImageView)findViewById(R.id.imgGpsState);        mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);        mlocListener = new MyLocationListener();        mGpsListener = new MyGPSListener();}private class MyGPSListener implements GpsStatus.Listener {        public void onGpsStatusChanged(int event) {            boolean isGPSFix = false;            switch (event) {                case GpsStatus.GPS_EVENT_SATELLITE_STATUS:                    if (mLastLocation != null)                        isGPSFix = (SystemClock.elapsedRealtime() - mLastLocationMillis) &lt; GPS_UPDATE_TIME_INTERVAL * 2;                    if (isGPSFix) { // A fix has been acquired.                        imgGpsState.setImageDrawable(ctx.getResources().getDrawable(R.drawable.gps_on_green));                    } else { // The fix has been lost.                        imgGpsState.setImageDrawable(ctx.getResources().getDrawable(R.drawable.gps_on_orange));                    }                    break;                case GpsStatus.GPS_EVENT_FIRST_FIX:                    imgGpsState.setImageDrawable(ctx.getResources().getDrawable(R.drawable.gps_on_green));                    break;                case GpsStatus.GPS_EVENT_STARTED:                    imgGpsState.setImageDrawable(ctx.getResources().getDrawable(R.drawable.gps_on_orange));                    break;                case GpsStatus.GPS_EVENT_STOPPED:                    imgGpsState.setImageDrawable(ctx.getResources().getDrawable(R.drawable.gps_on_red));                    break;            }        }    }public class MyLocationListener implements LocationListener    {        public void onLocationChanged(Location location)        {            if (location != null) {                       mLastLocationMillis = SystemClock.elapsedRealtime();            // do some things here                     mLastLocation = location;        }        public void onProviderDisabled(String provider)         {             imgGpsState.setImageDrawable(ctx.getResources().getDrawable(R.drawable.gps_on_red));        }         public void onProviderEnabled(String provider)         {             imgGpsState.setImageDrawable(ctx.getResources().getDrawable(R.drawable.gps_on_orange));        }         //this doesn't trigger on Android 2.x users say        public void onStatusChanged(String provider, int status, Bundle extras)         {         }        }        } @Override    protected void onResume() {     if(mlocManager != null) {         if (mGpsListener == null)         {            mGpsListener = new MyGPSListener();         }         if (mlocListener == null)         {            mlocListener = new MyLocationListener();         }        mlocManager.addGpsStatusListener(mGpsListener);        mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, GPS_UPDATE_TIME_INTERVAL, GPS_UPDATE_DISTANCE_INTERVAL, mlocListener);      }       super.onResume();    }}</code></pre>","379865","","379865","","2010-11-15 08:04:20","2012-08-24 15:04:31","Android GPS Status driving me nuts","<android><gps>","1","0","7","",""
"4178168","1","4178184","","2010-11-14 15:34:21","11","15690","<p>I want to programmatically move, copy and delete files and directories on SD card. I searched on google but couldn't find anything useful.</p><p>Please, help me to do this.</p>","458678","","1726308","","2013-04-05 07:50:30","2014-01-30 11:44:58","How to programmatically move, copy and delete files and directories on SD?","<android><file><directory><copy><move>","3","0","7","",""
"4178255","1","4178319","","2010-11-14 15:52:47","1","454","<p>I'm a .NET developer starting to dig into an android application. One thing that seems a little abstract is working with SqlLite. In a .NET application, I can do my Database setup, query testing and profiling, and enter in some test records through Management Studio for MSSQL. In fact, I'm constantly in Management Studio checking something - so I'm finding it difficult to work without a similar tool.</p><p>What are some good tools/tricks to use when developing SQLLite on Android? The tool doesn't have to have a GUI, but would be nice if I could run it as a desktop app and have it look at the same DB as my emulator.</p><p>For instance, something that will allow me to run a simple SELECT statement against a table to view records without having to do it through android?</p>","462307","","236247","","2011-06-28 13:00:31","2011-06-28 13:00:31","Tips/Tools for working with SQLite in Android?","<android><sqlite><rdbms>","2","0","2","",""
"4178354","1","4178451","","2010-11-14 16:13:34","1","415","<p>Greetings all,</p><p>I realize this issue has been posed before in other forms, and believe me, I have been searching the net for days trying to find the answer.  However, I'm fairly new to Android and Java, and I need a little guidance please.</p><p>I presently have two version of my app, one for Android 1.5 and 1.6, and another for 2.0 and beyond.  As you probably guessed, it's because the Contacts API is different.</p><p>I recently became aware that it was possible to combine both methods into a single app, by using dynamically loadable classes.  Very cool!  After days of attempts, I still haven't been able to do it successfully...  or at least, it won't run.</p><p>I have come across 3 examples of how to do this - one by Google, called ""Business Card"", another that had something to do with Spinners, and a 3rd was something someone here created.  My problem is that each one seems to me to have a showstopper.</p><p>I'm using Eclipse on Windows 7.  My app was first created for A1.5, so that's the one I'm upgrading.  What's happening is that my ContactsAccessorNewApi class needs to import the ContactContracts, and according to Eclipse, that won't work because my project was originally built without support for it.  Hence, it won't run.  I've tried adding the android.jar for SDK level 5 into the project, but that creates a whole mess of other problems.  </p><p>My code for this pat of my app is exactly like the Google example ""Business Card"" - so if someone could help me cross this hurdle, I'd be very grateful.  I'll be happy to post any code that you need to answer my question.</p><p>Thank you!</p>","507446","","","","","2010-11-14 16:35:22","Incorporating both Contacts and ContactsContract into an Android application","<android><contacts>","1","0","","",""
"4178373","1","","","2010-11-14 16:16:47","1","794","<p>How do i make an intent open an youtube video?Thanks</p>","507452","","868319","","2011-11-25 08:51:46","2012-05-24 05:28:30","Playing youtube videos through intent","<java><android><youtube>","3","0","1","",""
"4178379","1","","","2010-11-14 16:18:42","0","296","<p>I'm very new to android development and to get started I've started modifying the android ask sample 'shape wallpaper'. I've added a touch ripple, change resources etc and removed the more basic example. If I have my se xperia x10 plugged in and run the app it downloads to the phone and once started works great. I then unplug the phone and the wallpaper keeps working for approximately 24 hours. It then slows redrawing dramatically then displays nothing - I can't even load the settings page! Anyone have any ideas why? Do I need to do a compilation outside eclipse? I've got the source on Google code which i'll add a link to once I can get on pc (typing this on phone).</p><p>Thanks.</p>","507454","","","","","2010-12-30 11:57:09","android live wallpaper locking up","<android>","2","0","","",""
"4178547","1","4183705","","2010-11-14 16:58:02","0","69","<p>I have a simple concept question.  I have a class that snaps a picture and displays it on a new java class: Result.java that displays the image on a basic ImageView in an xml file.  </p><p>I assume the camera stores the saved image on the SD card.  Is there a way for a new Java class to access that photo that was taken and do stuff do it?  How do I go about calling that bmp in another class in my app?</p><p>Also, when the app is closed, is there a command for me to delete that picture taken?</p><p>Thanks!</p>","496686","","","","","2010-11-15 11:06:49","Accessing an image taken from another class","<android><image><class><accessibility><declaration>","1","0","","",""
"4178643","1","","","2010-11-14 17:19:53","0","3709","<p>My issue is this:I use the android emulator, targeting android 2.2.I created a custom view which I want to handle the background of my application, in this view I only want to display an image but I want it to fill the entire screen.</p><p>I initialize the view from my ""Activity"" like this:BackgroundView bw = new BackgroundView(this);</p><p>The problem: On my HDD, the resource image I'm using is 500x375 pixels. After calling:</p><p>Bitmap m_resourceBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.landscape_1);int nWidth = m_resourceBitmap.getWidth();int nHeight = m_resourceBitmap.getHeight();</p><p>the returned nWidth and nHeight depend on where I placed the resource, if i place it in the ""drawable-mdpi"" I get the original size, otherwise I get other sizes.</p><p>On the other hand if I ask the view for it's width and height viathis.getWidth();this.getHeight();</p><p>I get fixed values, but different from the resolution I expected from the device (I set a 480x800 device and I get 320x533)</p><p>and finally if I try to create a scale matrix using view dimensions divided by the image dimensions, the result, on screen, is an image much smaller than the screen...</p><p>My question is:What questions should I ask and from which objects so that inside a View I can draw a resource Bitmap so that it occupies the entire screen?</p>","507486","","21234","","2010-11-14 17:21:59","2010-11-14 17:33:39","how to scale an image to fill the screen","<android><image-scaling>","1","1","","",""
"4178682","1","4178756","","2010-11-14 17:29:42","9","23387","<p>I am developing an Android app and I am doing some heavy work (bringing data from an online web page and parsing it to store in database) in a service. Currently, it is taking about 20+ mins and for this time my UI is stuck. I was thinking of using a thread in service so my UI doesn't get stuck but it is giving error. I am using the following code:</p><pre><code>Thread thread = new Thread(){      @Override      public void run() {          try {              while(true) {                  sleep(1000);                  Toast.makeText(getBaseContext(), ""Running Thread..."", Toast.LENGTH_LONG).show();              }          } catch (InterruptedException e) {           Toast.makeText(getBaseContext(), e.toString(), Toast.LENGTH_LONG).show();          }      }  };thread.start();</code></pre><p>This simple code is giving run time error. Even If I take out the while loop, it is still not working. Please, can any one tell me what mistake I am doing. Apparently, I copied this code directly from an e-book. It is suppose to work but its not. </p>","499773","","244296","","2011-03-08 04:30:30","2013-03-11 14:24:35","How to start a new Thread in a service?","<android>","3","4","12","",""
"4178709","1","4179101","","2010-11-14 17:35:26","7","10805","<p>I just started doing some Android app development, and I decided I'm going to write an app to work with <a href=""http://en.wikipedia.org/wiki/Google_Calendar"" rel=""nofollow"">Google Calendar</a>.</p><p>The first problem that came to me is that I can't add any Gmail account on the emulator. When I go to <em>settings</em> -> <em>accounts</em>, I can only add an Exchange account.</p><p>This raises a question how should I develop such application. I know that I should mock the API while I'm running tests, but how am I supposed to run the app on the emulator?</p><p>Should I just test it on mocked API with <a href=""http://en.wikipedia.org/wiki/JUnit"" rel=""nofollow"">JUnit</a> and then run it on <em>production</em> phone?</p>","72583","","63550","","2012-07-08 13:06:00","2012-07-08 13:18:18","How to develop an application for Android which uses Google Calendar API","<android><android-emulator><google-api><google-calendar>","2","0","4","",""
"4178765","1","4179817","","2010-11-14 17:48:09","3","132","<p>I need to force an Android project created in Eclipse for the 2.0 platform to run on the 1.5 AVD (emulator).  This is due to the fact that I'm writing an app that will support both the Contacts API and the ContactsContract API.</p><p>Does anyone know the magic word to make this happen?</p>","507446","","507446","","2010-11-14 21:14:35","2010-12-09 22:30:09","Running an Android 2.x application in a 1.x emulator","<android><android-emulator>","3","0","","",""
"4178854","1","4178886","","2010-11-14 18:07:48","0","701","<p>I'm trying to implement something like scheduling in my application, so I need to get names of all the day in a week and show it to user. It is simple: i can just make an enum with all the days and use it, but the localization problem shows up. The list will have english lables always. Is there a way to localize the days of week simply?</p><p>Thanks.</p>","473070","","473070","","2010-11-14 18:13:58","2010-11-14 20:40:43","Localized week days on android","<android><localization>","2","0","","",""
"4178896","1","4647008","","2010-11-14 18:19:23","1","5754","<p>I'm having problems calling a class function from my Widget as the result of a service action.</p><pre><code>public class HelloWidget extends AppWidgetProvider {    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager,         int[] appWidgetIds) {        Intent intent = new Intent(context, NeoService.class);        context.startService(intent);        MyClass mClass = new MyClass(context, appWidgetManager);        mClass.doUpdate();        super.onUpdate(context, appWidgetManager, appWidgetIds);    }}</code></pre><p>The call to mClass.doUpdate() above works just fine. But then when I try to do it again in my onReceive it doesn't work and I get a forceclose as soon as the correct action is received:</p><pre><code>@Override    public void onReceive(Context context, Intent intent) {     if(Intent.ACTION_TIME_TICK.equals(action))    {        mTime.doUpdate();    //  Toast.makeText(context, ""TicK Tock!"", Toast.LENGTH_LONG).show();    }}</code></pre><p>If I comment out the mTime.doUpdate(); and uncomment the Toast it displays the toast just fine as it should.</p><p>Edit: The error message I get is as follows:</p><pre><code>11-18 18:25:00.201: ERROR/AndroidRuntime(2759): FATAL EXCEPTION: main11-18 18:25:00.201: ERROR/AndroidRuntime(2759): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.TIME_TICK flg=0x40000004 (has extras) } in de.thesmile.android.widget.HelloWidget@4841129811-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:905)11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at android.os.Handler.handleCallback(Handler.java:587)11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at android.os.Handler.dispatchMessage(Handler.java:92)11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at android.os.Looper.loop(Looper.java:123)11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at java.lang.reflect.Method.invokeNative(Native Method)11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at java.lang.reflect.Method.invoke(Method.java:521)11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at dalvik.system.NativeStart.main(Native Method)11-18 18:25:00.201: ERROR/AndroidRuntime(2759): Caused by: java.lang.NullPointerException11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at de.thesmile.android.widget.HelloWidget.onReceive(HelloWidget.java:45)11-18 18:25:00.201: ERROR/AndroidRuntime(2759):     at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:892)</code></pre>","353674","","418183","","2010-11-18 18:47:45","2011-01-10 12:52:14","Android Widget + Service","<android><service><action><broadcastreceiver>","1","2","2","",""
"4178914","1","4179565","","2010-11-14 18:23:04","0","153","<p>i have a android APP that needs a remote Database, to do INSERT's and SELECT's. </p><p>I will use a webservice to comunicate with the remote database, the webservice will be installed in the server side, with the remote database, and webservice will do the SELECTS and the INSERTS and will return me XML data. But i dont know anything about webservices, then a friend will do it.</p><p>But my friend need's to known if there is any limitations making webservices for Android. I search on google for days but all i am finding is very complex and i can't find the answer to these three questions:</p><ol><li><p>Webservice needs to be created with a special way?</p></li><li><p>Webservice remote functions can have parameters? (i need to give to the webservice parameters to do the select's or the inserts of data)</p></li><li><p>Webservice can return results in XML normally or needs a special way to do it?</p></li></ol><p>Also, if i have to know something more, please tell me</p><p>thanks</p>","479886","","","","","2010-11-14 20:37:08","How have to be a Webservice for use it with Android?? (limitations, paramters, return... etc)","<android><web-services>","1","0","","",""
"4178989","1","4179507","","2010-11-14 18:38:04","22","25923","<p>Can I change  the media volume? and how? I used this so far:</p><pre><code>setVolumeControlStream(AudioManager.STREAM_MUSIC);</code></pre><p>But have a seekbar and want to change the media volume, not ring volume.</p><p>So can someone show me how to just change the media volume at <code>onCreate()</code> and I fix the seekbar later.</p>","502419","","244296","","2012-08-14 21:16:52","2012-08-14 21:16:52","Change Media volume in Android?","<android><audio><android-audiomanager>","3","0","8","",""
"4179030","1","","","2010-11-14 18:48:29","0","368","<p>When my app loads I have it animate a screen in. In the onAnimationEnd I call schedule to have it call a function 2 seconds later that will call an animation to animate the view out again. Currently it animates in, but the scheduler never seems to call the animate out. If I click home, then go back to the app it immediately calls the animate out. Why would, if the schedule is working, the app wait until it loses focus then gets focus back to actually trigger the function the schedule is supposed to call. Here's the code:</p><p>These are defined in the onCreate:</p><pre><code>slideTopIn = AnimationUtils.loadAnimation(this, R.anim.slide_top_in);slideTopIn.setAnimationListener(slideTopInListener);slideTopOut = AnimationUtils.loadAnimation(this, R.anim.slide_top_out);slideTopOut.setAnimationListener(slideTopOutListener);freeAlertMsg.startAnimation(slideTopIn);</code></pre><p>These are defined outside the onCreate within the activity class:</p><pre><code>private AnimationListener slideTopInListener = new AnimationListener(){    public void onAnimationEnd(Animation anim){        alertTimer.schedule(new Runnable() {            public void run() { hideFreeAlert(); }        }, 2, TimeUnit.SECONDS);    };    public void onAnimationStart(Animation anim){        freeAlertMsg.setVisibility(View.VISIBLE);    };    public void onAnimationRepeat(Animation anim){    };};private AnimationListener slideTopOutListener = new AnimationListener(){    public void onAnimationEnd(Animation anim){        mainScreen.removeView(freeAlert);    };    public void onAnimationStart(Animation anim){        Log.d(""Animation Listener"",""slideTopOutListener"");    };    public void onAnimationRepeat(Animation anim){    };};private void hideFreeAlert(){    freeAlertMsg.startAnimation(slideTopOut);}</code></pre><p>So basically it executes the startAnimation(slideTopIn). Then nothing happens. If i click home, then go back to the app, the startAnimation(slideTopOut) immediately executes. I'm guessing the schedule actually runs but never triggers the animation for some reason.</p>","469219","","","","","2011-05-04 00:15:02","android: Problem using schedule to call an animation","<android><animation><schedule>","1","3","","",""
"4179064","1","4478797","","2010-11-14 18:55:29","1","2360","<p>I can create new contact with Intent by passing info as extra data with putExtra, is it possible to create Intent with info and if contact is already in phonebook it will be update with new info?</p><p>tnx.</p>","505160","","","","","2010-12-18 16:02:47","Android contact info update with intent?","<java><android><mobile-phones><manager><contact>","2","0","1","",""
"4179102","1","4179205","","2010-11-14 19:03:09","0","302","<p>I've followed the <a href=""http://code.google.com/p/maven-android-plugin/wiki/Source?tm=4"" rel=""nofollow"">instructions for configuring Maven</a> for building android projects, this is what my POM looks like</p><pre><code>&lt;project xmlns=""http://maven.apache.org/POM/4.0.0"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""         xsi:schemaLocation=""http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd""&gt;    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;    &lt;groupId&gt;com.example&lt;/groupId&gt;    &lt;artifactId&gt;MavenMess&lt;/artifactId&gt;    &lt;version&gt;1&lt;/version&gt;    &lt;packaging&gt;apk&lt;/packaging&gt;    &lt;name&gt;Maven Android Plugin - samples&lt;/name&gt;    &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;2.2.1&lt;/version&gt;            &lt;scope&gt;provided&lt;/scope&gt;        &lt;/dependency&gt;    &lt;/dependencies&gt;    &lt;build&gt;        &lt;finalName&gt;${project.artifactId}&lt;/finalName&gt;        &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;        &lt;plugins&gt;            &lt;plugin&gt;                &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt;                &lt;artifactId&gt;maven-android-plugin&lt;/artifactId&gt;                &lt;version&gt;2.6.0&lt;/version&gt;                &lt;configuration&gt;                    &lt;sdk&gt;                        &lt;!--  platform or api level (api level 4 = platform 1.6)--&gt;                        &lt;platform&gt;8&lt;/platform&gt;                    &lt;/sdk&gt;                    &lt;emulator&gt;                        &lt;!--  the name of the avd device to use for starting the emulator--&gt;                        &lt;avd&gt;GoogleAPIs&lt;/avd&gt;                    &lt;/emulator&gt;                    &lt;deleteConflictingFiles&gt;true&lt;/deleteConflictingFiles&gt;                    &lt;undeployBeforeDeploy&gt;true&lt;/undeployBeforeDeploy&gt;                &lt;/configuration&gt;                &lt;extensions&gt;true&lt;/extensions&gt;            &lt;/plugin&gt;            &lt;plugin&gt;                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;                &lt;!--  version 2.3 defaults to java 1.5, so no further configuration needed--&gt;                &lt;version&gt;2.3&lt;/version&gt;            &lt;/plugin&gt;        &lt;/plugins&gt;    &lt;/build&gt;&lt;/project&gt;</code></pre><p>I can run <code>mvn install</code> ok, but when I run <code>mvn deploy</code> I get the following error</p><pre><code>[INFO] ------------------------------------------------------------------------[ERROR] BUILD ERROR[INFO] ------------------------------------------------------------------------[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-deploy-plugin:2.4check that the following section of the pom.xml is present and correct:&lt;distributionManagement&gt;  &lt;!-- use the following if you're not using a snapshot version. --&gt;  &lt;repository&gt;    &lt;id&gt;repo&lt;/id&gt;    &lt;name&gt;Repository Name&lt;/name&gt;    &lt;url&gt;scp://host/path/to/repo&lt;/url&gt;  &lt;/repository&gt;  &lt;!-- use the following if you ARE using a snapshot version. --&gt;  &lt;snapshotRepository&gt;    &lt;id&gt;repo&lt;/id&gt;    &lt;name&gt;Repository Name&lt;/name&gt;    &lt;url&gt;scp://host/path/to/repo&lt;/url&gt;  &lt;/snapshotRepository&gt;&lt;/distributionManagement&gt;Cause: Class 'org.apache.maven.artifact.repository.ArtifactRepository' cannot be instantiated[INFO] ------------------------------------------------------------------------[INFO] For more information, run Maven with the -e switch[INFO] ------------------------------------------------------------------------[INFO] Total time: 5 seconds[INFO] Finished at: Sun Nov 14 18:56:41 GMT 2010[INFO] Final Memory: 58M/543M[INFO] ------------------------------------------------------------------------</code></pre><p>What if I don't use a repository, how can I get around this?</p>","155695","","","","","2010-11-14 21:47:39","Maven deploy plugin is asking for SCM details, what if I don't use one?","<android><maven-2>","2","0","","",""
"4179178","1","4746471","","2010-11-14 19:22:02","7","13186","<p>Any body gotten on device debugging working wit hthe Galaxy Tab? I have a Stock Generic Galaxy Tab and Although Eclpise will let me ""Run"" my apps on the device, if I click ""Debug"" in eclpise instead it doesn't do anything nor does it try to connect to the debugger.</p><p>Ideas?</p><p><strong>UPDATE: Solution was to explicitly set my application to debuggable in the manifest. If the device (Galaxy Tab) is not set to default in it's boot image, it will not implicitly allow debugging.</strong></p>","353674","","353674","","2011-01-25 11:28:42","2013-09-13 06:34:20","Galaxy Tab on device debug?","<android><eclipse><debugging>","5","0","2","",""
"4179299","1","","","2010-11-14 19:42:36","3","1575","<p>I'm designing an Application to control multi zone audio amplifiers. To do so I have to create a socket connection, So far that works fine. What I would like to do is instead of the user having to manually type in the ip address I would like my app to automatically scan the network, check all MAC address Match it to the NIC database, if it matches the corp of my amp, then save the ip address. Is that possible if yes how? Or is there an easier way to do it?</p>","507567","","1431","","2010-11-14 19:44:26","2010-11-14 23:32:46","Scan Network For A Specific MAC Address - Android","<android><networking><android-wifi>","1","0","7","",""
"4179305","1","4179412","","2010-11-14 19:43:46","0","596","<p>I am developing an android application where I have a main-activity that contains a progress bar and a tabhost. the tabhost has 3 tabs.</p><p>How do I from a tab-activity access the progress bar in the main activity? I want to be able to start and stop the progress bar when things changes inside each tab ativity...</p>","297410","","","","","2011-03-19 01:02:06","How do I access a progress bar in a main-activity containing a tabhost from one of the tabs?","<android><android-tabhost>","2","0","2","",""
"4179456","1","4179966","","2010-11-14 20:14:13","2","3651","<p>I'm trying to rotate a drawable inside a view by touching it and moving the finger. I've come up with several solutions, but none of them feels natural on the device.</p><p>Here's my first approach: Depending on where the user touched the screen and in which direction the finger was moved, I'm changing the drawable's rotation, calculated more or less arbitrarily.</p><pre><code>private void updateRotation(float x, float y, float oldX, float oldY) {    int width = getWidth();    int height = getHeight();    float centerX = width / 2;    float centerY = height / 2;    float xSpeed = rotationSpeed(x, oldX, width);    float ySpeed = rotationSpeed(y, oldY, height);     if ((y &lt; centerY &amp;&amp; x &gt; oldX)        || (y &gt; centerY &amp;&amp; x &lt; oldX))        rotation += xSpeed;    else if ((y &lt; centerY &amp;&amp; x &lt; oldX)             || (y &gt; centerY &amp;&amp; x &gt; oldX))        rotation -= xSpeed;    if ((x &gt; centerX &amp;&amp; y &gt; oldY)        || (x &lt; centerX &amp;&amp; y &lt; oldY))        rotation += ySpeed;    else if ((x &gt; centerX &amp;&amp; y &lt; oldY)             || (x &lt; centerX &amp;&amp; y &gt; oldY))        rotation -= ySpeed;}private static float rotationSpeed(float pos, float oldPos, float max) {    return (Math.abs(pos - oldPos) * 180) / max;}</code></pre><p>This approach had a few annoying side effects: Sometimes the drawable would rotate while the finger wasn't moving and the rotation was generally not as fast as the user's finger.</p><p>Hence I threw this code away and started with my second approach. I'm using trigonometry to calculate the actual rotation that would be equivalent to the finger movement:</p><pre><code>private void updateRotation(float x, float y, float oldX, float oldY) {    float centerX = getWidth() / 2;    float centerY = getHeight() / 2;    float a = distance(centerX, centerY, x, y);    float b = distance(centerX, centerY, oldX, oldY);    float c = distance(x, y, oldX, oldY);    double r = Math.acos((Math.pow(a, 2) + Math.pow(b, 2) - Math.pow(c, 2))                         / (2 * a * b));    if ((oldY &lt; centerY &amp;&amp; x &lt; oldX)        || (oldY &gt; centerY &amp;&amp; x &gt; oldX)        || (oldX &gt; centerX &amp;&amp; y &lt; oldY)        || (oldX &lt; centerX &amp;&amp; y &gt; oldY))        r *= -1;     rotation += (int) Math.toDegrees(r);}private float distance(float x1, float y1, float x2, float y2) {    return Math.abs(x1 - x2) + Math.abs(y1 - y2);}</code></pre><p>Although this does sound like the correct solution to me, it's not working well either. Finger movement is sometimes ignored - could the calculation be too expensive? Furthermore, the rotation is still a bit faster than the actual finger movement.</p><p>Ideally, if I start rotating the drawable touching a specific point, this very point should stay below the finger at all times. Can you tell me how to achieve this?</p><p><strong>Edit:</strong></p><p>Here's my adoption of Snailer's suggestion. I had to switch the arguments for the <code>atan2</code> method to rotate into the right direction, now it works great:</p><pre><code>private void updateRotation(float x, float y) {    double r = Math.atan2(x - getWidth() / 2, getHeight() / 2 - y);    rotation = (int) Math.toDegrees(r);}</code></pre>","368405","","368405","","2010-11-15 20:10:15","2013-09-03 16:05:40","Android: How to rotate an element by touching it?","<android><graphics><touch>","1","0","0","",""
"4179482","1","","","2010-11-14 20:18:13","0","674","<p>I'm working on an android app and I'm stuck. Here's the scenario that I have:</p><ol><li>The user picks a contact to call</li><li>The user presses the dialer button to call that contact</li><li>Android's native dial screen pops up i.e. Dialing Contact screen</li></ol><p>Here's what I want to do:After pressing the dialer button, is there any way for my app to control what pops up after pressing the dialer button?</p><p>Resources and tutorials are much appreciated.</p>","507585","","","","","2010-11-15 01:29:53","Can you control the native interface after pressing the dialer button on Android?","<android>","1","0","","",""
"4179594","1","8972733","","2010-11-14 20:42:57","4","5762","<p>I am having trouble granting ""reverse permissions"" for apps that Iwish to provide with sensitive data in a controlled manner.</p><p>My application is a time tracker and, because the time-tracking logcould be considered personal information, I have created a permissionfor accessing it and assigned it the android.permission-group.PERSONAL_INFO permission group.</p><p>To export the time log from the phone I am adding the ability to sendthe log as an email attachment. The attachment is generated by acontent provider that is protected by my newly added permission. Mycode for sending the email looks like this:</p><pre><code>   String email = ""someone@example.com"";   Uri uri = TimeLog.CSVAttachment.CONTENT_URI;   Intent i = new Intent(Intent.ACTION_SEND, uri);   i.setType(""text/csv"");   i.putExtra(Intent.EXTRA_EMAIL, new String[]{email});   i.putExtra(Intent.EXTRA_SUBJECT, ""Time log"");   i.putExtra(Intent.EXTRA_TEXT, ""Hello World!"");   i.putExtra(Intent.EXTRA_STREAM, uri);   i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);   startActivity(i);</code></pre><p>When running it on my HTC phone, I get a pop-up choice between Gmailand HTC mail. Choosing Gmail, I get this exception in the Gmail app:</p><pre><code>ERROR/AndroidRuntime(8169): Caused by: java.lang.SecurityException:Permission Denial: reading com.mycompany.timelog.TimeLog uricontent://com.mycompany.timelog/csv_attachment from pid=8169,uid=10035 requires com.mycompany.timelog.permission.READ_TIME_LOG</code></pre><p>I do have <code>android:grantUriPermissions=""true""</code> set on my provider butthat's not helping. I have a theory about why this happens. I hadexpected FLAG_GRANT_READ_URI_PERMISSION to give Gmail the right toaccess my content provider, but I think what really happens is thatthis permission is granted tocom.android.internal.app.ResolverActivity because there is more thanone match for the Intent and Android creates a wrapper activity fordisplaying the choice to the user.</p><p>So, I've tried hard-coding this into my app just for testing:</p><pre><code>   grantUriPermission(""com.google.android.gm"", uri,       Intent.FLAG_GRANT_READ_URI_PERMISSION);</code></pre><p>This allows Gmail to display the email correctly and I can press""Send"". Unfortunately, after GMail has closed I get this exception incom.google.process.gapps:</p><p>ERROR/AndroidRuntime(7617): java.lang.SecurityException: PermissionDenial: reading com.mycompany.timelog.TimeLog uricontent://com.mycompany.timelog/csv_attachment from pid=7617,uid=10011 requires <code>com.mycompany.timelog.permission.READ_TIME_LOG</code></p><p>Note that this is coming from a different PID and UID. This is becausethe actual call to openAssetFile happens from some sync providercomponent that belongs to a different package(com.google.android.googleapps?).</p><p>While I had some hope of eventually finding a way to grant permissionsto the final receiver of my <code>ACTION_SEND</code> intent, the fact that the callto openAssetFile happens from some entirely different and practicallyunrelated package leaves me baffled as to how permission granting issupposed to work.</p><p>So ultimately my question is, given that the log is sensitive data,how would I allow it to be emailed as an attachment while honoring theprivacy of the user (e.g. without making the attachment worldreadable)?</p>","66620","","1434631","","2013-01-23 09:49:32","2013-01-23 09:49:32","What is the correct permission handling when sending sensitive app data as email attachment?","<android>","3","6","4","",""
"4179613","1","4181042","","2010-11-14 20:47:37","2","2353","<p>I have created multiple bitmaps - one for each folder (mdpi, hdpi, ldpi). Can someone show me some code or point me to the appropriate method that will allow me to detect which resource Android decided to load.</p><p>Thanks,</p>","503760","","1140748","","2012-05-06 16:39:56","2012-05-06 16:39:56","How to determine what bitmap resource was loaded (ldpi, mdpi, or hdpi)?","<android><screen><resolution><dpi>","4","0","2","",""
"4179615","1","","","2010-11-14 20:47:52","1","351","<p>Say I want to create a custom control that would look something like this:</p><p><img src=""http://karmalita.com/stuff/alpha1.png""></p><p>The width of the popup balloon can change, and the relative position of the ""pointer triangle"" can change as well.  Of course, additional graphics/text will be drawn on top.</p><p>I want it based on images, rather than trying to do the whole thing vector.  And of course, the images have varying translucency, which is where the complications arise.</p><p>I know there are various ways of doing it (currently I use four images, one of which gets copied a bunch of times....it works but is messy), but I'm interested in finding the easiest, cleanest way.  What would be nice would be if I could use a nine-patch for the main rectangle (below left), then draw the pointer triangle (below right) on top of it.</p><p><img src=""http://karmalita.com/stuff/alpha2.png""></p><p>But of course that won't work, since the bottom edge of the rectangle will bleed through the pointer triangle, and the shadows will accumulate, etc.  </p><p>Is there some Porter-Duff magic I can do?  </p><p>Or should I simply mask the area of the pointer using an inverse clip rect,  then draw the nine-patch (stretched appropriately), so it looks like this....</p><p><img src=""http://karmalita.com/stuff/alpha3.png""></p><p>....then remove the clip rect, then draw the pointer triangle in the area where the clip rect was?  </p><p>Or what?  Is there an easier/better/more efficient way?</p><p>Although I'd love a solution for this specific problem, I'm mostly interested in a general solution for these sorts of scenarios.</p>","226507","","","","","2010-11-14 21:07:59","Alpha compositing issues","<android><graphics>","1","0","","",""
"4179682","1","","","2010-11-14 21:07:23","1","431","<p>I am trying to update my sqlite database in Android. I have this function, adjustPosition, which should adjust the position column of my rows based on the position I pass in. </p><p>For example, if position=4 and I have two rows with positions 4,5 respectively, then they should be 3,4 by the time the function returns.</p><pre><code>public void adjustPosition(int position){    while(true){        Cursor query = mDb.rawQuery(""select _ID, position from icon where position = "" + position, null);        if(query != null){            if(query.getCount()==0){                query.close();                return;            }            query.moveToFirst();            long id = query.getLong(0);            int newPosition = position-1;             String sqlQuery = ""update icon set position="" + newPosition + "" where _ID="" + id;            boolean result = mDb.rawQuery(sqlQuery, null) != null;            String sqlQuery2 = ""select position from icon where _ID=""+id;            query = mDb.rawQuery(sqlQuery2, null);            query.moveToFirst();            int posn = query.getInt(0);  // should equal newPosition, which is 3            position++; // have a breakpoint here            query.close();        } else {                            return;        }    }}</code></pre><p>I have a breakpoint at the line 'positon ++;' . The value of posn should be  3, but for some reason it is 4. I have tried the SQL query using the SQLite Manager plugin in Firefox and it works fine so I don't think my SQL syntax is the problem. Do I have to commit db changes or something?</p>","507605","","1288","","2011-06-06 17:04:05","2011-06-06 17:04:05","Can't get sqlite to update properly on Android","<android><sql>","0","3","","",""
"4179766","1","4179801","","2010-11-14 21:26:22","1","2109","<p>What are the key differences between Android, iOS and Blackberry OS in terms of level of accessibility by application developers (i.e. access to the video input, sound input, phone functionalities, to which extent, etc.)?</p><p>PS: Assume latest version of each OS.</p><p><strong>EDIT:</strong> Can someone turn this into a wiki so we can compile answers from people that don""t necessarily have experience in all 3 plaforms.</p>","96855","","96855","","2010-11-14 21:59:20","2013-02-03 22:14:59","What are the key differences between Android, iOS and Blackberry OS?","<android><blackberry><ios><comparison>","3","2","2","",""
"4179797","1","","","2010-11-14 21:32:33","4","989","<p><br /> I just read this:<a href=""http://stackoverflow.com/questions/3913750/android-how-to-stop-an-infinite-animation-applied-on-an-imageview"">Android: How to stop an infinite animation applied on an ImageView?</a>, I tried it and it works perfectly, I set the animation in the <code>onCreate()</code> method of my Activity using <code>AnimationUtils.loadAnimation(AppContext, animationRes)</code>, then I start the animation using <code>startAnimation()</code> and stop it using <code>clearAnimation()</code>. The problem I've got is that if I start another activity and then go back to the one with the animation, it doesn't work anymore. It looks like the animation is not even started, the listener attached to the animation doesn't enter the <code>onAnimationStart()</code>. Am I missing something here?</p><p>Thanks!</p>","389262","","","","","2011-04-27 08:24:24","Android: How to start an infinite animation applied on an ImageView after the Activity with the animated View has been resumed?","<android><animation><imageview>","1","2","","",""
"4180083","1","4180458","","2010-11-14 22:31:47","4","5645","<p>I adapted this tutorial (http://www.screaming-penguin.com/node/7749) to an Android app I've built to allow for a button press to export the current database to the user's sdcard. It works flawlessly.</p><p>But I'm afraid that users of my app would be unfamiliar with the db file, and I'm looking for a way to convert that to a more user-friendly format. I came across this thread (http://groups.google.com/group/android-beginners/browse_thread/thread/4e53ebca14daecfc), which recommends ""querying data from the database and writing the data into a csv file.""</p><p>I was hoping someone could point me in the right direction to begin figuring out how to do this. I'm finding it hard to track down more information about the specific method.</p><p>Or does it make more sense to just explain in a short ""about"" how to read and access .db files?</p><p>Thanks</p><p>EDIT: I also have a question about the sqlite export process, which I think I'll just ask here rather than create a new question. Is there a way to modify the code below so that each export would receive either a string representation of the date or just a single numeral appended to it? Right now if you export a second time, it automatically overwrites the old file. Thanks.</p><pre><code>protected Boolean doInBackground(final String... args) {        File dbFile = new File(Environment.getDataDirectory() +                 ""/data/com.example.example/databases/data"");        File exportDir = new File(Environment.getExternalStorageDirectory(), ""exampledata"");        if (exportDir.exists()) {            exportDir.mkdirs();        }        File file = new File(exportDir, dbFile.getName());        try {            file.createNewFile();            this.copyFile(dbFile, file);            return true;        } catch(IOException e) {            Log.e(MyApplication.APP_NAME, e.getMessage(), e);            return false;        }    }</code></pre>","503185","","503185","","2010-11-14 22:43:12","2010-11-14 23:54:16","Using a button to export sqlite db to an excel-readable file (perhaps csv)?","<java><android><excel><sqlite>","1","1","6","",""
"4180448","1","5114100","","2010-11-14 23:51:18","0","791","<p>I've got a swipe listener, based on SimpleOnGestureListener that works very well, as long as I attach it to a button like so:</p><pre><code>final GestureDetector detector = new GestureDetector(MyGestureListener());View.OnTouchListener listener = new View.OnTouchListener() {    public boolean onTouch(View v, MotionEvent e) {        if(detector.onTouchEvent(e)) {            return true;        }        else {            return false;        }     }};findViewById(R.id.widget).setOnTouchListener(listener);</code></pre><p>However, if I change ""widget"" to something other than a Button, like a LinearLayout or a TextView, it no longer works.  Is there something I have to do to make it work with other widgets?</p>","238849","","","","","2011-02-25 05:53:08","Gesture (swipe) listener won't work for any widget but a Button","<android>","1","2","0","",""
"4180512","1","","","2010-11-15 00:09:15","2","3317","<p>I'm struggling with my app that launches multiple instances of thesame Activity using the same intent. My main activity is of class typeA and it does a startActivity() of two children that are of the sameclass type B. So we have B1 and B2 launched. If B1 and B2 are bothpaused (by pushing back button and making sure finish() is not invokedon them so they are truly paused), how can A uniquely bring either B1or B2 to the foreground again? I do want to launch a new B activity. Iwant to uniquely bring B1 or B2 to the foreground.</p><p>so both B1 and B2 were created like this...Intent intent = new Intent(context, B.class);intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(intent);</p><p>Now I want A to bring B1 (or B2) to the foreground/front so I use thebelow code, but how do I distinguish B1 or B2 when starting theactivity? This only brings the last instance of B that was on top tothe foreground.</p><p>Intent intent = new Intent(context, B.class);intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);startActivity(intent);</p><p>I've tried keeping around references to B1 and B2 and doing somethinglike this, but this also only goes to the last instance of activityclass B that was on top...</p><p>Intent intent = new Intent(B1context, B.class);intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);B1context.startActivity(intent);</p><p>I even tried this, but it still doesnt get me my unique B1 or B2...Intent intent = B1.getIntent(); // i.e. the original intent thatstarted mestartActivity(intent); // still only brings to front the last B thatwas on top.</p><p>Thanks in advance!</p>","507716","","","","","2013-02-20 17:05:26","Android: Multiple activity instances launched by same intent. Bring one uniquely to foreground?","<android><activity><android-intent>","3","2","","",""
"4180642","1","","","2010-11-15 00:55:55","0","863","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3675335/how-to-login-twitter-using-oauth-from-my-android-application"">How to Login twitter using Oauth from my android application?</a>  </p></blockquote><p>I would like to know how can I tweet using oAuth in Android. </p><p>What should be the callback url??? Please help!!!</p>","506161","","","","","2010-12-18 00:24:50","Android- How to tweet using oAuth?","<android><twitter><oauth><twitter-oauth>","1","1","","2012-07-07 02:59:28",""
"4180670","1","4418350","","2010-11-15 01:05:14","2","4915","<p>Hey,I'm using MediaPlayer to play a regular ShoutCast stream. The code is straightforward with prepareAsync() and a handler to start the playback. While it works flawlessly with some streams like DI.FM or ETN.FM (http://u10.di.fm:80/di_progressive), with others (http://mp3.wpsu.org:8000/) it won't go past the prepare state. No other listeners are called either. </p><pre><code>//Uri streamUri = Uri.parse(""http://u10.di.fm:80/di_progressive""); /* works */Uri streamUri = Uri.parse(""http://mp3.wpsu.org:8000/""); /* stuck on prepare state */MediaPlayer mediaPlayer = new MediaPlayer();mediaPlayer.setOnPreparedListener(new OnPreparedListener() {    public void onPrepared(MediaPlayer mp) {        mp.start();    }});mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);mediaPlayer.setDataSource(this.getBaseContext(), streamUri);mediaPlayer.prepareAsync();</code></pre><p>Any feedback is appreciated!</p>","507739","","","","","2011-08-09 09:36:29","Android MediaPlayer is preparing too long","<android><music-player>","2","3","","",""
"4180675","1","4180722","","2010-11-15 01:06:19","2","10508","<p>I am trying to do a demo on a android device, but the screen is too small so is kinda hard to do a demo let say in a meeting room with 12 people. Although I can pass the device around the table or just simple borrow or get more devices for the demo purposes.</p><p>I understand there are devies where you can buy special USB converter to do TV-out like in iPhone, and some specific devices on Android (e.g. Motorola Incredible?) But I have to demo on a specific device where it runs standard Android build.</p><p>I understand I can do it on Android emulator but the screen refresh rate is too slow, as it will send the wrong message to the audience that the app is slow. (Or there is a way to increase the screen refresh rate for emulator?) Furthermore the emulator doesn't support multitouch. (Or am I wrong?)</p><p>Not sure if anyone </p>","339229","","","","","2013-12-05 11:40:22","How do I output to monitor from android device","<android><video>","4","0","1","",""
"4180770","1","4186824","","2010-11-15 01:31:39","3","3801","<p>I want to allow users only to type certain characters based on the a regex in my android applications. How do I achieve it?</p>","421372","","","","","2013-01-25 16:53:14","Allow only selected charcters based on regex in an EditText","<android><regex><user-input><input-validation><edittext>","2","4","2","",""
"4180867","1","","","2010-11-15 01:56:11","3","11529","<p>Is there any way to make smaller DatePicker and TimePicker (but to be visible all parts ) in Android ? I tried to set layout_width=""130dp"" but then DatePicker isn't visible, just left upper corner.</p>","486578","","","","","2013-12-13 08:02:25","Make DatePicker and TimePicker smaller","<android>","2","2","","",""
"4180960","1","4308702","","2010-11-15 02:23:09","10","5386","<p>I am so confused...</p><p>SoundPool.play(int soundID, <strong>float leftVolume, float rightVolume</strong>, int priority, int loop, float rate)</p><p>volume here is from 0.0 to 1.0</p><p>Tutorials I've seen recommend to calculate stream volume as:</p><pre><code>AudioManager mgr = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);int streamVolume = mgr.getStreamVolume(AudioManager.STREAM_MUSIC);streamVolume = streamVolume / AudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, 0, 1f);</code></pre><p>which makes sense. </p><p>I would assume that this volume would override global media volume set by user in phone and I can change volume for my app independently by changing stream volume in soundPool.</p><p>But in reality it works like multiplier - if I set 0.5 for volume in soundpool, the actual volume will be always half of the global one. Very easy to reproduce:</p><ol><li>set global media volume inphone settings to max</li><li>set volume in activity using soundpool.play to 0.5 - play sound</li><li>set volume in soundpool.play to 1 - play sound, it will be two times louder</li></ol><p>Can somebody explain why it works like that? is volume passed to SoundPool.play method really a multiplier to the global volume?</p>","473725","","491044","","2012-01-30 09:48:32","2012-09-18 07:49:02","stream volume in SoundPool vs volume in AudioManager","<android><soundpool><android-audiomanager>","1","0","2","",""
"4180967","1","4332484","","2010-11-15 02:24:46","0","799","<p>im using ftp4j to connect and download a file via ftp</p><p>The following works to save to the emulated  sdcard.</p><pre><code>try {            client.login(username, password);            client.download(""test.jpg"", new java.io.File(""/sdcard/test.jpg""));            Toast.makeText(ftpactivity.this, ""download complete"",                    Toast.LENGTH_SHORT).show();        } catch (Exception ex) {            Toast.makeText(ftpactivity.this, ex.toString(),                    Toast.LENGTH_SHORT).show();        }</code></pre><p>How can I save to the internal memory instead so that the test.jpg can be loaded into an imageview? </p><p>Sorry for my noobness and thanks in advance.</p>","377613","","","","","2011-09-28 19:29:07","Android save to internal memory using ftp api","<java><android><programming-languages>","2","0","","",""
"4181025","1","4181764","","2010-11-15 02:43:27","1","1072","<p>I am using a custom layout on an AlertDialog.  The custom layout has an EditText filed which I am using to get a phone.  When I display the AlertDialog, in order to get the keyboard to type in the phone number you have to click on the EditText filed.  Is there a way to get the keyboard to automatically pop up when I bring up the AlertDialog so that the user does not have to click on the EditText filed to get the Keyboard.</p><p>Thanks,Prasanna</p>","494103","","65977","","2010-11-15 04:40:41","2010-11-15 05:50:47","Getting Keyboard To Appear Without Having To Click on EditText","<android>","2","0","1","",""
"4181117","1","","","2010-11-15 03:09:09","0","325","<p>I've built the buttons into a layout file and I have a switch statement to address all of them. Most of them work fine I'm using </p><pre><code>code.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); //code is the EditText name</code></pre><p>This works fine for all the characters there is a key for. But I need to add >, &lt; and ? keys which don't work consistently. I've tried making it send KeyEvents for alt then doing x and z for > &lt; but that doesn't work in the virtual device because that has a different keyboard layout than my Droid. I couldn't get the ? to work on either I tried shift then / for the virtual device but it doesn't work and on my droid it has it's own key.</p><p>How can I send the characters that don't have their own keys?</p>","428740","","","","","2010-11-15 23:03:25","Custom keyboard built into app UI","<android><keyboard><keyboard-events>","1","0","1","",""
"4181276","1","4181299","","2010-11-15 03:54:02","0","404","<p>Basically, is there a command in droid that will allow me to check the time on the user's phone and have it returned?  Where I can then assign the time to an int?</p><p>Thanks!</p>","496686","","21234","","2010-11-15 21:13:25","2010-11-15 21:13:25","Is there a command to get the time of day/night in an app?","<android><time><integer>","1","1","","",""
"4181309","1","7383161","","2010-11-15 04:06:13","3","8890","<p>Is it possible to add something to the list of items that shows up when a user long presses on any Edit Text? (Cut, copy paste, select text, select all, input method) I want to add an option to this that will scan a QR code and paste the result into the Edit Text. I think this would not be very hard to get this behavior out of Edit Texts that I put into my own application, but I am wanting to add this option to any Edit Text inside any application on my phone. Is something like this possible, if so can anyone point me in the right direction?</p><p>Edit 150 bounty: I am looking to add an item to the EditText pop-up dialog when it is long pressed. I want am looking for a way to make this change system wide, not just within the context of 1 application.</p>","507810","","507810","","2011-09-10 14:57:00","2011-09-12 04:08:42","Android Long Press on Edit Text behavior","<android><input><edittext>","3","2","3","",""
"4181402","1","4194337","","2010-11-15 04:28:22","3","1185","<p>I have a widget and I want it to make a phonecall to a particular number when the user clicks on the widget. How do i do this? Please help.</p>","481239","","","","","2010-11-16 12:56:04","Android: Making a phone call from home screen widget","<android><widget><phonecalls>","2","0","3","",""
"4181566","1","4237015","","2010-11-15 05:09:07","4","9322","<p>What I'm trying to do is this: I want my application to download an image from the Internet and save it to the phone's internal memory in a location that is private to the application. If there is no image available for the list item (i.e. it can't be found on the Internet), I want a default placeholder image to display. This is the image that I have defined in my list_item_row.xml file as the default. </p><p>In my ListActivity file, I am calling an instance of a CustomCursorAdapter class I have written. It is in CustomCursorAdapter where I am iterating through all the list items and defining what content needs to be mapped to the views, including the image file by trying to read it from internal memory.</p><p>I've seen several questions on this subject, but the examples either are specific to external phone memory (e.g. SDCard), involve saving strings instead of images, or involve using Bitmap.CompressFormat to reduce the resolution of the file (which is unnecessary in my case, as these images will be small thumbnails of already-small resolution). Trying to piece together code from each example has been difficult, hence my asking about my specific example.</p><p>At the moment, I believe I've written valid code, but no image is displaying for my list items, including the default placeholder image. I don't know  if the problem is being caused by invalid download/save code, or invalid read code - it doesn't help that I don't know how to check internal memory to see if the image exists.</p><p>Anyways, here's my code. Any help would be greatly appreciated.</p><p><strong>ProductUtils.java</strong></p><pre><code>public static String productLookup(String productID, Context c) throws IOException {    URL url = new URL(""http://www.samplewebsite.com/"" + productID + "".jpg"");    URLConnection connection = url.openConnection();    InputStream input = connection.getInputStream();    FileOutputStream output =         c.openFileOutput(productID + ""-thumbnail.jpg"", Context.MODE_PRIVATE);    byte[] data = new byte[1024];    output.write(data);    output.flush();    output.close();    input.close();}</code></pre><p><strong>CustomCursorAdapter.java</strong></p><pre><code>public class CustomCursorAdapter extends CursorAdapter {    public CustomCursorAdapter(Context context, Cursor c) {        super(context, c);    }    @Override    public void bindView(View view, Context context, Cursor cursor) {        ImageView thumbnail = (ImageView) view.findViewById(R.id.thumbnail);        String fileName =                 cursor.getString(cursor.getColumnIndex(DbAdapter.KEY_IMAGE_FILE_PATH));        Bitmap bMap = BitmapFactory.decodeFile(fileName);        thumbnail.setImageBitmap(bMap);    }    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent) {        LayoutInflater inflater = LayoutInflater.from(context);        View v = inflater.inflate(R.layout.list_item_row, parent, false);        bindView(v, context, cursor);        return v;    }}</code></pre>","453354","","","","","2010-11-21 08:22:26","Android - downloading image from web, saving to internal memory in location private to app, displaying for list item","<java><android><save><inputstream><fileoutputstream>","2","0","3","",""
"4181596","1","4181653","","2010-11-15 05:16:36","0","4368","<p>So i have a code developed where when some button from the app is pressed it should get displayed in the Textview with some Animation(to add some fun). Is it possible to have text animations in Textview or should i use Canvas or SurfaceView for drawing this aplhabets with animation?  </p><p>Any help in this regard with some code sample will be great.  </p>","498338","","","","","2010-11-15 05:29:48","How to do Text Animations using Android SDK?","<android>","1","2","1","",""
"4181615","1","4183542","","2010-11-15 05:21:11","6","5980","<p>I've seen two apps that can customize lockscreens: Widget locker, slidescreen. Do we really have an API that lets us customize the lockscreen? </p><p>If not, what is the trick?</p>","389161","","379693","","2010-11-15 09:55:18","2010-11-15 10:42:41","Android Lockscreen API?","<api><android-widget><android>","1","0","5","",""
"4181627","1","4181670","","2010-11-15 05:24:22","0","483","<p>I have the following XML:        </p><pre><code>&lt;TextView android:layout_y=""20dip""    android:layout_x=""20dip"" androd:gravity=""fill"" android:textColor=""#FFFFFF"" android:background=""#4F2F4F"" android:layout_height=""335dip""  android:layout_width=""270dip"" /&gt; &lt;/AbsoluteLayout&gt; </code></pre><p>This gives me the error <code>Error parsing XML: unbound prefix</code>. Why?</p>","505453","","1419007","","2012-10-06 10:56:57","2012-10-06 10:56:57","Why do I get the following error: Error parsing XML: unbound prefix","<android>","1","0","","",""
"4181656","1","4186359","","2010-11-15 05:29:56","3","1862","<p>I am new to video streaming and am working on a project to broadcast video to android phone over internet, and users to view the video at the same time may reach 100. </p><p>After looking around for a while I think using rtsp streaming for the phone client may be convenient(Am I right?) and so I have to choose a server, My current choice will be using </p><ol><li>VLC</li><li>Darwin Streaming Server</li></ol><p>Are they suitable? Or any other better choice?</p><p>How about the performance of these two servers while 100 users accessing at the same time.</p><p>Thanks in advance</p><p>Regards</p><p>Bolton</p>","505530","","505530","","2010-11-15 13:16:58","2010-11-15 16:15:56","Server for broadcasting RTSP video to Android","<android><video-streaming><rtsp>","1","0","2","",""
"4181699","1","","","2010-11-15 05:37:30","0","1518","<p>we can launch android market application from:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.setData(""market://details?id=packgename"");startActivity(intent);</code></pre><p>My question is how to launch the third-party android applications I installed through Intent directly? Do you guys have any ideas?</p>","507874","","180100","","2010-11-15 06:03:48","2010-11-17 07:05:29","How to launch the third-party android applications I installed through Intent directly?","<android>","1","1","1","",""
"4181712","1","","","2010-11-15 05:40:34","1","1405","<p>i know very well that android not support the mysqlbut i need to connect mysql and get the information from database</p><p>i studied there are SOAP and REST services to connect mysql from android is it possible?then give me one idea and if possible one example pls</p>","430394","","759866","","2014-02-20 17:21:43","2014-02-20 17:21:43","mysql to android using soap","<mysql><android><sqlconnection>","2","3","1","",""
"4181743","1","4181781","","2010-11-15 05:45:53","0","603","<p>I have work that needs to be done in this order:</p><p>In main activity:-Show progress dialog-Fetch and Parse XML from web-dismiss dialog-Switch to ListView activity that uses array from parsed XML in first activity</p><p>My problem is that because I have my fetching/parsing work in an ASyncTask, the main activityimmediately tries to load the new activity even the I need the fetch/parse work to be done first because it gets the data for the listView (the new activity).  How can I make sure the new Activity does not load until the ASyncTask work is complete?</p><p>Here is an example of what I am working with:</p><pre><code>   public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button submit = (Button) findViewById(R.id.submitButton);    submit.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            EditText text = (EditText) findViewById(R.id.entry);            input = text.getText().toString();            input = input.replace("" "", ""%20"");  //replace spaces with %20 for URL specification                     WeatherRetrievalTask wt = new WeatherRetrievalTask();        wt.execute();            Bundle bun = new Bundle();            bun.putParcelableArray(""in"", (Parcelable[])weather);            Intent myIntent = new Intent(view.getContext(), WeeklyDisplayActivity.class);            myIntent.putExtras(bun);            startActivityForResult(myIntent, 0);        }    });}</code></pre><p>*Ignore this bundle work, as this is a topic for another question I need to ask...</p><p>So the startActivityForResult needs to wait until the ASyncTask is completed and the dialog is dismissed before it runs because it needs the weather data first in order to populate the list view.</p>","487840","","","","","2010-11-15 05:54:58","Using ASyncTask when work needs to be done linearly","<android><android-asynctask>","1","0","","",""
"4181774","1","4182060","","2010-11-15 05:53:29","53","96939","<p>I need to show image by using File name only not from the Resource id.</p><pre><code>     ImageView imgView=new ImageView(this);     imgView.setBackgroundResource(R.drawable.img1);</code></pre><p>I have the image img1 in the drawable folder. I wish to show that image from the file how to do this. </p>","482568","","379693","","2010-11-15 06:53:14","2013-07-11 01:55:51","Show Image View from file path in android?","<android><imageview><android-imageview><android-file>","7","0","29","",""
"4181831","1","4181867","","2010-11-15 06:04:27","1","124","<p>What is the character to use to Place a 'return' in a string resource?</p><p>IE:  In the value of a string, '/' means there is no space before the words in the string....Is there a char to use that puts in a return so I can have the string displayed in multiple paragraphs?</p>","496686","","21234","","2010-11-15 21:13:16","2010-11-15 21:13:16","Spacing in a string","<android><string><formatting><character>","2","0","","",""
"4181842","1","4181924","","2010-11-15 06:06:05","0","344","<p>please provide the sample code here</p>","505453","","","","","2010-11-15 06:23:15","i would like to know how to open a mapview on the click of a button on a another view(this view opens up before the mapview)","<java><android>","1","0","","2013-02-11 05:33:49",""
"4181864","1","","","2010-11-15 06:10:02","0","262","<p>i dont know how to use soap from android to connect mysql</p><p>please inform me how to connect android and mysql using soap</p><p>regardsrenu</p>","430394","","13302","","2010-11-15 07:02:17","2010-11-15 07:02:17","mysql to android using soap","<mysql><android>","0","0","0","",""
"4181885","1","4182130","","2010-11-15 06:14:04","5","5091","<p>I have read posts on passing arrays from and to activities, but I am confused as to how I would do it for my specific case.</p><p>I have an array of objects called DaysWeather (a DaysWeather[] array) where the objects have several String attributes as well as a bitmap attribute.  I read somewhere that you have to make it serializable or parceable or something, but it seems messy at first glance.</p><p>Could someone lead me in the right direction?  </p><p>Is there a simple way to do this?</p>","487840","","","","","2011-06-01 10:43:26","How do you pass an object array to an Activity?","<android><activity><bundle>","1","0","2","",""
"4181886","1","4192169","","2010-11-15 06:14:25","1","564","<p>I require a sliding drawer in my application.It should be placed at the bottom of the page.It has to contain a set of images and I have to set a background colour for the sliding drawer. I saw some sample codes...But I am not getting a clear idea on how to do it. Can anyone plz help?</p>","504162","","","","","2011-03-17 07:25:27","SlidingDrawer containing images","<android>","1","1","1","",""
"4181934","1","4181982","","2010-11-15 06:26:33","47","36644","<p>I have passed a url String from java to C code as <code>jstring</code> data type. And my library method needs a <code>char *</code> as url.</p><p>How can I convert <code>jstring</code> in <code>char *</code> ?</p><p>p.s. Is there any advantage of using jcharArray in C? (i.e. Passing <code>char []</code> instead of string in native method)</p><p>Thanks in advance for your help.</p>","246942","","","","","2014-04-17 07:06:17","jni converting jstring to char *","<android><jni>","2","0","9","",""
"4181988","1","","","2010-11-15 06:35:46","0","2098","<p>hii! i am trying to fill an image onto my screen, but it is just covering around 75-80% part of whole screen, not whole screen .the codeblock i am using is as:</p><pre><code>requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FILL_PARENT,WindowManager.LayoutParams.FLAG_FULLSCREEN);    setContentView(R.layout.main);</code></pre><p>and main.xml code snippt:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""@drawable/homepage_image""android:gravity=""center""&gt;&lt;ImageButtonandroid:id=""@+id/btnSequence""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/btn_sequence""android:gravity=""center_vertical""/&gt;&lt;ImageButtonandroid:id=""@+id/btnVideo""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/btn_video""android:gravity=""center_vertical""/&gt;&lt;ImageButtonandroid:id=""@+id/btnInfo""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/btn_info""android:gravity=""center_vertical""/&gt;&lt;/LinearLayout&gt;</code></pre><p>thanks</p>","490953","","21234","","2010-11-15 10:10:44","2012-04-06 13:31:26","filling whole screen with background image!","<android><layout>","2","0","0","",""
"4181994","1","4182148","","2010-11-15 06:37:26","4","6540","<p>I have a ListView whose rows are formatted by me. Each row has a mix of ImageView and TextView.I have also implemented my own adapter and am able to draw each row through it.</p><p>Now, I would want something like this-</p><ul><li>User clicks on an ImageView (not anywhere else on the row, but only this ImageView should respond to clicks)</li><li>I get to know the position of the row whose ImageView was clicked.</li></ul><p>I have tried many things for this and have wanted my code to be as efficient as possible (in terms of overkill).Currently i can capture the click event on that particular ImageView only, but I can't know which row was clicked.</p><p>I have provided an attribute in the Row XML like this-</p><pre><code>&lt;ImageView android:id=""@+id/user_image""    android:padding=""5dip""     android:layout_height=""60dip""     android:layout_width=""60dip""    android:clickable=""true""    android:onClick=""uImgClickHandler""/&gt; </code></pre><p>And in my code, I have a method like this:</p><pre><code>public void uImgClickHandler(View v){  Log.d(""IMG CLICKED"", """"+v.getId());  LinearLayout parentRow = (LinearLayout)v.getParent(); }</code></pre><p>I can get the parent row (perhaps) but am not sure how to go further from here.Can someone please help?</p>","243709","","31751","","2012-06-22 09:18:44","2013-09-09 13:45:49","Help regarding onClick() event on an item of ListView custom row layout","<android><android-listview>","4","2","8","",""
"4182024","1","","","2010-11-15 06:45:27","0","477","<p>I know you can write apps in c, c++, and java. However I have heard that android also supports scheme, python, lua, and others but never could find it verified or an actual list.</p>","507925","","497043","","2010-11-15 06:46:46","2012-03-11 00:58:19","what programming languages does 2.2 officially support?","<android><programming-languages><android-2.2-froyo>","3","2","","",""
"4182085","1","","","2010-11-15 06:56:46","1","351","<p>I have a problem with TextView in Android</p><p>I am making an application like Facebook. In m.facebook.com, when I open it I see they do one thing specailly.</p><p>(Alice) is writing on (BackStreetBoy1010938920) wall</p><p>Because the width of Mobile screen is small so the real message like tha</p><p>(Alice) is writing on (BackStreet </p><p>Boy10101009393) wall</p><p>I guess they use TextView for  (BackStreetBoy1010938920) but I can't do like this.</p><p>Can anybody help me, I am very thanks?</p>","398650","","","","","2010-11-15 07:03:24","How to divide TextView into 2 Seperate TextView in Android","<android>","1","0","","",""
"4182152","1","4200930","","2010-11-15 07:08:05","1","2257","<p>I'm running Ubuntu Linux, and trying to compile native code for Android using the NDK.The contents of my Android.mk file:</p><pre><code>   LOCAL_PATH := $(call my-dir)   include $(CLEAR_VARS)   LOCAL_MODULE    := NativeDroid   LOCAL_SRC_FILES := org_me_nativedroid_mJNI.c   include $(BUILD_SHARED_LIBRARY)</code></pre><p>Its in the directory of that eclipse project.My native code is in folder NativeDroid/jni, where NativeDroid is the project folder.</p><p>(From the command line):  and the errors I get</p><pre><code>thomas@THOMASDESKLINUX:~/Documents/LinuxProgramming/EclipseWorkspace/Native Droid$ /home/thomas/Documents/LinuxProgramming/Android\ SDKs/android-ndk-r4b/ndk-builddirname: extra operand `SDKs/android-ndk-r4b/ndk-build'Try `dirname --help' for more information.make: /home/thomas/build/core/build-local.mk: No such file or directorymake: *** No rule to make target `/home/thomas/build/core/build-local.mk'.  Stop.</code></pre><p>Thanks in Advance!,Dragonwrenn</p>","450153","","","","","2010-11-17 02:25:04","Android NDK not compiling","<android><compilation><android-ndk>","2","0","","",""
"4182169","1","","","2010-11-15 07:11:14","3","1649","<p>i would just like to ask on how can i get the messages on my email inbox folderand display it?similarly, how can I access gmail's inbox or other mail client's inbox folder? is this possible on android?</p>","476777","","12707","","2010-11-15 07:13:51","2012-10-31 13:15:30","how can i get the messages in gmail/email client inbox folder?","<android><email>","2","0","3","",""
"4182247","1","","","2010-11-15 07:23:11","0","883","<p>Anybody can tell me how to display the bluetooth device (MyGlucoHealth meter) data in LogCat.  the following code :  </p><p>InputStream  is = btSocket.getInputStream();   </p><p>How to read data from ""is"" and print it. ?</p><p>Thanaks,Chenna</p>","462493","","","","","2013-12-19 06:37:37","Read Blutooth Device data and print it","<android><bluetooth><device><inputstream>","2","0","","",""
"4182253","1","4185936","","2010-11-15 07:23:39","6","3208","<p>I plan to develop Android application which will encrypt/decrypt voice data such that parties can communicate using secure channel. So the question is: how to intercept voice/audio data during GSM call? Is it possible or not? Should I use Android NDK or something else?</p>","472270","","","","","2013-07-10 04:04:49","Is it possible to intercept voice data during call?","<android><audio><android-ndk><voice>","5","0","4","",""
"4182299","1","4183341","","2010-11-15 07:31:33","4","1703","<p>I've added the intent-filter.And when I tap ""share"" in the Gallery, it will launch my activity.</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>But I don't know how to get the correct data from the current intent.Any helps?</p><p>EDIT: Sorry, missing ""picture"" in the question</p>","428022","","428022","","2010-11-15 09:53:36","2010-11-15 10:15:50","How to get the data from ""share picture via"" dialog on Android?","<android><android-intent>","2","2","2","",""
"4182355","1","4182801","","2010-11-15 07:39:36","1","5163","<p>Currently I'm implementing a REST client which shall parse the XML response messages. It is intended, later, to be running on an Android device. Thus, memory and processing speed is quite an issue. However there will be only one XML response at a time so processing or holding multiple XML documents at a time is not an issue.</p><p>As fas as I understood there are three ways of parsing XML with the Android SDK:</p><ul><li>SAX</li><li>XmlPullParser</li><li>DOM</li></ul><p>Reading about these different parsing methods I got that SAX is recommended for large XML files as it won't hold the complete tree in memory like DOM.</p><p>However, I'm asking myself what is large in terms of kilobytes, megabytes, ...? Is there a practical size up to which it does not really matter whether using SAX or DOM?</p><p>Thanks,<br/>Robert</p>","478406","","","","","2010-11-15 09:03:15","Maximum size when parsing XML with DOM","<java><android><xml>","3","2","","",""
"4182486","1","4685019","","2010-11-15 08:03:43","46","56305","<p>I have a linear layout which consists of imageview and textview , one below another in a linear layout.    </p><pre><code>&lt;linearLayout android:orientation=""horizontal"" ... &gt; &lt;ImageView      android:id=""@+id/thumbnail""     android:layout_weight=""0.8""      android:layout_width=""0dip""     android:layout_height=""fill_parent"" &gt; &lt;/ImageView&gt; &lt;TextView     android:id=""@+id/description""    android:layout_weight=""0.2""    android:layout_width=""0dip""    android:layout_height=""wrap_content"" &gt; &lt;/TextView&gt;</code></pre><p></p><p>Some rules might be missing , this is to give an idea , how layout looks.I want another small text view of say 50dip in length and width , placed over the imageview, by ""over"" I meant z-index more than imageview , I want to place this , in the center and above(overlapping) the imageview.</p><p>I want to know how can we place one view above the other, with varying z-index (preferably in linear layout) ?</p>","207646","","","","","2014-03-10 16:36:28","Placing/Overlapping(z-index) a view above another view in android","<android><android-layout>","6","0","15","",""
"4182694","1","4182751","","2010-11-15 08:44:04","1","2791","<p>I am trying to control android phone touch screen, It's not have keypad available .</p><p>Is there  any known tool that can send command to Android touch screen  as if the user touch the screen ?</p><p>Thanks,Koby</p>","497159","","","","","2010-11-15 08:54:46","How can I simulate touch screen clicks on Android phone from my PC?","<android>","2","0","1","",""
"4182724","1","4188347","","2010-11-15 08:49:04","0","160","<p>How to draw, say, a rectangle on the screen with it being proportional to the current device?e.g. a rectangle, centered on the viewport, one pixel smaller than the screen on each border.</p><p>I can live with Orthogonal, but would like perspective (basically everything at Z=something should be proportional to the screen, and the upper parts of the elements being distorted by perspective)</p><p>I can calculate everything on my own if i know the relation... but i don't have a starting point.</p><p>I could experiment and get to a relation myself... i even resorted to that while coding for the Wii, but that's a really bad decision on Android and all the screen ratios/sizes out there...</p>","183132","","","","","2010-11-15 20:07:28","drawing GL object proportional to screen","<android><opengl-es>","1","0","","",""
"4182761","1","4185897","","2010-11-15 08:56:19","30","11180","<p>I know, that I get the same result with both code snipplets</p><pre><code>finish();startActivity(newActivity);</code></pre><p>and</p><pre><code>startActivity(newActivity);finish();</code></pre><p>I'd like to know your opinion, if there is a big difference between them?! Or if one is better as another? And why?</p><p>Thank you,</p><p>Mur</p>","408780","","","","","2013-12-28 11:47:52","Finish old activity and start a new one or vice versa","<android><activity>","4","0","3","",""
"4182785","1","","","2010-11-15 09:00:55","0","576","<p>I have this in code:</p><pre><code>Uri contactUri = ContentUris.withAppendedId(Contacts.People.CONTENT_URI, contactId);Intent intent = new Intent(Intent.ACTION_VIEW, contactUri);startActivity(intent);</code></pre><p>This launchs the contacts application and displays the contact according tothe ID supplied, this works in all Android versions except 2.2 (API level 8) where it displays the wrong contact. </p><p>any idea ?</p>","164460","","5346","","2010-11-15 09:03:56","2010-11-15 09:18:29","android contact view","<android><contacts>","1","3","","",""
"4182820","1","","","2010-11-15 09:05:45","4","1793","<p>I've been looking the source code available from the Restlet <a href=""http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html"" rel=""nofollow"">official tutorial</a>.</p><p>I am trying to hit the Restlet server using the Android app from he tutorial adn I only get the JSON response, not the Java Object. I tried using all libraries and extensions, nothing works. When I hit the tutorial url though ( <a href=""http://restlet-example-serialization.appspot.com/contacts/123"" rel=""nofollow"">http://restlet-example-serialization.appspot.com/contacts/123</a>) I get the desired response. Any ideas? BTW, I am just using the server (GAE) in the example, not the GWT frontend.</p>","316597","","313758","","2010-11-27 09:28:41","2011-03-16 09:04:18","RESTlet tutorial application does not return Java Objects (JSON only)","<android><google-app-engine><restlet-2.0>","1","1","1","",""
"4182873","1","4182905","","2010-11-15 09:13:19","1","74","<p>I've studied several Android books in 2009 and have fiddled with SDK 1.0 with a couple of test projects; then I moved to another side project with different technologies and I have not followed the updates of the SDK in term of cool new features.</p><p>Do you mind to give a brief recap of what I've missed since SDK 1.0?</p>","130929","","","","","2010-11-15 10:44:33","Android: what I've missed since SDK 1.0?","<android><sdk>","1","0","1","",""
"4182884","1","4182971","","2010-11-15 09:14:37","1","876","<p>Hi I am dispalying some items in expanded List view. those are items and their categories.If we select one item then that item status is updated to db.next when we open that list depending upon the status set that item background .For ex if the status is 0 That that item having the black background.if the status is 1 that item background is white.I am updating that item status to db and getting that values exactly.But i don't know how we set the background for the items in the expanded list when it is displaying.Please give me some suggestions.it is urgent.Thanks in advance</p>","479027","","479027","","2010-11-15 12:00:12","2010-11-16 01:09:07","Set the color for item in Expanded List","<android>","3","0","1","",""
"4182982","1","","","2010-11-15 09:27:46","0","259","<p>I need to use perticular image as the theme for my most of the activities in my application...please help me how to do this..</p>","508065","","","","","2010-11-15 09:34:05","how to use image as a theme ","<android>","2","0","","",""
"4182999","1","","","2010-11-15 09:29:31","0","2221","<p>The problem is that if i use these two lines of code,my app closes unxepectedly and if not used, the app works just fine...is there any other way to get to the maps.class? The following is the code i used:   </p><pre><code>     Intent in = new Intent(BlobCity.this, maps.class)       startActivity(in);</code></pre><p>the following 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=""BlobCity.xyz.com""  android:versionCode=""1""  android:versionName=""1.0""&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.ACCESS_COARSE_LOCATION""/&gt;  &lt;uses-library android:name=""com.google.android.maps"" /&gt; &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;           &lt;activity android:name="".BlobCity""              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="".maps"" /&gt;     &lt;/application&gt;      &lt;/manifest&gt;</code></pre><p>blobcity.java:</p><pre><code>public class BlobCity extends Activity{    /** Called when the activity is first created. */    Button signIn,register;    TextView Blob,City,username,password;    EditText eUsername,ePassword;    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        signIn = (Button) findViewById(R.id.signIn);          register = (Button) findViewById(R.id.register);        Blob = (TextView) findViewById(R.id.blob);        City = (TextView) findViewById(R.id.city);        username = (TextView) findViewById(R.id.username);        password = (TextView) findViewById(R.id.password);        eUsername = (EditText) findViewById(R.id.eUsername);        ePassword = (EditText) findViewById(R.id.ePassword);        signIn.setOnClickListener(new sendUserPass());        register.setOnClickListener(new regPage());    }    class sendUserPass implements Button.OnClickListener    {        public void onClick(View v)        {            String uname = eUsername.getText().toString();            String pwd = ePassword.getText().toString();            String requestString = (""http://192.168.1.102:8080/BlobCity/RemoteLogin?email=""+ uname + ""&amp;pwd="" + pwd);            String line;            try {                HttpResponse response = new DefaultHttpClient().execute(new HttpGet(requestString));                InputStream is = response.getEntity().getContent();                BufferedReader br = new BufferedReader(new InputStreamReader(is));                StringBuilder rb = new StringBuilder("""");                while ((line=br.readLine()) != null)                {                    rb.append(line) ;                }                if(rb.toString().equals(""0""))                {                    Toast toast = Toast.makeText(getApplicationContext(), ""Please enter a valid Username and/or Password!"", Toast.LENGTH_LONG);                    toast.show();                    toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);                    eUsername.setText("""");                    ePassword.setText("""");                }                else                {                    Intent in = new Intent(BlobCity.this, maps.class);                    startActivity(in);                    eUsername.setText("""");                    ePassword.setText("""");                   }            }            catch (ClientProtocolException e)             {                e.printStackTrace();            }            catch (IOException e)            {                e.printStackTrace();            }        }    }    class regPage implements Button.OnClickListener    {        public void onClick(View v)        {            Intent browse = new Intent( Intent.ACTION_VIEW , Uri.parse(""http://www.blobcity.com"") );            startActivity(browse);        }    }}</code></pre><p>maps.java:</p><pre><code>import android.os.Bundle;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;public class maps extends MapActivity{    MapView mapView;     /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.map);        mapView = (MapView) findViewById(R.id.map);    }    @Override    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        return false;    }}</code></pre>","505453","","512958","","2012-12-12 17:01:39","2012-12-12 17:01:39","ERROR/dalvikvm(1399): Could not find class 'maptest.xyz.com.maps', referenced from method maptest.xyz.com.maptest$1.onClick","<java><android><android-intent>","3","6","","",""
"4183112","1","","","2010-11-15 09:45:41","2","636","<p>I have a problem with an Autocompletetextview. If I use an emulator with wvga800 resolution and I have the autocompletetextview on the bottom of the screen, the direction of the drop down list is down, while if I use an emulator with a HVGA resolution the direction is up (the direction I want).</p><p>How can I indicate the direction of an autocompletetextview drop down list?</p><p>Regards.</p>","508078","","21234","","2010-11-15 09:57:55","2010-11-15 09:57:55","AutocompleteTextview drop down list direction","<android><autocompletetextview>","0","1","1","",""
"4183226","1","4183255","","2010-11-15 09:59:12","0","247","<p>my attribute value is coming in html tag .can any body tell how to parse the value</p><p>any help would be appreciated </p>","426344","","","","","2010-11-15 10:03:26","my attribute value is coming html tag how to parse the value in android","<android>","1","0","","",""
"4183251","1","4183792","","2010-11-15 10:03:21","0","5315","<p>I am using sqlite database in Android. I'm not creating any database I'm using created database and it has successfully opened but when I am using </p><pre><code>Cursor cursor= db.query(tablename,  null, null, null, null, null, null);</code></pre><p>then it gives this table does not exists. Please let me know complete procedure for accessing sqlite databases in Android.</p>","474419","","330204","","2011-11-29 20:51:54","2011-11-29 21:06:38","Sqlite android no such table exists","<android><sqlite>","1","1","","",""
"4183253","1","","","2010-11-15 10:03:25","0","269","<p>how to get count of satellites in Android 2.1 when ever am using loction.getExtras().getInt(""satellites""); my app automatically closed please any one help me how to resolve it.And one more thing in android 1.5 its working fine .....</p>","626381","","626381","","2010-11-15 12:47:53","2010-11-15 12:54:28","how to get how many sattelites in view android 2.1 sdk","<android>","1","0","1","",""
"4183287","1","","","2010-11-15 10:07:42","0","278","<p>I want my tooltip to include a an active url link. Would it be possible in a MapView? Or do i have to place my MapView inside a WebView for this purpose? Any tutorial on the web? Any solution?</p><p>Here is something i require:</p><p><img src=""http://i.stack.imgur.com/d1eF1.jpg"" alt=""alt text""></p>","2355649","","2355649","","2010-11-15 11:13:27","2010-11-16 05:59:08","Is it possible to have an active url in a tooltip in Google Map in Android","<android>","2","0","","",""
"4183372","1","4221767","","2010-11-15 10:19:59","7","4266","<p>for the sake of simplicity let's assume that I'm making a simple Pong clone game for Android. Let's assume that it would only be playable in the landscape mode. (ignore square phones for now).</p><p>I'd like the game to look in the same scale on each phone, to the extent that if you took a screenshot of the game on QVGA phone, and resized the screenshot to WVGA size, it would look almost the same as would the game look on WVGA phone. In other words, the paddle's width should always be 1/32 of the screen width, the ball's diameter should always be 1/16 of the screen width.</p><p><strong>What would be the proper way to paint the application? It would run in standard SurfaceView that would be drawn onto a <code>Canvas</code>.</strong></p><p>Let's say that I have a high-resolution PNGs for the paddle, ball and for the game font (scoreboard, main menu). </p><p>Do I find out the physical resolution, then scale the <code>Canvas</code> via <code>scale(float sx, float sy)</code> to make all my Canvases (on QVGA and WVGA) have the same <em>virtual</em> resolution, and then draw exactly the same primitives on each position on each screen size? </p><p>Or can I use density-independent pixels (dip) somehow in the Canvas?</p>","72746","","154112","","2012-06-16 05:05:04","2013-04-10 19:05:15","How to properly scale a game on Android","<android><resolution><android-canvas>","3","0","6","",""
"4183377","1","","","2010-11-15 10:20:36","0","282","<p>I have overridden onKeyDown/onkeyUp for one of my activities in order to capture the Volume keys press events and manipulate the sound of the application. However I've noticed that while a menu (be it options menu or context menu ) is activated then I can't no longer capture the volume keys press events. How could this be by passed ?</p><p>PS I guess in larger sense this could refer to all keys not only the volume ones</p>","304866","","304866","","2010-11-15 10:26:19","2010-11-15 10:46:05","Volume keys events while a menu is showing","<android>","1","0","","",""
"4183459","1","4683372","","2010-11-15 10:30:05","2","365","<p>I am novice in android development and facing some problems. I have installed Eclipse helios along with ADT 0.9.9 and Android Windows SDK and android 2.2 package. I have developed a small app for testing (one button and EditText control which displays message when user clicks button), it complied successfully. But when I want to run this on emulator its not showing there. It once installed and worked but after I updated my code (Updated only message which will be displayed when user clicks button) its not showing the updated output so I uninstalled app from emulator using app manager. I tried every thing <strong>(used Run As and creating Android config even freshly installed SDK</strong>) to solve the problem but couldn't. Even DDMS not listing any process or any sign of running emulator. Not in even Log Cat</p>","173613","","173613","","2010-11-15 10:51:58","2011-01-13 17:54:19","Android is not working on Windows 7","<android><windows-7><sdk>","1","5","","",""
"4183582","1","4185130","","2010-11-15 10:49:40","6","372","<p>Let me give you the scenario.</p><p>Say that my first Activity that loads up, also creates a thread, which will run indefinitely in the background.</p><p>Now, if I move to another Activity, I assume that the thread that I initially created in the main activity will continue to run.</p><p>So, now to my main question - in order to manage this background thread from other Activities, is it safe to store a reference to that thread in a singleton object?</p>","380579","","","","","2010-11-15 14:25:34","Is it safe to keep a reference to a thread in a singleton?","<java><android><multithreading><singleton>","2","1","1","",""
"4183671","1","4184116","","2010-11-15 11:03:29","0","1646","<p>I am trying to debug the Home Sample application(To change the theme of home) provided in android sdk. but I am not able to do so.No error is shown but no breakpoints are encountered either.I am confused.Can somebody suggest something?</p>","505407","","","","","2011-11-24 10:13:29","I am not able to debug Home sample application in android","<android><android-manifest>","2","3","","",""
"4183697","1","4183740","","2010-11-15 11:06:01","0","183","<p>I tried to make a file choose following the below link<a href=""http://www.dreamincode.net/forums/topic/190013-creating-simple-file-chooser/"" rel=""nofollow"">http://www.dreamincode.net/forums/topic/190013-creating-simple-file-chooser/</a></p><p>However, I got the error ""Your content must have a ListView whose id attribute is 'android.R.id.list' ""</p><p>I have googled the error and I need to get a listview tag in the xml file. However, the above example does not have it and it seems working well. </p><p>Although I am not triggering the file chooser in the main page, I think my code does not have much differences to it. Could you help me to see if there are any ways to solve this problem, please?</p><p>file_view.xml</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;  &lt;TextView android:id=""@+id/fd_text1"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:singleLine=""true"" android:textStyle=""bold"" android:layout_marginTop=""5dip""&gt;&lt;/TextView&gt;&lt;TextView android:id=""@+id/fd_text2"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_marginLeft=""10dip""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>filechooser.java</p><pre><code>public class filechooser extends ListActivity{ private fileArrayAdapter adapter; private File curDir; @Override public void onCreate(Bundle savedInstanceState){  super.onCreate(savedInstanceState);  setContentView(R.layout.file_view);  curDir = new File(""/sdcard/"");  fill(curDir); } public void fill(File f){  File[] dirs = f.listFiles();  this.setTitle(""Current Dir: ""+f.getName());  List&lt;fc_option&gt;dir = new ArrayList&lt;fc_option&gt;();  List&lt;fc_option&gt;fls = new ArrayList&lt;fc_option&gt;();  try{   for (File ff: dirs){    if (ff.isDirectory())     dir.add(new fc_option(ff.getName(), ""Folder"", ff.getAbsolutePath()));    else     fls.add(new fc_option(ff.getName(), ""File Size: "" + ff.length(), ff.getAbsolutePath()));   }  }catch (Exception e){  }  Collections.sort(dir);  Collections.sort(fls);  dir.addAll(fls);  if (!f.getName().equalsIgnoreCase(""sdcard""))   dir.add(0,new fc_option("".."",""Parent Directory"", f.getParent()));  adapter = new fileArrayAdapter(this, R.layout.file_view, dir); //get problems  this.setListAdapter(adapter); } //@Override  protected void onListItemClick(ListView l, View v, int position, long id){  super.onListItemClick(l,v,position, id);  fc_option o = adapter.getItem(position);  if (o.getData().equalsIgnoreCase(""folder"") || o.getData().equalsIgnoreCase(""parent directory"")){   curDir = new File(o.getPath());   fill(curDir);  }else{   onFileClick(o);  } } private void onFileClick(fc_option o){  Toast.makeText(this,""File Click""+o.getName(), Toast.LENGTH_SHORT).show(); }}</code></pre><p>the fileArrayAdapter is exactly the same as the link.</p><p>Thank you for your help</p>","499735","","162407","","2010-11-15 11:09:49","2010-11-15 11:12:55","An error about listview","<android><listview><filechooser>","2","0","","",""
"4183721","1","4183753","","2010-11-15 11:09:30","0","249","<p>can any one suggest how can i have a list of icons like browser icon,email icon and contacts icon upon clicking on those it should lead to android browser,email and contacts apps respectively...right now i have done it, upon clicking buttons. Now i want icons(with image and text) instead of buttons...</p>","505580","","","","","2010-11-15 13:24:43","how can i have a list of icons in my android app;","<java><android><eclipse>","5","1","1","",""
"4183761","1","4183786","","2010-11-15 11:15:14","0","206","<p>I'm developing a mobile web browser application for Android which supports complex script rendering of Indic scripts.</p><p>For this, I used a currently available open source web browser for Android (which is licensed under GPLv3) &amp; modified its code to support complex script rendering. </p><p>Now the code of the browser is from that open source app &amp; the code of the complex script rendering part is from me.</p><p>My question is, Can I publish this application in a different name under the same license?</p><p>(i.e. If the name of the open sourse app is ""ABC Browser"", can I publish the modified app which is able to support complex script rendering in a different name such as ""XYZ Browser"" under GPLv3 license?)</p><p>Thanks!</p>","471349","","181337","","2012-05-05 19:10:20","2012-05-05 19:10:20","Can I re-publish a software under GPLv3 in a different name after modifying its code?","<android><open-source><gplv3>","2","0","","2012-05-06 19:13:49",""
"4183798","1","","","2010-11-15 11:19:03","2","848","<p>How do I display an image with the following configuration in Android?</p><ul><li>Retain original aspect ratio (the image can be scaled, but not stretched)</li><li>Fill the width of the parent</li><li>Aligned to the bottom of the parent</li></ul><p>The following does not work:</p><pre><code>&lt;ImageViewandroid:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:scaleType=""fitCenter""android:layout_alignParentBottom=""true""android:src=""@drawable/background"" /&gt;</code></pre><p>Using the above xml the ImageView takes the width of the parent, but the image inside the ImageView does not.</p>","143378","","143378","","2010-11-15 12:29:31","2011-04-01 01:37:08","How do I display this image in Android?","<android><imageview><android-layout><resolution-independence>","1","2","","",""
"4183858","1","","","2010-11-15 11:24:35","6","3354","<p>I need to send some data to an <code>Activity</code>, which may be running in different context.For this I created a class say A, which has an <code>ArrayList</code> of datatype say B as its one of instance member . I declared class B as Class A's Inner class. To send this class A's instance through <code>Intent</code>, I made class A and B both <code>Parcelable</code>. </p><p>Class structure is something like this (this does not include the complete code e.g. code written to make the classes <code>Parcelable</code>):</p><pre><code>public class A implements Parcelable{   public class B implements Parcelable{         public ArrayList&lt;String&gt; value;         ....         ....           public void writeToParcel(Parcel dest, int flags) {            dest.writeList(value);           }        ....        ....   }   public List&lt;B&gt; group;   public String name;   ....   ....     public void writeToParcel(Parcel dest, int flags) {        dest.writeList(group);        dest.writeString(name);       }   ....   ....}</code></pre><p>I used the <code>putExtra (String name, Parcelable value)</code> function to put data.</p><p>But on the receiving side, I got the following exception:</p><pre><code> Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 1087): 1289817569622 java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.SET_VOIP_SUPP_SERVICE_REQUEST_LOCAL (has extras) } in com.hsc.example.android.MyApp.MyAppActuvity$1@43b409b0E/AndroidRuntime( 1087):        at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:765)E/AndroidRuntime( 1087):        at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime( 1087):        at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime( 1087):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 1087):        at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime( 1087):        at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 1087):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 1087):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime( 1087):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime( 1087):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime( 1087): Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@43b51240: Unmarshalling unknown type code 3211319 at offset 440E/AndroidRuntime( 1087):        at android.os.Parcel.readValue(Parcel.java:1777)E/AndroidRuntime( 1087):        at android.os.Parcel.readListInternal(Parcel.java:1956)E/AndroidRuntime( 1087):        at android.os.Parcel.readList(Parcel.java:1302)E/AndroidRuntime( 1087):        at com.hsc.example.android.MyApp.A.&lt;init&gt;(A.java:61)E/AndroidRuntime( 1087):        at com.hsc.example.android.MyApp.A.&lt;init&gt;(A.java:57)E/AndroidRuntime( 1087):        at com.hsc.example.android.MyApp.A$1.createFromParcel(A.java:67)E/AndroidRuntime( 1087):        at com.hsc.example.android.MyApp.A$1.createFromParcel(A.java:1)E/AndroidRuntime( 1087):        at android.os.Parcel.readParcelable(Parcel.java:1845)E/AndroidRuntime( 1087):        at android.os.Parcel.readValue(Parcel.java:1713)E/AndroidRuntime( 1087):        at android.os.Parcel.readMapInternal(Parcel.java:1947)E/AndroidRuntime( 1087):        at android.os.Bundle.unparcel(Bundle.java:169)E/AndroidRuntime( 1087):        at android.os.Bundle.getParcelable(Bundle.java:1037)E/AndroidRuntime( 1087):        at android.content.Intent.getParcelableExtra(Intent.java:3269)E/AndroidRuntime( 1087):        at com.hsc.example.android.MyApp.MyAppActuvity$1.onReceive(MyAppActuvity.java:219)E/AndroidRuntime( 1087):        at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:754)E/AndroidRuntime( 1087):        ... 9 more</code></pre><p>Then I moved the class B, outside the class A (As I thought this may be problem of inner class, and declared the CREATOR static. This static declaration was not present when class B was an inner class of Class A). But it did not helped.</p><p>This seems that this problem is due to nested Parceling.</p><p>Any suggestion ??</p><p><strong>NOTE</strong>: when I used <code>android.os.Bundle.putParcelable(String key, Parcelable value)</code> function of Bundle class, and then unmarshalled it using <code>android.os.Bundle.getParcelable(String key)</code> then everything is fine. So it seems that the problem is with respect to Intents only.</p>","301444","","301444","","2010-11-19 04:38:15","2014-04-15 04:02:55","Nested Parcelling : RuntimeException - Unmarshalling unknown type code 3211319 at offset 440","<android><android-intent><parcelable>","2","1","2","",""
"4183885","1","4183951","","2010-11-15 11:22:45","0","113","<p>can any one suggest how can i have a list of icons like browser icon,email icon and contacts icon upon clicking on those it should lead to android browser,email and contacts apps respectively...right now i have done it, upon clicking buttons. Now i want icons(with image and text) instead of buttons.</p>","505580","manju","","","","2010-11-15 11:38:10","how can i have a list of icons in my android app;","<java><android><eclipse>","1","2","1","",""
"4183916","1","4186060","","2010-11-15 11:32:17","1","923","<p>i have several problem:</p><ol><li><p>if i modify   Email app ,if i can use cygwin to compile.if yes how to compile,if no  if i can compile in VMware Workstation with Ubuntu.</p></li><li><p>if i modify  framework resources,if i can use cygwin to compile.if yes how to compile,if no  if i can compile in VMware Workstation with Ubuntu.</p></li><li><p>how to combile  whole source code ,if i can use cygwin or VMware Workstation with Ubuntu</p></li></ol><p>every one can give me some guide  or link  and so on</p>","233618","","","","","2010-11-15 15:47:31","compile souce code of android in cygwin","<android>","1","0","0","",""
"4183944","1","","","2010-11-15 11:37:44","1","2842","<p>Friends, my android application runs in debug mode only even if i click the run button of the eclipse or run it by touching on its icon on the device. what will be reason for this?? anybody has any idea about it??</p>","462695","","","","","2013-03-13 06:55:08","android application running in debug mode only","<android>","2","0","1","",""
"4183968","1","","","2010-11-15 11:40:19","0","1968","<p>I have a screen that contains there different layout.</p><h2>BigLayout [it contains all three layout]</h2><p>LayoutA   - titleLayoutB   - bodyLayoutC   - buttonthe title layout contain TextView, Button and CheckedTextView and of it in the BighLayout, if i want that the CheckedTextView will be display over the body layout, how can i do such a thing?</p>","508197","","21234","","2010-11-30 17:29:21","2010-11-30 17:29:21","layout over layout on android","<android><button><textview><android-layout>","2","1","","",""
"4184141","1","4184341","","2010-11-15 12:06:31","3","844","<p>I've got a small clipping problem that I haven't been able to solve using an EditText view in a TableRow. Whatever I try, the EditText view is either clipped (attached screenshot), or, if I set shrinkColumns to either 0 or 1, the label text disappears (and the EditText view takes up the whole width). The layout is 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:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:orientation=""vertical"" android:padding=""10dip""&gt;  &lt;TableLayout android:orientation=""vertical""  android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;TableRow android:orientation=""horizontal""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;      &lt;TextView android:paddingRight=""10dip"" android:layout_column=""1""      android:text=""Label Text"" /&gt;      &lt;EditText android:text=""Very long text that makes the text view go on clipping frenzy""      android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt;    &lt;/TableRow&gt;  &lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I've tried it on a 2.2 emulator running at QVGA and HVGA, a HTC Hero on 2.1 and the Wildfire on 2.1 as well. I've also played around with the clipToPadding attribute which doesn't seem to help in my case. The same issue appears if I set the hint attribute with a long text and leave the text value empty.</p><p>As I am doing nothing particularly complex, I suspect a simple error on my side. Any ideas, hints or suggestions are highly appreciated.</p><p>Cheers!</p><p><img src=""http://i.stack.imgur.com/TGdRc.png"" alt=""alt text""></p>","249893","","","","","2010-11-15 12:35:23","Android text clipping problem with EditView inside a TableLayout","<android><text><tablelayout><clipping>","2","1","2","",""
"4184145","1","","","2010-11-15 12:07:11","0","950","<p>I am trying to develop dictionary application which uses source files from res/raw.It works when i use a smaller file, but not with a file that I have to use which is cca 5mb.</p><p>I decided to split it in parts and to use it this way because it appears that android has some file size limits for assets folder(1mb?).But it doesnt work this way, it loads something in the program but not all the dictionary files. What seems to be the problem? Am I going in a completely wrong way about this?</p><pre><code>    private void loadWords() throws IOException {        final Resources resources = mHelperContext.getResources();        InputStream inputStream = resources.openRawResource(R.raw.definitions1);        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));        ucitaj(reader);        InputStream inputStream2 = resources.openRawResource(R.raw.definitions2);        BufferedReader reader2 = new BufferedReader(new InputStreamReader(inputStream2));        ucitaj(reader2);        InputStream inputStream3 = resources.openRawResource(R.raw.definitions3);        BufferedReader reader3 = new BufferedReader(new InputStreamReader(inputStream3));        ucitaj(reader3);        InputStream inputStream4 = resources.openRawResource(R.raw.definitions4);        BufferedReader reader4 = new BufferedReader(new InputStreamReader(inputStream4));        ucitaj(reader4);        InputStream inputStream5 = resources.openRawResource(R.raw.definitions5);        BufferedReader reader5 = new BufferedReader(new InputStreamReader(inputStream5));        ucitaj(reader5);        InputStream inputStream6 = resources.openRawResource(R.raw.definitions6);        BufferedReader reader6 = new BufferedReader(new InputStreamReader(inputStream6));        ucitaj(reader6);</code></pre><p>-- </p><pre><code>  private void ucitaj(BufferedReader reader) throws IOException {        Log.d(TAG, ""Loading words..."");        try {            String line;            while ((line = reader.readLine()) != null) {                String[] strings = TextUtils.split(line, "" -- "");                if (strings.length &lt; 2) continue;                long id = addWord(strings[0].trim(), strings[1].trim());                if (id &lt; 0) {                    Log.e(TAG, ""unable to add word: "" + strings[0].trim());                }            }        } finally {            reader.close();        }        Log.d(TAG, ""DONE loading words."");    }</code></pre>","508216","","508216","","2010-11-15 12:50:26","2010-11-15 14:34:26","using big files from res/raw","<android>","1","2","1","",""
"4184345","1","4185746","","2010-11-15 12:34:02","1","1591","<p>I am trying to gate the title of preferencesreen in my program ..anybody tell me how can i get title?my code of preference xml is here. i want to get the title ""Show List"" in my program.</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=""Settings""&gt;        &lt;PreferenceScreen android:title=""Show List"" android:key =""show_list"" android.id=""@+id/preference_screen""&gt;            &lt;intent android:action=""android.intent.action.VIEW""                android:targetPackage=""com.picknext""                android:targetClass=""com.picknext.PickName"" /&gt;        &lt;/PreferenceScreen&gt;        &lt;ListPreference android:title=""Remove after pick""            android:key=""selection_of_Y_N_Name_Pick"" android:entries=""@array/selection_of_y_n_namepick""            android:entryValues=""@array/value_of_y_n_naempick"" android:defaultValue=""Yes"" /&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre>","501483","","471164","","2011-05-24 06:38:51","2011-05-24 06:38:51","How to get title of preferencescreen in android","<android>","1","0","","",""
"4184354","1","4184664","","2010-11-15 12:34:56","0","669","<p>I am trying to learn a few things from <a href=""http://code.google.com/p/iosched/source/checkout"" rel=""nofollow"">http://code.google.com/p/iosched/source/checkout</a>. I wanted to see how they implemented that UI patterns they were talking about on the I/O. </p><p>In the <em>HomeActivity</em> they use this code to fire up the <em>NotesActivity</em> : </p><pre><code>/* Launch list of notes user has taken*/public void onNotesClick(View v) {      startActivity(new Intent(Intent.ACTION_VIEW, Notes.CONTENT_URI));}</code></pre><p>Notes class is in the ScheduleContract class and it looks like : </p><pre><code>public static class Notes implements NotesColumns, BaseColumns {    public static final Uri CONTENT_URI =            BASE_CONTENT_URI.buildUpon().appendPath(PATH_NOTES).build();    public static final Uri CONTENT_EXPORT_URI =            CONTENT_URI.buildUpon().appendPath(PATH_EXPORT).build();    /** {@link Sessions#SESSION_ID} that this note references. */    public static final String SESSION_ID = ""session_id"";    /** Default ""ORDER BY"" clause. */    public static final String DEFAULT_SORT = NotesColumns.NOTE_TIME + "" DESC"";    public static final String CONTENT_TYPE =            ""vnd.android.cursor.dir/vnd.iosched.note"";    public static final String CONTENT_ITEM_TYPE =            ""vnd.android.cursor.item/vnd.iosched.note"";    public static Uri buildNoteUri(long noteId) {        return ContentUris.withAppendedId(CONTENT_URI, noteId);    }    public static long getNoteId(Uri uri) {        return ContentUris.parseId(uri);    }}</code></pre><p>I cant see what exactly this code do, and how it ends up starting <em>NotesActivity</em> with notes loaded in. I also dont understand how and for what is URI used as a second parameter in new :<br>    Intent(Intent.ACTION_VIEW, Notes.CONTENT_URI).<br>I searched on Google for explanation but failed to find simple one and simple examples. I would guess that <em>Notes</em> class is used to point to and format the data (notes) and then somehow <em>NotesActivity</em> is started, but dont understand exactly how.</p>","257501","","","","","2010-11-15 13:17:17","Help with intent starting on Android","<android><android-intent><android-layout>","1","0","1","",""
"4184382","1","4192840","","2010-11-15 12:38:16","10","19159","<p>i have a listview and implemented onclick and also onfling.problem is when i do fling(swipe left to right), onclick event of listview is also getting executed.How to overCome this problem? <strong>how to differentiate touch(tap) and fling(swipe) in listview?</strong> </p><pre><code>     listClickListener = new OnItemClickListener() {           public void onItemClick(AdapterView&lt;?&gt; parent, View v,int position, long id) {            //Job of Onclick Listener                }      };       mContactList.setOnItemClickListener(listClickListener);         mContactList.setAdapter(adapter);        // Gesture detection         gestureDetector = new GestureDetector(new MyGestureDetector(prosNos));          gestureListener = new View.OnTouchListener() {              public boolean onTouch(View v, MotionEvent event) {                  if (gestureDetector.onTouchEvent(event)) {                      return true;                  }                  return false;              }          };          mContactList.setOnTouchListener(gestureListener);         }     public class MyGestureDetector extends SimpleOnGestureListener {         @Override         public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {            // My fling event           return false;        }    }</code></pre><p>P.S. Is it possible? to comment the OnClickListener of ListView and writing the same logic in any onTouchEvent? but still I have no doubt that onFling will call onTouch. Am I right?</p>","430652","","1150311","","2014-01-12 12:54:49","2014-01-12 12:54:49","how to implement both ontouch and also onfling in a same listview?","<android><listview><gesture><swipe><ontouchlistener>","1","4","6","",""
"4184433","1","","","2010-11-15 12:45:26","0","532","<p>i would like some help on sending some data between two emulators.they all speak about port forwarding but i cant make it work .the emulators have the id 5554 and 5556.and i know the listening port of each emulator.</p><p>what to write in order to sent message between the two emuators??</p>","508246","","","","","2010-12-22 06:44:59","who to connect two android emulators runnnig on same machine?","<android>","1","1","1","",""
"4184536","1","","","2010-11-15 12:56:26","3","9717","<p>Please help me if you know how to add both scrollbar.<br/>First of all i clear to all.<br/>I added both scroll bar in tablelayout but main problem is i m using dynamic data for filling tablerow. So, if there is only one record so horizontal scroll view top after the data. but i want to show horizontal in bottom and also show vertical.</p><p><br/>Thanks <br/>Prashant</p>","487253","","","","","2011-05-14 05:16:50","Horizontal and vertical scrollbar in Android with tablelayout?","<java><android><tablelayout>","3","1","3","",""
"4184556","1","4186345","","2010-11-15 12:58:30","8","3908","<p>I have an ExpandableListActivity (using a SimpleCursorTreeAdapter) which starts another activity when the user clicks on a child-element. When pressing the back-button in the new activity all the list-items are collapsed again. How do I save the expanded state of the ExpandableListActivity and restore it again.</p><p>I already tried to implemented onSaveInstanceState() and onRestoreInstanceState() like this...</p><pre><code>@Overrideprotected void onSaveInstanceState(Bundle outState) {    super.onSaveInstanceState(outState);    Parcelable listState = getExpandableListView().onSaveInstanceState();    outState.putParcelable(""ListState"", listState);}@Overrideprotected void onRestoreInstanceState(Bundle state) {    super.onRestoreInstanceState(state);    Parcelable listState = state.getParcelable(""ListState"");    getExpandableListView().onRestoreInstanceState(listState);}</code></pre><p>...but onRestoreInstanceState() gets never called. I also tried to restore the state in the onCreate() method but it isn't called as well:</p><pre><code>if (savedInstanceState != null) {    Parcelable listState = savedInstanceState.getParcelable(""ListState"");    getExpandableListView().onRestoreInstanceState(listState);}</code></pre>","272802","","272802","","2010-11-15 16:16:48","2013-04-21 19:26:22","Save and restore expanded/collapsed state of an ExpandableListActivity","<android><state><expandablelistview>","3","3","4","",""
"4184792","1","4184812","","2010-11-15 13:26:11","3","360","<p>For an application prototype I'm creating a simple user login. The Password of the user will then be hashed using sha224 and transferred to the back-end. The Problem I am facing right now is the following. The password that was stored in the DB (also hashed using sha224) seems to look a little different then the hash I am sending. I use the following code to create the hashes. </p><p>Given Password == test</p><p><strong>Python</strong></p><pre><code>from hashlib import sha224sha224(""test"").hexdigest()</code></pre><p><strong>android</strong></p><pre><code>MessageDigest sha224 = MessageDigest.getInstance(""SHA-224"");sha224.update(key.getBytes());byte[] digest = sha224.digest();StringBuffer buffer = new StringBuffer();for(int i = 0; i &lt; digest.length; i++) { buffer.append(String.valueOf(Integer.toHexString(0xFF &amp; digest[i])));}return buffer.toString();</code></pre><p>What now will be produced looks like this and I will post the two hashes directly underneath each other. (The first one is python and the second android)</p><p>90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a80990a3ed9e32b2aaf4c61c41eb925426119e1a9dc53d4286ade99a89</p><p>They are almost the same but the python hash has two 0s more. Do you guys have any idea why?</p>","463910","","168868","","2012-12-25 21:31:28","2012-12-25 21:31:28","Difference between android sha224 and python sha224","<android><python><hash><sha2>","3","0","1","",""
"4184829","1","14991114","","2010-11-15 13:30:03","0","2112","<p>I am using the webview control in android to show the html content. But I face a problem that in webview I have to fix the height so thats why if html content contains less data then it wasted the space. Is there any solution to solve this problem that how can I show only same content as html has in the webview without any wasted space please help.</p><p>following xml i used to draw webview is this right? In this i give fix height to webview. if i am not giving fix height then it will show only 1 line data with scroll.</p><pre><code>         &lt;LinearLayout android:id=""@+id/llweb"" android:layout_width=""fill_parent"" android:scrollbars=""vertical"" android:background=""@android:color/transparent"" android:layout_height=""500dip""&gt;        &lt;WebView android:id=""@+id/helloWebView"" android:layout_width=""fill_parent"" android:background=""@android:color/transparent"" android:layout_height=""500dip""/&gt;    &lt;/LinearLayout&gt;</code></pre><p>thanks</p>","339116","","339116","","2010-11-16 05:38:47","2013-02-20 22:25:32","webview in android","<android><webview>","2","0","","",""
"4184889","1","","","2010-11-15 13:39:08","1","1049","<p>I need to recursively move through a bunch of custom views of mine that extend the view class.</p><p>E.g.</p><pre><code>ViewOne.javaViewTwo.javaViewThree.java</code></pre><p>I have created instances of each view in my MainClass.java</p><pre><code>ViewOne vOne;ViewTwo vTwo;ViewThree vThree;</code></pre><p>these views all implement a function called <code>start()</code>.</p><p>and I want to be able to loop through them somehow:</p><pre><code>for(int i=0; i&lt;= 2:i++){  views[i].start();}</code></pre><p>How would I go about doing this?</p><p>The above is only an example. The real reason I need to be able to move through them numerically and programatically is because I want to be able to add and remove views to a layout in their numeric order as button (previous and next) are clicked. (I don't want them all added to the layout at the start because they are heavily resource intensive views).</p><p>So what is required is as such:</p><p>Click Next -> add next view -> remove current view.Click Previous -> add previous view -> remove current view.</p><p>e.g.</p><pre><code>currView = 1Current View is currView (1)Click NextAdd View currView+1 (2) to LayoutSwitch to View currView+1 (2)Remove View currView (1)orcurrView = 2Current View is currView (2)Click PreviousAdd View currView-1 (1) to LayoutSwitch to currView-1 (1)remove View currView (2)</code></pre><p>Note, this views are all of their own unique type and are infact individual classes that extend View. I can't simply typecast them to ""View"" because that's wrong, their types are ViewOne, ViewTwo and ViewThree respectively (for example).</p>","353674","","353674","","2010-11-15 15:53:35","2010-11-15 20:04:54","Android refer to custom views in a loop?","<android><recursion><views>","3","0","","",""
"4184903","1","","","2010-11-15 13:42:12","1","226","<p>I would like to get contact by name, and after that be able to check and update all information in it. Is there any example on that matter, because I couldn't find one that shows that in whole.</p><p>tnx.</p>","505160","","","","","2011-04-13 19:31:26","Update contact info on Android < 2.0","<java><android>","1","0","","",""
"4184913","1","4184961","","2010-11-15 13:44:02","1","369","<p>Hi I am create media player...its display songs in listview but when I click the song. The log cat show this error...any one help me... </p><pre><code>                 mp.reset();                 mp.setDataSource(songPath);                 mp.prepare();                 mp.start();</code></pre><p>logcat error:`</p><pre><code>11-15 19:12:32.250: INFO/StagefrightPlayer(34): setDataSource('/sdcardparatha.mp3')11-15 19:12:32.289: ERROR/MediaPlayer(2515): error (1, -2147483648)11-15 19:12:32.289: VERBOSE/song(2515): Prepare failed.: status=0x1</code></pre>","486554","","437301","","2010-11-15 15:40:01","2010-11-15 15:40:01","mediaplayer not working","<java><android><audio>","1","0","","",""
"4184922","1","","","2010-11-15 13:45:32","1","989","<p>I'm developing an application which allows user to edit an image and save that edited image as new image on sd card I want to get the current state of the canvas object.please help me with this.</p>","508309","","508309","","2010-11-16 06:26:59","2011-10-11 05:09:54","How to save current state of canvas as an image in android","<android>","1","1","1","",""
"4184951","1","4185511","","2010-11-15 13:48:03","13","22334","<p>Hi I am using <code>ACTION_IMAGE_CAPTURE</code> for capturing image using <code>Intent</code> as follows:</p><pre><code>Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, (new File(Environment.getExternalStorageDirectory(),String.valueOf(System.currentTimeMillis()) + "".jpg"")));startActivityForResult(cameraIntent, 0);</code></pre><p>I need to store image in an sdcard and retrieve the path of that image using the <code>onActivityResult</code> method. I don't know how to get the image path of the currently captured image.</p><p>If any one knows please help.</p><p>Thanks</p>","392924","","1309352","","2013-06-03 09:32:12","2014-03-27 09:01:04","Get Path of image from ACTION_IMAGE_CAPTURE Intent","<android><camera><android-camera><android-camera-intent>","3","1","11","",""
"4184968","1","4202890","","2010-11-15 13:50:21","1","930","<p>I have this code inside my asynctask:</p><pre><code>@Overrideprotected void onPreExecute() {    waitDialog = new ProgressDialog(context);               waitDialog.setTitle(R.string.wait_title);               waitDialog.setMessage(context.getString(R.string.wait_body));    waitDialog.setIndeterminate(true);    waitDialog.show();}@Overrideprotected Boolean doInBackground(Void... unused) {    Intent serviceIntent = new Intent(context, PublisherService.class);    saveSettings(false);    startService(serviceIntent);    return serviceIsRunning();}</code></pre><p>The dialog shows but while my service is starting (and it takes a few seconds) the progressdialog is frozen. If i use a simple <code>SystemClock.sleep()</code> inside my <code>doInBackground()</code> call it works fine.</p><p>Can someone tell me why is this happening and how to solve the issue?</p><p>Thanks</p>","106478","","","","","2010-11-17 09:03:04","ProgressDialog freezes when trying to run a service with an asynctask","<android><service><android-asynctask>","2","0","","",""
"4185061","1","","","2010-11-15 14:03:33","77","49337","<p>Can I program for Android using Python? I seem to have stumbled upon many links while searching... however neither of them is concrete.</p><p>Any suggestions? I want to write apps for Android but really don't want to get into Java for all this.</p><p>PS: My question is whether I can write proper, full fledged apps for Android. </p>","225312","","","","","2013-02-14 03:03:51","Android Python Programming","<python><android>","6","3","25","",""
"4185068","1","","","2010-11-15 14:03:49","1","424","<p>I just downloaded the source of wordpress app. I am on the process of rebranding the wordpress app (icons &amp; lebels) for my self hosted site. I was wondering, if there is a process / configuration option to remove the wordpress links &amp; wordpress blogging options from my app. It doesn't make sense for the user to download my app from market place &amp; go to wordpress site with it.</p><p>THIS IS A GENERIC ANDROID QUESTION: </p><p>I want the users be able to use both the default wordpress app &amp; my self hosted app. However, for that, I think I need to change the package name in the android manifest and thus refactor all the old package names of all the java class. But then I will loose the ability to sync &amp; get update of the latest build of the wordpress app.</p><p><strong>Is there a way I can install the same code with the same package (as a different application) without conflicting with the wordpress app ?</strong> </p><p><em><strong>Can anyone point me to the direction where I can find more details on the application namespace / package name conflicts?</em></strong></p>","321098","","","","","2010-11-15 14:23:26","Rebranding Wordpress Android app for the self hosted blog","<android><wordpress>","1","2","","",""
"4185469","1","4185508","","2010-11-15 14:47:43","0","597","<p>I have an error when i use intent to start activity when i choose a tab </p><pre><code>intent = new Intent().setClass(this, tab1.class);mTabHost.addTab(mTabHost.newTabSpec(""tab_test1"").setIndicator(""Search"").setContent(intent));</code></pre><p>the erroe is </p><pre><code>Sorry !The Application has stopped unexpectedly  , please try again later </code></pre>","508377","","105224","","2010-11-15 14:52:10","2010-11-15 14:55:47","Exception when use android tabs with intent to start activity","<java><android>","2","1","","",""
"4185507","1","11944886","","2010-11-15 14:52:53","17","22785","<p>I would like to create different layouts for tablets and handsets in Android. Where should I put the layout resources in order to make this differentiation?</p>","143378","","143378","","2012-08-14 06:41:24","2013-04-30 08:58:16","Layout for tablets in Android","<android><android-layout><tablet>","3","1","13","",""
"4185512","1","","","2010-11-15 14:53:29","2","1006","<p>I have an application, which uses the LocationManager. Therefore I'm now writing an instrumentation test. I've found already a similar <a href=""http://stackoverflow.com/questions/1972895/testing-gps-in-android/3940877#3940877"">answer</a>, but this won't work for me.</p><pre><code>public class LocationSensorTest extends AndroidTestCase {  /*package*/ LocationManager lm;  private LocationSensor sensor;  @Override  protected void setUp() throws Exception {    super.setUp();    sensor = new LocationSensor(getContext());    lm = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE);    lm.addTestProvider(""test"", false, false, false, false, false, false, false, Criteria.POWER_LOW, Criteria.ACCURACY_FINE);    lm.setTestProviderEnabled(""test"", true);  }  public void testHasAnyActiveLocationProvider() {    assertTrue(sensor.hasAnyActiveLocationProvider());  }}</code></pre><p>The test fails during the ""addTestProvider"" with a SecurityException that the ""android.permission.ACCESS_MOCK_LOCATION"" is missing. The Point is that the instrumentation test AndroidManifest.xml has this uses permission, but the application to test not.</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""de.app.android.tests"" android:versionCode=""1"" android:versionName=""1.0""&gt;  &lt;application&gt;    &lt;uses-library android:name=""android.test.runner"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_MOCK_LOCATION"" /&gt;  &lt;/application&gt;  &lt;instrumentation android:name=""android.test.InstrumentationTestRunner"" android:targetPackage=""de.app.android"" android:label=""Requester App Tests"" /&gt;  &lt;uses-sdk android:minSdkVersion=""4"" /&gt;&lt;/manifest&gt; </code></pre><p>Has somebody an idea how to solve this?</p>","495712","","","","","2011-03-17 09:30:34","test location provider in android instrumentation test project","<android><unit-testing><location>","1","0","1","",""
"4185587","1","","","2010-11-15 14:59:53","0","75","<p>Is any possibility to update the IMAGE in the ImageButton or ImageView at the time of refreshing the page in Android.</p><p>Thanks in advance</p>","508394","","968408","","2012-12-31 11:51:55","2012-12-31 11:51:55","How to update the image in the image button at refreshing the page in android?","<android><user-interface>","2","0","","",""
"4185625","1","","","2010-11-15 15:03:38","1","1328","<p>Any suggestion for live stream for android.</p><p>In my app i need to stream live video from Live Stream.. Is there any api or example to do it? If so, please provide it.</p><p>I need as like this...</p><p><a href=""http://www.livestream.com/aplive?utm_source=website-home&amp;utm_medium=promo-header&amp;utm_campaign=aplive"" rel=""nofollow"">http://www.livestream.com/aplive?utm_source=website-home&amp;utm_medium=promo-header&amp;utm_campaign=aplive</a></p><p>Thanks,jana.</p>","286831","","","","","2010-11-15 15:10:50","In Android, How to stream live video from Live Stream?","<android>","1","2","","",""
"4185771","1","4185955","","2010-11-15 15:18:00","1","997","<p>Does a custom PreferenceActivity need to define a List?</p><p>If I do not define a list as part of my content associated with my custom PreferenceActivity, I get the following RuntimeException: </p><blockquote>  <p>Your content must have a ListView  whose id attribute is  'android.R.id.list'</p></blockquote><p>I am trying to create a custom PreferenceActivity that shows two lists:</p><ol><li>One list that adds selections to the other list</li><li>One list that allows the user to move items up or down, or delete them (probably with a context menu)</li></ol><p>What is a ""preferred"" way of doing this?</p><p>Thanks,wTs</p>","285417","","","","","2012-12-28 21:42:27","Does Custom PreferenceActivity Need To Define List","<android><android-preferences>","3","0","2","",""
"4185930","1","4186580","","2010-11-15 15:34:36","16","21628","<p>A good example of this is either on the Twitter launch screen (the screen with the large icons that is seen when the application is first launch) or even just look at the application tray when you focus an application icon.</p><p>Basically I need to highlight an ImageView where the highlight contours to the image within the ImageView and looks like it's a border to that image. I would also like to customize the highlight to have it be a certain color and for it to fade out.</p><p>Thanks,</p><p>groomsy</p>","349179","","","","","2013-09-18 18:25:44","How to highlight ImageView when focused or clicked?","<android><focus><imageview><highlight>","2","0","12","",""
"4185933","1","4186349","","2010-11-15 15:34:53","0","716","<p>I need to change the colors and/or style of the ContextMenu when I long press an item of a ListView.</p><p>I've looked everywhere for an answer and cannot find anything related to ContextMenu customization.</p><p>Is it possible? </p><p>Thanks!</p>","508430","","21234","","2010-11-15 15:38:39","2010-11-15 16:15:36","Customize ListView ContextMenu colors","<android><layout>","1","0","","",""
"4186021","1","4186097","","2010-11-15 15:43:36","106","138765","<p>In an Android application, how do you start a new activity (GUI) when a button in another activity is clicked, and how do you pass data between these two activities?</p>","508377","","220060","","2013-05-09 21:17:58","2013-12-03 11:58:34","How to start new activity on button click","<android>","7","0","48","",""
"4186168","1","","","2010-11-15 15:58:46","2","2487","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4119827/how-can-i-open-android-browser-with-specified-post-parameters"">How can I open android browser with specified POST parameters?</a>  </p></blockquote><p>I have set up a Button that will link to Google Checkout, however, I need to POST a whole lot of required data (not GET) so I can't use the usual Intent method.</p><pre><code>            //open the browser            Uri u = Uri.parse(uri.toString());            Intent i = new Intent(Intent.ACTION_VIEW, u);            startActivity(i);</code></pre><p>How do I post data to a URL by pressing a button and then load the result into a web browser?  In this case it will be the Google Checkout webpage.</p>","248521","","","","","2012-03-28 14:31:23","How to POST data from a Android Java button then load it in a web browser?","<android>","1","0","","2012-03-28 15:02:17",""
"4186177","1","4186456","","2010-11-15 15:59:23","1","3004","<p>I read the official document about supporting multiple screens <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a></p><p>According to that document, I should just create different directories for different resolultion.</p><p>Now the question. How to support devices with normal screen and high density or low density?</p><p>I ask it because, there are two posibilities (WVGA800 (480x800) and WVGA854 (480x854)) and (WQVGA400 (240x400) and WQVGA432 (240x432)) and I don't know where to store some background images for them.</p><p>I would take drawable-normal-hdpi or drawable-normal-ldpi, but how to make difference between 480x800 and 480x854 or between 240x400 and 240x432?!</p><p>Thank you in advance,</p><p>Mur</p>","408780","","408780","","2010-11-15 17:00:40","2013-03-26 13:07:48","Supporting Multiple Screens for some devices in Android","<android><screen-resolution>","2","0","","",""
"4186204","1","","","2010-11-15 16:01:50","2","520","<p>I use the BitmapFactory.decodeByteArray to generate a Bitmap from a PNG image. Then I use Bitmap.getPixels to retrive all the pixel data. The problem is that when a pixel is set as fully transparent, all the color data seams to be discarded. 0x0000ff00 is being returned as 0x00000000. If I create an image from code which has transparent pixels I make a copy, render that to a canvas, use Canvas.drawColor(0xff000000, Mode.DST_ATOP) and then get all the correct color values with getPixels and then add that with the alpha values I got from the first getPixels call. I can't do that now since the color information seams to be gone.Is there any way to make sure that the color information is stored when generating a Bitmap from a PNG file using the BitmapFactory?</p>","164779","","","","","2010-11-15 16:58:25","BitmapFactory.decodeByteArray doesn't keep color information when pixel is fully transparent","<android>","1","0","","",""
"4186231","1","","","2010-11-15 16:03:46","0","884","<p>I have a horizontal linear layout with multiple image views. Is there a way to resize these views automatically, so that all of them fit inside the screen?this is the code: </p><pre><code>&lt;LinearLayoutandroid:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;ImageView     android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:src=""@drawable/cinnamon""/&gt;&lt;ImageView     android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_toRightOf=""@+id/cinnamon""/&gt;&lt;ImageView     android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:src=""@drawable/ham""/&gt;</code></pre><p></p><p>Best Regards</p>","460611","","460611","","2010-11-15 16:31:09","2012-03-20 17:38:59","Resize views in a layout","<android>","1","0","1","",""
"4186235","1","4320462","","2010-11-15 16:04:05","0","5196","<p>I'm developing and Android application.</p><p>I have a model on Blender and I want to export it to use it with OpenGL ES 1.1. on Android.</p><p>How can I export my model as a set of points and vertex?</p><p>Is there any other suitable format to use with OpenGL ES 1.1? I'm not using a rendering engine.</p><p>Thanks.</p>","68571","","","","","2013-05-25 14:30:21","Export blender design to OpenGL ES 1.1","<android><opengl-es><blender>","5","0","2","",""
"4186312","1","4589100","","2010-11-15 16:12:00","4","943","<p><em>I developed a Android-Homescreen-Widget and got a weird problem: The ""Open""-Button in the Market grayed out because there is actually no Application to launch. So, many people complain because they don't realize that my package is a widget. They even give me a bad rating and I want to avoid that by giving the people a hint what they should do. A first-line-hint in the description (written in Uppercase) didn't help at all, so I'm searching for a better solution.</em></p><p><strong>Is it possible to display a message directly after the installation of a package in the android-market?</strong></p>","61855","","","","","2011-01-03 22:41:24","Display message after Package install","<android><package><google-play>","2","0","4","",""
"4186313","1","4188601","","2010-11-15 16:12:12","1","6370","<p>The answer to this question might be really obvious but its giving me a headache. I have a simple LinearLayout with one single ListView in it. I do this: onCreate</p><pre><code>public void onCreate(Bundle b) {        super.onCreate(b);        setContentView(R.layout.friends);        ListView listView = (ListView) findViewById(R.id.friend_list);        listAdapter = new CheckinListAdapter(checkins, listView, R.layout.checkin_list_item);        listView.setAdapter(listAdapter);        if (getLastNonConfigurationInstance() != null) {            FriendsActivity last = (FriendsActivity) getLastNonConfigurationInstance();            this.checkins.addAll(last.checkins);            this.sort = last.sort;        } else {            refresh();        }        registerForContextMenu(listView);    }</code></pre><p>But for some reason <code>onCreateContextMenu</code> never gets called! So I did some research and since I am loading the list after the register, perhaps it doesn't register it correctly. If I go in my <code>ListAdapter</code> and do <code>registerForContextMenu</code> it does show up. But it doesn't behave correctly with the keyboard. So I am now confused on what can be the error because it seems a little non intuitive for me to have to register each child item. All the examples I find online are using <code>ArrayAdapter</code>. :(</p><p>Any suggestions?</p><p><strong>Edit</strong></p><p><strong>Here is more detail, in case it something I don't see:</strong></p><p>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""&gt;    &lt;Button android:text=""@string/check_in""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:onClick=""onCheckInClicked""/&gt;    &lt;ListView android:id=""@+id/friend_list""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""/&gt;&lt;/LinearLayout&gt;</code></pre><p>List item xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:paddingTop=""5dip""        android:paddingBottom=""5dip""&gt;    &lt;ImageView android:id=""@+id/user_photo""               android:layout_width=""40dip""               android:layout_height=""40dip""               android:scaleType=""centerCrop""/&gt;    &lt;LinearLayout android:layout_width=""wrap_content""                  android:layout_height=""wrap_content""                  android:orientation=""vertical""                  android:layout_marginLeft=""8dip""&gt;        &lt;LinearLayout android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;            &lt;Button android:id=""@+id/user"" style=""@style/TextButton""/&gt;            &lt;TextView android:text=""@string/at""                      android:layout_width=""wrap_content""                      android:layout_height=""wrap_content""/&gt;            &lt;Button android:id=""@+id/venue""                    android:singleLine=""true""                    android:ellipsize=""end""                    style=""@style/TextButton""/&gt;        &lt;/LinearLayout&gt;        &lt;TextView android:id=""@+id/venue_address"" style=""@style/GreyLarge""/&gt;        &lt;LinearLayout android:id=""@+id/checkin_detail""                      android:layout_width=""wrap_content""                      android:layout_height=""wrap_content""                      android:layout_marginTop=""6dip""                      android:layout_marginBottom=""6dip""&gt;            &lt;ImageView android:id=""@+id/checkin_image""                       android:layout_width=""70dip""                       android:layout_height=""60dip""                       android:layout_marginRight=""8dip""                       android:scaleType=""centerCrop""/&gt;            &lt;TextView android:id=""@+id/checkin_shout""                      android:layout_width=""wrap_content""                      android:layout_height=""wrap_content""/&gt;        &lt;/LinearLayout&gt;        &lt;TextView android:id=""@+id/elapsedTime"" style=""@style/GreySmall""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","419075","","419075","","2010-11-15 17:16:03","2010-11-15 20:38:58","registerForContextMenu not get calling properly - what am I doing wrong?","<android>","2","0","1","",""
"4186435","1","4186479","","2010-11-15 16:22:17","0","455","<p>I would like to start doing some Android development, and would like a cheap device to deploy apps to, just for testing and demo purposes.  Is it possible to deploy apps to, for instance, an <a href=""http://www.archos.com/products/ta/archos_28it/specs.html?country=us&amp;lang=en"" rel=""nofollow"">Archos 28</a>?  I don't know much about Android development yet, and haven't found a good answer to this question elsewhere.  Thanks.</p>","301677","","","","","2011-05-14 15:40:06","Can an Archos 28 be used as a test device for Android development?","<android>","2","0","","",""
"4186470","1","4193577","","2010-11-15 16:25:27","1","1008","<p>How do you display different images for different screen resolutions (hdpi, ldpi, mdpi) in an embedded HTML resource of an Android app?</p><p>The HTML resource is located in <code>assets</code>, but can be changed if necessary.</p><p>If this is not possible, how do you change the display size of the image based on the screen resolution?</p>","143378","","143378","","2010-11-15 18:08:00","2011-12-18 04:34:59","Different images for different resolutions in HTML resources in Android","<html><android><image><android-webview><resolution-independence>","2","0","","",""
"4186583","1","4186703","","2010-11-15 16:34:53","1","2073","<p>I have a class which extends AsyncTask, which is intended to serve as a generic task manager class for my application.  </p><p><strong>Problem</strong>:The strange behavior is that the progress dialog shows up, but is never dismissed.  </p><ul><li><p>I am sure that onPostExecute() gets called for every task instance, as any Log.d("""","""") statements fire if placed in here, even the Toast messages show up from within this method, but I am not able to dismiss the static dialog.  </p></li><li><p>I understand that AsyncTask(s) have access to UI thread at only 2 places [onPreExecute() and onPostExecute()], so I think trying to dismiss the dialog in runOnUiThread() is unnecessary.  </p></li><li><p>All calls to executeTask() are made from different onCreate() methods of different activities that need to fetch some data over network before populating some of their UI elements, and I always pass the current activity's context to the tasks.  </p></li><li><p>As I do not switch activities until after the related tasks are completed, I believe the activity context objects are still valid (am I wrong to have assumed this???) I have never found any of them to be null while debugging.  </p></li><li><p>Could this be a timing issue? I have also observed that most of the times DDMS shows all tasks get completed <strong>before</strong> the activity is displayed. If I use <code>new Handler().postDelayed(runnable_which_calls_these_tasks,10);</code> in the onCreate(), and add delaying code in foo_X(), the activities are displayed without any delay, but the dialog will just not dismiss(). </p></li></ul><p>I have read through quite a number of articles on this issue but am still not able to figure out exactly where am I going wrong. I do not want to define each task as <code>private inner class Task1 extends AsyncTask&lt;&gt;</code>  in all of my activity classes and I would not want to (unless this is the only solution) load my application object with all activity references either as mentioned in this discussion: <a href=""http://stackoverflow.com/questions/3357477/is-asynctask-really-massively-flawed-or-am-i-just-missing-something"">Is AsyncTask really massively flawed or am I just missing something?</a>. </p><p>I have spent a week on this and am absolutely clueless :( It would be great if someone can guide me, and let me know what am I missing.<br>Following is the class definition: [I've removed some irrelevant application specific code for clarity]</p><pre><code>public class NetworkTask extends AsyncTask&lt;Void, Integer, Boolean&gt; {  private  Context UIcontext;  private int operationType;  private static ProgressDialog dialog;private static int taskCount;private NetworkTask(int operationType Context context){      this.UIcontext = context;     this.operationType = operationType;    if (taskCount++ == 0)          dialog = ProgressDialog.show(context,"""",""Loading..."");}  public static Boolean executeTask(int operationType, Context context) {    return new NetworkTask(operationType, context).execute().get(); }@Override  protected void onPreExecute(){      super.onPreExecute();      if (taskCount == 1)          dialog.show();  }  @Overrideprotected Boolean doInBackground(Void... arg0) {  switch(operationType){      case TYPE_1:          foo1();          break;      case TYPE_2:          foo2();          break;      case TYPE_3:          foo3();          break;      case TYPE_4:          foo4();          break;  }  @Overrideprotected void onPostExecute(Boolean result) {    super.onPostExecute(result);    taskCount--;    if (dialog.isShowing() &amp;&amp; taskCount == 0){            dialog.dismiss();    }else {        Toast.makeText(UIcontext, ""Task#""+ operationType+"", m done, but there are ""+taskCount+"" more"", 5).show();    }}</code></pre><p>}</p>","508496","","508496","","2010-11-15 18:17:59","2010-11-15 23:31:14","onPostExecute() gets called but it wont dismiss my dialog","<android><android-asynctask><progressdialog>","1","0","1","",""
"4186615","1","","","2010-11-15 16:37:59","1","1945","<p>I'm developing an Android application for the Droid Incredible.  When I plug in my headphones, an icon appears on the status bar, so I presume the phone must know headphones are present.</p><p>My code produces beeps in response to various user inputs, but I discovered today that's a REALLY BAD idea when the user is wearing headphones.   Ow.</p><p>Does anybody have suggestions for how I can detect the presence of headphones programmatically, in Android??</p><p>Thanks,R.</p>","453989","","453989","","2010-11-16 14:09:19","2010-11-16 14:09:19","Droid Incredible Headphones Detection","<android><headphones>","2","0","","",""
"4186721","1","","","2010-11-15 16:47:25","1","299","<p>i would like to create an Android app that shows the map of the United States with annotations in different cities; when i zoom in a zone i would like to see annotations in single places (e.g. i see NewYork:10 pictures, then i zoom in NY and i see 6 annotations in Central Park and 4 in 5th.avenue, for example). Has anyone already made a similar thing (like in iPhone Photo application and/or an earthquake sample shown on the web using JS GoogleMaps ?)</p><p>Thanks in advance and greetings ! c.</p>","339500","","339500","","2010-11-16 13:21:01","2010-11-16 13:21:01","Android MapView: how to show grouped annotations?","<android>","0","0","","",""
"4186864","1","4188823","","2010-11-15 17:01:09","1","828","<p>within a public class that doesn't extend any other class I'm doing some evaluation stuff and I would like to return a Dialog if something needs to be communicated to the user.</p><p>I'm using an AsyncTask to run a method of an instance of this class from the main ui:</p><pre><code>private OnlineActivities onlineActivities = new OnlineActivities();new DoOnlineActivity().execute(getApplicationContext());private class DoOnlineStuff extends AsyncTask&lt;Context, Integer, Dialog&gt; {    @Override    protected Dialog doInBackground(Context... params) {        return onlineActivities.start(params[0]);    }    @Override    protected void onProgressUpdate(Integer... progress) {        Log.v(RuntimeVars.getMyName(), ""AsyncOnlineTask in progess"");    }    @Override    protected void onPostExecute(Dialog result) {        if (result != null)            result.show();    }}</code></pre><p>Now, the <code>public Dialog start()</code> method of <code>OnlineActivities.java</code> creates a dialog using the Context that was assigned via it's parameter.</p><p>When the Dialog is returned to <code>onPostExecute</code> I receive the following exception</p><pre><code>11-14 23:53:43.303: ERROR/AndroidRuntime(1320): FATAL EXCEPTION: main11-14 23:53:43.303: ERROR/AndroidRuntime(1320): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at android.view.ViewRoot.setView(ViewRoot.java:509)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at android.app.Dialog.show(Dialog.java:241)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at info.myProject.messaging.ConversationList$DoOnlineActivity.onPostExecute(ConversationList.java:245)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at info.myProject.messaging.ConversationList$DoOnlineActivity.onPostExecute(ConversationList.java:1)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at android.os.AsyncTask.finish(AsyncTask.java:417)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at android.os.AsyncTask.access$300(AsyncTask.java:127)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at android.os.Handler.dispatchMessage(Handler.java:99)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at android.os.Looper.loop(Looper.java:123)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at java.lang.reflect.Method.invokeNative(Native Method)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at java.lang.reflect.Method.invoke(Method.java:521)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-14 23:53:43.303: ERROR/AndroidRuntime(1320):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I suppose I cannot use the context like this. But what would be the alternative? How can I outsource some basic stuff I always need to do, even some general Dialogs? </p><p>Do I need to use custom intents instead?</p><p>Thanks for your help!</p><p>Best regards<br>S.</p>","419501","","","","","2010-11-15 21:30:19","How to return AlertDialogs from a generic class in Android?","<android><context><alertdialog>","2","0","","",""
"4186915","1","4186945","","2010-11-15 17:05:57","0","3760","<p>I cant get this to work anymore</p><p>Here is my code:</p><pre><code>ImageView jpgView = (ImageView)findViewById(R.id.ImageView01);    String myJpgPath = ""/sdcard/pic.jpg"";                  jpgView.setVisibility(View.VISIBLE);    //jpgView.setScaleType(ImageView.ScaleType.FIT_CENTER);    jpgView.setAdjustViewBounds(true);  BitmapFactory.Options options = new BitmapFactory.Options();    options.inSampleSize = 2;  Bitmap bm = BitmapFactory.decodeFile(myJpgPath, options);  jpgView.setImageBitmap(bm);</code></pre><p>Can anyone help?</p>","377613","","","","","2012-11-23 01:17:41","Display jpg from sdcard android","<java><android>","2","2","","",""
"4186970","1","","","2010-11-15 17:12:17","2","405","<p>the UI i want is like below:</p><pre>------------------------------+head|btn1|btn2|btn2           |  -------------------------------Content                       |Content                       |                              |                              |                              |                              |                              |                              |                              |                              |                              |                              |------------------------------|foot|btn3|btn4|btn5           |------------------------------|</pre><p>Anyone know how to design xml for this ui?</p>","441165","","13070","","2010-11-15 17:15:19","2010-11-15 18:01:18","How to make a simpe UI for android?","<android><user-interface>","2","1","","",""
"4187012","1","4314086","","2010-11-15 17:17:07","4","2718","<p>This does not refer to anywhere in my code at all.  How do I go about getting to the bottom of it?</p><pre><code>java.lang.NullPointerExceptionat com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42)at com.google.android.maps.MapView.onDraw(MapView.java:494)at android.view.View.draw(View.java:6739)at android.view.ViewGroup.drawChild(ViewGroup.java:1648)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)at android.view.ViewGroup.drawChild(ViewGroup.java:1646)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)at android.view.View.draw(View.java:6742)at android.widget.FrameLayout.draw(FrameLayout.java:352)at android.view.ViewGroup.drawChild(ViewGroup.java:1648)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)at android.view.View.draw(View.java:6742)at android.widget.FrameLayout.draw(FrameLayout.java:352)at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1872)at android.view.ViewRoot.draw(ViewRoot.java:1422)at android.view.ViewRoot.performTraversals(ViewRoot.java:1167)at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:144)at android.app.ActivityThread.main(ActivityThread.java:4937)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Here is the draw method of the ItemizedOverlay</p><pre><code>public void draw(Canvas canvas, MapView mapView, boolean shadow) {            try {            super.draw(canvas, mapView, false);            if (getMainOverlayArray().size() != 0){            pfOverlayItem tempOver = null;            for (int i = 0; i &lt; getMainOverlayArray().size(); i++) {                tempOver = getMainOverlayArray().get(i);            boolean isMatch = false;            if (tempOver.getTitle().equals(selectedName))            {                isMatch = true;            }            if (isMatch){            Projection projection = mapView.getProjection();            Point point = new Point();            projection.toPixels(tempOver.getPoint(), point);            Paint background = new Paint();            background.setColor(Color.WHITE);            background.setAlpha(150);            RectF rect = new RectF();            rect.set(point.x - 55, point.y +15,                    point.x + 100, point.y + 65);            canvas.drawRoundRect(rect, 5, 5, background);            Paint text = new Paint();            text.setAntiAlias(true);            text.setColor(Color.BLUE);            text.setTextSize(14);            text.setTypeface(Typeface.MONOSPACE);            canvas.drawText(tempOver.getTitle() , point.x -50 , point.y + 30, text);            canvas.drawText(tempOver.getTypeTextOut(), point.x -50 , point.y + 45, text);            canvas.drawText(tempOver.getdestination(), point.x -50 , point.y + 60, text);            }            }            }            }catch (Exception e){                Log.e(""Error"", ""Problem drawing view"", e);                e.printStackTrace();            }        }</code></pre><p>I now print out the stacktrace and no difference! :-(</p><p>Does anyone have any ideas that could help get to the bottom of this?</p><p><strong>EDIT - Latest code 28/11 FULL CLASS</strong></p><pre><code>    private class SitesOverlay extends ItemizedOverlay&lt;pfOverlayItem&gt; {        private List&lt;pfOverlayItem&gt; items = new ArrayList&lt;pfOverlayItem&gt;();        private PopupPanel panel=new PopupPanel(R.layout.popup);        private MapLocation selectedMapLocation;          private static final int CIRCLERADIUS = 2;        private ArrayList&lt;pfOverlayItem&gt; mOverlays = new ArrayList&lt;pfOverlayItem&gt;();        public SitesOverlay() {            super(null);            //super(boundCenter(defaultMarker));            //items = getMainOverlayArray();            //items = mOverlays;            populate();        }public void finishedLoading(){    populate();}        @Override        protected pfOverlayItem createItem(int i) {            // Log.i(""CREATE"",""MARKER"");            return (items.get(i));        }        public void addItem(OverlayItem overlay) {            overlay.setMarker(boundCenter(overlay.getMarker(0)));            items.add((pfOverlayItem) overlay);            //populate();        }        public void clearItems(){            runOnUiThread(new Runnable() {                public void run() {                    items.clear();                    myMapView.invalidate();                }            });        }        public void clear() {            mOverlays.clear();            myMapView.removeAllViews();            //numItems = 0;            // Workaround for another bug with this class:            // http://groups.google.com/group/android-developers/browse_thread/thread/38b11314e34714c3            setLastFocusedIndex(-1);            populate();        }        @Override        public void draw(Canvas canvas, MapView mapView, boolean shadow) {            super.draw(canvas, mapView, false);            try {            if (getMainOverlayArray().size() != 0){            pfOverlayItem tempOver = null;            for (int i = 0; i &lt; getMainOverlayArray().size(); i++) {                tempOver = getMainOverlayArray().get(i);            boolean isMatch = false;            //Log.i(""Selected Name"",selectedName);            if (tempOver.getTitle().equals(selectedName))            {                isMatch = true;            }            if (isMatch){            Projection projection = mapView.getProjection();            Point point = new Point();            projection.toPixels(tempOver.getPoint(), point);            Paint background = new Paint();            background.setColor(Color.WHITE);            background.setAlpha(150);            RectF rect = new RectF();            rect.set(point.x - 50, point.y +15,                    point.x + 90, point.y + 50);            canvas.drawRoundRect(rect, 5, 5, background);            Paint text = new Paint();            text.setAntiAlias(true);            text.setColor(Color.BLUE);            text.setTextSize(14);            text.setTypeface(Typeface.MONOSPACE);            //canvas.drawRoundRect(rect, 2, 2, background);            canvas.drawText(tempOver.getTitle() + "" "" + tempOver.getcallsign(), point.x -50 , point.y + 30, text);            canvas.drawText(tempOver.getdestination() + "" "" + tempOver.getdraft(), point.x -50 , point.y + 45, text);            }            }            }            }catch (Exception e){                Log.e(""Error"", ""Problem drawing view"", e);                 e.printStackTrace();            }        }        @Override        protected boolean onTap(int i) {            pfOverlayItem item = getItem(i);            if (selectedName.equals(item.getTitle())){                //Toast.makeText(PlaneFinderMain.this, ""SECOND MOFO PRESS"", 3000).show();                try{                    Intent myIntent = new Intent(PlaneFinderMain.this, DetailActivity.class);                myIntent.putExtra( ""int"", i);                myIntent.putExtra( ""string"", selectedName );                PlaneFinderMain.this.startActivity(myIntent);                }catch (Exception e){                    Log.e(""Error"", ""Cannot launch"", e);                }            }            currentadshex = item.getmmsi();            new GetRouteTask(item.getmmsi()).execute();            selectedItem = i;            selectedName = item.getTitle();            selectedPlanePoint = item.getPoint();            GeoPoint geo=item.getPoint();            Point pt=myMapView.getProjection().toPixels(geo, null);            View view=panel.getView();            ((TextView)view.findViewById(R.id.reg)).setText(item.getTitle());            ((TextView)view.findViewById(R.id.flightno)).setText(item.getcallsign());            ((TextView)view.findViewById(R.id.route)).setText(item.getdestination());            ((TextView)view.findViewById(R.id.height)).setText(item.getdraft());            return (true);        }        @Override        public boolean onTouchEvent(MotionEvent event, MapView mapView) {             if (event.getAction() == MotionEvent.ACTION_DOWN){                 if (selectedPlanePoint != null){                     Projection projection = mapView.getProjection();                     Point point = new Point();                     projection.toPixels(selectedPlanePoint, point);                     Point pointHit = new Point();                     pointHit.x=(int)event.getX();                     pointHit.y=(int)event.getY();                     if ((point.x - pointHit.x) &gt;-100 &amp;&amp; (point.x - pointHit.x) &lt;70  &amp;&amp; (point.y - pointHit.y) &lt; -25  &amp;&amp; (point.y - pointHit.y) &gt; -95){                            try{                                     Intent myIntent = new Intent(PlaneFinderMain.this, DetailActivity.class);                                    myIntent.putExtra( ""int"", selectedItem);                                    myIntent.putExtra( ""string"", selectedName );                                    PlaneFinderMain.this.startActivity(myIntent);                                }catch (Exception e){                                    Log.e(""Error"", ""Cannot launch"", e);                                }                     }else{                     }                 }             }            return false;        }        @Override        public int size() {            return (items.size());        }        public void addOverlay(OverlayItem o){            setLastFocusedIndex(-1);            populate();        }    }</code></pre>","103999","","103999","","2010-11-28 15:46:27","2013-11-20 12:43:06","Android Maps NullPointerException ItemizedOverlay","<android><debugging><overlay><nullpointerexception>","2","14","","",""
"4187025","1","4194427","","2010-11-15 17:18:47","1","818","<p>I am using SmsManager to send text messages from my application. The code snippet is</p><pre><code>smsManager.sendTextMessage(number, null, content, null, null);</code></pre><p>For messages with less than 160 characters. And for multipart messages I use,</p><pre><code>ArrayList&lt;String&gt; parts = smsManager.divideMessage(content);sMan.sendMultipartTextMessage(number, null, parts, null, null);</code></pre><p>These statements cause The process com.android.phone has stopped unexpectedly please try again in a random fashion. I don't understand what's going on.</p><p>This is the stack trace I got:</p><pre><code>java.lang.NullPointerExceptionE/AndroidRuntime( 1143):    at com.android.internal.telephony.SMSDispatcher.handleSendComplete(SMSDispatcher.java:741)E/AndroidRuntime( 1143):    at com.android.internal.telephony.SMSDispatcher.handleMessage(SMSDispatcher.java:407)E/AndroidRuntime( 1143):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 1143):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 1143):    at android.app.ActivityThread.main(ActivityThread.java:4603)E/AndroidRuntime( 1143):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 1143):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 1143):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime( 1143):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime( 1143):    at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Any pointers will be greatly appreciated.</p>","421372","","421372","","2010-11-15 17:40:45","2010-11-16 13:07:40","SmsManager causes com.android.phone force closes randomly","<android><text><sms>","1","0","1","",""
"4187083","1","4209508","","2010-11-15 17:24:43","0","394","<p>i am making an android APP, and i need to have a submenu, permanent, same menu in all my windows. This menu haves the navegability between the parts of my app, (googlemap view, invite, config and tabhost with listviews)</p><p>i can do a menu that only changes the superior part of the window? i mean, like html frames</p><p>how i can do it?</p><p>thanks</p>","479886","","","","","2010-11-17 21:51:03","It is possible to add a permanent sub-menu in the down part of my app??? (like html frame style menu)","<android><menu>","1","2","","",""
"4187101","1","4187269","","2010-11-15 17:25:41","0","1881","<p>I know there is the Date() class built into the API, but what line of code actually grabs the time of day?</p>","496686","","267702","","2014-04-01 01:45:48","2014-04-01 01:45:48","How can I check the current time on a droid device and put that into an integer?","<android><date><time><integer>","3","0","","",""
"4187242","1","4196865","","2010-11-15 17:42:26","6","8825","<p>it seems android calendar api is not available. can you please give me some tips and tricks for creating a similar thing.just like creating events,meeting, birthday etc.. and also notification when the event occurs. and also layout should be similar to-our in-built calendar give me some ideas or hint about look and logic?</p>","430652","","430652","","2010-11-21 09:27:39","2010-11-21 09:27:39","how to create full functionality of calendar in android?","<android><api><layout><calendar>","1","6","6","",""
"4187249","1","","","2010-11-15 17:43:02","7","1029","<p>Using the the Geo Fix command to set the virtual device's location in the Android Emulator works properly for the Maps application.  However, when I attempt to view my current location in Google Maps in the virtual device's browser, I receive the ""Your location could not be determined"" error.  Does the Geo Fix command not support the W3C geolocation standard or am I missing something? </p>","508570","","","","","2012-05-10 05:57:31","Geo Fix Not Setting Browser Location in Android Emulator","<android><geolocation><android-emulator>","1","2","","",""
"4187476","1","","","2010-11-15 18:11:05","1","491","<p>I have a custom <code>ContentProvider</code> class, which I originally developed in the same project file with the application using it. However since this application is intended to be only one of many users of the <code>ContentProvider</code>, I want to split it in a different project. The code is being developed on the Android PDK, but future clients might be developed on the SDK (on a custom SDK, or SDK plugin, etc).</p><p>The problem I'm facing, is about the constants in the <code>ContentProvider</code> class, e.g. CONTENT_URI, column names and as well some constants which are used to interpret the values returned from queries. These of course cannot be accessed from another project. It seems to me I have 3 options at this point:</p><p>1) Ignore the problem, and type in the values directly in the user application code. This however makes accessing the <code>ContentProvider</code> uglier. I would have to change some columns, to encode some columns with strings instead of integers, to keep the code maintainable. </p><p>2) Put the constants in a separate class, and include a full copy in applications using the <code>ContentProvider</code>. I'm not a fan of duplicating code though. Keeping a duplicate of this code in each target app, will make some things slightly more annoying to maintain.</p><p>3) Abuse the fact that I'm developing on the PDK, and expose a platform library, as described in <code>vendor/sample/frameworks/PlatformLibrary</code>. However, platform libraries don't have a manifest file, which if my understanding is correct means that I can't include a <code>ContentProvider</code>. This means I would need one ""normal"" project for the <code>ContactProvider</code>, and a separate one just to expose the class with the constant values. This feels so much wrong.</p><p>The answer at <a href=""http://stackoverflow.com/questions/2277202/class-structure-for-a-contentprovider-having-multiple-sub-tables"">Class structure for a ContentProvider having multiple sub tables</a> seems to imply option (1), which probably looks like the best option right now.</p><p>However, maybe I have missed another, neat &amp; tidy, way to do this? Keeping in mind that I am developing on the PDK, I would certainly like my <code>ContentProvider</code> to be usable in the same manner as stock Google providers.</p>","508540","","","","","2011-08-25 08:31:22","Is there a ""proper"" way to keep a content provider implementation seperate from it's users?","<android><android-contentprovider>","1","0","","",""
"4187483","1","4187551","","2010-11-15 18:12:29","1","5324","<p>Hey - is there a way to use the System.currentTimeMillis(); to have convery that number into a basic output HH:MM in droid?</p><p>I am using the sample code:</p><pre><code>    Toast.makeText(this,            String.valueOf(System.currentTimeMillis()),            Toast.LENGTH_LONG).show();</code></pre><p>That outputs the current time in MS since the epoch.  There has got to be a better way to do this rather than convert that large number and display the current time right?</p>","496686","","426429","","2010-11-15 19:56:26","2010-11-15 19:56:26","Converting System.currentTimeMillis() into the current, readable time","<java><android><time><system>","1","0","","",""
"4187490","1","","","2010-11-15 18:13:21","0","2186","<p>I want to resize an image, either increasing or decreasing its dimensions, in my Android application.</p><p>This is the code I have so far...</p><pre><code>Bitmap scratch = BitmapFactory.decodeResource (getResources (), R.drawable.skalyzmn);canvas.drawBitmap (image, x, y, null);</code></pre><p>Is this the correct way to resize an image? How do I progress part this stage to perform the actual resizing?</p>","500067","","1268895","","2012-04-19 16:25:07","2014-01-29 11:06:33","Change the image dimensions","<java><android><image><canvas><size>","1","0","","",""
"4187631","1","4570206","","2010-11-15 18:35:35","2","4950","<p>I'm trying to create a database that contains mock objects for testing purposes.  I'd prefer to have this db reside in my test package instead of in my application package.</p><pre><code>protected class MockObjectOpenHelper extends SQLiteOpenHelper {    MockObjectOpenHelper() {        super(instrumentation.getContext(), FILE_NAME, null, DATABASE_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db) {        ...    }}</code></pre><p>When I create my SQLiteOpenHelper from within my app, I pass in the instrumentation context as well as a path that's relative to my test package's database directory.  I would think this would allow me to create a database in my test package, but this doesn't seem to be the case.  The ""databases"" directory is never created in my test package.</p><p>Is there a way to have my app create and access a database that resides in my test project?</p><p>The exception:</p><pre><code>14:50:13.917 pool-1-thread-1 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.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:659)at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:652)at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:482)at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)at com.myapp.test.http.DbMockHttpClient.createClientRequestDirector(DbMockHttpClient.java:52)at com.myapp.test.http.UniversalMockHttpClient.createClientRequestDirector(UniversalMockHttpClient.java:42)at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:539)at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)E</code></pre>","82156","","82156","","2010-11-15 22:52:59","2012-01-18 06:23:01","""Unable to open database file"" when using SQLiteOpenHelper with instrumentation context","<android><sqlite>","2","0","1","",""
"4187637","1","4187714","","2010-11-15 18:36:41","1","9473","<p>I'm having trouble switching views with button presses in my Android app. The code shows no errors in Eclipse, but the app quits unexpectedly in the emulator when the button is clicked. My code is below. Thanks</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 go = (Button)findViewById(R.id.goButton);        go.setOnClickListener(mGoListener);         }    private OnClickListener mGoListener = new OnClickListener() {    public void onClick(View v) {                       Intent intent = new Intent(Intent.ACTION_VIEW);            intent.setClassName(""android.taboo.Activities"", ""android.taboo.Activities.MainMenu"");            startActivity(intent);        }    };}public class MainMenu extends Activity{    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mainmenu);        TextView quickStart = (TextView)findViewById(R.id.quickStart);        quickStart.setOnClickListener(mQuickStartListener);        TextView gameSetup = (TextView)findViewById(R.id.gameSetup);        gameSetup.setOnClickListener(mGameSetupListener);        TextView settings = (TextView)findViewById(R.id.settings);        settings.setOnClickListener(mSettingsListener);        TextView wordEntry = (TextView)findViewById(R.id.wordEntry);        wordEntry.setOnClickListener(mWordEntryListener);    }    //Listeners for MainMenu navigation buttons    private OnClickListener mQuickStartListener = new OnClickListener() {        public void onClick(View v) {          setContentView(R.layout.quickstart);        }    };    private OnClickListener mGameSetupListener = new OnClickListener() {        public void onClick(View v) {          setContentView(R.layout.gamesetup);        }    };    private OnClickListener mSettingsListener = new OnClickListener() {        public void onClick(View v) {          setContentView(R.layout.settings);        }    };    private OnClickListener mWordEntryListener = new OnClickListener() {        public void onClick(View v) {          setContentView(R.layout.word);        }    };}</code></pre>","365491","","450827","","2012-09-29 19:59:11","2012-09-29 19:59:11","Using buttons to switch views with Android SDK","<java><android><eclipse>","1","0","","",""
"4187663","1","4187888","","2010-11-15 18:40:07","3","6435","<p>I have downloaded the <code>Layar401.apk</code> file from web and trying to install it into my android device (HTC Magic, Android 2.2). But every time I'm trying to install it its saying: </p><pre><code>adb install Layar401.apk1098 KB/s (1855698 bytes in 1.649s)    pkg: /data/local/tmp/Layar401.apkFailure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]</code></pre><p>From other posts I figured out that there might be a missing shared library of Google maps api in <code>manifest.xml</code> file. I tried to view the <code>manifest.xml</code> file and it gave me something like following:</p><pre><code>package: name='com.layar' versionCode='27' versionName='4.0.1'uses-permission:'android.permission.ACCESS_NETWORK_STATE'uses-permission:'android.permission.INTERNET'uses-permission:'android.permission.ACCESS_COARSE_LOCATION'uses-permission:'android.permission.ACCESS_COARSE_UPDATES'uses-permission:'android.permission.ACCESS_FINE_LOCATION'uses-permission:'android.permission.ACCESS_WIFI_STATE'uses-permission:'android.permission.CAMERA'uses-permission:'android.permission.WAKE_LOCK'uses-permission:'android.permission.READ_PHONE_STATE'uses-permission:'android.permission.VIBRATE'uses-permission:'android.permission.WRITE_EXTERNAL_STORAGE'application: label='Layar' icon='res/drawable/icon.png'uses-library:'com.google.android.maps'launchable activity name='com.layar.Main'label='Layar' icon=''sdkVersion:'3'targetSdkVersion:'4'uses-feature:'android.hardware.camera'mainother-activitiesother-receiverssupports-screens: 'small' 'normal' 'large'locales: '--_--' 'ja' 'de' 'he' 'sk' 'el' 'nl' 'ko' 'fr' 'tr' 'es' 'it' 'pt' 'hu' 'ru' 'sv' 'fr_CA' 'zh_HK' 'zh_CN' 'pt_BR' 'es_US' 'zh_TW'densities: '120' '160' '240'</code></pre><p>But here it says library includes google maps api as well. So I'm not sure why I'm not able to install this apk file.</p><p>Any sort of help will be appreciated.</p><p>Thanks.</p>","400859","","1195594","","2013-01-02 13:26:32","2013-01-02 13:26:32","getting Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY] while trying to install Layar401.apk","<android>","2","0","","",""
"4187673","1","4713487","","2010-11-15 18:41:09","15","15066","<p>I'm trying to create a popup window that only appears the first time the application starts. I want it to display some text and have a button to close the popup. However, I'm having troubles getting the PopupWindow to even work. I've tried two different ways of doing it:</p><p>First I have an XML file which declares the layout of the popup called popup.xml (a textview inside a linearlayout) and I've added this in the OnCreate() of my main Activity:</p><pre><code>PopupWindow pw = new PopupWindow(findViewById(R.id.popup), 100, 100, true);    pw.showAtLocation(findViewById(R.id.main), Gravity.CENTER, 0, 0);</code></pre><p>Second I did the exact same with this code:</p><pre><code>final LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    PopupWindow pw = new PopupWindow(inflater.inflate(R.layout.popup, (ViewGroup) findViewById(R.layout.main) ), 100, 100, true);    pw.showAtLocation(findViewById(R.id.main_page_layout), Gravity.CENTER, 0, 0);</code></pre><p>The first throws a NullPointerException and the second throws a BadTokenException and says ""Unable to add window -- token null is not valid""</p><p>What in the world am I doing wrong? I'm extremely novice so please bear with me.</p>","431327","","431327","","2010-11-18 04:58:28","2013-07-21 08:02:38","Problems creating a Popup Window in Android Activity","<android><popupwindow>","6","0","6","",""
"4187696","1","","","2010-11-15 18:44:47","2","1137","<p>I'd like to know a bit more about what is the vspace memory exactly. Running out of vspace memory when loading a lib for our android games often occurs as we tend to take as much ram as we can at the application startup. I haven't been able to find any information about it.</p><p>Here`s the error message I get:</p><pre><code>11-11 16:00:57.057: ERROR/libEGL(946): load_driver(/system/lib/egl/libEGL_adreno200.so): Cannot load library: alloc_mem_region[847]: OOPS:    64 cannot map library 'libEGL_adreno200.so'. **no vspace available**.</code></pre><p>What exactly is vspace memory?</p><p>Some links / info about android / linux memory model would be appreciated too!</p><p>Thanks!</p>","508620","","81398","","2011-06-09 13:06:50","2013-08-05 20:53:35","Android ""vspace"" memory?","<android><memory-allocation>","1","4","3","",""
"4187726","1","","","2010-11-15 18:48:25","1","293","<p>I'm currently making a game for Android and it's all nice and working, but during my game sometimes errors pop up about other apps (like Twitter/Facebook or some HTC Sense related processes) not responding.</p><p>Am I doing something wrong with my game that those apps don't get enough CPU or RAM or what could that be?</p><p>Hints are highly appreciated, as I don't want my players to be disturbed by this.</p><p>Thanks!</p>","387873","","","","","2010-11-15 18:48:25","Getting ""not responding"" errors from other apps while playing my game","<android>","0","3","1","",""
"4187750","1","","","2010-11-15 18:51:42","0","2290","<p>I keep getting this exception in LogCat</p><p>Failed to find provider info for android.server.provider.checkin</p><p>The android dev reference seems to have no info on this at all, I have however seen some vague reference's to a provider tag and an authorities attribute relating to a getType method???</p><p>I have a getBytes() method but that is all. Anyway, I added one to the manifest like so:</p><p><strong>         android:enabled=""true""></strong> </p><p>Eclipse complains about this, says its looking for missing required attribute name, what required attribute name, Android's dev reference does not say. Does anyone have an example of how thing is supposed to be setup. I ma not sure if I am even on the right track here...</p><p>ThanksRick</p>","508635","","","","","2012-02-17 00:58:56","Failed to find provider info for android.server.provider.checkin error","<android><xml>","1","2","1","",""
"4187960","1","4217754","","2010-11-15 19:18:47","24","26824","<p>I have the following code</p><pre><code>class OverlayTask extends AsyncTask&lt;Void, Void, Void&gt; {    @Override    public void onPreExecute() {        if (sites != null) {            myMapView.getOverlays().remove(sites);            myMapView.invalidate();            sites = null;        }    }    @Override    public Void doInBackground(Void... unused) {            grabShipsWithLocation();            return (null);    }    @Override    public void onPostExecute(Void unused) {        myMapView.getOverlays().add(sites);        myMapView.invalidate();        isLoading = false;    }}</code></pre><p>That seems to work fine on a few test devices but I am seeing a lot of errors appearing on the dev console.  I can't seem to work out why and where to put this Looper.prepare().  Is it needed?</p><pre><code>java.lang.ExceptionInInitializerErrorat com.test.appname.FinderMain$1.gotLocation(FinderMain.java:286)at com.test.appname.MyLocation$GetLastLocation.run(MyLocation.java:89)at java.util.Timer$TimerImpl.run(Timer.java:289)Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()at android.os.Handler.&lt;init&gt;(Handler.java:121)at android.os.AsyncTask$InternalHandler.&lt;init&gt;(AsyncTask.java:421)at android.os.AsyncTask$InternalHandler.&lt;init&gt;(AsyncTask.java:421)at android.os.AsyncTask.&lt;clinit&gt;(AsyncTask.java:152)</code></pre><p>As requested MyLocation.java</p><pre><code>    class GetLastLocation extends TimerTask {    @Override    public void run() {         lm.removeUpdates(locationListenerGps);         lm.removeUpdates(locationListenerNetwork);         Location net_loc=null, gps_loc=null;         if(gps_enabled)             gps_loc=lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);         if(network_enabled)             net_loc=lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);         //if there are both values use the latest one         if(gps_loc!=null &amp;&amp; net_loc!=null){             if(gps_loc.getTime()&gt;net_loc.getTime())                 locationResult.gotLocation(gps_loc);             else                 locationResult.gotLocation(net_loc);             return;         }         if(gps_loc!=null){             locationResult.gotLocation(gps_loc); //Line 89             return;         }         if(net_loc!=null){             locationResult.gotLocation(net_loc);             return;         }         locationResult.gotLocation(null);    }}</code></pre>","103999","","103999","","2010-11-15 21:03:12","2011-03-13 16:26:45","AsyncTask and Looper.prepare() error","<android><android-asynctask><looper>","2","5","14","",""
"4188003","1","","","2010-11-15 19:23:10","0","164","<p>I honestly could not think of a good title. Sorry. Anyway, so I have an app that I am making where I pull information from my custom web api. I pull data from the api and fill in the layout with this information. Problem is it takes a while so the app stalls for a few seconds before the information is pulled since it is in the onCreate method of the activity. To resolve this I implemented a loading dialog. This is where the problems began. I put the http requests into a seperate thread and it downloads fine. No problem. However it keeps force closing every time I try to modify the layout afterward. So basically my question is how do I modify the layout after the background thread is finished? Everything I try keeps force closing the app.</p>","114650","","","","","2010-11-15 19:26:19","App keeps dying after http request results are put into layout","<android><multithreading><http><request>","1","1","","",""
"4188025","1","4192903","","2010-11-15 19:25:53","3","3622","<p>I'm writing on a custom view in android. It uses some png's, provided as resources in the drawable-folder (I put it in all of the drawable folders now, just to make sure) of my project.</p><p>Unfortunately, when I startup the app, I get a force close and the last thing the log says is: <code>""WARN/ResourceType(261): Resources don't contain package for resource number 0x7f020002""</code> (The Hex-Number is the first icon I intend to load).</p><p>Now for the curious thing: The graphical layout-editor of the eclipse adt plugin has no problems whatsoever loading an displaying the icons in its design view. It's only when I start up the actual app (emulator or actual cellphone), that android can't find the resources.</p><p>I tried cleaning the project and refreshing the file structure. That didn't quite work out -.-</p><p>EDIT: I just realized that I can't even load a string resource. The problem seems to exist for all resources. Do I have to do something, before the resources become available?</p><p>Hope someone can help me,</p><p>thx in advance</p>","337591","","337591","","2010-11-16 09:38:47","2012-07-01 15:46:21","Android: Resources don't contain package for resource number 0x","<java><android><eclipse><resources><adt>","3","6","1","",""
"4188168","1","4193403","","2010-11-15 19:43:51","3","6020","<p>How do you adjust the font size of an Android <code>WebView</code>? The following appears to have no effect:</p><pre><code>private void fontSizePlus() {    fontSize = (fontSize &lt; FONT_SIZE_MAX) ? fontSize + FONT_SIZE_INCREMENT : fontSize;    this.changeFontSize(fontSize);}private void fontSizeMinus() {    fontSize = (fontSize &gt; FONT_SIZE_MIN) ? fontSize - FONT_SIZE_INCREMENT : fontSize;    this.changeFontSize(fontSize);}private void changeFontSize(int value) {    String js = ""document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '"" + value + ""%';"";    mWebView.loadUrl(""javascript:(function() { "" + js +  "" })()"");  }</code></pre><p>Where the <code>WebView</code> and constants have been initialized as follows:</p><pre><code>private final static int FONT_SIZE_DEFAULT = 100;private final static int FONT_SIZE_MIN = 50;private final static int FONT_SIZE_MAX = 150;private final static int FONT_SIZE_INCREMENT = 5;private int fontSize = FONT_SIZE_DEFAULT;private WebView mWebView;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.index);    mWebView = (WebView) findViewById(R.id.webview);    mWebView.getSettings().setJavaScriptEnabled(true);    mWebView.loadUrl(""file:///android_asset/index.htm"");}</code></pre>","143378","","143378","","2010-11-15 20:06:42","2012-07-19 05:51:08","Adjust font size of Android WebView","<javascript><android><webkit><webview><font-size>","3","0","4","",""
"4188247","1","4188352","","2010-11-15 19:55:22","0","1621","<p>I want to bind data from an xml file? how can I do that where i'm using a layout xml file to define a scrollview ??</p>","508377","","","","","2010-11-15 20:30:57","how to fill in scroll view from file or database or any data source?","<android>","1","0","","",""
"4188250","1","","","2010-11-15 19:55:50","11","7060","<p>I have an Android code base which uses APIs with settings to get different data for several apps. All apps use the same code base but with one or two design tweaks. So how do I re-use the main code base without having to copy the whole Android project each time?</p><p>iPhone uses multiple targets in the same project which works well. If android cant do this do I need to compile binaries of the code base in one project and then import into each new app project? If so how? I'm using Eclipse and am an intermediate Java developer.</p><p>Any help much appreciated!</p><p>Doug</p>","508690","","","","","2013-11-26 16:52:45","How to create multiple Android apps from one code base","<android><eclipse>","5","1","","",""
"4188360","1","4188382","","2010-11-15 20:08:54","0","440","<p>Super easy, I am sure - but in conditional if/then statements using droid, how do I go about using them with integers, ie:</p><pre><code>int currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);public void getResult(int currentHour, Intent intent) {    if (currentHour &lt; 14) then:        //do something}</code></pre><p>I know this isn't the right way to do it, but I am having a brain fart as to comparing ints...thanks!</p>","496686","","232593","","2010-11-15 20:11:57","2010-11-15 20:12:10","if/then conditional statements using ints","<integer><if-statement><conditional><android>","2","0","","",""
"4188417","1","4189952","","2010-11-15 20:17:26","2","4983","<p>Is it possible to determine the unique bluetooth MAC address for an iPhone and an Android (and to a lesser extent, other smartphones) from within an app on said device?  Is my assumption that the MAC address is universally unique correct?</p><p>A general yes or no would be helpful.  Example code in the case of an iPhone or an Android would be extremely helpful.</p>","348056","","348056","","2010-11-15 23:16:53","2012-01-14 18:51:04","Determining unique Bluetooth MAC address for iPhone and Android","<iphone><android><bluetooth><symbian><smartphone>","2","1","","",""
"4188536","1","","","2010-11-15 20:32:10","0","89","<p>How do I go about writing text to an ImageView in a class?</p><p>SO, if I am in the main class, using an Intent, I have this:</p><p>setContentView(R.layout.result);if (currentHour > 8 &amp;&amp; currentHour &lt; 22) {  //Write formatted text into a textbox in the ImageView</p><p>Is there a simple line of code for that?</p><p>Thanks!</p>","496686","","21234","","2010-11-15 21:12:52","2011-06-23 08:47:59","Writing to an ImageView in code with Droid","<android><class><testing><imageview>","1","1","","",""
"4188539","1","4209423","","2010-11-15 20:32:17","0","105","<p>My employer wants to sign up to release applications through the Android Market, but they don't like item 15.7 in the Terms of Use.</p><p><a href=""http://www.android.com/us/developer-distribution-agreement.html"" rel=""nofollow"">http://www.android.com/us/developer-distribution-agreement.html</a></p><blockquote>  <p>15.7 This Agreement, and your relationship with Google under this Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. </p></blockquote><p>They want me to contact Google and determine whether or not the Terms can be modified so that ""the State of California"" is replaced with ""the Commonwealth of Virginia"" and ""Santa Clara, California"" is replaced with our city.</p><p>Even if the answer is ""No"", I'm supposed to document the effort and communication, so I can't just tell them that it is extremely unlikely.</p><p>Does anyone here know if it's possible and/or who I can contact at Google to ask?</p>","24246","","","","","2010-11-17 21:39:37","Is it possible to amend the Android Market Terms of Use?","<android><terms-of-use><amend>","1","6","","",""
"4188585","1","","","2010-11-15 20:37:21","0","450","<p>My goal is to create a custom ROM for commodity Android tablet hardware. It won't use the normal Android UI widgets, but just a simple launcher that offers a custom email app, a news app, and maybe a handful of other things. Each icon won't be small, as in the normal Android launcher, but rather a full half or quarter of the screen.</p><p>What would be the best way to go about this? Could I create a custom ROM that does nothing but start up and launch a stripped-down browser process that loads web pages from the local drive? Would that be a good option?</p><p>I'm also considering a development machine. G1s are plentiful and well-supported, as are M001s. If I had a custom ROM that worked on a test machine, what kind of work would be needed to get it working on a different hardware platform?</p><p>I appreciate any input you can offer.</p>","237171","","","","","2010-11-16 09:30:42","Entirely custom UI for an Android device","<android><user-interface><interface><tablet><rom>","1","2","1","",""
"4188637","1","","","2010-11-15 20:42:59","2","1529","<p>I'm running into a problem: when I use a non-trivial type of Spinner item, the Spinner displays the drop-down list someplace other than on the Spinner.</p><p>(Note: most of this description is identical to <a href=""http://stackoverflow.com/questions/4188443/android-doesnt-honor-selection-change-with-custom-spinner-items"">Android doesn't honor selection change with custom Spinner items?</a>, but the problem I'm reporting here is slightly different.  I've split these up so it's clear where to direct different replies to)</p><p>My goal was to have a slightly more fancy display for each item in the spinner, and so I started by creating a layout that contains several items, one of which is the target TextView (lbl2, in this case)</p><p>        </p><p>I then attempt to set up the Spinner (my eventual goal is to populate the spinner programmatically, so I'm not using resources to set this up) using:</p><pre><code>    Spinner spinner = (Spinner) findViewById(R.id.spinner);    ArrayAdapter&lt;CharSequence&gt; adapter = new ArrayAdapter&lt;CharSequence&gt;(            this, R.layout.spinner_fancy, R.id.lbl2);    adapter.add(""Item #1"");    adapter.add(""Item #2"");    adapter.add(""Item #3"");    spinner.setAdapter(adapter);</code></pre><p>When I run the program it looks (mostly) good - the Spinner is, in fact, rendering the goofy-looking multi-color, vertical layout of three textviews for each item, and it's correctly substituting Item #1, Item #2, and Item #3 for lbl2.  I can even click on the spinner &amp; bring up the drop-down list of choices. </p><p>This problem is that the items aren't displayed over the spinner. Instead they're just kind of floating over the activity, a bit further down.  Hopefully this picture will help clarify:  <img src=""http://www.freeimagehosting.net/uploads/bf9f584156.png"" alt=""Floating Spinner Elements""></p><p>EDIT: Thanks for the vote up - I've fixed up the image so it's now inline!</p>","250610","","250610","","2010-11-16 01:15:59","2012-04-13 11:40:01","Custom spinner items not appearing as part of Spinner","<android><android-widget>","1","0","1","",""
"4188661","1","","","2010-11-15 20:47:03","2","535","<p>Any View have a constructor <code>public View (Context context, AttributeSet attrs, int defStyle)</code> which iscalled when <code>View</code> declared with a style attribute. So, if I have some class inherited from <code>View</code> class, I can access declared attributes (like <code>android:layout_width</code> or <code>android:background</code>) via <code>AttributeSet</code> attrs in a constructor. But when I move attributes to style I cannot see attributes and values exists in a style. I want to read items declared in style but I have only style ID in <code>defStyle</code> parameter. Is there some way to read style items using the style ID? </p>","474913","","597607","","2012-06-19 21:49:34","2012-06-19 21:49:34","Accessing style items by style ID","<android>","1","0","","",""
"4188737","1","4188801","","2010-11-15 20:56:38","0","909","<p>In my Android App Activity, I have a RelativeLayout with one ImageView and a couple of TextViews being populated at runtime. I also have a Save button in the activity that I use to save the image in the ImageView to the device SD Card.Now what I really want to do is Convert the elements (image and the text in the RelativeLayout) together to a PNG image when the Save button is clicked and Save it to the SD Card.</p><p>Have anyone tried a conversion like this before? It would be very helpful if someone can give me some hints or code snippets on how to go about doing this?</p><p>The Save functionality works fine but currently only saves the image in the imageview.</p><p>Thanks in advance.</p>","447886","","","","","2010-11-15 21:04:01","How do I convert a RelativeLayout with an Imageview and TextView to a PNG image?","<java><android><png><android-layout>","1","0","","",""
"4188763","1","4189354","","2010-11-15 20:59:14","0","5474","<p>If I have a TableLayout structure (below) which defines 2 ImageViews. One which also specifies pixel values for width/height. This works as I would expect - Pic one is resized to 50px and pic2 is kept at its original size:</p><pre><code>&lt;TableLayout android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;TableRow&gt;        &lt;ImageView android:src=""@drawable/pic1"" android:layout_width=""50px"" android:layout_height=""50px"" /&gt;        &lt;ImageView android:src=""@drawable/pic2"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p><strong>But I really need to do the above programmatically so I do it like this...</strong></p><pre><code>TableLayout tableLayout = new TableLayout(ctx);TableRow tableRow = new TaleRow(ctx);ImageView imageViewOne = new ImageView(ctx);ImageView imageViewTwo = new ImageView(ctx);imageViewOne.setImageResource(R.drawable.pic1);imageViewTwo.setImageResource(R.drawable.pic2);imageViewOne.setLayoutParams(new LayoutParams(50, 50));rootView.addView(tableLayout);tableLayout.addView(tableRow);tableRow.addView(imageViewOne);tableRow.addView(imageViewTwo);</code></pre><p>The above doesn't do the same as the XML - The first ImageView does not show at all using the programmatic way after adding the setLayoutParams() method to it.</p><p><strong>I mist be missing something here, what is it that is different?</strong></p><p>Thanks!</p>","316825","","","","","2012-03-30 12:08:17","Resizing an ImageView within a TableLayout programmatically","<android>","1","0","","",""
"4188781","1","4188814","","2010-11-15 21:01:00","0","784","<p>Can I set a code that doesn't change the orientation of the screen of my app if I turn the phone sideways?  I tried making a new main.xml file in the layout-land folder, and it just looks weird.</p><p>So, the screen doesn't turn when the oreintation is changed?</p><p>Thanks!</p>","496686","","21234","","2010-11-15 21:13:05","2010-11-15 21:13:05","Is there a way to keep the orientation of my droid project vertical?","<android><layout><landscape>","1","2","0","",""
"4188818","1","4189035","","2010-11-15 21:06:40","1","7539","<p>I am a novice with Java.</p><p>I have to implement an array of objects that changes in size during execution.</p><p>The code I am writing is going to be ported on Android, too.</p><p>According to your experience, what's the best class to implement that?</p><p>Thanks,<br>Dan</p>","354742","","","","","2010-11-16 15:25:29","Java - best way to implement a dynamic-size array of objects","<java><android>","4","2","","",""
"4188859","1","4188880","","2010-11-15 21:13:07","16","8003","<p>I want to put a button next to a EditText and I want their heights to match. </p><p>For example, from the built in Android browser:</p><p><img src=""http://i.stack.imgur.com/l9lk9.png"" alt=""alt text""></p><p>The Go button is the same height as the EditText field.  I know I could wrap both these views in a parent layout view, and set both of their heights to fill_parent, and that would make them match.  However, I would like to do this without having to give the layout a static size.  I would rather have the EditText take whatever height it needs based on the font size and then have the button next to it match whatever height that might be.</p><p>Is this possible with an xml layout?  </p>","445348","","","","","2013-08-06 00:02:12","How to get a button's height to match another element's height?","<android><layout><height><match>","3","0","2","",""
"4188913","1","4189165","","2010-11-15 21:19:21","1","3550","<p>how can I get the URL of an HTTPResponse?I tried:</p><pre><code>response.getHeaders(""Locations"")</code></pre><p>But I obtained:</p><pre><code>11-15 21:14:03.355: INFO/System.out(880): [Lorg.apache.http.Header;@43ea9568</code></pre>","496371","","115145","","2010-11-15 21:49:37","2011-07-17 12:54:30","How can I get the URL of an HTTPResponse","<android><url><httpclient><httpresponse>","2","1","2","",""
"4188922","1","4201340","","2010-11-15 21:20:18","1","1991","<p>I am displaying markers on a map. I am not sure how I can specify a different drawable resource for different markers?</p><p>I would like to show a green pin if locations distance &lt; 50, etc. etc.</p><pre><code>pin = getResources().getDrawable(R.drawable.pushpin);        itemizedOverlay = new MyItemizedOverlay(pin, mapView);        for (Record element : list) {            GeoPoint point;            OverlayItem overlayItem;            double lat = Double.parseDouble(element.getLatitude());            double lng = Double.parseDouble(element.getLongitude());            double locationDistance = Double.parseDouble(element.getLocationDist());            geoPoint.add(new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6)));            listOfOverlays = mapView.getOverlays();            point = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));            Log.i(""deep"", ""deep    "" + point);            overlayItem = new OverlayItem(point, """", element.getTitle());            if(locationDistance &lt; 50){                //green            }            else if(locationDistance &gt; 50 &amp;&amp; locationDistance &lt; 100){                //yellow            }            else if(locationDistance &gt; 100 &amp;&amp; locationDistance &lt; 150){                //blue            }</code></pre>","19875","","7894","","2010-11-15 23:52:40","2012-11-09 09:31:37","How can I show different markers on a map?","<java><android><google-maps><google-maps-api-2><itemizedoverlay>","3","0","","",""
"4188936","1","","","2010-11-15 21:22:03","0","196","<p>I am trying to make an app that snaps a picture as a bmp, has the FaceDetector Class analyze the pic and display the pic on an xml file.  Then the pic is to be deleted.</p><p>I have the Intent in my main class:</p><pre><code>    case R.id.scan_box:        Intent cameraIntent = new Intent(                android.provider.MediaStore.ACTION_IMAGE_CAPTURE);        startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);        break;</code></pre><p>and the result as:</p><pre><code> protected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (resultCode == RESULT_CANCELED) {        showToast(this, ""Scan Cancelled"");        return;    }    setContentView(R.layout.result);    Bitmap thumbnail = (Bitmap) data.getExtras().get(""data"");    ImageView image = (ImageView) findViewById(R.id.photoResultView);    image.setImageBitmap(photoResultView);    image.setImageDrawable(bmd);}</code></pre><p>Resizing the bmp, and placing it in the result class.  How do I go about then using the face detector API to call that specific bmp that was just taken?  I know it is probably stored on the sd-card, but I can't seem to figure out how to implement it.  I use this, in a FaceDtect class:</p><p>sourceImage = BitmapFactory.decodeResource(getResources(),                R.drawable.IMAGE, bfo);</p><p>where IMAGE is the image I want to detect, but I can only access files in the drawable folder.  How to I access the picture I just took instead?  Does the camera assign the picture a certain string that my app can access?</p><p>Thanks so much for any help!</p>","496686","","46642","","2010-11-15 21:34:29","2010-11-15 21:34:29","Accessing images in your app","<android><string><image><camera>","0","2","","",""
"4188984","1","","","2010-11-15 21:29:50","1","332","<p>I have an android emulator. I would like to develop an application to measure the signal strength (RSSI) from the Acess Point. I would like to poll the signal strength and update the metric about the signal strength.</p><p>I am using <strong>WifiManager</strong>. But as I run the application, I get the following output,</p><pre><code>WIFI Status:SSID&lt;none&gt;,BSSID:&lt;none&gt;,MAC:&lt;none&gt;..</code></pre><p>Is it possible to develop such an application.</p><p>RegardsChandra</p>","276859","","","","","2010-11-15 21:29:50","Access Network Information through an Android emulator","<android><android-emulator><wifimanager>","0","2","","",""
"4189081","1","4338778","","2010-11-15 21:41:59","2","6378","<p>I tested calling a soap  12 webservices with ksoap2. I used this code to call the webservice: </p><pre><code>SoapObject request = new SoapObject(NAMESPACE, NAME);request.addProperty(""id"", ID);request.addProperty(""name"", ""test@test.de"");request.addProperty(""pw"", ""password"");request.addProperty(""listid"", 501);SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);envelope.setOutputSoapObject(request);AndroidHttpTransport client = new AndroidHttpTransport(URL);try {   client.call(NAMESPACE + NAME, envelope);   Object response = envelope.getResponse();} catch (IOException e) {   Log.e(getClass().getSimpleName(), ""IO Problem"", e);} catch (XmlPullParserException e) {   Log.e(getClass().getSimpleName(), ""Parser Problem"", e);}</code></pre><p>I now get the following exception: </p><pre><code>org.xmlpull.v1.XmlPullParserException:expected: START_TAG {http://www.w3.org/2001/12/soap-envelope}Envelope (position:START_TAG &lt;{http://schemas.xmlsoap.org/soap/envelope/}soapenv:Envelope&gt;@1:114 in java.io.InputStreamReader@44f28a80)</code></pre><p>Is this a problem of the server response or is there something wrong in my code so far? It seems that other users have the same problem. If I change the Envelope to SoapEnvelope.VER11 I get a step further (I get an access denied response from the soap server probably because of a wrong URL) maybe there is additional info missing to create a VER12 envelope. </p>","114066","","114066","","2010-11-23 10:42:43","2013-06-06 05:28:53","Is there a problem with ksoap2 and soap Version 12?","<android><soap><ksoap2>","5","3","","",""
"4189137","1","4196361","","2010-11-15 21:47:48","1","2043","<p>I'm having trouble with setting up an Ortho view for drawing 2D ontop of the 3D scene.</p><p>I set up my view like this:</p><pre><code>public void onSurfaceChanged( GL10 gl, int width, int height ) {    gl.glViewport( 0, 0, width, height );    gl.glMatrixMode( GL10.GL_PROJECTION );    gl.glLoadIdentity();    GLU.gluPerspective( gl, 45.0f, ( ( float )width / ( float )height ), 0.1f, 100.0f );    gl.glMatrixMode( GL10.GL_MODELVIEW );    gl.glLoadIdentity();}</code></pre><p>and I set up my Ortho view like this:</p><pre><code>public void onSurfaceOrtho( GL10 gl ) {    gl.glOrthof( 0.0f, 100.0f, 100.0f, 0.0f, -0.1f, 0.1f );    gl.glMatrixMode( GL10.GL_PROJECTION );    gl.glLoadIdentity();}</code></pre><p>Then I draw my frame like this:</p><pre><code>public void onDrawFrame( GL10 gl ) {    gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT );    gl.glLoadIdentity();    scene.onDrawFrame( gl );    gl.glPushMatrix();    onSurfaceOrtho( gl );    screen.onDrawFrame( gl );    gl.glPopMatrix();}</code></pre><p>The scene and screen objects are drawing objects for 3D and 2D.  The screen object doesn't draw anything yet as I'm just starting with 2D Ortho views.  However the scene objects draw a cube.  So everything works ok until I add the new code for 2D Ortho drawing - from glPushMatrix() to glPopMatrix().  Now I don't see anything but my clear color.</p><p>So what is it the code in the function onSurfaceOrtho() does that clears my screen?</p><p>I would expect what has been drawn to the view before the call to set up an Ortho view, to be left alone.  I don't call any explicit clear bits, but still it seems like something clears my view - and it is the code in the onSurfaceOrtho() function.</p><p>How can I set up an 2D Ortho view correctly so I can draw 2D ontop of my 3D view?</p>","324943","","","","","2010-11-16 16:23:12","Trying to use Ortho for drawing 2D","<android><opengl-es>","1","5","","",""
"4189272","1","4189309","","2010-11-15 22:02:24","6","12185","<p>I'm developing an Android application and I want to change the color and theme of the application. How can I do this?</p>","508377","","46642","","2010-11-15 22:04:03","2012-12-01 05:08:52","How do I change the theme on an Android application?","<android>","2","2","3","",""
"4189410","1","","","2010-11-15 22:18:42","11","1589","<p>I want the Android speech recognition system analysing audio file and not the default incoming voice from microphone.</p><p>Is there any way to do that ?</p><p>Thank you.</p>","348175","","348175","","2010-11-15 22:24:18","2013-05-05 05:39:34","Is there any way to send audio file to the speech-to-text recognition","<android><file><wav><speech-recognition>","2","1","2","",""
"4189416","1","","","2010-11-15 22:19:18","3","14364","<p>I have written a simple app and would like to try it out on my Samsung Galaxy i9000. After some trouble finding the proper USB-driver i finally have the device show up in the Device Manager under Android Phone/Android Composite ADB Interface. I am running Vista SP1 and my phone is a Samsung Galaxy i9000 with 2.1-update1.</p><p>The problem I'm having is when running ""adb servies"" in cmd the device list is empty, and the device is not showing up in Eclipse.</p><ul><li>The phone is in developer (debug) mode</li><li>I have added android:debuggable=""true"" for the app in the manifest-file</li><li>I have tried several times to kill and restart adb in the cmd-prompt without result</li><li>I have rebooted both phone and computer several times</li><li>Used usddeview to completely remove previous drives before installing the proper ones</li></ul><p>I ran the following in the commandprompt:</p><ul><li>adb kill-server</li><li>set ADB_TRACE=all</li><li>adb nodaemon server</li></ul><p>Then i ran Eclipse and got this (never mind the wierd sdk-path :P):</p><pre><code>C:\Program Files\JCreatorV4LE\Android\android-sdk-windows\tools&gt;adb kill-serverC:\Program Files\JCreatorV4LE\Android\android-sdk-windows\tools&gt;set ADB_TRACE=allC:\Program Files\JCreatorV4LE\Android\android-sdk-windows\tools&gt;adb nodaemon serverbit_buffer_init 002A2780bit_buffer_init 002A37C0adb_socketpair: returns (100, 101)fdevent_update: add 1 to 101event_looper_hook: call hook for 101 (new=0, old=1)transport: local client initCreated device threadtransport: client_socket_thread() startingsocket_loopback_server: port 5037 type tcp =&gt; fd 102fdevent_update: add 1 to 102event_looper_hook: call hook for 102 (new=0, old=1)_event_socketpair_start: hook 101(pair:100) for 65 wanted=1_event_socket_start: hooking 102(lo-server:5037) for 1 (flags 41)adb_win32: waiting for 2 eventssocket_loopback_client: could not connect to tcp:5555socket_loopback_client: could not connect to tcp:5557socket_loopback_client: could not connect to tcp:5559socket_loopback_client: could not connect to tcp:5561socket_loopback_client: could not connect to tcp:5563socket_loopback_client: could not connect to tcp:5565socket_loopback_client: could not connect to tcp:5567socket_loopback_client: could not connect to tcp:5569socket_loopback_client: could not connect to tcp:5571socket_loopback_client: could not connect to tcp:5573socket_loopback_client: could not connect to tcp:5575socket_loopback_client: could not connect to tcp:5577socket_loopback_client: could not connect to tcp:5579socket_loopback_client: could not connect to tcp:5581socket_loopback_client: could not connect to tcp:5583socket_loopback_client: could not connect to tcp:5585adb_win32: got one (index 1)_event_socket_check 102(lo-server:5037) returns 1adb_win32: signaling 102(lo-server:5037) for 1adb_socket_accept on fd 102 returns fd 119LS(1): created (fd=119)Connecting to smart socketCreating smart socketSS(0): created 00407E60fdevent_update: add 1 to 119event_looper_hook: call hook for 119 (new=0, old=1)SS(0): enqueue 16SS(0): len is 12SS(0): 'host:version'writex: 119 0022CCA8 12: 4f4b41593030303430303161  OKAY0004001awritex: 119 okSS(0): handled host service 'version'SS(0): closedadb_close: 119(accept:102(lo-server:5037))LS(1): closed_event_socketpair_start: hook 101(pair:100) for 65 wanted=1adb_win32: waiting for 2 eventsadb_win32: got one (index 1)_event_socket_check 102(lo-server:5037) returns 0adb_win32: waiting for 2 eventsadb_win32: got one (index 1)_event_socket_check 102(lo-server:5037) returns 1adb_win32: signaling 102(lo-server:5037) for 1adb_socket_accept on fd 102 returns fd 120LS(2): created (fd=120)Connecting to smart socketCreating smart socketSS(0): created 00407E60fdevent_update: add 1 to 120event_looper_hook: call hook for 120 (new=0, old=1)_event_socketpair_start: hook 101(pair:100) for 65 wanted=1_event_socket_start: hooking 120(accept:102(lo-server:5037)) for 1 (flags 41)adb_win32: waiting for 3 eventsadb_win32: got one (index 1)_event_socket_check 102(lo-server:5037) returns 0adb_win32: waiting for 3 eventsadb_win32: got one (index 2)_event_socket_check 120(accept:102(lo-server:5037)) returns 1adb_win32: signaling 120(accept:102(lo-server:5037)) for 1SS(0): enqueue 22SS(0): len is 18SS(0): 'host:track-devices'device tracker 002A6D98 createdLS(0) bound to 'track-devices'SS(0): okaySS(0): closedLS(2): enqueue 4_event_socketpair_start: hook 101(pair:100) for 65 wanted=1adb_win32: waiting for 3 events</code></pre><p>This make any sense? I've spent hours trying to figure this out so any suggestion at all is appreciated.</p><p>/Johan</p>","501260","","379693","","2010-11-16 05:15:21","2014-01-08 13:06:38","Actual Android device not found adb devices","<android><adb><logcat><android-logcat>","1","3","1","",""
"4189455","1","4254167","","2010-11-15 22:24:45","1","684","<p>I have a list in my app.</p><p>When a user touches a list item with their finger, the onListItemClick handler fires and I have it opening a new Activity.</p><p>However, when a user uses the trackball/pad to click, I want to perform some different functionality.  I've overrode onTrackballEvent and everything works perfectly fine in the emulator's trackball mode.</p><p>Unfortunately, when testing on the Samsung Moment, clicking the trackpad fires the onListItemClick handler, not the onTrackballEvent handler.</p><p>Does anyone know why?  Does anyone have a way around this?</p>","406790","","","","","2010-11-24 05:08:05","onTrackballEvent not firing on Samsung Moment","<android><listview><trackball>","2","0","","",""
"4189456","1","4193296","","2010-11-15 22:24:47","0","304","<p>How do I go about setting texts/images into a Image and Content View I have in an xml?</p><p>I have something like:</p><p>tv.setText(""Random Number: "" + Math.random());if (currentHour > 8 &amp;&amp; currentHour &lt; 22) {            tv.setText(""Random number:"" + random + ""%"");</p><p>but I want the displayed text (tv) to be displayed in a new xml file, Result.</p><p>setContentView(R.layout.result);</p><p>Is there a way to gather information like the random number, etc..and have the results displayed in a new layout - Result?</p><p>Thanks!</p>","496686","","21234","","2010-11-15 23:33:51","2010-11-16 10:43:55","Setting text into a ContentView","<android><xml><layout><content><textview>","1","0","","",""
"4189487","1","","","2010-11-15 22:28:51","0","1485","<p>I am writing an Android test program to record my voice, send it over UDP, and then play it. Right now, to make things simple, I run two threads, one records and send the data, the other receives it and play it.</p><p>I want to use UDP and not TCP so I am using DatagramPacket and DatagramSocket, hence why there is files in the middle (I have not figured out how to pass a UDP socket in the MediaRecorder and MediaPlayer class).</p><p>The code goes as follow:</p><pre><code> public class audiorecorderudp extends Activity {   public static final String SERVERIP = ""127.0.0.1"";   public static final int SERVERPORT = 4444;   boolean recording = false;   MediaRecorder recorder;   MediaPlayer player;   Button recordButton;   Uri audioFilePath;   Uri inputFilePath;   File outputFile;   File inputFile;   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // Start the server    new Thread(new Server()).start();    try {     Thread.sleep(500);    } catch (InterruptedException e) { }    // File to which audio should be recorded    outputFile = getFileStreamPath(""output.amr"");    inputFile = getFileStreamPath(""input.amr"");    audioFilePath = Uri.parse(outputFile.getAbsolutePath());    inputFilePath = Uri.parse(inputFile.getAbsolutePath());    // Button to record to a file using microphone    recordButton = (Button) findViewById(R.id.record);    recordButton.setOnClickListener(new View.OnClickListener() {     public void onClick(View v) {      if (!recording) {       // Start the recording       recording = true;       recorder = new MediaRecorder();       recorder.setAudioSource(MediaRecorder.AudioSource.MIC);       recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);       recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);       // We set the path of the file       recorder.setOutputFile(audioFilePath.getPath());       try {        recorder.prepare();        // Recording will start after next instruction        recorder.start();       }       catch (IllegalStateException e) { }       catch (IOException e) { }      }      else {       //Stop the recording and tidy up       recorder.stop();       recorder.release();       try {        InetAddress serverAddr = InetAddress.getByName(SERVERIP);        DatagramSocket socket = new DatagramSocket();;        InputStream is = new FileInputStream(outputFile);        long length = outputFile.length();        if (length &gt; Integer.MAX_VALUE) {         // File is too large        }        // Create the byte array to hold the data        byte[] bytes = new byte[(int)length];        int offset = 0;        int numRead = 0;        while (offset &lt; bytes.length          &amp;&amp; (numRead=is.read(bytes, offset, bytes.length-offset)) &gt;= 0) {         offset += numRead;        }        if (offset &lt; bytes.length) {         throw new IOException(""Could not completely read file ""+outputFile.getName());        }        is.close();        DatagramPacket packet = new DatagramPacket(bytes, bytes.length, serverAddr, SERVERPORT);        socket.send(packet);       }       catch (UnknownHostException e1) { }       catch (FileNotFoundException e) { }       catch (IOException e) { }      }     }    });   }   class Server implements Runnable {    @Override    public void run() {     try {      InetAddress serverAddr = InetAddress.getByName(SERVERIP);      DatagramSocket socket = new DatagramSocket(SERVERPORT, serverAddr);      byte[] buf = new byte[1024];      DatagramPacket packet = new DatagramPacket(buf, buf.length);      socket.receive(packet);      FileOutputStream inputStream = new FileOutputStream(inputFile);       inputStream.write(packet.getData());      inputStream.close();      // Play      player = new MediaPlayer();      try {       inputFile = getFileStreamPath(""input.amr"");       inputFilePath = Uri.parse(inputFile.getAbsolutePath());       File file = new File(inputFilePath.getPath());       FileInputStream fis = new FileInputStream(file);       player.setDataSource(fis.getFD());       player.setLooping(false);       player.prepare();       player.start();      }      catch (IllegalArgumentException e) { }      catch (IllegalStateException e) { }      catch (IOException e) { }      // When we reach the end of the file      player.setOnCompletionListener(new OnCompletionListener() {        @Override        public void onCompletion(MediaPlayer player) {         player.stop();       }      });     }     catch (Exception e) { }    }   }  }</code></pre><p>A button gets pressed and the recording starts. When that button is pressed again, the recording stops, the content of the file is then sent in a packet. The server thread that I created should receive the packet, put it into the file, and have the MediaPlayer open and play that file.</p><p>My problem is that, when prepare() is called for the MediaPlayer, it goes into the catch IOException with the following error: Prepare failed.: status=0x1</p><p>If I try to use the audioFilePath (the file that the recording got saved into), then it works. For some reason, calling FileOutputStream seems to not let me call prepare afterwards.</p><p>Does anyone has any clue please?</p><p>I've been really stuck on this issue for two days.</p><p>Thank you very much,</p><p>EDIT: Adding stack trace:</p><pre><code>catch (IOException e) { StackTraceElement[] stack = e.getStackTrace(); }</code></pre><p>Copying the values:</p><pre><code>     stack StackTraceElement[3]  (id=829706641152)   [0] StackTraceElement  (id=829706640240)    declaringClass ""android.media.MediaPlayer"" (id=829706640272)     count 25     hashCode -2110370052     offset 0     value  (id=829706640304)      [0] a      [1] n      [2] d      [3] r      [4] o      [5] i      [6] d      [7] .      [8] m      [9] e      [10] d      [11] i      [12] a      [13] .      [14] M      [15] e      [16] d      [17] i      [18] a      [19] P      [20] l      [21] a      [22] y      [23] e      [24] r    fileName ""MediaPlayer.java"" (id=829706640448)     count 16     hashCode -955755861     offset 0     value  (id=829706640480)      [0] M      [1] e      [2] d      [3] i      [4] a      [5] P      [6] l      [7] a      [8] y      [9] e      [10] r      [11] .      [12] j      [13] a      [14] v      [15] a    lineNumber -2    methodName ""prepare"" (id=829706640376)     count 7     hashCode -318370553     offset 0     value  (id=829706640408)      [0] p      [1] r      [2] e      [3] p      [4] a      [5] r      [6] e   [1] StackTraceElement  (id=829706640536)    declaringClass ""com.audiorecorderandudp.rudy.audiorecorderudp$Server"" (id=829706640568)    fileName ""audiorecorderudp.java"" (id=829706640792)    lineNumber 185    methodName ""run"" (id=829706640728)   [2] StackTraceElement  (id=829706640888)    declaringClass ""java.lang.Thread"" (id=829706640920)     count 16     hashCode 1212802142     offset 0     value  (id=829706640952)      [0] j      [1] a      [2] v      [3] a      [4] .      [5] l      [6] a      [7] n      [8] g      [9] .      [10] T      [11] h      [12] r      [13] e      [14] a      [15] d    fileName ""Thread.java"" (id=829706641072)     count 11     hashCode -741624986     offset 0     value  (id=829706641104)      [0] T      [1] h      [2] r      [3] e      [4] a      [5] d      [6] .      [7] j      [8] a      [9] v      [10] a    lineNumber 1060    methodName ""run"" (id=829706641008)     count 3     hashCode 113291     offset 0     value  (id=829706641040)      [0] r      [1] u      [2] n </code></pre><p>Jary</p>","505281","","505281","","2010-11-16 17:17:43","2010-11-16 17:17:43","MediaPlayer prepare() method crashing after FileOutputStream (Android)","<android><file><audio><udp><media-player>","0","3","","",""
"4189528","1","4189575","","2010-11-15 22:34:09","1","1457","<p>I am currently building a simple application for Android using the NDK and needs to getthe coordinates from the GPS. I've searched the web, but have come up empty handed. Is there some API or such for NDK-programs to access the GPS?</p>","438234","","","","","2013-05-19 18:23:32","Access GPS through NDK applications","<android><android-ndk>","2","0","","",""
"4189610","1","","","2010-11-15 22:43:47","1","326","<p>I'm querying a ContentProvider, looping thru the rows in the cursor, creating an object for each row and adding that object to a list.  I'm registering each object as a ContentObserver of its own uri.  That's working fine, the objects are getting notified when their DB row is updated and/or deleted.  My problem is that if the DB row is deleted how I know to remove it's corresponding object from the list?</p><p>In the object's onChange() method, I'm querying the ContentProvider for it's _id and if I get no results back, I'm setting a ""deleted"" flag.  I've also registered the list (actually a ContentObserver wrapper around the list) as a ContentObserver for the main ContentProvider uri, and in that onChange() method, I loop thru the list and check the ""deleted"" flag of each object in the list and remove it from the list if deleted==true.</p><p>However, it seems that the list is getting notified BEFORE the individual objects are...hence, as I loop thru the list the relevant object's ""deleted"" flag is not yet set.  </p><p>Is there any way to control the order in which ContentObservers get notified of changes?  since the docs don't say anything, I suspect the answer is ""no"", but thought I'd ask.</p><p>The current situation isn't that bad, since the next time the list gets a notification, it will remove the previously deleted object, hence, I have at most 1 extra object in the list...but there must be an ""approved"" way of handling this, but as I'm new to Android development I haven't been able to figure out what it would be.  Any suggestions?</p>","508861","","","","","2010-11-15 22:43:47","order of ContentObserver notifications","<android><android-contentprovider>","0","0","","",""
"4189737","1","","","2010-11-15 23:03:55","1","2389","<p>Hopefully this is an easy one because I've been trying all sorts of different ways to get rid of this.</p><p>I am making an android app which incorporates a clock animation. I've got everything working really well except one very annoying thing.</p><p>I have a second hand on the clock and I'm using the following code to rotate it around a the second hand center point. As you'll probably notice I'm trying to make this look like an analogue second hand so it sweeps instead of just ticking.</p><pre><code>        public float secdegrees, secondwidth, secondheight;        secondMatrix = new Matrix();        secondwidth = secondHand.getWidth();        secondheight = secondHand.getHeight();        secdegrees = anglepersec * secnow;        secdegrees += anglepluspermilli * millis;        secondMatrix.setRotate(secdegrees, secondwidth/2, secondheight / 2);        newSecond = Bitmap.createBitmap(secondHand, 0, 0,               (int) secondwidth, (int) secondheight, secondMatrix, true);        c.drawBitmap(newSecond, (centrex - newSecond.getWidth()/2),               ((face.getHeight()/2) - newSecond.getHeight()/2), null);</code></pre><p>It actually does just the job I want... almost.</p><p>The problem is the hand shakes/jiggles around the center point ever so slightly, but it's really noticeable and really spoils the aesthetics.</p><p>I pretty much suspect that it's the way that it's rounding the float value, but I was hoping that someone had experienced this before and had any ideas on how to get rid of it.</p><p>For reference the second hand image was originally 74 px x 28 px and is (currently) 74 x 74 pixels .png with the middle of the second hand exactly crossing the crossing point. I've also tried making it 75 x 75 so that there is actually a central pixel too but no luck.</p><p>Any help at all would be appreciated.</p><p>** UPDATE</p><p>I've tried to change the code in case the decimals were getting dropped but still no luck I'm afraid. Here is option 2 I've tried and failed with;</p><pre><code>        secondMatrix = new Matrix();        secondwidth = secondHand.getWidth();        secondheight = secondHand.getHeight();        secdegrees = anglepersec * secnow;        secdegrees += anglepluspermilli * millis;        secondMatrix.setRotate(secdegrees, secondwidth/2, secondheight / 2);        newSecond = Bitmap.createBitmap(secondHand, 0, 0, (int) secondwidth,              (int) secondheight, secondMatrix, true);        float secW = newSecond.getWidth()/2;        float secH = newSecond.getHeight()/2;        // NEW CODE HERE        float calcdeg = secdegrees % 90;        calcdeg = (float) Math.toRadians(calcdeg);        float NegY = (float) ((secondwidth*Math.cos(calcdeg)) +             (secondwidth * Math.sin(calcdeg)));        c.drawBitmap(newSecond, centrex - NegY/2,              ((face.getHeight()/2) - NegY/2), null);</code></pre>","508875","","508875","","2010-11-17 00:16:13","2010-12-06 13:42:59","Android problem with Image Rotate and Matrix","<android><matrix><rotation><clock><shake>","1","3","","",""
"4189796","1","4189845","","2010-11-15 23:13:57","1","1190","<p>I want to write an app which launches android market.(The activity should only one activity)so plz refer me the android market link or any suggestion.</p>","412168","","273456","","2011-09-04 15:30:06","2012-06-21 21:30:27","Android market app Link","<android><google-play>","2","3","1","",""
"4189837","1","","","2010-11-15 23:21:02","1","1321","<p>I have to do login with my app.After the login, if it is correct, I wanna show a tabview with:- My Stats- Upload Photo- MapView</p><p>This is my code for the login activity</p><pre><code>public class LoginActivity extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    String url, user, pwd, user_field, pwd_field;    url = ""http://myurl.com/login/"";    user_field = ""username"";    pwd_field = ""password"";    user = ""myuser"";    pwd = ""mypass"";    List&lt;NameValuePair&gt; myList = new ArrayList&lt;NameValuePair&gt;(2);    myList.add(new BasicNameValuePair(user_field, user));     myList.add(new BasicNameValuePair(pwd_field, pwd));    final HttpParams params = new BasicHttpParams();    final HttpClient client = new DefaultHttpClient(params);    final HttpPost post = new HttpPost(url);    //final HttpResponse end = null;    //String endResult = null;    Button login_button = (Button)findViewById(R.id.login_button);    try {        post.setEntity(new UrlEncodedFormEntity(myList));    } catch (UnsupportedEncodingException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }     login_button.setOnClickListener(new OnClickListener(){        public void onClick(View v) {            try {                HttpResponse response = client.execute(post);                //HttpResponse end = response;                System.out.println(response.getStatusLine());            } catch (ClientProtocolException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }          }    });}</code></pre><p>}</p><p>How can I check if the Login is correct or not?Thanks a lot!</p>","496371","","","","","2011-01-29 03:01:55","Help for Check Login Status","<android><post><login><check>","2","3","1","",""
"4189875","1","4250246","","2010-11-15 23:29:17","28","14423","<p>In the process of implementing traditional and simplified chinese support in my Android application and I confused on how this is supposed to work.</p><p>So from reading the <a href=""http://developer.android.com/resources/tutorials/localization/index.html"">documentation</a>as well as some discussions like <a href=""https://groups.google.com/group/android-developers/browse_thread/thread/9d7a3ee32af73fec/433ecaba101b2a03"">this</a> and <a href=""https://groups.google.com/group/android-developers/browse_thread/thread/bcbd760d8651ae65/ff9b0007050e2123"">this</a> I have put simplified chinese into </p><ul><li>values-zh</li><li>values-zh-rCN</li><li>values-zh-rSG</li></ul><p>and traditional chinese into </p><ul><li>values-zh-rTW</li><li>values-zh-rHK</li></ul><p>That all works fine but somehow does not make sense to me (sorry if I dont understand enough about chinese simplified vs traditional usage). </p><p>From what I understand from checking the locale setting dialog in the emulator as well as on a rooted phone a user can change the locale to Simplified Chinese or Traditional Chinese. </p><p>Now here is the question. How does the system know where to get the simplified or traditional chinese strings.xml. Is there some sort of assumption baked in that says if I am supposed to display simplified chinese get it from values-zh and get traditional from values-zh-rTW?</p><p>But what if a user is located in HK and set his device up to display simplified chinese? Or what if an emigrant somewhere else in the world sets his device to traditional chinese but his region is e.g. US or CA?</p><p>What do I have to do to allow my users to set their locale and have my app appear with the right locale? </p><p><strong>Update:</strong> </p><p>From further investigation I believe that a Android phone user can not set the country separately from the language. They can only set what is called the locale in the UI. It consists of language and country, but the list is limited so many combinations are not possible.</p><p>E.g. a Chinese person living in the US that wants to use Traditional Chinese could set the language to traditional chinese (at least on a rooted phone) and would then have a locale of zh-rTW. He could in no way set his country separately to be US. In a similar manner any sort of emigrant can not set their native language with the country they currently live in.. </p><p>Basically that means that only a bunch of combinations of language and country are supported. Now the questions is how to find out which ones they are?</p>","136445","","136445","","2010-11-22 17:50:59","2011-02-22 16:41:27","Simplified and Traditional Chinese vs Regions","<android><internationalization>","2","1","18","",""
"4189883","1","4193863","","2010-11-15 23:30:15","28","36909","<p>I try to arrange two buttons (with images on them which work fine) next to each other and to center them horizontally. That's what I have so far:</p><pre><code>&lt;LinearLayout android:orientation=""horizontal"" android:layout_below=""@id/radioGroup""              android:layout_width=""wrap_content"" android:layout_height=""wrap_content""              android:layout_gravity=""center_horizontal|center""&gt;    &lt;Button            android:id=""@+id/allow""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_below=""@id/radioGroup""            android:layout_gravity=""center_horizontal""            android:drawableLeft=""@drawable/accept_btn""            android:text=""Allow""/&gt;    &lt;Button            android:id=""@+id/deny""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_toRightOf=""@id/allow""            android:layout_below=""@id/radioGroup""            android:layout_gravity=""center_horizontal""            android:drawableLeft=""@drawable/block_btn""            android:text=""Deny""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Unfortunately they are still aligned to the left side. Any help is appreciated! Yves</p><p><strong>Edit</strong>:</p><p>Unfortunately none of the comments or suggestions work so far. That's why I try to provide a simplified, full layout now with a 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:layout_width=""fill_parent"" android:layout_height=""wrap_content""            android:layout_centerHorizontal=""true""&gt;    &lt;TextView android:text=""@+id/TextView01"" android:id=""@+id/TextView01""          android:layout_width=""wrap_content"" android:layout_height=""wrap_content""/&gt;    &lt;Button        android:id=""@+id/allow""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/TextView01""        android:text=""Allow""/&gt;    &lt;Button        android:id=""@+id/deny""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/allow""        android:layout_alignTop=""@id/allow""        android:text=""Deny""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>I've tried all combinations of attributes in the LinearLayout and on the Button elements without luck. Any other ideas?</p>","363473","","363473","","2010-11-16 08:03:39","2013-08-06 08:12:45","Center two buttons horizontally","<android><layout>","13","3","16","",""
"4189891","1","","","2010-11-15 23:31:22","0","808","<p>I've got a game, a custom View class draws my gameboard. I'm thinking of drawing some elements on a separate layer above the gameboard. I could do this in the View's canvas code, but since they won't change frequently, was thinking of introducing a frame layout to display this top layer:</p><pre><code>&lt;FrameLayout&gt;  &lt;LinearLayout /&gt; // game board  &lt;LinearLayout background=""#00000000""/&gt; // stuff like cards, other overlays.&lt;/FrameLayout&gt;    vs&lt;LinearLayout /&gt; // game board, draw cards etc on every onDraw() call myself.</code></pre><p>I'm not sure which route to take, the only reason I wouldn't do the FrameLayout is because I'm not sure if it has an impact on battery life. Everytime onDraw() is called, the system probably has to do an alpha composition of the two layers. Is that more battery consuming than drawing the elements from that layer myself in my canvas on every frame? Hard to answer since I'm not sure how complex the drawing will be yet, any general opinions?</p><p>Thanks</p>","291701","","","","","2010-11-15 23:41:25","FrameLayout for drawing overlays in a game? Battery?","<android>","1","0","","",""
"4189925","1","4190336","","2010-11-15 23:38:22","0","7889","<p>I seem to be getting application crashes at:</p><blockquote>  <p>parent.findViewById(R.id.a_1).setVisibility(View.VISIBLE);</p></blockquote><p>not sure what im doing wrong</p><p>code is below</p><p><strong>layouttext.java</strong></p><pre><code>    public class layouttest extends Activity { private Spinner solvefor;  private ArrayAdapter&lt;CharSequence&gt; featuresAdapter;  private List&lt;CharSequence&gt; featuresList;     /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        featuresList = new ArrayList&lt;CharSequence&gt;();         featuresAdapter = new ArrayAdapter&lt;CharSequence&gt;(this, android.R.layout.simple_spinner_item, featuresList);         featuresAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);         solvefor = ((Spinner) layouttest.this.findViewById(R.id.solvefor));         solvefor.setAdapter(featuresAdapter);         featuresAdapter.add(""Velocity"");         featuresAdapter.add(""Time"");         featuresAdapter.add(""Distance"");         solvefor.setOnItemSelectedListener(new MyOnItemSelectedListener());    }}</code></pre><p><strong>MyOnItemSelectedListener.java</strong>    package android.example.layouttest;</p><pre><code>import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemSelectedListener;import android.widget.Toast;public class MyOnItemSelectedListener implements OnItemSelectedListener { private static final int SPINNER_OPTION_FIRST = 0;     private static final int SPINNER_OPTION_SECOND = 1; public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {   switch(pos) {          case SPINNER_OPTION_FIRST: {           Toast.makeText(parent.getContext(), ""0"", Toast.LENGTH_LONG).show();          break;         }          case SPINNER_OPTION_SECOND: {           Toast.makeText(parent.getContext(), ""1"", Toast.LENGTH_LONG).show();          parent.findViewById(R.id.a_1).setVisibility(View.VISIBLE);          parent.findViewById(R.id.a_2).setVisibility(View.VISIBLE);          break;         }   }   }    public void onNothingSelected(AdapterView&lt;?&gt; parent) {         // Do nothing.       }}</code></pre>","508902","","","","","2010-11-16 01:04:01","android crash when using setVisibility(View.VISIBLE)","<android>","1","2","","",""
"4189956","1","4346496","","2010-11-15 23:43:08","1","3448","<p>I lost last 3 hours trying to do this. Im making an app that will ship with a DB filled with populated tables that would not change on clients devices. I managed to do this by putting it in the assets folder and copying it as a stream of bytes to the appropriate data folder on the phone. Problem is when I wish to update the database, I cant get it to work. I delete the DB in data folder on phone (from code), but copying the new database always fails, or the copied DB has the appropriate size but no tables in it.How to do this? Or is there a simpler way? Can I open DB directly from assets (it would be the simplest way if it can, but I cant find how to access the path to assets from code)? </p>","257501","","135152","","2011-05-25 03:07:17","2012-12-20 07:28:21","Updating prepopulated database in Android","<android><sqlite><android-assets>","1","1","4","",""
"4189983","1","4190019","","2010-11-15 23:48:41","0","3652","<p>When it comes to using the <code>ListView</code> inside of a <a href=""http://developer.android.com/reference/android/app/ListActivity.html"" rel=""nofollow""><code>ListActivity</code></a>, is there a difference between applying an <code>OnItemClickListener</code> to the associated ListView and overriding the <code>onListItemClick</code> method in your ListActivity? There doesn't appear to be any difference except which class handles the event.</p><p>Is there one that is preferable to the other, whether it be for efficiency reasons, code maintainability, or Android best-practices?</p>","508912","","","","","2010-11-16 04:19:27","onItemClickListener (ListActivity) vs onItemClick (ListView): which one should I use?","<android><android-listview>","2","0","","",""
"4190265","1","4190592","","2010-11-16 00:49:34","1","366","<p>I've successfully being able to use the ACTION_SEND intent which displays my application in the list when the share button is pressed in the gallery. My app basically sends the selected picture to my computer and no further input form the user is required. Rather than starting my app when selected in the list which is an unnecessary step is it possible to pass the data to my own service which sends the picture and avoid starting my app? </p><p>If not what other options do I have? Start my app, sent the picture and close the activity?</p>","376338","","","","","2010-11-16 02:06:43","Android can ACTION_SEND be used to call a Service","<android><android-intent><intentfilter><android-service>","1","0","","",""
"4190314","1","","","2010-11-16 01:00:22","0","471","<p>I am implementing a music player application in Android. My play list selection screen is implemented as a tab selector widget which contains a ListActivity inside each of the tabs: Artist, Albums, Songs.I want to update the ListView in each of the ListActivity when I delete an item from any of the lists.</p><p>i.e. When I long press an item in the Artists list a context menu is drawn with ""Delete Artist""And it should delete all the songs from this artist in the Songs ListView, delete all the albums by this artist in the Albums ListView, and finally delete the entry for the artist in the Artist ListView.</p><p>Each of the ListActivity has its own fillData() method, which updates the ListView when the button in the context menu is pressed.</p><p>How can I call the fillData() method of the Albums ListActivity after I update the ListView inside of the Artists ListActivity?</p>","508956","","","","","2010-11-16 02:11:05","How can I update the all the views inside a TabHost when pressing on a ContextMenu item from within one of the views?","<android>","1","0","","",""
"4190361","1","4190583","","2010-11-16 01:10:22","0","1110","<p>I want to capture Intents with a specific Uri pattern that uses the http scheme. I DO NOT want the chooser dialog to pop up. </p><p>The Android API advertises filtering of intents based on pattern matching of the path part of the Uri:</p><p><a href=""http://developer.android.com/guide/topics/manifest/data-element.html"" rel=""nofollow"">http://developer.android.com/guide/topics/manifest/data-element.html</a></p><p>However, when I try to specify a pattern for my path other than "".*"" (which pops up the chooser, which I'm trying to avoid), it doesn't work, and the browser automatically handles the Intent.</p><p>So, my question is, what is the purpose of the pathPattern/pathPrefix if, for the http scheme, it either auto resolves to the browser, or pops up the chooser anyways?</p>","413414","","","","","2010-11-16 02:05:04","Android: What is the purpose of android:pathPattern if I can't filter http scheme?","<android><api><android-intent><pattern-matching>","1","0","","",""
"4190411","1","","","2010-11-16 01:23:27","0","363","<p>In my android project, I have a simple Java file which gets webpage content, does something with the text and returns text as a <code>String</code>. This text I display in a <code>ScrollView</code> in another activity on Android.</p><p>It works fine, but the problem comes when I try manipulating the text in this Java file. I tried with arrays, it didn't work then switched back to <code>String</code>, still nothing. It is just a particular method which fails to provide any output but the program compiles fine. </p><p>However, the same method when tried in a Java project in Eclipse works perfectly fine.</p><p>Here's my code:</p><pre><code>// This method will return selected stripped text extracted from rawDatapublic static String FillMenus(String rawData){    String resulT = """";    int c1, c2;    for(int i=0; i&lt;11; i++){         c1 = rawData.indexOf(""\"" width=\""50px\"" /&gt;"") + 17;        c2 = rawData.indexOf("" €&lt;/td&gt;"") + 2;        if (c1==16 || c2==1) break;        if (c1&lt;=c2){            resulT = resulT+""\n""+ rawData.substring(c1, c2);             rawData = rawData.substring(c2);        }        if (c1&gt;c2){             resulT = resulT+""\n""+StripTag((rawData.substring(0, c2)));             rawData = rawData.substring(c2);        }    }     return resulT;}</code></pre><p>If there is nothing wrong with this method, then why does it not provide any output? If I return <code>rawData</code> in Android, the phone displays everything properly. If I return the output result <code>String</code>, it is all blank in the phone.</p><p>If I call this method (say created in class <code>ABC</code>) in another test class (test.java) inside the same Android project say with <code>String a = ABC.FillMenus(String b)</code> there is something strange. I get a compiler error, while it shows blank in Android phone. And the same thing called from within a Java project works absolutely fine.</p><p>Is there something I'm missing?</p>","507112","","21441","","2010-11-16 01:30:27","2010-11-16 02:47:10","Strange Problem with Android, Program compiles but does not work","<java><android><string><unicode><query-string>","1","3","","",""
"4190429","1","4190906","","2010-11-16 01:29:56","28","29624","<p>I have an application with several Activities in Android and I want the user to be able to log-out by pressing a menu button. The problem I have is that</p><p>A) Android doesn't let you terminate the application and<br>B) even when I send the user to the <code>LoginActivity</code> again they can always press <em>back</em> and get right back to the previous activity they were in.</p><p>I already tried to launch the Activity with the two following flags: </p><pre><code>Intent intent  = new Intent(this, LoginActivity.class);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);        startActivity(intent);</code></pre><p>I also tried with each one of them by themselves.</p><p>I also tried calling <code>finish()</code> after <code>startActivity(intent)</code> as I read in another StackOverflowquestion.</p>","505162","","356895","","2013-10-08 14:20:37","2013-10-08 14:20:37","How to clear the Android Stack of activities?","<android><activity><stack><back-stack>","8","2","8","",""
"4190478","1","4191217","","2010-11-16 01:40:44","2","2604","<p><strong>Skip to the bottom if you just want to see the question without context</strong></p><p>The android app I'm building has a simple table with three columns:</p><blockquote>  <p><strong>_id</strong> INTEGER PRIMARY KEY..., <strong>name</strong> TEXT, <strong>color</strong> INT</p></blockquote><p>This table is called <code>categories</code>.  I load my categories from the database and feed them into a <code>SimpleCursorAdapter</code> for use with a <code>Spinner</code> like so:</p><pre><code>String[] from = new String[] {        ListDbAdapter.KEY_CATEGORY_NAME,        ListDbAdapter.KEY_CATEGORY_COLOR };int[] to = new int[] { R.id.categorySpinnerItem };mCategorySpinnerAdapter = new SimpleCursorAdapter(this,    R.layout.category_spinner_item, categoryCursor, from, to);mCategorySpinnerAdapter    .setViewBinder(new CategorySpinnerViewBinder());mCategorySpinner.setAdapter(mCategorySpinnerAdapter);</code></pre><p>I set a custom <code>ViewBinder</code> because I want the category name to be the text of the spinner item, and the color to be the background color.  My <code>ViewBinder</code> looks like this:</p><pre><code>private static final int NAME_COLUMN = 1;private static final int COLOR_COLUMN = 2;@Overridepublic boolean setViewValue(View view, Cursor cursor, int columnIndex) {    TextView textView = (TextView) view;    String name = cursor.getString(NAME_COLUMN);    int color = cursor.getInt(COLOR_COLUMN);    textView.setText(name);    textView.setBackgroundColor(color);    return true;}</code></pre><p><strong>Here is my question (finally)</strong></p><p>In the <em>setViewValue</em> method, what is <em>columnIndex</em> supposed to be doing?  The documentation says <em>""the column at which the data can be found in the cursor""</em> but when I debug through <em>setViewValue</em> I hit it three times and <em>columnIndex</em> is always <code>1</code>.</p><p>I was expecting the debugger to get into <em>setViewValue</em> once for each entry in the from array, with a columnIndex first of <code>1</code> and then <code>2</code>.  Or maybe once for each column in the query results.</p><p>The above code works, I can get the desired functionality but only because of my NAME_COLUMN and COLOR_COLUMN constants.  I'd be really interested to hear an explanation of <em>setViewValue</em> and its parameters from someone more experienced with custom ViewBinders.</p>","508425","","493939","","2012-06-02 07:45:24","2012-06-02 07:45:24","Some help understanding columnIndex in ViewBInder","<android><android-viewbinder>","2","0","","",""
"4190564","1","5205993","","2010-11-16 02:00:51","3","896","<p>I am trying to retrieve serialized classes using Restlet 2.1 with Android as the client and GAE as the server. This is the relevant code:</p><pre><code>ClientResource cr = new ClientResource(""http://localhost:8888/mydata"");// Get the MyData objectMyDataResource resource = cr.wrap(MyDataResource.class);MyData myData = resource.retrieve();</code></pre><p>I initially tested this in a standalone JSE class, and everything worked fine.When I try to run the same thing in Android, the myData object is null. Any ideas? </p>","316597","","","","","2011-03-06 03:16:02","Restlet On Android - Issues with serialization","<java><android><serialization><restlet><deserialization>","1","2","3","",""
"4190699","1","4190730","","2010-11-16 02:32:46","2","1648","<p>I would like to run a small Windows program on an Android slate. It runs just fine under Wine in Ubuntu, but I am unsure how to install &amp; run Wine on the Android slate. </p><p>Sorry if it's not strictly a programming question. If you want it to be so, I could rephrase it as ""will I have to write my Delphi code again Java  in order to run it on an Android slate?"" </p>","192910","","","","","2012-05-01 01:12:20","Can I run Wine on an Android slate?","<android>","5","1","","",""
"4190710","1","","","2010-11-16 02:33:58","0","526","<p>Is it possible for an Android/iPhone to wirelessly find the WiFi MAC address of a neighboring smart phone?  If so, then roughly how should I go about doing this?  What API can you direct me toward on the Android?  On the iPhone?</p>","348056","","348056","","2010-11-16 15:24:33","2010-11-16 15:24:33","Is it possible for an Android/iPhone to find the WiFi MAC address of a neighboring smart phone?","<iphone><android><smartphone><mac-address>","0","3","","",""
"4190889","1","4191192","","2010-11-16 03:11:32","2","1057","<p>I'm new to Java, I'm porting over our Windows Phone 7 library to run on Android. Due to syntax similarities this has been very simple so far. Our library is basically an abstracted http message queue that provides data persistence and integrity on mobile platforms. It only provides asynchronous methods which is a design choice. On WP7 I make use of delegates to call the user supplied callback when an async message has been processed and the servers response received. </p><p>To achieve the same thing on Android I've found two ways so far - A simple Java listener interface that contains OnSuccess and OnFailure methods that the user must implement, or using the Android handler class which provides a message queue between threads (http://developer.android.com/reference/android/os/Handler.html). </p><p>I've gone with the Handler at this stage as if I'm honest it is the most similar to a C# delegate. It also seems like less work for a user of our library to implement. Example of some user code to make use of our library:</p><pre><code>connection.GetMessage(""http://somerestservice.com"", GetCallback);Handler GetCallback = new Handler() {    public void handleMessage(Message message){        CustomMessageClass customMessage = (CustomMessageClass)message.obj;        if(customMessage.status == Status.Delivered) {           // Process message here,            // it contains various information about the transaction            // as well as a tag that can contain a user object etc.            // It also contains the servers response as a string and as a byte array.        }    }};</code></pre><p>Using this the user can create as many different handlers as they'd like, called whatever they'd like, and pass them in as method parameters. Very similar to a delegate...</p><p>The reason I'm wondering if I should move to a listener interface is because the more exposure I gain to Java the more it seems that's just how it's done and it's how third parties using our library would expect it to be done. </p><p>It's essentially the same process, except each time you wanted to do something different with the server response i.e. You might be fetching different types of data from different endpoints, you're going to have to create a custom class that implements our interface each time, as well as implementing any methods our interface has. Or of course you could have a single monolithic class that all server responses were funneled in to but have fun trying to figure out what to do with each individual response...</p><p>I may be a bit biased due to coming from C# but a listener seems a bit convoluted and I like the handler implementation better, do any Java developers have any thoughts/advice? It would be much appreciated.</p><p>Cheers!</p>","509035","","13154","","2010-11-16 04:28:54","2010-11-16 04:28:54","Should I use a listener interface or handler for event callbacks in Android development?","<c#><java><android><windows-mobile>","2","1","","",""
"4190968","1","4190994","","2010-11-16 03:26:52","0","523","<p>i'm trying to query only one data(the first one) from the database.</p><pre><code>Cursor img_cursor = db.query(                    IMAGE_URL_TABLE_NAME,                    new String[]{""small_img_url"" , ""large_img_url""},                    null"",                    null, null, null, null);</code></pre><p>could somebody tell me how to implement , query only one data(the first one) from table?</p><p>==========================================================================================</p><p>thank you , xandy~ </p><p>i solved the problem , but i think the answer is :</p><p>Cursor img_cursor = db.query(                    IMAGE_URL_TABLE_NAME,                    new String[]{""small_img_url"" , ""large_img_url""},                    null"",                    null, null, null, null , ""1"");</p><p>i used ""limit 1"" first time , but crashed , if only pass number as a String , it works.</p><p>by the way , query has 8 parameters  while we using the limit parameter. thx all</p>","422405","","422405","","2010-11-16 05:55:40","2010-11-16 05:55:40","android sqlite3 query only one data(the first) from the table","<android><sqlite>","1","0","2","",""
"4191081","1","","","2010-11-16 03:54:05","4","1066","<p>I have an app written in Delphi 5 that I want to convert to run on Android 2.x. The app is pretty simple; its used to upload/download configuration files to a separate microprocessor over a Modbus serial link. (It's an engine management chip for use in boosting horsepower in turbo-diesel engines).   I haven't programmed since my Pascal days at uni so I am almost a complete beginner but willing to invest some time into this and I have the source code of course.</p><p>From the reading I have done so far, it appears that re-writing the app in Java seems to be the most common solution but also some suggest using Monodroid?  What I would really appreciate is some definitive advice around what versions and tools I should put together to do this - eg do I install the Java SDK or do I look at Monodroid and just convert the existing code?  The thing that I find most challenging is getting the right approach/environment setup - I'm overwhelmed with information and choice here!  Once I am sure that I have the right approach, I will then figure out the details as I go but there is nothing worse than spending hours and hours fiddling with one approach to then later learn it was wasted!</p><p>My objective here is to get the functionality of the existing code replicated as easily as possible in Android, not to replicate the look and feel perfectly and not to become an Android programming guru :)</p><p>Really appreciate any guidance on this...</p><p>Marcus</p>","509057","","24462","","2010-11-16 19:00:31","2011-09-30 13:34:37","Converting a Delphi 5 engine control app to Android - need advice on the approach","<java><android><delphi><monodroid>","7","0","1","",""
"4191115","1","4192033","","2010-11-16 04:01:58","1","1573","<p>I would like to store an object into a SQLlite database. I am looking for how to best do it in order to ensure that if I need to updata/change this object in the future that users of the new and old object layout will be minimally impacted. In other words I want to ensure that making changes to the object will have minimum affect on clients that do not update their software on the old database format. I want to also ensure an easy update from the old record style to the new format.</p><p>I was thinking that I could add an element in the SQL row to identify the object type with a unique name, and to identify the object version number. That way I could read the row and use the object number to control the deserializer to use the correct version of the class.</p><p>I would greatly appreciate best practices on the subject.</p>","467569","","236247","","2011-06-28 15:03:23","2011-06-28 15:03:23","Store object into SQLite database best practices","<android><sqlite><serialization>","1","2","","",""
"4191136","1","","","2010-11-16 04:06:44","2","7863","<p>How do I store and retrieve a byte array (image data) to and from a SQLite database in Android?</p>","482568","","23897","","2010-11-16 04:17:05","2010-11-22 15:05:56","How to store and retrieve a byte array (image data) to and from a SQLite database?","<android><sqlite>","1","1","1","",""
"4191243","1","4191259","","2010-11-16 04:30:03","2","872","<p>What is the difference between locales ja and ja_JP in Android? Do I have to care about both?</p><p>Thanks in advance.</p>","476747","","","","","2010-11-16 04:34:10","Locale Setting in Android","<android><locale>","1","0","","",""
"4191285","1","4192588","","2010-11-16 04:40:19","1","1510","<p>Im writing automatic test for my program. I have completed writing it on Android. However, now I want to write a script to run it from command line adb shell. Do you know how to do it? As I test many components of my program, running it from script will save lots of my effort.</p><p>Thanks.</p><p>Here 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.wsandroid.test""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;uses-library android:name=""android.test.runner"" /&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;instrumentation android:targetPackage=""com.wsandroid"" android:name=""android.test.InstrumentationTestRunner"" /&gt;</code></pre><p> </p><p>Thanks</p>","426196","","","","","2012-10-22 13:51:16","How to start Android test unit from command line","<android><unit-testing><adb>","1","0","1","",""
"4191303","1","4191319","","2010-11-16 04:45:36","0","500","<p>I am trying to log in eclipse in a very simple test app.I have the following:</p><pre><code>public class Test extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Log.i(""FSDSFS"",""JJJJJJ"");    }}</code></pre><p>I have imported the log via import android.util.Log; and am looking in the LogCat,but I see nothing at all.I clicked on the I with a circle around it in LogCat.</p><p>What could I be doing wrong here?</p><p>Thanks</p>","509087","","","","","2010-11-16 04:50:07","Logging in Eclipse/Android","<android><eclipse>","1","0","","",""
"4191426","1","4191617","","2010-11-16 05:21:01","0","1099","<p>How do I have an app return to the 'Home' screen when the user is on a different class and they click the back/return button on their phone?</p><p>Right now, when they access a different class and hit the back button, it goes back to the Home screen on the Droid rather than the Home screen on the app - how do I get it to go back to the Home Screen on the app?</p><p>Thanks!</p>","496686","","","","","2010-11-16 06:12:36","What is the command to return to your main screen in an app?","<android><command><homescreen>","2","0","","",""
"4191452","1","4191556","","2010-11-16 05:29:22","0","42","<p>I am a novice programmer when it comes to Java, I have Java:How To Program 7th Ed. that I am reading. My major is Computer Science so I have a little bit of knowledge about what yo do but as for the Application. I am trying to make a game app and was wandering what would be a good source to reference for various things inside of the app mainly the game play. </p>","509106","","","","","2010-11-16 05:52:31","What is a good resource for help on codes to use for App?","<java><android>","2","0","","",""
"4191492","1","4191847","","2010-11-16 05:37:58","10","15804","<p>How can I launch a facebook app from my app in android?</p>","1746300","","3043","","2010-11-16 05:51:26","2013-06-14 14:36:09","launch facebook app from other app","<android>","4","1","27","",""
"4191620","1","","","2010-11-16 06:11:28","0","299","<p>In My application i want to load a webpage by ckicking a TextView. How i can do this?Please Help.</p><p>Thank You.</p>","436765","","","","","2010-11-16 06:56:13","Loading a Webpage from my emulator","<android>","3","2","","",""
"4191641","1","4191686","","2010-11-16 06:16:21","0","566","<p>More specifically I want to edit the Settings.apk and add more options. I'm unsure what the best approach to this is. I know how to convert the classes.dex to a .jar, but this doesn't seem like the way to go about accomplishing anything. At any rate, I'm really looking for some insight into this and advanced editing such as this. Someone knows how to, care to share?</p>","420015","","","","","2010-11-16 06:25:55","Android: I want to edit system apps. Tell me what I need to know","<java><android><editing>","1","0","","",""
"4191667","1","4191773","","2010-11-16 06:22:30","1","723","<p>Hi i am displaying items according to different categories using Expandable Listview.Now I want to display only items ,No need of parent name or parent indicator.is there any solution from expandable list view to diplay only child items .I don't have time Thats y i am displaying items from expandable list view(I am alredy developed this one) .So please give me some suggestions.It is very urgent.thanks in advance</p>","479027","","","","","2011-07-15 03:44:45","Display only child items in Expandable list No need of parent indicator","<android>","2","0","1","",""
"4191762","1","4191807","","2010-11-16 06:40:56","80","79222","<p>Is it possible to view Androidmanifest.xml file?I just changed the extension for apk file to zip. This zip file contains Androidmanifest.xml file. But I cant view the Androidmanifest.xml coding. Its fully encrypted. How to view the Androidmanifest.xml file?</p>","488433","","488433","","2011-01-21 12:59:48","2014-01-06 07:30:16","How to view AndroidManifest.xml from APK file?","<android><xml><encryption><android-manifest><apk>","4","3","57","",""
"4191765","1","","","2010-11-16 06:41:52","1","606","<p>I use android version 2.2 to develop.I want to capture the screenshot of live wallpaper which is the current wallpaper in the launcher. Is there the method to capture thescreenshot?</p><p>Thanks for helping. </p>","509149","","19750","","2011-03-31 15:43:09","2011-03-31 15:43:09","Code for capturing the screenshot of live wallpaper in android 2.2","<android><screenshot><live-wallpaper>","0","2","1","",""
"4191805","1","4193687","","2010-11-16 06:48:55","-1","1181","<p>What's cross-platform for those, flexible, easy to develop and debug, and offers good cross-platform GUI development?</p><p>Good support for ODBC database is a plus and support for GIS database is a major plus.</p>","192910","","450398","","2010-11-16 08:09:38","2012-11-27 17:42:15","Is there a 'best' Java RAD - for al Android/Linux/Windows?","<java><android><rad>","4","0","","2012-11-27 21:40:33",""
"4191813","1","4191910","","2010-11-16 06:50:19","1","204","<p>I am developing Android TextToSpeech app. This application is not working in <em>Android 1.5</em>, but it works fine in <em>Android 1.6</em>.</p><p>I am using <code>google-api-translate.jar</code>.</p>","254790","","638471","","2013-12-22 13:59:12","2013-12-22 13:59:12","Android TextToSpeech is not working on android 1.5","<android><google-translate><android-1.5-cupcake>","1","0","2","",""
"4191822","1","","","2010-11-16 06:51:18","-1","457","<p>I want to do something like that. For example, I have a textview with String<strong>Alibaba</strong> love <strong>Mary</strong> so muckIn that String alibaba and Mary have a event to open something but I can't know how to use event for Mary and Alibaba seperatelyCan anyone have some code demo for me, It make me crazy somedays</p>","398650","","","","","2010-12-18 04:22:21","2 String in a TextView listen Seperated clickevent in 1 TextView","<android><events><textview>","2","0","","",""
"4191826","1","4191984","","2010-11-16 06:51:25","0","479","<p>I tried doing it by using Intent,but,i seem to get the following error:11-15 22:40:39.266: ERROR/dalvikvm(1589): Could not find class 'BlobCity.xyz.com.maps', referenced from method BlobCity.xyz.com.BlobCity$sendUserPass.onClick</p><p>where blobcity is my class that calls the maps class which contains the mapview.</p>","505453","","","","","2010-12-08 03:56:56","how do call a class(mapview extending mapActivity) from another class?","<java><android><android-intent>","2","2","","",""
"4191902","1","4235189","","2010-11-16 07:07:46","0","2242","<p>I have a vertically oriented <code>LinearLayout</code> that has a child <code>LinearLayout</code> that includes a <code>TextView</code>, an <code>EditText</code>, and a <code>Button</code>,  and a child <code>ImageView</code>. </p><p>So something like:</p><pre><code>&lt;LinearLayout&gt;   &lt;LinearLayout&gt;        &lt;TextView&gt;        &lt;EditText&gt;        &lt;Button&gt;   &lt;ImageView&gt;</code></pre><p>And the problem I am experiencing is that the seperation between the LinearLayout and the ImageView (displaying a .png as a background with android:background=""@drawable/sun"") is displaying a visible crease in between them.  I have the LinearLayout  using the same background color as the .png so that it looks like they flow together, but the crease ruins that aspect.  </p><p>Edit: Here's a screenshot!</p><p><img src=""http://i.stack.imgur.com/4F0rZ.png"" alt=""alt text""></p><p>Do you see the thin line under the submit button? </p><p>Here is the xml:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@color/lightblue""    &gt;    &lt;TextView          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""@string/welcome""        android:textSize=""17sp""        android:textColor=""@color/black""    /&gt;    &lt;EditText         android:id=""@+id/entry""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:hint=""@string/hint_text""        android:textSize=""25sp""        android:inputType=""text""    /&gt;    &lt;Button        android:id=""@+id/submitButton""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textSize=""25sp""        android:text=""Submit""    /&gt;    &lt;FrameLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:paddingTop=""0px""    &gt;    &lt;ImageView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""@drawable/sunclouds""        android:layout_marginBottom=""20dip""/&gt;    &lt;TextView        android:id=""@+id/marq""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginBottom=""10dip""        android:layout_gravity=""center_horizontal|bottom""        android:textColor=""@color/black""        android:text=""@string/provider""        android:marqueeRepeatLimit=""marquee_forever""        android:ellipsize=""marquee""        android:focusable=""true""        android:focusableInTouchMode=""true""        android:singleLine=""true""        android:scrollHorizontally=""true""        /&gt;    &lt;/FrameLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>How can I fix this?</p><p>(side note, my sun and cloud have rough edges, any quick fixes with gimp?)</p>","487840","","487840","","2010-11-16 15:31:19","2010-11-20 21:50:11","Removing ImageView border","<android><imageview><android-linearlayout>","1","9","1","",""
"4191929","1","","","2010-11-16 07:14:03","0","1052","<p>I am trying to build a music app on a android device with GStreamer ported on it. But when I try mp3 url streaming on http, it failed to handle stream (however, it works perfectly fine on Android devices with base Media Framework, OPENCore). So I wanted to know whether GStreamer supports http url streaming, or is there any other way of doing it.</p><p>Thanks in advance </p>","196579","","","","","2010-11-18 05:42:20","Android GStreamer fails to stream http url","<android><android-emulator><android-ndk><gstreamer>","1","0","","",""
"4191941","1","","","2010-11-16 07:16:53","1","1491","<p>I have one activity (Home.class), and that activity contains 3 views:</p><p>first_view.xml, second_view.xml,third_view.xml</p><p>first_view.xml contains 2 buttons (btnSecond and btnThird). If I click btnSecond, second_view.xml will appear. If I click btnThird, third_view.xml will appear.</p><p>In the third view there is a ExpandableListView. So I extend ExpandableListActivity in the Home.class. But now there is a problem. </p><p>When I am running, an exception occurs:</p><p>java.lang.RuntimeException: Your content must have a ExpandableListView whose id attribute is 'android.R.id.list' </p><p>When I use ExpandableListView in all xml files, the problem is solved. But I want to display this list only in third_view.xml. How can I solve this problem?</p>","504117","","","","","2011-06-29 04:22:50","problem with ExpandableListView in Android","<android><expandablelistview>","1","0","","",""
"4191997","1","4192037","","2010-11-16 07:30:01","3","1138","<p>I have a very simple 2 screen android app.</p><p>Is there any downside to simply switching out the layouts via setContentView or should i be using intents?Don't want to bugger up my app if something is wrong with this.</p>","509087","","","","","2011-01-21 19:27:33","Android setContentView or Intents?","<android>","4","0","1","",""
"4192013","1","","","2010-11-16 07:33:13","0","179","<p>In android I have my textview, I type ""HELLO I AM <strong>KELLO</strong> I kie <strong>HAMBERY</strong>""I want when I click on Kello it will pass into kello activityand when I click on Hambery it will pass into Hambery activiy</p>","398650","","","","","2010-12-18 04:20:17","Click LinkText To Open A activities","<android>","2","1","","",""
"4192023","1","4192079","","2010-11-16 07:35:31","0","1326","<p><br> i just want to break a large image into some equal parts like 4, 6 or 8. can we do it? actually i want to store every parts of image as a separate image in my  drawable folder for future use.</p><p>can any one help me?</p><p>Thanks in advance sunit</p>","361288","","","","","2010-11-16 09:43:12","how to break a large image into 8 equal parts in android","<android>","1","0","","",""
"4192059","1","4192489","","2010-11-16 07:43:56","3","1871","<p>I'm try to create selector to CheckBox and replace the android:button with the selector.In the selector i had two 9patch image , but for some reason that not work good.the 9patch images are ok.This the selector code:</p><pre><code>&lt;selector android:constantSize=""false""  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_checked=""false""       android:drawable=""@drawable/bopen"" /&gt;    &lt;item android:state_checked=""true""      android:drawable=""@drawable/bclose"" /&gt;    &lt;item android:drawable=""@drawable/bclose"" /&gt;&lt;/selector&gt;</code></pre><p>What can i do ?</p>","508197","","321697","","2011-01-06 15:37:31","2012-01-31 22:13:08","selector with 9 patch","<android>","1","3","","",""
"4192223","1","4477841","","2010-11-16 08:21:24","0","557","<p>I'm reading some sources for Android, and I read this:</p><pre><code>OutputStream thumbOut = mCr.openOutputStream(uri);bitmap.compress(Bitmap.CompressFormat.JPEG, 85, thumbOut);thumbOut.close();</code></pre><p>when trying to store a bitmap (bitmap) in a database (uri is the URI of a row in the database). As far as I can understand, openOutputStream allows to store binary data in the database, but only the path of the file is placed in the DB. The file is placed somewhere in the filesystem. Is this correct? My question is: how do I specify the exact location of the files when stored this way?Thanks for any clarification.</p>","427544","","21234","","2010-11-16 08:59:42","2010-12-18 11:29:30","Writing binary data in a sqlite database Android's ContentResolver","<android><database><android-sdk-2.2><android-contentresolver>","1","0","","",""
"4192351","1","4192397","","2010-11-16 08:42:28","0","1191","<p>I want to display the images in my Application added to my ""raw"" folder of the Eclipse as it gets started.</p><p>How do I add those particular images to an Array and rotate the loop until all the Images are displayed?</p><p>Can anyone help me for this?</p>","422859","","628006","","2012-03-31 00:37:36","2012-03-31 00:37:36","Adding images into array of an Android Application","<android><arrays>","1","2","","",""
"4192371","1","4192456","","2010-11-16 08:45:12","2","567","<p>Im pretty sure the answer is no, but im using the new IntelliJ EAP version and have a project i worked on a while back which was just written against JDK 1.6 for an applet based application.</p><p>However now i could see how it could be useful in an android app that im interested in creating.</p><p>Do i now have to re-write all the code/tests again targeting the android sdk or can i just drop in my existing JAR file and only use android for the UI layer.</p><p>Its just android seems to make testing WAY harder than it needs to be, and i have alot of existing tests written and working, if it wasnt so hard to just write a quick unit test (standard Junit @Test style) i wouldnt mind porting, however i just dont get the whole instrumentation thing, as i dont need a UI at the moment...</p><p>Anyway so back to the point, can i use my existing JDK built code in an android app?</p>","476660","","27615","","2011-11-26 10:28:14","2011-11-26 10:28:14","Can Android use standard built JAR files?","<android><unit-testing><jdk>","2","0","","",""
"4192413","1","","","2010-11-16 08:52:11","0","750","<p>I want to get an animated text in Android where it should run from left to right on the screen. Eg.I want to get this textprivate static final String QUOTE =            ""Nobody uses Java anymore. It's this big heavyweight ball and chain.""; </p><p>running from right to left using animation.</p><p>However, this text gets truncated to  ""Nobody uses Java anymore. It's"" in Portrait mode and to""Nobody uses Java anymore. It's this big heavyweight"" in landscape mode.</p><p>This is the code that I have used</p><pre><code>        Paint paint = new Paint();        paint.setColor(Color.BLUE);        private static final String QUOTE =        ""Nobody uses Java anymore. It's this big heavyweight ball and chain."";         paint.setTextSize(20);        paint.setAntiAlias(true);        int len= QUOTE.length();        canvas.scale(1,-1);        canvas.drawText(QUOTE, 0, len-1, 100, 60, paint);        canvas.drawText(QUOTE,0,100 , paint);        createAnim(canvas);            private void createAnim(Canvas canvas) {        anim2= new TranslateAnimation(500,-500,30,30);        anim2.setRepeatCount(Animation.INFINITE);        anim2.setInterpolator(new AccelerateDecelerateInterpolator());        anim2.setRepeatMode(Animation.RESTART);        anim2.setDuration(1000L);        startAnimation(anim2);             }</code></pre>","490096","","","","","2010-12-14 11:43:19","Not getting complete text while Animation on Canvas : Android,","<android><animation><canvas>","1","0","1","",""
"4192471","1","4192494","","2010-11-16 08:59:45","2","193","<p>i have this 3 lines of code which i use to hold the state of items in my listview wjen scrolling, but my problem is, the last line of code only gets executed. could you please help me solve this. this is the code block:</p><pre><code>holder.viewName.setTextColor((priority.equals(""Low"")? Color.BLUE: Color.GRAY ) );holder.viewName.setTextColor((priority.equals(""Medium"")? Color.GREEN: Color.GRAY ) );holder.viewName.setTextColor((priority.equals(""High"")? Color.RED: Color.GRAY ) ); // items in this state condition only gets executed in the listview, the rest are ignored and set to gray.</code></pre><p>is there a way i can join the code logic together, so that all 3 conditions can be called?.. thank you </p>","479908","","","","","2010-11-16 09:24:41","Please help solve this listview problem","<android>","2","0","","",""
"4192487","1","","","2010-11-16 09:02:47","0","332","<p>Can someone please suggest me some good framework (officially released) to follow for developing AIR Desktop and android applications just like Cairngorm for flex web applications.</p><p>Thanks Piyush G.</p>","82433","","1104926","","2011-12-19 13:59:11","2011-12-19 13:59:11","Framework model for AIR and Android applications.","<android><flex><air><flex4><cairngorm>","2","2","","",""
"4192559","1","4192629","","2010-11-16 09:15:01","0","2554","<p>i am using contact picker, is it possible to select multiple contacts with the help of checkbox in contactpicker activity? is there any other possible way?P.S: now i am using a contactpicker activity,which helps to get a single contact! :-(</p>","430652","","489741","","2013-03-12 15:18:39","2013-03-12 15:18:39","is it possible to selecte multiple contacts from contact picker?","<android><checkbox><contact>","1","0","2","",""
"4192639","1","4193074","","2010-11-16 09:25:18","0","317","<p>intentTest.java:</p><pre><code>    package intentTest.xyz.com;     import android.app.Activity;   import android.content.Intent;   import android.os.Bundle;  import android.view.View;  import android.widget.Button;      public class intentTest extends Activity {      Button b;            /** Called when the activity is first created. */     @Override      public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);        setContentView(R.layout.main);         b = (Button) findViewById(R.id.b);        b.setOnClickListener( new View.OnClickListener() {           public void onClick(View view) {            Intent intent = new Intent(intentTest.this,seond.class );            startActivity(intent);           }       });    }}</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=""First screen""      /&gt;   &lt;Button      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""click""     android:name=""@+id/b""     /&gt;    &lt;/LinearLayout&gt;</code></pre><p>seond.java:</p><pre><code>package intentTest.xyz.com;import android.app.Activity;import android.os.Bundle;public class seond extends Activity{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.second);     } }</code></pre><p>second.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;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:text=""second screen""     /&gt;</code></pre><p></p><p>manifest.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=""intentTest.xyz.com""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".intentTest""              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="".seond""&gt;&lt;/activity&gt;&lt;/application&gt;&lt;/manifest&gt; </code></pre><p>i get the following error code:</p><pre><code>11-16 01:26:07.156: ERROR/AndroidRuntime(779): Uncaught handler: thread main exiting  due to uncaught exception11-16 01:26:07.166: ERROR/AndroidRuntime(779): java.lang.RuntimeException: Unable to start activity ComponentInfo{intentTest.xyz.com/intentTest.xyz.com.intentTest}: java.lang.NullPointerException11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at android.os.Handler.dispatchMessage(Handler.java:99)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at android.os.Looper.loop(Looper.java:123)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at android.app.ActivityThread.main(ActivityThread.java:4203)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at java.lang.reflect.Method.invokeNative(Native Method)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at java.lang.reflect.Method.invoke(Method.java:521)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at dalvik.system.NativeStart.main(Native Method)11-16 01:26:07.166: ERROR/AndroidRuntime(779): Caused by: java.lang.NullPointerException11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at intentTest.xyz.com.intentTest.onCreate(intentTest.java:18)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)11-16 01:26:07.166: ERROR/AndroidRuntime(779):     ... 11 more</code></pre>","505453","","","","","2010-11-16 10:18:52","my app crashes before it starts.This is a simple app in which i am making the use of intent to call another class from a previous class","<java><android><android-intent>","5","0","","",""
"4192699","1","","","2010-11-16 09:31:28","0","1242","<p>Is there a way to retrieve the number of sent SMS messages between specific dates in android?</p><p>I would prefer an officially supported SDK functionality, this stating in your answer whether this is part of the official SDK would be helpful.</p><p>I am aware of <a href=""http://stackoverflow.com/questions/990558/android-broadcast-receiver-for-sent-sms-messages"">this</a> stack overflow question but it seems to use the not officially supported <code>android.provider.Telephony.SMS_RECEIVED</code> and <code>content://sms/sent</code>, so I would rather not use it (please correct me if i'm wrong about this being unsupported).</p>","16418","","557179","","2011-10-07 19:13:19","2011-10-07 19:13:19","How to get the number of sent SMS messages between specific dates in android","<android><sms><content><provider>","1","0","","",""
"4192738","1","","","2010-11-16 09:36:56","0","904","<p>I got a well known security exception: </p><pre><code>java.lang.SecurityException: Sending SMS message: User 1001 does not have android.permission.SEND_SMS</code></pre><p>I added the following line to the android manifest file:</p><pre><code>&lt;uses-permission android:name=""android.permission.SEND_SMS"" /&gt;</code></pre><p>But even when I do this I got the same exception.</p><p>This has possibly something to do with the shared user id I use:<code>android:sharedUserId=""android.uid.phone""</code>, so here my question:</p><p>When I use a shared user id (from a system application), can I add my own permissions to the manifest file.</p><p>additional information:I used the same certificate as the system, else I couldn't use the same user id as a system application.</p><p>Thanks in advance for your answers and remarks!</p>","509318","","1232277","","2013-01-05 03:13:08","2013-01-05 03:13:08","How to use security permissions in combination with a shared user id?","<android><android-manifest>","0","3","","",""
"4192798","1","","","2010-11-16 09:45:17","12","3707","<p>I've seen references on how to SET system colours, but I need to find out how you GET them - how do you find out what they are?</p><p>On the Samsung Galaxy S for example, the tab views, ListView highlights when you select an item, and the Summary text line on the preference screen are all blue.</p><p>There are many apps which immitate this style and I want to do the same. Obviously I cannot just hard code and set the colour to Blue, as other handsets use different colours.</p><p>The question is, is there a way to programmatically find out what colour the Preference Screen Summary Line, Tabs, or ListView selections are, so that you can then set that against a TextView elsewhere in your app?</p><p>How do I get the android system colours?</p>","509326","","509326","","2010-11-16 12:40:53","2012-01-02 21:50:09","How to Get Android System Colors","<android><uicolor>","2","1","2","",""
"4192806","1","","","2010-11-16 09:46:42","2","2823","<p>I know you can set orientation using android:screenOrientation statically and setRequestedOrientation programatically.  However the problem is that if I use either of these to set the screen orientation I do not get to choose which landscape or which portrait I want.  To wit, flipping the phone 180 degrees does not rotate the view but rather just appears upside down to the user.  I cannot use screenOrientation=""sensor"", because in some cases I would only want the view to be landscape OR portrait and seldom both.  This seems insignificant until you consider external hardware.  </p><p>If I developed an app and set the layout to android:screenOrientation=""landscape"", the app would only display correctly if the left side of the droid were sitting on a desk.  Unforunately the left side is where the usb port is, so the phone would not sit very well on that side if it were plugged in.  Unless of course they used a docking station but that is not the kind of help I am looking for.  If the right side of the phone is sitting on the desk to allow for the cord, the display appears upside down. I tried posting an image but being a new user I was not able to do so.</p><p>What I would like to know is how to programmatically choose which landscape (Surface.ROTATION_90,Surface.ROTATION_270) or portrait (Surface.ROTATION_0,Surface.ROTATION_180) orientation I wish the user to see, but more importantly allow them to do so in the app's settings activity.  I have googled for quite awhile and all I can find are sensors that tell you when the orientation/rotation has changed and to what, but none show how to programmatically set either.  Any sample code or links to the same would be greatly appreciated.  </p><p>Thank you in advance.</p>","509298","","","","","2011-01-25 16:51:51","How to set desired lanscape orientation","<android><screen-orientation>","0","2","1","",""
"4192867","1","4193040","","2010-11-16 09:53:05","2","2635","<p>I'm trying to create a very simple android screen with the following content: top banner, webview and bottom banner. for some reason, i can't do it. my xml look like:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/FrameLayout02""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""    android:orientation=""vertical""     android:fitsSystemWindows=""true"" android:isScrollContainer=""false""&gt;    &lt;ImageView android:layout_width=""wrap_content"" android:layout_above=""@+id/Web""        android:layout_height=""fill_parent"" android:layout_gravity=""top""        android:src=""@drawable/logo""&gt;&lt;/ImageView&gt;    &lt;WebView android:layout_gravity=""center"" android:id=""@+id/Web""         android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;&lt;/WebView&gt;    &lt;ImageView android:layout_width=""wrap_content"" android:layout_below=""@+id/Web""        android:layout_height=""fill_parent"" android:layout_gravity=""bottom""        android:src=""@drawable/logo""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre><p>what is wrong? </p><p>Thanks,Daniel</p>","509334","","","","","2010-11-16 10:24:47","screen with top banner, webview and bottom banner","<android><xml>","1","0","","",""
"4192955","1","","","2010-11-16 10:02:59","3","1838","<p>how to develop HTML + CSS for android mobile.. any guidance will be great help</p>","502218","","","","","2010-11-16 10:35:28","html development for android mobile","<html><android><css><user-interface>","4","2","1","",""
"4192979","1","4193051","","2010-11-16 10:06:34","2","1130","<p>My Application needs to Download some bigger Files. I use a Service for the Download an show the Progress in a Notification. The Problem is that during that download time the user can switch from 3g to WIFI. In that case the progress stops but no exception is thrown.How do i handle this situation properly?</p><pre><code>URL url = new URL(myurl);URLConnection conexion = url.openConnection();conexion.setReadTimeout(10000);conexion.setConnectTimeout(10000);conexion.connect();int lenghtOfFile = conexion.getContentLength();// downlod the fileInputStream input = new BufferedInputStream(url.openStream());OutputStream output = new FileOutputStream(targetFilePath);byte data[] = new byte[1024];long total = 0;while ((count = input.read(data)) != -1) {    total += count;    // publishing the progress....    updateProgress(downloadNM, downloadNotification, (int)total*100/lenghtOfFile);    output.write(data, 0, count);}output.flush();output.close();input.close();</code></pre>","457378","","","","","2010-11-16 10:16:01","How to handle switch from 3G to WIFI. UrlConnection TimeOut does not throw Exeption","<android><urlconnection>","1","0","","",""
"4193039","1","","","2010-11-16 10:14:29","0","895","<p>Im writing a program which is going to be a type of scheduler backed by a database.</p><p>We'll call the database items, A B C and each relies on each other. You can't add a B without an A, and you can't add a C without a B (relies on row ids).</p><p>They're all a simple list of items, but we want to do a little more with B like Hold, Extend, and view C items.</p><p>Initially I figured I would use a Context Menu but reading through the android design guidelines, I understand that while desirable, this should not be the way of navigating items.</p><p>So with my ListView for A, I can add a Button to delete an item or allow a press on the item to get into the ListView for B.</p><p>But how would you recommend I design the ListView for B?</p><p>After a B record is added, we don't need to edit it, but we will have some options like Hold and Extend. We also wouldn't want to allow a click on a List Item for B to go straight to the ListView for C as we would bypass the options needed for B.</p><p>Im guessing I could either:</p><p>1) Ignore the Guidelines and Stick with Context Menus2) Have a Greyed out Edit form for B, with a clickable button to go to C3) Have a Greyed out Edit form for B, but include the C ListView on the Edit form for B</p><p>The last two options then raises its own issues, in that as C relies on B, we would either need to have a ""Save and Continue"" or ""Next"" button to ensure the B item is saved, or if we included the C ListView on the B Edit form I would presumably save the BId on the C Window with a temporary Id of say -1 bearing in mind that we haven't yet saved B and don't know what its row id is, remembering to save/tidyup everything on returning.</p><p>How would you guys handle something like this? </p><p>Is it acceptable to have ""Next..."" options in Android screens?Where would you normally Save a New database option, do you utilise a save button, or do you handle it ""OnBack"" like the Contacts Edit screen?</p>","509326","","","","","2010-11-16 10:14:29","Android UI Design Principles","<android><design><user-interface>","0","2","","",""
"4193143","1","4332092","","2010-11-16 10:26:57","0","579","<p>i am using ksoap library to call webservice in android.i dont see request timeout property here in case of INTERNET is not available in the middle of call so it is important to have it.</p><p>some one suggested me to use socket class which has Sotimeout but i dont know how to implement it here any one suggest me what should i do?</p><pre><code>public void callWebservice(){try {SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);request.addProperty(""passonString"", ""anything"");SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);envelope.dotNet=true;envelope.setOutputSoapObject(request);HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);androidHttpTransport.call(SOAP_ACTION, envelope);.....}catch(Exception ex){}}</code></pre>","249991","","","","","2010-12-02 05:49:00","Ksoap Library and Request Time out?","<android><webservice-client>","1","0","","",""
"4193167","1","","","2010-11-16 10:29:31","8","20724","<p>I have a scroll view with lots of image buttons. I want to change the image for an image button when it's pressed. The thing is that I want the image to remain until another image button is pressed. That's why I couldn't use a selector. What is the best practice to achieve his?</p><p>Best Regards</p>","460611","","","","","2014-03-18 10:21:34","Change source image for image view when pressed","<android>","10","0","2","",""
"4193186","1","4193228","","2010-11-16 10:32:26","0","568","<p>I have searched SO for anser to my question which is ""invocking a remote webservice from a j2me application"". All the tutorials refer to implementing it as a MIDLET. But I am not using a midlet. Can anyone please tell me if it is possible to invoke a webservice in plain j2me application, which is as basic as a hello world?I am coding for android. My code starts with somethig like </p><pre><code>    public class HelloWorld extends Activity {    //some initialization    public void OnCreate() {   //remaining initialization commands ... etc   }    //etc    }</code></pre><p>I want to know if a webservice can be invoked from this kind of program?</p>","170986","","21234","","2010-11-16 11:00:24","2010-11-16 11:00:24","Android : connecting to a webservice in Android","<java><android><webservice-client>","1","1","1","",""
"4193218","1","4193245","","2010-11-16 10:36:00","0","2174","<p>Can anyone tell me how to show the soft input keyboard while a activity opens.In Normal case a keyboard pops up when we tap inside the edit text but i want to open it automatically when that screen loads.</p><p>here is the xml layout file</p><p>and here is the main.xml layout file                                    </p><pre><code>&lt;TextView android:id=""@+id/TextView01"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:text=""This is my sample App of android""    android:textColor=""#000000"" android:textSize=""20dip""&gt;&lt;/TextView&gt;&lt;EditText android:id=""@+id/EditText01"" android:layout_height=""wrap_content""    android:layout_width=""fill_parent""&gt;&lt;/EditText&gt;&lt;Button android:id=""@+id/Button01"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:text=""Say Hello""&gt;&lt;/Button&gt;</code></pre><p></p>","395661","","395661","","2010-11-16 12:04:17","2012-04-08 20:47:55","how to show android Keyboard automatically while Screen Opens?","<android>","2","0","","",""
"4193224","1","4197400","","2010-11-16 10:36:32","0","733","<p>I am working on a test application on Android platform. Test the write/read speed to the sdcard. I write in C language with NDK interface.</p><p>First I write a for-loop to create 256 files with 512 random bytes in each. This part works fine. I open file with flag O_CREAT|O_WRONLY|O_SYNC and mode 0666. After call write, I do sync() to make sure the data is written on the card.</p><p>Then I write another 2-level for-loop to read these file to test speed. I use O_RDWR|O_SYNC to open the file. Then call read().</p><p>Here is the thing: If it is the first time I run the read part. The first loop to read take more time than the after. I'm sure it is because after the first loop, program read the cache not the real physical card.</p><p>I've tried O_DIRECT flag to read. But it error with EINVAL. In the man page for open, it says maybe it is because of this function not implement by the platform.</p><p>Do you have any idea on how to read with no-cache in Android?</p>","411771","","","","","2010-11-16 18:06:07","How to read file with no-cache in Android?","<android><file><cache-control>","1","0","","",""
"4193274","1","","","2010-11-16 10:41:06","1","321","<p>I am trying to set up an AVD for a 480*854 device. The AVD seems fine but when it opens my app the SurfaceView that I create is opening at 320*480 rather than 480*854. Does anyone have any ideas as to what might be going wrong?</p><p>cheers</p>","509383","","","","","2012-08-17 17:28:00","Android Emulator opening view at 320*480 when set to 480*854","<android><android-emulator>","3","0","","",""
"4193318","1","4279090","","2010-11-16 10:47:05","0","4537","<p>I'm developing an Android application.</p><p>I have a 3D model drawn with Blender. Do you know if there is a way to export that model into a OpenGL geometry?</p><p>I'm going to use C++ code to load model and draw it with OpenGL. But if you know a better choice, please tell me.</p>","68571","","419","","2011-01-24 19:19:29","2011-01-24 19:19:55","Export BLENDER model into an OpenGL geometry inside a C++ header file","<android><opengl-es><jni><blender>","2","0","1","",""
"4193338","1","","","2010-11-16 10:49:51","1","387","<p>There are 20 buttons in an Activity .</p><p>The ids are <code>R.id.ButtonR1C1; R.id.ButtonR1C2</code> .. and so on ie. Row 1, Col 1..</p><p>now earlier I had created 20 buttons.</p><pre><code>private Button b1,b2,b3...;</code></pre><p>and then </p><pre><code>b1=(Button)findViewbyId(R.id.ButtonR1C1);b2=(Button)findViewbyId(R.id.ButtonR1C2);</code></pre><p>.... and so on.</p><p>Finally </p><pre><code>b1.setOnClickListener(this);b2.setOnClickListener(this);  </code></pre><p>... 20</p><p>so I thought I'd create a Button Array </p><pre><code>Button barray[][]=new Button{4][5];for(int i=1;i&lt;=4;i++) {   for (int j=1;j&lt;=5;j++) {      String t=""R.id.ButtonR""+i+""C""+j;      barray[i-1][j-1]=(Button)findViewbyId(Integer.parseInt(t));   }}</code></pre><p>Gives an error..</p><p>Any help??</p>","502773","","251173","","2010-11-16 10:56:55","2012-12-31 22:35:54","Problem with converting a string to an integer and passing as an ID to a view","<java><android>","6","2","","",""
"4193343","1","4235614","","2010-11-16 10:50:04","5","10623","<p>I'm wanting to write a widget displays the users' prepay balance, remaining data etc. </p><p>I'm thinking of automatically calling the USSD code which returns this data (will have to have a regex for each network), at intervals (not often, to save battery). This would have to be done in the background. I have an app at the moment which runs the ussd code and returns the result, so I think this should be possible - but I'm not sure how it would be done in the background.</p><p>I've seen the intents for Calling a number, but I'm not sure how to get the result, and I'm also thinking that that intent would cause the call screen to come up into the foreground?</p><p>The other option is to get the data by screen-scraping the result from the carrier's website/maybe wap site but that would result in data charges for the user, so I would prefer a solution using the USSD code.</p><p>Thanks in advance for any help - only started working on understanding android today so got quite a lot to learn :)</p>","401492","","","","","2012-04-20 10:49:19","Call (and get the response for) a USSD Code, in the background?","<android>","3","3","2","",""
"4193348","1","4193857","","2010-11-16 10:50:53","3","6805","<p>I want to create a custom <code>OptionsMenu</code> in my application. The default <code>OptionsMenu</code> display only three items in one row. Now i want to display five to six items having only icons. Also i want to change the background color of the OptionsMenu but not getting the appropriate way of doing this. If it is possible then please let me know about it.</p>","457982","","457982","","2011-01-10 11:31:05","2011-01-10 11:31:05","Custom options menu in Android","<android><options-menu>","1","0","2","",""
"4193384","1","","","2010-11-16 10:54:34","3","1592","<p>I want to get the current bitmap associated with my canvas so I can perform operations on it. I can't see how to do this though. </p><p>I've seen some examples where you create a bitmap and set the canvas to use this bitmap, so obviously you can then access it later, but I'm using the canvas returned from a SurfaceHolder so there's no constructor.</p><p>For instance, examples often show this kind of thing:</p><pre><code>Bitmap bmp = Bitmap.createBitmap(xxx, yyy, Bitmap.Config.ARGB_8888);Canvas c = new Canvas(bmp);</code></pre><ul><li>so at this point I can see bmp.</li></ul><p>In my case, the canvas is obtained by:</p><pre><code>final SurfaceHolder holder = getSurfaceHolder();    Canvas c = null;    try {        c = holder.lockCanvas();</code></pre><p>So how can I get the bitmap for c?</p><p><em>Edit</em>@Reuben - you may be right, I did wonder this. In short, my aim is to capture the current canvas contents where I have drawn ""stuff"", and make a copy of it, reversed, to put underneath. Like a reflection. The example of this that I found performed it all via bitmaps, so I assumed I needed to somehow capture the current canvas to a bitmap to then use it. If there is a better way I can do this, I'm all ears!</p>","509400","","509400","","2010-11-16 13:40:41","2012-02-14 01:23:41","How to obtain the current bitmap of a canvas?","<java><android><canvas><bitmap>","2","1","","",""
"4193397","1","","","2010-11-16 10:55:42","1","10192","<p>I want to create a photo gallery on Android. I'm using <code>Gallery</code> and <code>BaseAdapter</code> to create a scrollable gallery. Now I want to add an action when an image of the gallery is shown (each image's width is the same as screen width), so I need to get its index in the image array. My question is <strong>how to get the index of the image</strong> which shows on the screen? </p><p>I want to get the index of the image as soon as it shows on the screen, not on click event.I've tried to get current image position in <code>getView()</code>, but the result is strange: </p><p>I scroll to image02 but position=2 (should be 1). When I scroll back, image02's position=0 (should be 1). </p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);               Gallery g = (Gallery) this.findViewById(R.id.Gallery);          g.setAdapter(new ImageAdapter(this));}public class ImageAdapter extends BaseAdapter {      private Context mContext;      private Integer[] mImageIds = {              //each image's size is 320x60            R.drawable.btm01,              R.drawable.btm02,              R.drawable.btm03    };      public ImageAdapter(Context c){          this.mContext = c;      }    @Override    public int getCount() {        // TODO Auto-generated method stub        return mImageIds.length;    }    @Override    public Object getItem(int position) {        // TODO Auto-generated method stub        return null;    }    @Override    public long getItemId(int position) {        // TODO Auto-generated method stub        return 0;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        // TODO Auto-generated method stub        ImageView imageView = new ImageView(mContext);          imageView.setImageResource(mImageIds[position]);          imageView.setLayoutParams(new Gallery.LayoutParams(320,60));            return imageView;      }</code></pre>","67391","","84237","","2014-03-22 14:28:31","2014-03-22 14:28:31","How to create a Photo Gallery on Android?","<android><image-gallery>","1","0","0","",""
"4193442","1","","","2010-11-16 11:01:04","1","3010","<p>I noticed from Android API, they have this method getPassword(Account account).</p><pre><code>accountManager = AccountManager.get(this);Account[] allGoogleAccounts = accountManager.getAccountsByType(""com.google"");for (Account account : allGoogleAccounts) {  System.out.println(accountManager.getPassword(account));}</code></pre><p>But i have this error:</p><pre><code>11-16 10:49:08.986: WARN/System.err(5732): java.lang.SecurityException: caller uid 10039 is different than the authenticator's uid11-16 10:49:09.038: WARN/System.err(5732):     at android.os.Parcel.readException(Parcel.java:1247)11-16 10:49:09.038: WARN/System.err(5732):     at android.os.Parcel.readException(Parcel.java:1235)11-16 10:49:09.045: WARN/System.err(5732):     at android.accounts.IAccountManager$Stub$Proxy.getPassword(IAccountManager.java:415)11-16 10:49:09.087: WARN/System.err(5732):     at android.accounts.AccountManager.getPassword(AccountManager.java:277)11-16 10:49:09.087: WARN/System.err(5732):     at com.test.account.onCreate(account.java:30)11-16 10:49:09.107: WARN/System.err(5732):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)11-16 10:49:09.107: WARN/System.err(5732):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)11-16 10:49:09.125: WARN/System.err(5732):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)11-16 10:49:09.125: WARN/System.err(5732):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)11-16 10:49:09.134: WARN/System.err(5732):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)11-16 10:49:09.156: WARN/System.err(5732):     at android.os.Handler.dispatchMessage(Handler.java:99)11-16 10:49:09.156: WARN/System.err(5732):     at android.os.Looper.loop(Looper.java:123)11-16 10:49:09.166: WARN/System.err(5732):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-16 10:49:09.175: WARN/System.err(5732):     at java.lang.reflect.Method.invokeNative(Native Method)11-16 10:49:09.185: WARN/System.err(5732):     at java.lang.reflect.Method.invoke(Method.java:521)11-16 10:49:09.185: WARN/System.err(5732):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-16 10:49:09.195: WARN/System.err(5732):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-16 10:49:09.206: WARN/System.err(5732):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Anyone can tell me my mistake?Thanks.</p>","430926","","1741671","","2013-01-11 05:49:19","2013-01-11 05:49:19","Get password from android account","<android><email><passwords>","1","2","1","",""
"4193502","1","4193707","","2010-11-16 11:08:40","3","1744","<p>I'm using a external TrueType font in an embedded HTML resource. The font is located in assets, at the same level than the HTML resource. </p><p>The font is loaded with CSS:</p><pre><code>@font-face {     font-family: MyExternalFont;     src: url('MyExternalFont.ttf'); }body {    font-family:MyExternalFont;}</code></pre><p>And the HTML resource is loaded as follows:</p><pre><code>WebView w = (WebView) findViewById(R.id.webview);w.loadUrl(""file:///android_asset/index.htm"");</code></pre><p>This works fine in <strong>Android 1.5</strong>, <strong>Android 1.6</strong> and <strong>Android 2.2</strong>. It doesn't work in <strong>Android 2.1</strong>.</p><p>However, when I load the font and use it in a <code>TextView</code>, it works on all Android versions. I do it like this:</p><pre><code>final Typeface t = Typeface.createFromAsset(getContext().getAssets(), ""MyExternalFont.ttf"");textView.setTypeface(t);</code></pre><p>What might be the problem?</p><p>(Unfortunately I can't upload the font because it's a paid font)</p>","143378","","","","","2010-11-16 11:39:21","External font doesn't load in Android 2.1","<android><css><webview><font-face><typeface>","1","0","","",""
"4193532","1","4193551","","2010-11-16 11:12:42","1","488","<p>Where can i find mapviews example? </p><p>-adding point to map-clicking that points, and then show up a layer on that point-create a way from point1 to point2</p><p>etc...</p><p>Thanks!</p>","472537","","","","","2011-09-05 08:19:23","Android map examples","<android><android-mapview>","1","0","1","",""
"4193605","1","4193758","","2010-11-16 11:23:34","2","7160","<p>I have created a webview with a transparent background.</p><pre><code>            browser = new WebView(ActivityActivate.this);            browser.setBackgroundColor(0);            browser.getSettings().setJavaScriptEnabled(true);            browser.addJavascriptInterface(new JavascriptInterface(), ""javaInterface"");                           browser.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);            browser.getSettings().setSupportZoom(true);            browser.loadDataWithBaseURL(""https://checkout.google.com"", form, ""text/html"", ""UTF-8"", null);            llPaymentButtons.addView(browser);</code></pre><p>Here is the JavaInterface that should change the color of the background when the html form is submitted and all the checkboxes pass the test.</p><pre><code>    /**     * Interface for Javascript communication     */    private class JavascriptInterface {        //This is in fact used but from JavaScript        @SuppressWarnings(""unused"")        public boolean checkboxPass() {            if( acceptsConditions() &amp;&amp; acceptsLicense() &amp;&amp; acceptsRefundPolicy() ) {                browser.setBackgroundColor(Color.WHITE);                return true;            }            return false;        }    }</code></pre><p>This does not work however, and the returned document still has a transparent background.  What am I doing wrong, it seems that <code>browser.setBackgroundColor(Color.WHITE);</code> does nothing?</p>","248521","","","","","2011-09-19 04:45:24","setBackgroundColor() in Webview is not working","<android><android-webview>","2","2","2","",""
"4193785","1","7204133","","2010-11-16 11:49:49","4","1734","<p>I have a mobile web site and a mobile app for Android that can load this web site in a webview.  I'd like to set the HTTP 'referer' request header from the Android app so that I track what Android app users do.  </p><p>I there any way to set the HTTP request headers before calling loadURL() in WebView ?</p><p><strong>EDIT:</strong></p><p>It turns out in Froyo (2.2) there is a way to do this as the loadUrl() command has a new parameter to specify extra headers <a href=""http://developer.android.com/reference/android/webkit/WebView.html"" rel=""nofollow"">WebView/loadUrl</a>. The comments say you can't override common headers, but I've tested 'referer' and it works fine.</p><p>So - still need a <strong>pre Froyo solution</strong> - any ideas ?</p>","156477","","156477","","2010-11-16 13:42:10","2011-08-26 11:43:13","android webview - set referer (for version < 2.2 aka Froyo)","<android><webview>","2","2","","",""
"4193795","1","","","2010-11-16 11:50:17","1","1059","<p>I would like to add a chat feature to my application, which runs on both iphone and android platform.Do you have any idea on how to make this ?</p><p>I have seen that tutorial : <a href=""http://mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/"" rel=""nofollow"">http://mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/</a>, but I don't know if it will work using the android NDK</p><p>I have also think about writing the architecture client/server in C but I'm not sure if it's the good solution ..</p><p>Do you have any idea ?Thanks</p>","509461","","","","","2012-09-23 14:39:20","Multi platform (android/iphone) chat","<iphone><android><chat>","2","1","1","",""
"4193808","1","4193852","","2010-11-16 11:51:58","0","446","<p>I have a requirement where I need to play an audio file in receiver mode(earpiece).I am not sure whether higher versions of Android SDK supports this receiver mode.I went through some links which said about 1.5/1.6 having changes in these Audio APIs and hence not sure. :(</p><p>Can someone please help?</p><p>Thanks.</p>","423639","","","","","2010-11-16 12:52:26","Does Android support 'Receiver' mode for playing audio files?","<android>","1","0","","",""
"4193834","1","4211814","","2010-11-16 11:55:09","0","1013","<p>I dont understand what seems to be the problem here...my app just crashes.And i get the followin logcat error:ERROR/dalvikvm(1270): Could not find class 'intentTest.xyz.com.second', referenced from method intentTest.xyz.com.intentTest$1.onClick</p><p>1.intentTest.java:</p><pre><code>package intentTest.xyz.com;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;public class intentTest extends Activity {  Button b;  /** Called when the activity is first created. */   @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    b = (Button) findViewById(R.id.b);    b.setOnClickListener( new View.OnClickListener() {        public void onClick(View view) {            Intent intent = new Intent(intentTest.this,second.class );            startActivity(intent);                        }    });   } }</code></pre><p>2.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=""First screen""/&gt;&lt;Buttonandroid:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""map""android:id=""@+id/b""/&gt;&lt;/LinearLayout&gt;</code></pre><p>3.second.java:</p><pre><code> package intentTest.xyz.com; import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; import android.os.Bundle; public class second extends MapActivity{  MapView map;  /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.second);   map = (MapView) findViewById(R.id.map);   } @Override protected boolean isRouteDisplayed() {  // TODO Auto-generated method stub return false;  }  }</code></pre><p>4.second.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.google.android.maps.MapView    xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/map""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:clickable=""true""    android:apiKey=""0ujyc9Tw2cYvyPECIKTQIK0pwuL-UPa_sh4BpIw""/&gt;</code></pre><p>5.manifest.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=""intentTest.xyz.com""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".intentTest""              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="".second""          android:label=""@string/app_name""&gt;           &lt;uses-library android:name=""com.google.android.maps"" /&gt;   &lt;/activity&gt;   &lt;/application&gt;  &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;  &lt;/manifest&gt; </code></pre>","505453","","505453","","2010-11-16 12:13:03","2010-11-18 04:59:38","opening a mapview on a button click from another class","<java><android><android-intent><android-mapview>","1","1","0","",""
"4193917","1","4919382","","2010-11-16 12:04:41","14","14606","<p>I'm getting ""<em>external allocation too large for this process</em>"" errors in my app. Lots of these at once:</p><pre><code>11-16 10:56:59.230: ERROR/dalvikvm-heap(2875): 1303680-byte external allocation too large for this process.11-16 10:56:59.230: ERROR/GraphicsJNI(2875): VM won't let us allocate 1303680 bytes11-16 10:56:59.230: ERROR/dalvikvm-heap(2875): 1536000-byte external allocation too large for this process.11-16 10:56:59.230: ERROR/GraphicsJNI(2875): VM won't let us allocate 1536000 bytes</code></pre><p>It appears that they are produced while the layout is being rendered, after loading large bitmaps. The errors, however, are not produced while the bitmap is being decoded.</p><p>How can I debug these errors? Any additional pointers?</p>","143378","","","","","2011-11-27 23:33:09","External allocation too large for this process in Android","<android><memory-management>","2","3","","",""
"4193925","1","","","2010-11-16 12:05:28","0","363","<p>I am developing an application in which the layout is independent of screen resolution.Now my problem is that in TextView the textview layout does change itself when the resolution of screen changes but the size of text remain same.</p><p>I want that when the resolution is high, according to that the text size should also adjust itself(i.e. text size should be changed).And simillarly when resolution is low the text size sholud also shrink.</p><p>But here when i reduce Y-AXIS to an extent the text vanishes.</p><p>I will really appriciate any answer.</p><p>Thank you.</p>","392675","","","","","2012-06-18 07:07:27","TextView in android","<android>","2","0","","",""
"4194124","1","","","2010-11-16 12:31:51","14","38755","<p>My book, ""Hello Android"" gives this as a way of using a custom db helper, setting up a cursor, and then setting up an adapter as follows:</p><pre><code>Cursor cursorCustomDatabaseHelper test = new CustomDatabaseHelper(this);try {        cursor = getData();        showData(cursor);} finally {        test.close();}</code></pre><p>With this however, everytime I need to refresh the data set, I need to keep running this block of code (which gets a bit difficult inside an onClick() for a button due to ""this"" not being available.</p><p>Is this the best way to refresh the data set, or should I look towards removing the .close and issue an adapter.notifyDataSetChanged()? If I do this, sometimes I get a force close as (and I can't remember at the moment) but sometimes it cannot Delete properly - I think this may be because the database is currently open and it tries to open again.</p><p>Should we also be declaring the variables for the Cursors, DatabaseHelpers and Adapter in the Class (outside of the OnCreate) so that they are accessible to all the functions?</p><p>I realise this is just poor programming at this stage, but Im trying to get some pointers as to the best way of doing things.</p>","509326","","","","","2013-08-31 13:03:39","Best Way to Refresh Adapter/ListView on Android","<android><listview><refresh>","3","1","2","",""
"4194137","1","","","2010-11-16 12:33:45","10","11437","<p>Is there a method to read the frame buffer of the current screen? I searched some data about the frame buffer. Some one used the glReadPixels method, but the information was not enough. Does anyone know how to read the current frame buffer in detail?</p><p>Thanks for helping.</p>","509149","","","","","2013-12-19 01:59:31","How to read the current frame buffer in android?","<android><framebuffer>","2","0","5","",""
"4194187","1","5111196","","2010-11-16 12:38:35","1","2213","<p>I need to develop a Stock Tracker Application using Google Finance API . i searched a lot for the same but i'm unable to find a good tutorial where Step by step tutoring of the same is done. i didnt find the official googla Finance APi documentation much helpful for Android development.</p><pre><code>Can anyone suggest a good tutorialfor my above query?</code></pre>","396437","","","","","2011-02-24 22:16:22","Need to develop Stock tracker Application in Android using Google Finance API?","<android><finance>","1","0","","",""
"4194321","1","","","2010-11-16 12:54:37","0","517","<p>I am having problem create a tablelayout inside an activity.  So far i managed to display the resulting query using textview.</p><pre><code>( (TextView) view.findViewById(R.id.tv_id) ).setText( listItem.getId()+""""); ( (TextView) view.findViewById(R.id.tv_name) ).setText( listItem.getName() ); ( (TextView) view.findViewById(R.id.tv_age) ).setText( listItem.getAge()+"""" );</code></pre><p>i would appreciate it if you can help me turn this textview into tablelayout.</p><p>thanks for your help</p>","509531","","509531","","2010-11-16 13:51:19","2010-11-16 14:18:19","Help create TableLayout inside .java activity","<android><activity><tablelayout>","1","0","","",""
"4194342","1","","","2010-11-16 12:56:36","26","36523","<p>Please help me if you know how to record voice, and also to record the voice of both caller and calle during a phone call. If anybody knows then give me a hint.</p>","487253","","559085","","2012-04-20 09:57:28","2013-11-06 21:10:19","How can I record voice and record Call in Android?","<android><call><records><voice-recording>","8","1","13","2013-11-06 21:36:58",""
"4194383","1","","","2010-11-16 13:02:21","2","780","<p>Does anyone have any idea how to find the n-th field (string) in a delimited string where the delimiters (separator) could be either a single char or several chars.</p><p>For instance, </p><pre><code>string = ""one*two*three""separator = ""*""</code></pre><p>and the syntax for user-defined function is <code>FindNthField(string,separator,position)</code></p><p>so position 3 would return <code>three</code></p><p>The separator in use would actually be <code>Chr(13)</code>.</p><p>This has to run on Android and so should be efficient.</p><p>Any suggestions would be greatly appreciated.</p>","509537","","180100","","2010-11-16 13:07:33","2010-11-16 13:42:37","Finding the nth string in a delimited string","<java><android>","3","3","","",""
"4194456","1","4194509","","2010-11-16 13:11:08","-2","1247","<p>I'm a newbie android developer, I'm trying to develop an application; a background service which listens to incoming/outgoing calls/messages. I want to learn how to:</p><ul><li>I want to end the phone calls from specific numbers</li><li>Delete the messages from Inbox/drafts/sent items </li></ul><p>May I get some leads to achieve this?</p>","505011","","28169","","2010-11-16 14:12:26","2010-11-16 14:12:26","Listening to outgoing/incoming calls","<android>","1","0","","",""
"4194492","1","4194797","","2010-11-16 13:15:54","4","1596","<p>Sorry if this is a bit of a vague question, however im struggling to find a single <em>solid</em> example on how to do unit testing (isolated testing) with Android...</p><p>Here is an example of what i'm wanting to achieve:</p><pre><code>// Some classclass Calculator{    public int Add(int a, int b) { return a+b; }}// Simple testimport org.junit.Assert;import org.junit.Test;class CalculatorTests{    @Test    public void should_add_numbers_correctly()    {        Calculator calculator = new Calculator();        int expectedResult = 5 + 5;        int actualResult = calculator.Add(5,5);        Assert.assertEqual(actualResult, expectedResult);    }   }</code></pre><p>So one project contains models and logic, then another project contains tests for said library. There is no front end or UI, so I want to do the bare minimum to just be able to test that my methods all work in isolation.</p>","476660","","","","","2010-11-17 09:06:54","Simplest way to unit test an android library application?","<java><android><unit-testing>","1","1","","",""
"4194530","1","","","2010-11-16 13:20:09","2","4301","<p>I am trying to open PDF file in android, but cant open it. It will throw an error.</p><p>and also if, Is there any code for open PDF file in android, so tell me</p>","487253","","488433","","2012-06-27 08:30:37","2012-06-27 08:30:37","How to open PDF file in Android","<android><pdf>","0","5","","2010-11-16 16:22:02",""
"4194550","1","4664112","","2010-11-16 13:22:38","1","176","<p>What is the most advised doctype for a <strong>website</strong> optimised for smartphones?<br>and what are the principal diferences between them.</p><p>XHTML Mobile Profile 1.0 </p><pre><code>&lt;!DOCTYPE html PUBLIC  ""-//WAPFORUM//DTD XHTML Mobile 1.0//EN""  ""http://www.wapforum.org/DTD/xhtml-mobile10.dtd""&gt;</code></pre><p>or XHTML Mobile Profile 1.1</p><pre><code>&lt;!DOCTYPE html PUBLIC  ""-//WAPFORUM//DTD XHTML Mobile 1.1//EN""  ""http://www.openmobilealliance.org/tech/DTD/xhtml-mobile11.dtd""&gt;</code></pre><p>or XHTML Mobile Profile 1.2</p><pre><code>&lt;!DOCTYPE html PUBLIC  ""-//WAPFORUM//DTD XHTML Mobile 1.2//EN""  ""http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd""&gt;</code></pre>","454998","","","","","2011-01-12 00:08:01","HTML prerequisites for mobile website developpement?","<android><xhtml><mobile-phones><iphone-web>","1","0","","",""
"4194799","1","4195194","","2010-11-16 13:49:09","3","866","<p>I started my own android app a few days ago since I needed a mobile application to store a bunch of data I collect in the hospital.</p><p>I'm pretty new to Java and android environment, although it seems easy to understand and very similar to C++.</p><p>Anyway, my application has a bunch of ""EditText"" and radio buttons and my question is:</p><p>How can I iterate through all those widgets (EditTexts and radio buttons)?</p><p>In .NET you could do a ""for each element in container "" loop but I can't seem to find a way to do this in Java/android environment.</p><p>Note: I don't know how many ""widgets"" exist in the activity, since some are created dinamicaly, others are hardcoded and some others show if some user preferences are set</p><p>Any help or hint would be appreciated.</p>","295342","","213269","","2010-11-23 18:18:49","2012-05-22 10:39:17","Loop through all ""widgets""/elements in a Activity","<java><android><for-loop><widget>","3","0","2","",""
"4194811","1","","","2010-11-16 13:50:14","0","1247","<p>I'm a French Computer Science Student.I've a project to do, create a simple application for login into my website, display (if login is correct) a New activity with 3 tab (each tab contains an activity).The application will be structured like this:First Activity: Login.If it is correct, go to the 3 tab activity.First tab displayed is My Profile Tab, with My nickname and my stats (obtained with the API of my website).The second tab is my friend tab.The third is ""Upload"" tab.I use it for upload photo that i taken in my photogallery.</p><p>Can someone follow and teach me about the creation of that app?I need to know, for first thing, how to do login and keep the session to the tab activity, if the login is correct.</p><p>I see a lot of answers here on stackoverflow, but neither help me.I see other questions from another guy, Phil, but the reply don't help me.</p><p>I hope you can give me an help.</p>","509583","","509583","","2010-11-16 14:06:39","2010-11-16 14:06:39","Android Application with Login","<android><login>","1","0","","",""
"4194826","1","","","2010-11-16 13:51:44","4","694","<p>Any one can suggest how to add images in email body ?I tried it, but no answer.</p><p>Here is my code:</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);sendIntent.setType(""image/jpeg"");sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { ""gmail@gmail.com"" });sendIntent.putExtra(Intent.EXTRA_SUBJECT, ""Photo"");sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file://"" + _path));sendIntent.setType(""image/png;text/html"");String htmlecode =     ""&lt;html&gt;&lt;b&gt;Bold Text works perfectly&lt;/b&gt;"" +    ""&lt;img width='48' height='48' alt='' "" +    ""src='http://upload.wikimedia.org/wikipedia/commons/7/7a/Basketball.png' /&gt;"" +    ""&lt;/html&gt;"";sendIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(htmlecode, imgGetter, null));startActivity(Intent.createChooser(sendIntent, ""Email:""));</code></pre><p>wat's wrong in this code ?</p>","366300","","414581","","2012-02-04 01:28:53","2013-09-29 15:45:15","Android Inline Images in Email","<android><android-intent><email-attachments>","1","0","","",""
"4194991","1","","","2010-11-16 14:10:16","0","1133","<p>hi there<br>i have been searching the web for a connection between my android simulator and a mysql db. <br>I've fount that you can't connect directly but via a webserver. The webserver wil handle my request from my android. I fount the following code on www.helloandroid.com<br>But i don't understand. If i run this code on the simulator nothing happens. The screen stays black.Where does Log.i land. In the android screen or in the error log or somewhere else?<br>Can somebody help me with this code?</p><pre><code>package app.android.ticket;import java.io.BufferedReader;import java.io.InputStream;import java.io.InputStreamReader;import java.util.ArrayList;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.NameValuePair;import org.apache.http.client.HttpClient;import org.apache.http.client.entity.UrlEncodedFormEntity;import org.apache.http.client.methods.HttpPost;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import org.json.JSONArray;import org.json.JSONException;import org.json.JSONObject;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class fetchData extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);  //call the method to run the data retreival    getServerData();}public static final String KEY_121 = ""http://www.jorisdek.nl/android/getAllPeopleBornAfter.php"";public fetchData() {    Log.e(""fetchData"", ""Initialized ServerLink "");}private void getServerData() {    InputStream is = null;    String result = """";    //the year data to send    ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();    nameValuePairs.add(new BasicNameValuePair(""year"",""1980""));    //http post    try{            HttpClient httpclient = new DefaultHttpClient();            HttpPost httppost = new HttpPost(KEY_121);            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));            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);                    Log.i(""log_tag"",""id: ""+json_data.getInt(""id"")+                            "", name: ""+json_data.getString(""name"")+                            "", sex: ""+json_data.getInt(""sex"")+                            "", birthyear: ""+json_data.getInt(""birthyear"")                    );            }    }catch(JSONException e){            Log.e(""log_tag"", ""Error parsing data ""+e.toString());    }}</code></pre><p>}    </p>","488500","","","","","2010-12-31 13:47:59","mysql db connection","<mysql><android><database><connect>","2","0","","",""
"4195046","1","4195219","","2010-11-16 14:17:39","2","202","<p>Folks, I'm trying to see if my plan realistic at all. I'm ne toAndroid platform but not new to software development. This is my firstpost here as well :)</p><p>We want (in our company) to create Android software to compliment ourtruck management software. Basically, it will do couple very specifictasks.</p><p>a. Send GPS updates to server.b. Receive trip information.c. Send pickup/delivery confirmation to server.</p><p>After evaluationg i. platform and Windows phone 7 platform we came toconclusion that only Android has multitasking that works for us. So,Android it is but I have some specific questions.</p><ol><li><p>Data plan we want to use will be very limited. Probably 5M/mo andno voice/text. I figured 5x1024x1024 = 5242280 bytes will give me 1kper transmission every 15 minutes (3000 transmissions per mo). It willleave 2M for other stuff that will happens every couple of days. Doesmy math look OK or there is lot of ""waste"" traffic? Our server goingto be XML SOAP and messages sent will be just Lon/Lat in XML package.1K will be OK? If I just calculate bytes it will be even less but Iwonder if there is ""minimum"" packet size, etc. Any insight on thisdata limitation appreciated.</p></li><li><p>Because of #1 we need to ""lock"" device somehow so there is no othersoftware that uses network. Possible? If so, what do I need to lookfor? I found already created app - firewall and it says phone has tobe rooted for that.</p></li><li><p>Receiving trip information. What's the best way to accomplish thatgiven my situation? Should I run some kind of listener? Will my phonehave IP address or something? Or should I get small text plan and usethat for this specific functionality? Can I receive text message in myown application?</p></li></ol><p>So, as you see we trying to shrink $80/mo service to $15/mo servicethat will do big savings to our company but not sure if it's allpossible with constraints we have. Also, we may just give discounts todrivers who have Android phone and will install our app but we don'tcount on that.</p><p>Thank you in advance for any help on this subject.</p><p><strong>UPDATE</strong>:Now that I think about it - limited data plan present challenges initially but actually helps us do it ""right"" to make sure we don't overload server with constant polls. What I really like to see is some real-worls experience with data usage. Problem is, to us to even come up with test app - will require considerable effort. Would be much better to rule this out right now if it won't work. For example, if I knew that message size 2k no matter how big of a message itslef - then I would know immediately that it won't work for us..</p>","509600","","509600","","2010-11-16 14:46:25","2010-11-16 18:00:51","Android platform, can I meet those requirements?","<android>","4","11","2","",""
"4195089","1","4927777","","2010-11-16 14:22:19","29","12945","<p>I sometimes see this error in my <code>logcat</code> output, </p><pre><code>Cursor: invalid statement in fillWindow().</code></pre><p>It sometimes happens when I press the back key and then it goes to the default Android <code>listview</code> before going to my custom <code>listview</code>. </p><p>What does it mean? How do I solve it? Because it does not point to any line of code where the problem is coming from.</p>","479908","","815724","","2013-03-10 12:17:54","2013-03-10 12:17:54","What does ""invalid statement in fillWindow()"" in Android cursor mean?","<android><cursor>","5","1","6","",""
"4195091","1","","","2010-11-16 14:22:28","1","2712","<p>I have been developing for Android since some time now and I found Java as proper way of doing development in it. But, now there are number of options available for developing in Android such as Titanium, PhoneGap and Adobe AIR.</p><p>The question is who will come as a winner for Android development. I have read lot of comparisons between Titanium, PhoneGap and native Android development. Now, with Adobe entering into it too, what is the future of Android Developers who develop with Java as the programming language. </p><p>Since, if one can develop for Iphone and Android with Titanium and Adobe AIR then why will one want to waste time and money for separate development.</p>","261566","","","","","2011-05-26 11:45:01","Developing for Android in Java or Adobe AIR or Titanium or PhoneGap?","<android><air><titanium>","5","0","","",""
"4195137","1","4195669","","2010-11-16 14:26:19","0","232","<p>I saw the method TelephonyManager.getVoiceMailAlphaTag() but I have no idea what it's for. The javadocs are useless.</p>","442512","","","","","2010-11-16 15:19:27","What is getVoiceMailAlphaTag() for?","<android>","1","0","","",""
"4195354","1","","","2010-11-16 14:45:59","0","3359","<p>I have researched extensively and am pretty sure this is not possible. I want to make a call and then inject DTMF when the far end answers. So 2 questions</p><ol><li>Is it possible ?</li><li>If not, how do I work to get it on the list of upcoming features to be provided on Android</li></ol><p>I can say that this is possible on BlackBerry and Symbian, so Android is falling behind in this regard.</p>","509634","","","","","2012-06-25 08:38:48","Android telephony dtmf","<android><telephony><dtmf>","2","0","","",""
"4195409","1","4195506","","2010-11-16 14:51:43","0","1444","<p>I want to record incoming call,any body knows please give some idea about that,other wise give some idea about How to know about incoming call,</p><p>Thanks All</p>","500595","","","","","2010-11-16 15:02:29","how to identify incoming call using android?","<android>","3","0","","",""
"4195426","1","","","2010-11-16 14:52:44","1","1785","<p>I'm using xml to draw a spinning progress indicator along with some text. In the bottom of the screen I have a TableLayout with two buttons, which are centered in the page with each text also centered. </p><p></p><p></p><pre><code>&lt;RelativeLayout        android:id=""@+id/progresscontainer""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:gravity=""center_horizontal""&gt;        &lt;ProgressBar android:id=""@+id/progress_bar""             style=""?android:attr/progressBarStyleSmall""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_centerInParent=""true""            android:paddingRight=""10dp"" /&gt;        &lt;TextView android:id=""@+id/progress_text""             android:layout_toRightOf=""@id/progress_bar""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_centerInParent=""true""            android:text=""First text"" /&gt;&lt;/RelativeLayout&gt;&lt;TableLayout    android:id=""@+id/buttonbar""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:paddingTop=""3dip""    android:background=""@color/buttonbar""    android:stretchColumns=""0,1""&gt;    &lt;TableRow&gt;        &lt;Button android:id=""@+id/button1""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Button1"" /&gt;        &lt;Button android:id=""@+id/button2""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Button2"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p></p><p>In the code I have a runnable that after a couple of seconds changes the text on the progress_text TextView.</p><pre><code>private Runnable mTimeTask = new Runnable() {   public void run() {       TextView progressText = (TextView) findViewById(R.id.progress_text);       progressText.setText(""Second text"");   }};</code></pre><p>The problem is that after this setText(), once I focus on one of the buttons, the text loses it's centered alignment and goes all the way to the left. What am I doing wrong?</p>","509647","","","","","2013-11-18 05:39:26","Android button loses text alignment after setText","<android><text><button><alignment>","2","0","1","",""
"4195446","1","4201892","","2010-11-16 14:55:19","1","2321","<p>Most OpenGL ES tutorials for Android I've followed has its onSurfaceChanged() function like this:</p><pre><code>public void onSurfaceChanged( GL10 gl, int width, int height ) {    gl.glViewport( 0, 0, width, height );    gl.glMatrixMode( GL10.GL_PROJECTION );    gl.glLoadIdentity();    GLU.gluPerspective( gl, 45.0f, ( ( float )width / ( float )height ), 0.1f, 100.0f );    gl.glMatrixMode( GL10.GL_MODELVIEW );    gl.glLoadIdentity();}</code></pre><p>However, what is the grouping here?  Must glMatrixMode() be called after glViewport?  And must a glLoadIdentity() be called right after glMatrixMode()?</p><p>I've been coding for ""full"" OpengGL before, and in my old codes I first called glMatrixMode(), then gluPerspective and last glLoadIdentity().  As if one first set what matrix should be used for gluPerspective() and last set glIdentity() to finish it.</p><p>What is the correct order for calling glMatrixMode(), glIdentity() and gluPerspective() - and why?  Are there differences between OpenGL and OpenGL ES for setting up glMatrixMode()?</p>","324943","","44729","","2010-12-14 20:04:11","2010-12-14 20:04:11","When to call glMatrixMode()","<android><opengl-es>","2","0","1","",""
"4195508","1","","","2010-11-16 15:02:47","8","19991","<p>I have an ImageView which I want to always be the same size.  If the image is smaller than the view, I'd like it to be centred in the view.  If the Image is larger than the view then I'd like it scaled down - with aspect ratio preserved.</p><p>I've had several attempts at this myself - the latest of which is:</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;ImageView android:id=""@+id/itemImage"" android:layout_width=""100dp""            android:layout_height=""100dp"" android:scaleType=""fitCenter""            android:adjustViewBounds=""true"" android:gravity=""center"" android:padding=""10px"" /&gt;  &lt;TextView android:id=""@+id/currentLentItem"" android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" android:padding=""10px""/&gt;&lt;/LinearLayout&gt;</code></pre><p>What am I missing here?</p>","398293","","","","","2011-02-28 16:57:53","ImageView that is a fixed size, regardless of image size","<android>","2","1","5","",""
"4195514","1","4196334","","2010-11-16 15:03:49","1","5042","<p>I am trying to pass 2 parameters to a javascript function.This code <code>webview.loadUrl(""javascript: function_to_call();"");</code> works fine without parameters but i couldn't use it with parameters.</p><p>This is javascript junction :</p><pre><code>function changeLocation(_lon , _lat){        var zoom=16;        var lonLat = new OpenLayers.LonLat( _lon , _lat )         .transform(        new OpenLayers.Projection(""EPSG:4326""        ),map.getProjectionObject());        map.setCenter (lonLat, zoom);  }</code></pre><p>And this is how i call it from java :</p><pre><code>webView.loadUrl(""javascript:changeLocation( -0.1279688 ,51.5077286 );"") ;</code></pre><p>Edit: I couldn't find the problem and i changed my approach, now i am injecting whole javascript function with desired changes everytime when i need to.It is not best solution but it works.Thank you everyone for your helps.</p>","426815","","481927","","2010-12-31 19:45:27","2012-07-26 19:26:32","how to call parameterized javascript function in the WebKit?","<javascript><android><webview><proj4js><mobile-webkit>","2","6","1","",""
"4195609","1","4196086","","2010-11-16 15:14:42","19","34980","<p>I think this should be easy to answer. I have an application that does some long calculations, and I would like to show a progress dialog while this is done. So far I have found that I could do this with threads/handlers, but didn't work, and then I found out about the AsyncTask. </p><p>In my application I use maps with markers on it, and I have implemented the onTap function to call a method that I have defined. The method creates a dialog with Yes/No buttons, and I would like to call an AsyncTask if Yes is clicked. My question is how to pass an ArrayList to the AsyncTask (and work with it there), and how to get back a new ArrayList like a result from the AsyncTask?</p><p>The code of the method looks like this:</p><pre><code>                       String curloc = current.toString();                       String itemdesc = item.mDescription;                       ArrayList&lt;String&gt; passing = new ArrayList&lt;String&gt;();                       passing.add(itemdesc);                       passing.add(curloc);                       ArrayList&lt;String&gt; result = new ArrayList&lt;String&gt;();                       new calc_stanica().execute(passing,result);                       String minim = result.get(0);                       int min = Integer.parseInt(minim);                       String glons = result.get(1);                       String glats = result.get(2);                       double glon = Double.parseDouble(glons);                       double glat = Double.parseDouble(glats);                       GeoPoint g = new GeoPoint(glon, glat);                       String korisni_linii = result.get(3);</code></pre><p>So, as you see, I would like to send the string array list ""passing"" to the AsyncTask, and to get the ""result"" string array list back from it. And the calc_stanica AssycTask class looks like this:</p><pre><code>public class calc_stanica extends AsyncTask&lt;ArrayList&lt;String&gt;, Void, ArrayList&lt;String&gt;&gt; {    ProgressDialog dialog;        @Override        protected void onPreExecute() {            dialog = new ProgressDialog(baraj_mapa.this);            dialog.setTitle(""Calculating..."");            dialog.setMessage(""Please wait..."");            dialog.setIndeterminate(true);            dialog.show();        }        protected ArrayList&lt;String&gt; doInBackground(ArrayList&lt;String&gt;... passing) {        //Some calculations...        return something; //???        }        protected void onPostExecute(Void unused) {            dialog.dismiss();        }</code></pre><p>So my question is how to get the elements of the ""passing"" array list in the AsyncTask doInBackground method (and use them there), and how to return an array list to use in the main method (the ""result"" array list)?</p><p>Thank you in advance...</p><p>Bojan Ilievski</p>","509666","","","","","2013-01-24 02:56:24","Passing arguments to AsyncTask, and returning results","<android><return><android-asynctask><progressdialog>","4","0","10","",""
"4195660","1","4196411","","2010-11-16 15:18:41","11","9200","<p>I'm looking for:A list of the existing photo gallery names (hopefully their top thumbnail as well)The contents of the gallery (I can then load thumbnails and full size as needed)</p><p>How would I go about getting a list of the ""Galleries"" (don't know if that's the proper term in android for the groupings of images visible in the Gallery app...) and their contents? I need access to the gallery in it's structure without using the existing gallery display (I'm creating a totally new one, not an over layer to the photo requestor etc.)</p><p>I assume MediaStore.Images is where I need to be but I don't see anything that will give me the groupings...</p>","463183","","","","","2010-11-16 16:27:44","Get list of photo galleries on Android","<android><image><gallery><mediastore>","1","0","10","",""
"4195682","1","4197370","","2010-11-16 15:21:04","24","30919","<p>Is there a way to disable the screensaver while my app is running?</p><p>The dimming of the screen is what I mean.</p>","97688","","168175","","2012-05-06 21:03:29","2014-03-20 15:42:09","Android disable screen timeout while app is running","<android>","8","2","9","",""
"4195832","1","","","2010-11-16 15:34:24","1","453","<p>i have implemented adwhirl to show adds in my app. and it is working fine in portait mode. when i change the oreintation to landscape mode the add is displaying but width is not fill parent(not showing on the whole screen). it is showing in the middle.</p><p>i didn't found any solution for the same..pls help me in this case.. </p>","383597","","","","","2011-05-25 08:27:02","android adwhirl integration problem","<android>","1","0","","",""
"4195864","1","","","2010-11-16 15:37:46","4","2046","<p>I am programming a sip application for Android. During a call I must record the microphone input and play the incoming audio. There must be an optional using of speakerphone. It must be Android 1.5+ (1.5, 1.6, 2.0, 2.1, 2.2, future versions) compatible and device portable.</p><p>OK. So I am using AudioTrack to play incoming audio, AudioRecord to record data from the microphone and AudioManager.setSpeakerphoneOn() to enable or disable speakerphone.</p><p>Sounds simple but it is not as simple as it should be. AudioManager.setSpeakerphoneOn(false) does not work unless AudioManager.setMode(AudioManager.MODE_IN_CALL) is called. So I have to be in MODE_IN_CALL.</p><p>Still OK and simple and it works on my G1 with Android 1.6, older Samsung phone, emulators, many our customer devices etc. But it does not work everywhere :(</p><p>On Samsung tablet GT-P1000 I get stream of 0, 0, 0, 0, ... as microphone input. I think the same problem is on Motorola phones (customers complain). After some test I realised that it is caused by AudioManager.setMode(AudioManager.MODE_IN_CALL). This causes that microphone does not work on some devices. But I have to call it because otherwise I can not disable speakerphone.</p><p>Is there a simple way how to make it simple, correct and working? And if possible without hell like Sipdroid highly dangerous source code:</p><pre><code>if (RtpStreamReceiver.samsung) {    AudioManager am = (AudioManager) Receiver.mContext.getSystemService(Context.AUDIO_SERVICE);    am.setMode(AudioManager.MODE_IN_CALL);    am.setMode(AudioManager.MODE_NORMAL);}</code></pre><p>or</p><pre><code> void initMode() {     samsung = Build.MODEL.contains(""SAMSUNG"") || Build.MODEL.contains(""SPH-"") ||     Build.MODEL.contains(""SGH-"") || Build.MODEL.contains(""GT-"");     if (Receiver.call_state == UserAgent.UA_STATE_INCOMING_CALL &amp;&amp;     (Receiver.pstn_state == null || Receiver.pstn_state.equals(""IDLE""))) {       setMode(AudioManager.MODE_NORMAL);  }</code></pre><p>Thanks a lotJan</p>","449293","","826488","","2011-07-05 07:05:04","2011-07-14 11:00:33","Android recording and playing +speakerphone as an option","<android><audio><audiorecord><speakerphone>","1","0","3","",""
"4195871","1","4589500","","2010-11-16 15:38:10","1","1382","<p>this is my second question related to ads, i'm really sorry, I've searched the whole web for the last 2 weeks now, didn't find a solution, maybe together we find something :=)</p><p>With the use of <strong>Adwhirl SDK</strong> I'm n*<em>ot able</em>* to display ads <strong>from any other ad network</strong> than <strong>AdMob</strong>. Google Adsense gets this Error, Millenial Network gets it too, and also Google AdSense.At least some of it should work.</p><p>It always says 'showing ad' but afterwards failure.Nothing is showing at all. Also ad roation do not work. I'm really a little bit pi**ed of after so long, trying to get this to work. Feeling like the last idiot on the web. :=/</p><p>thanks!</p><pre><code>11-16 16:26:35.676: WARN/AdWhirl SDK(15655): Unsupported ration type: 1411-16 16:26:35.686: WARN/AdWhirl SDK(15655): Caught an exception in adapter:11-16 16:26:35.686: WARN/AdWhirl SDK(15655): java.lang.Exception: Invalid adapter11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at com.adwhirl.adapters.AdWhirlAdapter.handle(AdWhirlAdapter.java:141)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at com.adwhirl.AdWhirlLayout.handleAd(AdWhirlLayout.java:163)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at com.adwhirl.AdWhirlLayout.access$3(AdWhirlLayout.java:151)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at com.adwhirl.AdWhirlLayout$HandleAdRunnable.run(AdWhirlLayout.java:316)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at android.os.Handler.handleCallback(Handler.java)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at android.os.Handler.dispatchMessage(Handler.java)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at android.os.Looper.loop(Looper.java)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at android.app.ActivityThread.main(ActivityThread.java)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at java.lang.reflect.Method.invokeNative(Native Method)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at java.lang.reflect.Method.invoke(Method.java)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)11-16 16:26:35.686: WARN/AdWhirl SDK(15655):     at dalvik.system.NativeStart.main(Native Method)11-16 16:26:35.696: DEBUG/AdWhirl SDK(15655): Showing ad:11-16 16:26:35.696: DEBUG/AdWhirl SDK(15655):     nid: 90728e67f6d94734a2669b1c15ebbfd911-16 16:26:35.696: DEBUG/AdWhirl SDK(15655):     name: zestadz11-16 16:26:35.696: DEBUG/AdWhirl SDK(15655):     type: 2011-16 16:26:35.696: DEBUG/AdWhirl SDK(15655):     key: 14131C047A50414xxxxxxxxxxxx ;=) 911-16 16:26:35.696: DEBUG/AdWhirl SDK(15655):     key2: 11-16 16:26:35.696: WARN/AdWhirl SDK(15655): Unsupported ration type: 2011-16 16:26:35.706: WARN/AdWhirl SDK(15655): Caught an exception in adapter:11-16 16:26:35.706: WARN/AdWhirl SDK(15655): java.lang.Exception: Invalid adapter11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at com.adwhirl.adapters.AdWhirlAdapter.handle(AdWhirlAdapter.java:141)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at com.adwhirl.AdWhirlLayout.handleAd(AdWhirlLayout.java:163)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at com.adwhirl.AdWhirlLayout.access$3(AdWhirlLayout.java:151)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at com.adwhirl.AdWhirlLayout$HandleAdRunnable.run(AdWhirlLayout.java:316)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at android.os.Handler.handleCallback(Handler.java)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at android.os.Handler.dispatchMessage(Handler.java)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at android.os.Looper.loop(Looper.java)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at android.app.ActivityThread.main(ActivityThread.java)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at java.lang.reflect.Method.invokeNative(Native Method)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at java.lang.reflect.Method.invoke(Method.java)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)11-16 16:26:35.706: WARN/AdWhirl SDK(15655):     at dalvik.system.NativeStart.main(Native Method)11-16 16:26:35.706: ERROR/AdWhirl SDK(15655): nextRation is null!</code></pre><p>Millenial says a littlebit more:</p><pre><code>   11-16 16:28:05.426: DEBUG/AdWhirl SDK(15655): Dart is &lt;64.70737969255892&gt; of &lt;100.0&gt;11-16 16:28:05.446: DEBUG/AdWhirl SDK(15655): Showing ad:11-16 16:28:05.446: DEBUG/AdWhirl SDK(15655):     nid: f47a7262bb3d4dbab6d3ab62ea1bada511-16 16:28:05.446: DEBUG/AdWhirl SDK(15655):     name: millennial11-16 16:28:05.446: DEBUG/AdWhirl SDK(15655):     type: 611-16 16:28:05.446: DEBUG/AdWhirl SDK(15655):     key: 2526411-16 16:28:05.446: DEBUG/AdWhirl SDK(15655):     key2: 11-16 16:28:05.446: DEBUG/AdWhirl SDK(15655): Valid adapter, calling handle()11-16 16:28:05.916: DEBUG/AdWhirl SDK(15655): Millennial failure    11-16 16:23:29.466: DEBUG/MillennialMediaAdSDK(15655): New MMAdView Started11-16 16:23:29.466: INFO/MillennialMediaAdSDK(15655): Activity: ActivityInfo{44c9c778 com.millennialmedia.android.VideoPlayer}11-16 16:23:29.476: INFO/MillennialMediaAdSDK(15655): Activity: ActivityInfo{44c7f458 com.millennialmedia.android.MMAdViewOverlayActivity}11-16 16:23:29.476: DEBUG/MillennialMediaAdSDK(15655): Automatic ad fetching is off with -1. You must manually call for ads.11-16 16:23:29.486: DEBUG/MillennialMediaAdSDK(15655): Calling for an advertisement: http://androidsdk.ads.mp.mydas.mobi/getAd.php5?sdkapid=25264&amp;auid=357988021219469&amp;ua=Mozilla/5.0 (Linux; U; Android Tegro-2.1.3 (2.1-update1); de-at; HTC Hero Build/ERE27) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17HTC Hero&amp;mmisdk=3.6.3-10.10.26.a&amp;kw=android&amp;mode=live&amp;adtype=MMBannerAdTop11-16 16:23:30.076: DEBUG/MillennialMediaAdSDK(15655): size: 011-16 16:23:30.076: DEBUG/MillennialMediaAdSDK(15655): num: 011-16 16:23:30.076: INFO/MillennialMediaAdSDK(15655): Millennial ad return failed</code></pre><p>Would be really thankful for any advice or help :=)<strong>Thanks!</strong></p>","371749","","","","","2011-01-03 23:55:22","Adwhirl - Millenial Ads - Unsupported ration type","<android><admob><adwhirl><advertisement>","1","2","","",""
"4195878","1","4196034","","2010-11-16 15:39:04","4","942","<p>I tried googling this quite a bit, but all the articles are from early 09 where things were much different. Seeing currently hardware and stuff, whats the battery life like when using XMPP on Android as a service? </p><p>Edit:I am currently using the ASmack library.</p>","117691","","117691","","2010-11-16 16:04:44","2010-11-16 16:04:44","Android XMPP battery life","<android><xmpp>","1","0","2","",""
"4196000","1","4196277","","2010-11-16 15:49:48","0","483","<p>I was wondering what is the correct way to set the text of a TextView after a button has been pushed? I currently have an app that would change the text every time the activity was created (but for now it only sets the text as one value for testing purposes):</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.mama);    TextView joke = (TextView) findViewById(R.id.TextView02);    joke.setText(""This is a test"");    Button nextButton = (Button) findViewById(R.id.Button01);    nextButton.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            startActivity(new Intent(JokesMamaActivity.this, JokesMamaActivity.class));            finish();        }    });}</code></pre><p>How would I be able to set the text without creating a new activity, and have the ability to continually change the text after the button has been clicked?</p>","509710","","","","","2010-11-16 16:13:36","Setting text in activity using Button","<android>","1","0","1","",""
"4196209","1","7527658","","2010-11-16 16:07:46","5","2527","<p>I'm trying to do several translations simultaneously on Android.</p><p>I have 2 or more buttons on a layout (all the same size), and when i press one i want the others to move out of the screen.</p><p>I've done a test app to try to implement this behaviour. </p><p>On it i've set a listener on click of one button to test, something like:</p><pre><code>button.setOnClickListener(new View.OnClickListener() {public void onClick(View view) {Button toMove = (Button) findViewById(R.id.button_test2);Button toMove2 = (Button) findViewById(R.id.button_test3);AnimationSet set = new AnimationSet(true);TranslateAnimation anim = new TranslateAnimation(0, -toMove  .getWidth(), 0, 0);anim.setFillAfter(true);anim.setDuration(1000);toMove.setAnimation(anim);toMove2.setAnimation(anim);set.addAnimation(anim);set.startNow();}</code></pre><p>The view:</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_test"" android:layout_width=""200px""    android:layout_height=""50px"" android:text=""@string/hello"" /&gt;&lt;Button android:id=""@+id/button_test2"" android:layout_width=""200px""    android:layout_height=""50px"" android:text=""@string/hello""     /&gt;&lt;Button android:id=""@+id/button_test3"" android:layout_width=""200px""    android:layout_height=""50px"" android:text=""@string/hello""     /&gt;    &lt;/LinearLayout&gt;</code></pre><p>The thing is that the two buttons start the animation, one slightly after the other. I've read that it is due to the getDelayForView() method that returns different delays of each. Is there any way to move 2 or more buttons simultaneously?</p><p>Google was not very helpful :-\</p>","327011","","327011","","2010-11-17 14:38:21","2013-04-24 14:23:51","Simultaneous Translations on Android","<android><animation>","1","0","1","",""
"4196422","1","","","2010-11-16 16:28:30","3","266","<p>I have a method which caches images from a remote URL and returns the cached image.  If the image is already cached, it is simply returned - otherwise it goes to the remote URL and compresses the bitmap to the cache.</p><p>My problem is that some photos(fetched from Flickr's web services), never successfully  <code>compress</code>, and never successfully get decoded via <code>BitmapFactory.decodeStream(inputStream)</code></p><p>here is my cache method:</p><pre><code>public static Bitmap createImage(Context context, String imageUrl, String imageName) {        Bitmap image = null;        try {            if(new File(context.getCacheDir(), imageName).exists())                return BitmapFactory.decodeFile(new File(context.getCacheDir(), imageName).getPath());            //load file from web            image = BitmapFactory.decodeStream(HttpClient.fetchInputStream(imageUrl));            FileOutputStream fos = null;            try {                fos = new FileOutputStream(new File(context.getCacheDir(), imageName));            }            //this should never happen            catch(FileNotFoundException e) {                if(Constants.LOGGING)                    Log.e(TAG, e.toString(), e);            }            //if the file couldn't be saved            if(fos != null &amp;&amp; image != null) {                if(!image.compress(Constants.BITMAP_CACHE_COMPRESS_FORMAT, Constants.CACHE_IMAGE_QUALITY, fos)) {                    if(Constants.LOGGING)                        Log.e(TAG, ""The image could not be saved: "" + imageName + "" - "" + imageUrl);                    image = BitmapFactory.decodeResource(context.getResources(), R.drawable.twitter_default_icon);                }                fos.flush();                fos.close();            }            else                image = BitmapFactory.decodeResource(context.getResources(), R.drawable.twitter_default_icon);        }        catch(IOException e) {            if(Constants.LOGGING)                Log.e(TAG, e.toString(), e);        }        return image;    }</code></pre><p>What are the reasons that <code>image.compress</code> would not successfully save the bitmap?</p><p>What are the reasons that <code>BitmapFactory.decoodeStream</code> would not properly create a bitmap?</p><p>It only seems to be some images(sometimes images that couldn't load before, do successfully load), which is confusing.</p><p>Here is how i get the <code>InputStream</code> of a remote image:</p><pre><code>protected static InputStream fetchInputStream(String url) {        try {            return new URL(url.replace("" "", ""%20"")).openStream();        }        catch(MalformedURLException e) {            if(Constants.LOGGING)                Log.e(TAG, e.toString());        }        catch(IOException e) {            if(Constants.LOGGING)                Log.e(TAG, e.toString());        }        return null;    }</code></pre><p>edit: i don't seem to be having trouble on the G1(90% of the time), but on the Samsung Galaxy-s i am having many problems showing many images</p><p>editing my edit, erg: some sets of images work perfectly on the g1 AND galaxy-s, and some sets of images mostly only work on the g1. ugh what the crap is going on?</p>","416412","","416412","","2010-11-16 22:50:47","2011-03-31 06:26:02","Failing to compress SOME remote images","<android>","1","0","","",""
"4196539","1","4196584","","2010-11-16 16:39:57","7","8577","<p>Is there an Android UI Library that has components like Action Bars and Dashboards? A lot of new applications seem to have these components, so I was hoping there was a solution available (either free or paid). </p>","61008","","","","","2013-12-09 17:42:14","Android UI library that has Action Bars, Dashboards, etc","<android>","7","0","6","",""
"4196703","1","","","2010-11-16 16:54:36","1","616","<p>Im am trying to set the wallpaper where it scales correctly for all phones.  Right now I have motorola droid size wallpapers packaged with my app, 960x854, and it works fine.  The problem is that I ran my apk on a mytouch and the wallpaper was zoomed in big-time.</p><p>I was told to use ""Bitmap.createScaledBitmap()"" so I got some code together to do this:</p><pre><code>if (position == 0) {    try {        Bitmap img_0 = BitmapFactory.decodeResource(getResources(), R.drawable.a_0);        Bitmap resized;        Display display = getWindowManager().getDefaultDisplay();        int newHeight = display.getHeight();        int newWidth = display.getWidth();        resized = Bitmap.createScaledBitmap(img_0, (newWidth), (newHeight), true);        WallpaperManager wm = WallpaperManager.getInstance(GalleryExample.this);        wm.setBitmap(resized);    } catch (IOException e) {        e.printStackTrace();    }}</code></pre><p>The problem is that I cant get it to scale as this method isnt working that well where its similar to where it was before, not much has changed, the image still seems zoomed in on the mytouch phone. </p><p>Is there a method to scale properly? I get the feeling that Android is messing with the picture itself when the wallpapermanager is called.</p>","509781","","","","","2010-11-16 16:54:36","Setting Android wallpaper w/ scaled images for different resolutions/screens","<java><android>","0","1","","",""
"4196736","1","","","2010-11-16 16:58:33","0","1048","<p>I'm on Mac OS X Leopard and installed the ADT plugin into EclipseGalileo.  I followed all the steps on the Android developer SDK page to get started.  My SDK version is 2.2 API 8 revision 2 and I just used the Hello Worldtutorial found here:</p><p><a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/hello-world.html</a></p><p>When I first created the Android application, I saw this error in theEclipse console:</p><p>[2010-11-13 18:20:43 - HelloAndroid] ERROR: Unable to open classfile /Users/mydirectory/Documents/workspace/HelloAndroid/gen/com/example/helloandroid/R.java: No such file or directory</p><p>I commented out this line to fill in the few lines from the tutorial:</p><p>setContentView(R.layout.main);</p><p>When I ran the app, it launched my emulator but all I saw was avertical screen on the left that said ""ANDROID"" and phone buttons onthe right.  I did not see the ""Hello, Android"" text from thetutorial.</p><p>Any ideas?</p>","509803","","","","","2010-11-16 17:10:12","Trying to get the Hello Android tutorial to work on Mac OS X Leopard","<android><eclipse><osx><osx-leopard>","2","0","","",""
"4197038","1","","","2010-11-16 17:26:23","1","1140","<p>I am looking for the sdk links of Blackberry, Android and Symbians mobiles, so that I can make applications on these platforms. </p>","","user383882","75204","","2010-11-16 23:17:07","2010-11-16 23:17:07","SDK download links for Blackberry, Android and Symbian","<android><blackberry><simulator>","1","3","1","",""
"4197093","1","4197193","","2010-11-16 17:31:39","0","661","<p>I would like to improve the load of my activities in my Android app.</p><p>Every activity is either a GridView, a List or a Gallery.</p><p>My questions is : How can I load only what's displayed ?</p><p>Let's say I have to display a list of 500 songs (The same with a grid of 500 pictures), and each cell includes the Thumbnail, title and lenght.</p><p>How can I know which one is currently displayed ?</p><p>I don't know if I made myself clear, if not please jut let me know.</p>","290613","","","","","2010-11-16 17:43:10","How to load only what displayed in List, Grid,Gallery, etc...?","<android><android-listview><android-gridview>","1","2","","",""
"4197135","1","4197364","","2010-11-16 17:36:22","6","10883","<p>I have a ListActivity with my customized adapter. and inside each of the view, it may have some buttons, in which i need to implement OnClickListener. I need to implement the OnClickListener in the adapter. However, I dont know how to call the function like startActivity() or setResult(). since the adapter doesnt extend to Activity. </p><p>so what is the best way to solve this problem ? thanks </p><p>regardschinyiu </p>","502958","","502958","","2010-11-16 17:55:06","2012-09-04 06:00:49","How to start Activity in adapter?","<java><android><activity><adapter>","3","0","4","",""
"4197182","1","","","2010-11-16 17:41:52","1","2402","<p>How to fix the position/layout of a ImageButton/Button/ImageView relative to the background?</p><p>I'd tried something 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:background=""@drawable/background_img""&gt;&lt;ImageButton    android:id=""@+id/btn1""    android:layout_width=""52dip""    android:layout_height=""52dip""    android:layout_alignParentBottom=""true""    android:layout_centerHorizontal=""true""    android:layout_marginBottom=""87dip""            android:background=""@drawable/btn1""/&gt;    &lt;/RelativeLayout&gt; </code></pre><p>When I change the display resolution, the background_img stretch to cover the new area, but the ImageButton doesn't streetch and doesn't respect the bottom margin proportionately.</p>","509855","","","","","2010-11-16 18:33:53","ANDROID: How to fix the position of a ImageButton relative to the background?","<android><layout><background><imagebutton><relativelayout>","1","1","","",""
"4197234","1","4757365","","2010-11-16 17:49:38","2","459","<p>I'm developing an Android application with OpenGL.</p><p>I'm very new with Android and OpenGL and my English is very poor. Yesterday I earned -4 points because I didn't explain something correctly.</p><p>I will try to explain my problem:</p><p>I have to show more than one 3D object on screen, for example a cube and a sphere. The objects that I'm going to use will be more complex.</p><p>Now, I can show one 2D object perfectly following this <a href=""http://blog.jayway.com/2009/12/04/opengl-es-tutorial-for-android-%E2%80%93-part-ii-building-a-polygon/"" rel=""nofollow"">tutorial</a>, but I don't know how to show a 3D object and neither more than one.</p><p>I use Blender to model 3D objects. I want to use these models with my application.</p><p>I have found a Java loader from Wavefront OBJ format <a href=""http://code.google.com/p/libgdx/source/browse/trunk/gdx/src/com/badlogic/gdx/graphics/ModelLoader.java?r=250"" rel=""nofollow"">here</a>. Now I can export my models to that format and then import it to my Android application.</p><p>Someone told me something about using a rendering engine. But I don't know what is a rendering engine.</p><p>But I have some restrictions:</p><p>I'm also using a native C++ SDK that uses OpenGL. If I'm going to use a Java rendering engine I will need to pass the data (visible targets, projection and pose matrices, etc.) from native to Java. For this I will use the JNI (Java Native Interface).</p><p>Another thing to consider with this native C++ SDK if it needs to create the OpenGL context with specific parameters, depending on the device. You'll need to make sure that my rendering engine allows an outside source to set up the GL context, or pass the appropriate settings to the engine myself.</p><p>In other words, I'm lose.</p><p>If you need more details, tell me.</p><p>My question is, if I use blender to model some objects, how can I show these objects on Android? May I need a rendering engine? a Java or a C++ rendering engine?</p><p>If you know books, tutorials or examples, please tell me.</p><p>Thanks.</p>","68571","","68571","","2010-11-17 21:35:31","2011-01-21 09:49:44","I'm confused about what must I do (android rendering engine)","<android><opengl-es><rendering-engine>","1","0","","",""
"4197281","1","","","2010-11-16 17:54:31","0","564","<p>In my android application i would like to connect to post a url to facebook.I tried using <a href=""https://github.com/facebook/facebook-android-sdk/"" rel=""nofollow"">https://github.com/facebook/facebook-android-sdk/</a> but am not able to cross the permission page and post the url.</p><p>I also tried using the <a href=""http://www.mobisoftinfotech.com/blog/android/845/"" rel=""nofollow"">http://www.mobisoftinfotech.com/blog/android/845/</a> but then i am able to see a window with title ""Connect to facebook"" but blank data in it.I tried changing application key and secret kaey but of no use.</p><p>Could you please let me know why is this issue and what needs to be done to post a url to facebook.</p><p>Please share your valuable suggestions to me.</p><p>Thanks in advance :)</p>","420261","","","","","2011-04-15 22:46:52","Connect facebook to post url in android","<android>","1","0","","",""
"4197324","1","4206300","","2010-11-16 17:58:26","1","935","<p>I have a gallery which has 7 + linear layouts in each view, and I set the background drawable for 7 of these layouts dynamically, depending on data I pull from out db, the position of the gallery, etc.  </p><p>I have a for loop that launches 7 threads to fetch data and fetch the information needed for the drawables to be generated, all of which returns via a common handler, which in turn fetches each of the linear layouts and runs setBackgroundDrawable() on each of them.</p><p>The problem I'm running into is that I can see my constructors for the drawable being run 7 times, but draw() is only called on 1 or 2 of them. If I scroll right or left, the same thing happens with the new view. However, if I scroll back to the already drawn screen, all 7 of the linear layouts have their backgrounds drawn properly.</p><p>I've tried calling invalidate() and requestLayout() on the linear layouts, their parents, the gallery, but to no avail.</p><p>I would post my code but there is a whole mass of it, and I'm crossing my fingers that my explanation provides enough background. I appreciate any help</p>","443659","","","","","2010-11-17 15:55:46","setBackgroundDrawable on multiple items not working properly","<android>","1","0","1","",""
"4197340","1","","","2010-11-16 17:59:47","1","138","<p>I looked it up on here, but I can't seem to find answers to the questions I'm looking for. I currently make HTML5 apps for iPhones, and was going to get more into the native side, but I've read Symbian actually has the most share (near 50%). My questions are:</p><ol><li><p>Is it profitable to develop for Symbian? E.g. if i made the same app for iPhone, Android or Symbian, which would bring in the most money based on statistics (and do you have a source?)</p></li><li><p>Is it easy? I read you can write apps for it in HTML5 and JS, but is that easy and does it let you use the entire phones API?</p></li></ol><p>Thoughts?</p>","144833","","","","","2010-11-16 18:05:12","Should I Develop For Symbian?","<iphone><android><mobile><comparison><symbian>","1","3","","",""
"4197356","1","4197407","","2010-11-16 18:01:13","2","7603","<p>I am creating a mortgage calculator android program and I was trying to figure out how to get the EditText value (comes back as an Editable) to convert to an integer so I can use those integers in the calculation of the mortgage.  I know that there is a toString() method.  Would that be the way to go and then try to convert it from a String to an integer?</p>","381222","","","","","2010-11-16 18:06:51","Android EditText value to integer","<android><string><integer><edittext>","1","0","1","",""
"4197416","1","","","2010-11-16 18:07:21","5","1436","<p>I am not able to find a floodfill algorithm implementation for Android.</p><p>Any idea if a floodfill API is available in Android, and if not, is there any other alternative?</p>","33411","","414","","2010-11-16 18:12:06","2013-03-11 18:21:28","Floodfill algorithm in Android","<android><graphics>","2","3","","",""
"4197478","1","4197541","","2010-11-16 18:14:18","9","9418","<p>Don't know why, but sometimes LocationManager is still working also after closing application.</p><p>I call startGPS() in onCreate-Methode in one Activity (only one, let me call it StartActivity).</p><pre><code>protected void startGPS(){     try {                lmanager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);     lmanager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);     lmanager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this); } catch(Exception e) {     e.printStackTrace(); }}</code></pre><p>And if this activity will be destroyed (so, when application will be closed), I call endGPS()</p><pre><code>public void endGPS(){ try {                lmanager.removeUpdates(this);     lmanager=null; } catch(Exception e) {  e.printStackTrace(); }}</code></pre><p>Some ideas, some suggestions, what have I done wrong?!</p>","408780","","","","","2012-12-17 15:09:06","How to stop location manager?","<android><gps><locationmanager>","3","3","1","",""
"4197566","1","","","2010-11-16 18:21:21","4","889","<p>My app downloads audio files to <code>/sdcard/Music</code>. When I try to play them, I am getting the following error.</p><blockquote>  <p>V/MediaPlayer-JNI( 2789): setDataSource: path  content://media/external/audio/med ia/2 E/MediaPlayerService( 1130):  Couldn't open fd for content://media/external/audio /media/2</p></blockquote><p>If I download the files to <code>/sdcard/</code> instead, the files play fine. The program creates the sub folder 'Music'  just before download and the permissions for 'sdcard' and 'Music' look same. </p>","326185","","331473","","2011-11-23 06:11:50","2011-11-23 06:11:50","MediaPlayer - setDataSource failing - Couldn't open fd for content://","<android>","0","1","","",""
"4197609","1","4212051","","2010-11-16 18:27:40","0","1192","<p>I have created a custom view by extending AutoCompleteTextView (with a specialized function called setCursorAdapter). I am supplying a SimpleCursorAdapter and adding a FilterQueryProvider. I am using this for a list of numbers where I need the ability to search anywhere within the number for a match.</p><pre><code>public void setCursorAdapter(final Uri uri, final String key) {        Cursor c = getContext().getContentResolver().query(uri,                new String[] { ""_id"", key }, null, null, key);        SimpleCursorAdapter adapter = new SimpleCursorAdapter(getContext(),                android.R.layout.simple_dropdown_item_1line, c,                new String[] { key }, new int[] { android.R.id.text1 });        this.addTextChangedListener(new TextWatcher() {            @Override            public void onTextChanged(CharSequence s, int start, int before,                    int count) {                ((SimpleCursorAdapter) getAdapter()).getFilterQueryProvider()                        .runQuery(s);            }            @Override            public void beforeTextChanged(CharSequence s, int start, int count,                    int after) {                // TODO Auto-generated method stub            }            @Override            public void afterTextChanged(Editable s) {                // TODO Auto-generated method stub            }        });        adapter.setFilterQueryProvider(new FilterQueryProvider() {            @Override            public Cursor runQuery(CharSequence constraint) {                Cursor c = getContext().getContentResolver().query(uri,                        new String[] { ""_id"", key },                        key + "" LIKE '%"" + constraint + ""%'"", null, key);                return c;            }        });        setAdapter(adapter);    }</code></pre><p>Everything is working perfectly, until I select the value from the drop down. The value that I receive in the EditText window: android.content.ContentResolver$CursorWrapperInner@...</p><p>How do I avoid this and get my (numeric) text displayed correctly. </p><p>Thanks</p>","356580","","","","","2012-02-28 14:30:39","Custom Cursor to Text with AutoCompleteTextView","<android><filter><cursor><autocompletetextview>","2","0","","",""
"4197704","1","4197851","","2010-11-16 18:36:41","1","1785","<p>I can get the data with NO problem...but I cannot delete the data. Any Suggestions..??</p><pre><code>                Cursor cu = getContentResolver().query(CONTENT_URI, null, null, null, null);            if (cu.moveToFirst())            {                numberInDb = cu.getString(2);                System.out.println(""Number in DB = "" + numberInDb);            }            ContentResolver c = getContentResolver();</code></pre><blockquote>  <p>NEITHER OF THESE NEXT 2 LINES WORK</p></blockquote><pre><code>            c.delete(CONTENT_URI, ""TITLE =""+ numberInDb, null);            getContentResolver().delete(CONTENT_URI, ""TITLE =""+ numberInDb, null);</code></pre>","393913","","","","","2010-11-16 18:53:07","Why can't I delete using a getContentResolver..?","<android>","1","2","1","",""
"4197705","1","","","2010-11-16 18:36:45","1","469","<p>I am trying to install app inventor  on my Samsung intercept.  I have gone through the steps in the set up computer and phone.  When it was time to plug in the USB connection the two notifications did not display.  Please, if anyone knows of any additional steps I need to take I would appreciate some advise. </p>","509911","","","","","2011-01-12 19:19:22","How to install app inventor onto Samsung intercept?","<android>","1","6","1","",""
"4197794","1","4235719","","2010-11-16 18:47:02","14","10339","<p>I've got a custom view in which I need to draw two bitmaps, one is a background, representing the image of a map and one is a pin which will be drawn on top/left position in canvas. </p><p>The both images are drawn onDraw and remain the same during the live of the activity that contains the view. After a while I get a </p><blockquote>  <p>OutOfMemoryError: bitmap size exceeds  VM budget</p></blockquote><p>This means that I have a leak and the bitmaps don't get garbage collected. I asked this question before, but now the situation changed a little. I made a init method where I set the bitmaps I want to use but this still isn't a good approach, the error appears later, but still there.</p><p>Here is the code</p><pre><code>public class MyMapView extends View {private int xPos = 0;private int yPos = 0;private int space = 0;private Bitmap resizedBitmap;private Bitmap position;private Bitmap mapBitmap;public void setMapBitmap(Bitmap value) {    this.mapBitmap =  value;}public MyMapView(Context context) { super(context);}public MyMapView(Context context, AttributeSet attrs) { super(context, attrs);}public MyMapView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle);}public void init(final Context context) { Paint paint = new Paint();    paint.setFilterBitmap(true);    int width = getMeasuredWidth();    int height = getMeasuredHeight();    resizedBitmap = Bitmap.createScaledBitmap(mapBitmap, height, height, true);    position = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.position);    space = (width - resizedBitmap.getWidth()) / 2;}public void destroy(){ resizedBitmap.recycle(); resizedBitmap=null; position.recycle(); position=null; mapBitmap.recycle(); mapBitmap=null;}@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {  setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec));}@Overrideprotected void onDraw(Canvas canvas) {     if (mapBitmap != null) {         canvas.drawBitmap(resizedBitmap, space, 0, null);     }     if (xPos != 0 &amp;&amp; yPos != 0) {         canvas.translate(xPos + space - position.getWidth() / 2, yPos - position.getHeight() / 2);         canvas.drawBitmap(position, new Matrix(), new Paint());     }} public void updatePosition(int xpos, int ypos) {   xPos = xpos;      yPos = ypos;      invalidate(); }}</code></pre><p>I call the setMapBitmap() and init() on onCreate of the activity that contains the view. In there I know what bitmap will be used as map. onPause of the activity I call the destroy() of the view. I still get errors. I've read this <a href=""http://mobi-solutions.blogspot.com/2010/08/how-to-if-you-want-to-create-and.html"">this</a> but I don't know how to adapt it on my case</p><p>I AM OPEN TO ANY OTHER SOLUTION. Please note that I need to resize the map bitmap (based on the height of the layout that contains it in mai activity) and still be able to draw the position on correct place. </p>","379865","","379865","","2010-11-19 08:07:26","2010-11-26 03:34:44","Android custom view Bitmap memory leak","<android><out-of-memory><ondraw><custom-view>","2","3","8","",""
"4198073","1","","","2010-11-16 19:21:04","5","3737","<p>the property android:layout_gravity=""clip_vertical|horizontal"" does the following as mentioned in the sdk documentation:</p><blockquote>  <p>Additional option that can be set to  have the top and/or bottom edges of  the child clipped to its container's  bounds. The clip will be based on the  vertical gravity: a top gravity will  clip the bottom edge, a bottom gravity  will clip the top edge, and neither  will clip both edges.</p></blockquote><p>but I can't see anything of this in my applications</p><p>so what is the purpose of this property exactly ?</p><p>thanks</p>","235123","","","","","2011-06-23 15:36:20","What is android:layout_gravity=""clip_vertical"" exactly","<android>","3","0","1","",""
"4198105","1","4198196","","2010-11-16 19:24:44","1","1395","<p>I am currently drawing lines on a MapView based on different GeoPoints to indicate sectors. With the following code (this is within an overlay):</p><pre><code>@Overridepublic void draw(Canvas canvas, MapView mapView, boolean shadow){    for(Polygon polygonTemp : polygonList)    {                   Path p = new Path();        Projection projection = mapView.getProjection();        boolean firstTime = true;        for(GeoPoint geoPoint : polygonTemp.getGeoPointList())        {            Point drawPoint = new Point();            projection.toPixels(geoPoint, drawPoint);            if(firstTime)            {                p.moveTo(drawPoint.x, drawPoint.y);                firstTime = false;            }            else            {                p.lineTo(drawPoint.x, drawPoint.y);            }        }        p.setFillType(Path.FillType.EVEN_ODD);        Paint polyPaint = new Paint();        polyPaint.setStrokeWidth(1);        polyPaint.setStyle(Paint.Style.FILL_AND_STROKE);        polyPaint.setAntiAlias(true);        polyPaint.setColor(Color.parseColor(polygonTemp.getColor()));        canvas.drawPath(p, polyPaint);        firstTime = true;    }    super.draw(canvas, mapView, shadow);}</code></pre><p>The problem is, I want them to be filled with some degree of transparency, so I can still see the map under the filled sectors. I tried to set polyPaint.setAlpha(), even to 255 (which should be completely transparent) and it doesn't do anything, it's completely opague.</p><p>Anyone knows what I'm doing wrong?</p>","298593","","881229","","2014-01-31 04:11:02","2014-01-31 04:11:02","Drawing transparent on a MapView","<android><android-canvas><transparency><android-mapview><draw>","1","0","","",""
"4198107","1","4198371","","2010-11-16 19:24:49","0","364","<p>I'm looking for some resources (online is good so I don't have to buy books, but books are ok) about mobile website development. I'm specifically targeting (in order) iPhone, Android, Blackberry. I'm proficient in HTML, and am getting into HTML5. I want to learn more about it in general, but specifically about using geolocation, detecting phone types, optimizing css, and a few other topics.  Does anyone have suggestions on where to look?</p><p>Thanks!</p>","348092","","","","","2010-11-16 20:00:30","Mobile Website Development Resources","<iphone><android><html5><mobile-website>","3","0","1","",""
"4198345","1","4199016","","2010-11-16 19:56:37","1","7285","<p>i define an imagebutton like this:</p><pre><code>&lt;ImageButton android:src=""@raw/blaimage"" /&gt; </code></pre><p>now how can i also define which method should be called when the button is clicked. </p><p>in the android documentation it says that you can use onClick but it doesnt seem to compile for me.</p><pre><code> android:onClick=""selfDestruct"" </code></pre><p>and in the activity i have:</p><pre><code> public void selfDestruct(View view) {     // Kabloey }</code></pre><p><a href=""http://developer.android.com/reference/android/widget/Button.html"" rel=""nofollow"">http://developer.android.com/reference/android/widget/Button.html</a></p>","97688","","97688","","2010-11-16 20:46:02","2011-11-10 21:49:53","android imagebutton click event in xml","<android><imagebutton>","2","5","","",""
"4198409","1","4198843","","2010-11-16 20:04:08","3","421","<p>I came across these types of android permissions:</p><pre><code>INTERNAL_SYSTEM_WINDOWMANAGE_APP_TOKENSREORDER_TASKSSET_ACTIVITY_WATCHER</code></pre><p>but they are unfamiliar to me.Could somebody explain what do they permit? In what situations are they likely to be used?</p><p>Thanks</p>","481828","","488830","","2010-11-16 20:06:47","2010-11-16 20:54:38","what do these android permissions mean and how to use them?","<android><permissions>","2","0","","",""
"4198425","1","4198569","","2010-11-16 20:05:49","26","40507","<p>When the data associated with array adapter is changed, invalidating the listview is sufficient to show the updated values? Following piece of code is not working, did i misunderstood something here.?</p><pre><code>public class ZeroItemListActivity extends Activity {    private ArrayList&lt;String&gt; listItems=new ArrayList&lt;String&gt;();    private ListView mMyListView;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mMyListView=(ListView) findViewById(R.id.MyListView);        mMyListView.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,listItems));    }    public void addItem(View v){        listItems.add(""list Item"");        mMyListView.invalidate();    }}</code></pre><p>Layout used :</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;ListView android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:id=""@+id/MyListView""&gt;&lt;/ListView&gt;    &lt;Button android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:id=""@+id/AddItemsButton""        android:text=""Add Items"" android:onClick=""addItem""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","110024","","","","","2014-03-20 15:14:41","Updating the list view when the adapter data changes","<android>","2","0","3","",""
"4198473","1","4217252","","2010-11-16 20:10:17","1","7957","<p>I'm building my app using this Maven script. But then I get a whole bunch of errors (see at the end of the posting). It's as if <em>android.jar</em> is not found. I checked the path to <em>android.jar</em> and it's fine.</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;project xmlns=""http://maven.apache.org/POM/4.0.0""     xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""    xsi:schemaLocation=""http://maven.apache.org/POM/4.0.0    http://maven.apache.org/maven-v4_0_0.xsd""&gt;    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;    &lt;groupId&gt;my.group.id&lt;/groupId&gt;    &lt;artifactId&gt;myproject1.0&lt;/artifactId&gt;    &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;    &lt;packaging&gt;apk&lt;/packaging&gt;    &lt;name&gt;MyProject&lt;/name&gt;    &lt;dependencyManagement&gt;        &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;2.1.2&lt;/version&gt;                &lt;scope&gt;provided&lt;/scope&gt;            &lt;/dependency&gt;        &lt;/dependencies&gt;    &lt;/dependencyManagement&gt;    &lt;build&gt;        &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;        &lt;plugins&gt;            &lt;plugin&gt;                &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt;                &lt;artifactId&gt;maven-android-plugin&lt;/artifactId&gt;                &lt;version&gt;2.6.0&lt;/version&gt;                &lt;configuration&gt;                    &lt;sdk&gt;                        &lt;platform&gt;4&lt;/platform&gt;                    &lt;/sdk&gt;                    &lt;emulator&gt;                        &lt;avd&gt;16&lt;/avd&gt;                    &lt;/emulator&gt;                    &lt;deleteConflictingFiles&gt;true&lt;/deleteConflictingFiles&gt;                    &lt;undeployBeforeDeploy&gt;true&lt;/undeployBeforeDeploy&gt;                &lt;/configuration&gt;                &lt;extensions&gt;true&lt;/extensions&gt;            &lt;/plugin&gt;            &lt;plugin&gt;                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;                &lt;version&gt;2.3&lt;/version&gt;            &lt;/plugin&gt;        &lt;/plugins&gt;    &lt;/build&gt;&lt;/project&gt;</code></pre><p>Errors:</p><pre><code>C:\projectX&gt;mvn install -e+ Error stacktraces are turned on.[INFO] Scanning for projects...[INFO] ------------------------------------------------------------------------[INFO] Building MyProject[INFO]    task-segment: [install][INFO] ------------------------------------------------------------------------[INFO] [android:generate-sources {execution: default-generate-sources}][INFO] ANDROID-904-002: Found aidl files: Count = 0[INFO] ANDROID-904-002: Found aidl files: Count = 0[INFO] Copying local resource files to combined resource directory.[INFO] C:\dev\android-sdk-windows\platforms\android-4/tools/aapt [package, -m, -J, \       C:\projectX\target\generated-sources\r, -M, C:\projectX\AndroidManifest.xml, -S, \       C:\projectX\target\generated-sources\combined-resources\res,-A, C:\projectX\assets, -I, \       C:\dev\android-sdk-windows\platforms\android-4\android.jar][ERROR] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Compilation failureC:\projectX\src\com\projectx\MyClass.java:[13,22] package org.apache.http does not existC:\projectX\src\com\projectx\MyClass.java:[23,29] package org.apache.http.entity does not existC:\projectX\src\com\projectx\MyClass.java:[28,29] package org.apache.http.params does not existC:\projectX\src\com\projectx\MyClass.java:[30,22] package android.content does not existC:\projectX\src\com\projectx\MyClass.java:[31,19] package android.util does not existC:\projectX\src\com\projectx\MyClass.java:[50,9] cannot find symbolsymbol  : class DefaultHttpClientlocation: class com.projectx.MyClassC:\projectX\src\com\projectx\MyService.java:[10,24] package android.telephony does not existC:\projectX\src\com\projectx\MyService.java:[13,18] package android.app does not existC:\projectX\src\com\projectx\MyService.java:[19,22] package android.content does not existC:\projectX\src\com\projectx\MyService.java:[23,40] package android.content.SharedPreferences does not existC:\projectX\src\com\projectx\MyService.java:[25,18] package android.net does not existC:\projectX\src\com\projectx\MyService.java:[28,17] package android.os does not existC:\projectX\src\com\projectx\MyService.java:[29,25] package android.preference does not existC:\projectX\src\com\projectx\MyService.java:[30,19] package android.util does not existC:\projectX\src\com\projectx\MyService.java:[31,19] package android.view does not existC:\projectX\src\com\projectx\MyService.java:[34,21] package android.widget does not existC:\projectX\src\com\projectx\MyService.java:[54,36] cannot find symbolsymbol: class Servicepublic class MyService extends Service {C:\projectX\src\com\projectx\MyClass.java:[103,34] cannot find symbolsymbol  : class Contextlocation: class com.projectx.MyClassC:\projectX\src\com\projectx\MyClass.java:[209,46] cannot find symbolsymbol  : class Contextlocation: class com.projectx.MyClassC:\projectX\src\com\projectx\MyClass.java:[229,37] cannot find symbolsymbol  : class Contextlocation: class com.projectx.MyClassC:\projectX\src\com\projectx\MyService.java:[75,16] cannot find symbolsymbol  : class PendingIntentlocation: class com.projectx.MyService...truncated...[INFO] ------------------------------------------------------------------------[INFO] Traceorg.apache.maven.BuildFailureException: Compilation failure</code></pre>","442512","","356895","","2013-06-06 21:59:08","2013-06-06 21:59:08","Building Android project in Maven: Package * does not exist","<android><maven><pom.xml>","3","1","","",""
"4198656","1","","","2010-11-16 20:33:01","7","16460","<p>How to use a layout as empty view for a listview when the adapter has zero elements?</p><p>setEmptyView is not working with this code : </p><pre><code>public class ZeroItemListActivity extends Activity {    private ArrayList&lt;String&gt; listItems=new ArrayList&lt;String&gt;();    private ListView mMyListView;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mMyListView=(ListView) findViewById(R.id.MyListView);        mMyListView.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,listItems));        LayoutInflater inflator=getLayoutInflater();        View emptyView=inflator.inflate(R.layout.empty_list_item, null);        //Empty view is set here        mMyListView.setEmptyView(emptyView);    }    public void addItem(View v){        listItems.add(""list Item"");        mMyListView.invalidate();    }}</code></pre><p>Layouts used : empty_list_item.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;Button android:id=""@+id/Button01"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""Empty List,Click to add items""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:text=""@string/hello"" /&gt;    &lt;ListView android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:id=""@+id/MyListView""&gt;&lt;/ListView&gt;    &lt;Button android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:id=""@+id/AddItemsButton""        android:text=""Add Items"" android:onClick=""addItem""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","110024","","","","","2013-05-02 03:02:44","Setting a layout to use as empty view for a ListView in case adapter has zero items in a Activity","<android>","2","1","2","",""
"4198772","1","4198807","","2010-11-16 20:47:35","5","17048","<p>I uploaded an apk file to a web server and attempted to access the link from the browser on the phone.  When I attempt to download from that link I receive an error message that reads ""An SD card is required to download.""  I do not have an SD card installed, but the internal memory is not full, so I would expect the app to install to internal memory. </p><p>The obvious solution is to install an SD Card.  Putting an SD card in the device does allow the app to install.  So, the question is why is this necessary?  </p><p>Nowhere in my app do I specify that this needs to be installed on an SD Card.  I've tried leaving the installLocation blank and setting it to ""auto"" and ""internalOnly"".  I've scoured the forums and not found a reason for this. </p>","417426","","","","","2013-07-02 16:52:52","Installing Android App Without SD Card","<android><android-manifest><sd-card>","3","0","","",""
"4198856","1","4198987","","2010-11-16 20:55:56","2","1980","<p>Seems to be a simple question, but I can't figure out how to do it.</p><p>I have a horizontal LinearView with something of fixed size at the left, then comes some text which should take as mich space as possible, but on the right should be another fixed-size object.</p><p>Now, my problems are right now: When the text in the middle is too long, the object at the right gets pushed out of the window. When the text is too short, it does not sit at the right border of the window, but directly next to the text.</p><p>How can I do it? My Code so far (As you can see, I tried to use the LayoutWeight, which didn't help...):</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/important""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_marginRight=""10dp""        android:background=""#000000""        android:layout_weight=""1""/&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;        &lt;TextView            android:id=""@+id/name""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:paddingTop=""5dp""            android:paddingRight=""5dp""            android:paddingLeft=""0dp""            android:textColor=""#333333""            android:paddingBottom=""0dp""            android:textSize=""14sp""            android:scrollHorizontally=""true""/&gt;        &lt;TextView            android:id=""@+id/description""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:textColor=""#666666""            android:paddingTop=""3dp""            android:paddingRight=""5dp""            android:paddingLeft=""10dp""            android:paddingBottom=""5dp""            android:textSize=""12sp"" /&gt;    &lt;/LinearLayout&gt;    &lt;ImageView android:id=""@+id/lastpage""         android:src=""@drawable/lastpage""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_weight=""200""        android:scaleType=""center""        android:layout_gravity=""right""/&gt;&lt;/LinearLayout&gt;</code></pre>","169748","","","","","2010-11-16 21:12:21","Android: LinearView with fixed sized widgets left and right and a flexible one in the middle","<android><android-linearlayout>","2","0","","",""
"4198901","1","4209570","","2010-11-16 21:00:40","2","1210","<p>I'm sure I'm missing something, but I'm just trying to get an app widget with a button and a counter. Every time I click the button I want the counter to update by 1.</p><p>I've set the onUpdate() function of the WidgetProvider to register a pending event to the button so that it starts a service to bump the counter numbver:</p><pre><code>Intent active = new Intent(context, CounterService.class);active.setAction(CounterService.COUNT);PendingIntent pending = PendingIntent.getService(context, 0, active, PendingIntent.FLAG_UPDATE_CURRENT);views.setOnClickPendingIntent(R.id.CountButton, pending);ComponentName component = new ComponentName(context.getPackageName(), KickCounterWidgetProvider.class.getName());    appWidgetManager.updateAppWidget(component, views);</code></pre><p>Then in the services CounterService::onStart() function I bump the count (stored in prefs for now) and then try and update the text field that shows the current count value:</p><pre><code>// ... bump the count here and store a string representation of it in currentCountString ...RemoteViews remoteView = new RemoteViews(getApplicationContext().getPackageName(), R.layout.widget);remoteView.setTextViewText(R.id.CurrentKickCount, currentCountString);// apply changes to widgetAppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getApplicationContext());ComponentName component = new ComponentName(getApplicationContext().getPackageName(), KickCounterWidgetProvider.class.getName());    appWidgetManager.updateAppWidget(component, remoteView);</code></pre><p>Judicious use of Logcat indicates tha this all works ok and the string seems to be OK, but for some reason the call to appWidgetManager.updateAppWidget() seems to be failing silently for some reason.</p><p>I don't know if it's related at all, but the first time I add an instance of the widget to the homescreen, not even the button works (ie the call to updateAppWidget() in onUpdate() in the Provider fails). Subsequent instances of the widget seem to work OK for the call to updateAppWidget() in the Provider but never works for the service.</p><p>Any help would be greatly appreciated.</p>","510046","","","","","2010-11-17 21:58:19","How can I update the UI for an android appwidget","<android><user-interface><appwidget>","2","0","1","",""
"4199054","1","","","2010-11-16 21:15:59","1","215","<p>I have a layout that is loaded in the Activity's onCreate(). I then add an extended OpenGL view to the layout. On the activity's onConfigurationChanged() method I want to load a new layout, and move the OpenGL view into it so I don't have to re-create all of the textures/objects/etc. that is under it which takes a while. How would I go about doing this properly?</p>","463183","","44729","","2010-11-16 21:53:21","2010-11-16 21:53:21","How do I move an OpenGL view between content views","<android><layout><opengl-es><view><content>","0","0","1","",""
"4199063","1","","","2010-11-16 21:16:59","1","397","<p>Hi i've found a example on this site on how to make a subclass of the application for android.</p><p>I've created this code</p><pre><code>package mensand.test;class TestApp extends android.app.Application {}</code></pre><p>Added this line to the manifest</p><pre><code>android:name=""mensand.test.TestApp""</code></pre><p>And when i run the app it's starts with a force close message.</p><p>When i remove the line from the manifest all runs ok</p><p>Greetings Andre Mens</p>","510060","","133802","","2010-11-16 21:22:02","2010-11-18 14:35:27","Android Application subclass constantly generates forceclose","<android><android-manifest>","1","1","","",""
"4199191","1","4200043","","2010-11-16 21:30:53","9","30844","<p>)I'm in a process of creating a memory game. My problem is that whenever i click for the second time, i can't even see toggled button. To be clear - first click toggles the togglebutton, so i can see the number it holds, the second click on a different togglebutton is suposed to toggle it, show me the number and then proceed to either set a score +1 if numbers are the same, or reverse them back again if they're different.</p><p>Below is the code that i use as my onClick function, i've been thinking about putting some kind of sleep or delay function somwhere in the second ""if block"" - (if(klikniecia ==2)).</p><p>Any help on this topic would be appreciated.</p><pre><code>public void onClick(View view) {for (int i = 0; i &lt; karta.length; i++){    if (view == karta[i]){        karta[i].setEnabled(false);        klikniecia++;        if (klikniecia == 1){            kartaID[0]=i;            kartaWartosc[0]=listaKart.get(i);        }        if (klikniecia == 2){            kartaID[1]=i;            kartaWartosc[1]=listaKart.get(i);            //i think, about setting a delay here, so i can see both of the cards, regardles if the're the same or not before reverting them.            if (czyPara()){                karta[kartaID[0]].setEnabled(false);                karta[kartaID[1]].setEnabled(false);                klikniecia=0;            }            else{                karta[kartaID[0]].setEnabled(true);                karta[kartaID[0]].toggle();                karta[kartaID[1]].setEnabled(true);                karta[kartaID[1]].toggle();                klikniecia=0;            }        }    }}</code></pre><p>}</p>","490584","","","","","2013-12-19 13:17:11","How to set delay in Android onClick function","<android><onclick><sleep><delay>","5","2","1","",""
"4199303","1","4636368","","2010-11-16 21:44:41","0","719","<p>Apparently my Android app isn't working as it should on Samsung Galaxy Tab. The MapView don't display map/satellite tiles on the Tab. On other devices the MapView works as it should. I don't own a Tab myself so I have problem finding out what might be wrong and I have no clue right now what might cause it. Any point in the right direction is highly appreciated. </p><p>The app works in emulator using the avd distribued by Samsung in the emulator with the fix described <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg123342.html"" rel=""nofollow"">here</a> in order to be able to debug MapView in it.<br/><br/><br/>Info from AndroidManifest.xml that might be interesting:</p><p></p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""8""/&gt;&lt;supports-screens    android:largeScreens=""true""    android:normalScreens=""true""    android:smallScreens=""true""    android:anyDensity=""true"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;&lt;application android:name="".MyAppName""    android:icon=""@drawable/ic_about""     android:theme=""@android:style/Theme.NoTitleBar""    android:label=""@string/app_name""     android:debuggable=""false""&gt;    &lt;activity android:name="".InitialActivity""&gt;        &lt;intent-filter android:label=""@string/app_name""&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="".FavoriteSpotActivity"" /&gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;&lt;/application&gt;</code></pre><p> </p>","287170","","287170","","2010-11-16 21:57:19","2011-01-08 21:55:41","MapView not working on Galaxy Tab","<android><tablet>","2","1","2","",""
"4199320","1","4199350","","2010-11-16 21:46:05","1","1887","<p>I'm a complete newbie to Android, and this may actually be more of a Java question...</p><p>I'm trying to set up an if statement based on the item clicked in a ListView. In my onItemClick method I have the following:</p><pre><code>Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show();if(((TextView) view).getText() == ""Page 1""){     Toast.makeText(getApplicationContext(), ""Page 1 clicked"", Toast.LENGTH_SHORT).show();}</code></pre><p>The string populating my ListView has ""Page 1""; I see the first Toast saying ""Page 1"", but I never get the ""Page 1 clicked"" Toast, so obviously something about my if statement is wonky. Suggestions?</p><p>Thanks!</p><p>Bill</p>","510085","","210719","","2010-11-16 21:48:06","2010-11-16 21:48:06","Android - How to get ListView text?","<java><android>","1","0","","",""
"4199323","1","4199575","","2010-11-16 21:46:10","4","2781","<p>I'm testing a simple hello app and it's not launching on the emulator. There's no errors and the console is this:  </p><pre><code>[2010-11-16 21:26:06 - Hello World] ------------------------------  [2010-11-16 21:26:06 - Hello World] Android Launch!  [2010-11-16 21:26:06 - Hello World] adb is running normally.  [2010-11-16 21:26:06 - Hello World] Performing com.hello.HelloWorld.HelloWorld activity launch  [2010-11-16 21:26:09 - Hello World] Launching a new emulator with Virtual Device 'VirtualDevice2.2'    </code></pre><p>The emulator launches and the screen appears with the lock and my app doesn't start.<br>Tried to unlock and go to launcher to look for my app and it's not there.<br>Anyone can help me on this one?<br>Thanks.</p><p>Code:  </p><pre><code>package com.hello.HelloWorld;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class HelloWorld extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        // We want to view some very simple text, so we need a TextView        TextView tv = new TextView(this);        // Put some text to the newly created TextVIew        tv.setText(""Hello Android"");        // Tell our App to display the textView        this.setContentView(tv);    }}</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""      android:versionCode=""1""      android:versionName=""1.0"" package=""com.hello.HelloWorld""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".HelloWorld""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre>","510097","","234039","","2010-11-16 23:08:30","2010-11-16 23:08:30","Android app not launching on emulator","<android><emulator>","1","4","2","",""
"4199511","1","","","2010-11-16 22:06:18","0","383","<p>I have an Android application that uses URLConnection to connect to a REST service and gets some content.  I am getting a ton of complaints that it doesn't work over a 4G connection like WiMAX, though it works fine over WiFi or 3G connections.  Is there anything special I have to do before attempting the REST request to allow it to use the 4G connection?  I am using Android 2.2.</p><p>PS: This is very hard to test as I only have Droid and a HTC Hero to work with.</p>","396936","","","","","2010-12-27 06:53:10","Android App Not connecting using WIMAX/4G","<android><networking><connection><urlconnection>","1","0","","",""
"4199563","1","4199921","","2010-11-16 22:12:04","7","2994","<p>I've got a hell of a lot of Log.i Log.d Log.e in my code for a recent app I've done. I'm about to publish this app and I don't really want people seeing it when they plug there phone into adb, but I do want it there for my own debugging.</p><p>I was wanting to extend android.util.log and just have a boolean switch in there so I could just turn off the log when I publish and turn it on when developing but this class is final, am I missing a trick?</p><p>I don't really want to go through my code an remove all, true if worst comes to worst I could do a ctrl+h global replace Log for //Log but that does suck as an answer.</p><p>I also realise that Log.d is stripped out at runtime but it is still ran (losing a little performance) so not running this would be an added bonus.</p><p>Yeah so basically I'm looking for a way to toggle my debug on and off programatically, this can also allow me later on to make it a preference or something if people want to view it or help out and send it on.</p><p>What do you guys implement for this?</p><p>Thanks</p>","413127","","","","","2010-11-17 06:47:54","android.util.Log when publishing - what can I do / not do","<android><debugging><design-patterns><logging><logcat>","3","0","5","",""
"4199681","1","4199701","","2010-11-16 22:24:44","2","1847","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2840608/how-do-i-add-a-newline-to-a-textview-in-android"">How do I add a newline to a TextView in Android?</a>  </p></blockquote><p>I would like to manually add a line break to my TextView. Now sure how I can do this.</p>","19875","","","","","2011-07-19 09:44:32","How can I add a line break to a TextView?","<java><android><textview>","1","0","","2011-07-19 11:21:16",""
"4199753","1","4971233","","2010-11-16 22:34:15","16","18031","<p>I have an Options Menu on my <code>Activity</code> with an <code>MenuItem</code> ""Start"". When this <code>MenuItem</code> is selected I would like to alter the Menu so it contains a <code>MenuItem</code> ""Stop"". And finally when ""Stop"" is selected, I would like to alter back to ""Start"".</p><p>Here is parts of my code that isn't working. I have both ""Start"" and ""Stop"" listed in <code>mymenu.xml</code> I should probably remove ""stop"" when the menu is created:</p><pre><code>public class MyActivity extends Activity {    private boolean isStarted = false;    @Override    public boolean onCreateOptionsMenu(Menu menu) {        MenuInflater inflater = getMenuInflater();        menu.removeItem(R.id.stop);        inflater.inflate(R.menu.mymenu, menu);        return true;    }    @Override    public boolean onOptionsItemSelected(MenuItem item) {        switch (item.getItemId()) {        case R.id.start:            isStarted = true;            return true;        case R.id.stop:            isStarted = false;            return true;        default:            return super.onOptionsItemSelected(item);        }    }    @Override    public boolean onPrepareOptionsMenu(Menu menu) {        if(isStarted) {            menu.removeItem(R.id.start);            menu.add(R.id.stop);        } else {            menu.removeItem(R.id.stop);            menu.add(R.id.start);        }        return true;    }}</code></pre>","213269","","213269","","2010-11-16 22:48:47","2013-12-06 13:52:16","How can I alter a MenuItem on the Options Menu on Android?","<android><menuitem><options-menu><alternation>","5","4","3","",""
"4199761","1","","","2010-11-16 22:35:37","1","438","<p>I'm trying to bring up the standard window for Bluetooth Settings (with Device name, Discoverability etc).</p><p>However, general approach with startActivity(intent) ends with NullPointerException pointing to BluetoothSettings.java onCreate:135. </p><p>Checking with the Android code, I've found that at line 135 they get some extras from the intent. So I prepare the same extras (names I've found in android core BluetoothDevicePicker interface) and issue it -- the same effect with NullPointerException.</p><p>Might be the wrongs names of the extras I prepare? </p><p>So is there a way I can see those extras (with names especially) from the intent the system itself submits when I open Bluetooth Settings manually acting like a user?</p><p>Many thanks.</p><p>My code is:</p><p>Intent settingsIntent = new Intent();settingsIntent.setClassName(""com.android.settings"", ""com.android.settings.bluetooth.BluetoothSettings"");settingsIntent.putExtra(""android.bluetooth.devicepicker.extra.LAUNCH_PACKAGE"", ""mypackage.bttoggle"");settingsIntent.putExtra(""android.bluetooth.devicepicker.extra.DEVICE_PICKER_LAUNCH_CLASS"", ""mypackage.bttoggle.BluetoothWidget"");PendingIntent settingsPendingIntent = PendingIntent.getActivity(context, 0, settingsIntent, 0);views.setOnClickPendingIntent(R.id.btnSettings, settingsPendingIntent);</p><p>It's a widget so I need to use PendingIntent.</p><p>This code get the following Exception at runtime:</p><p>ERROR/AndroidRuntime(4905): Uncaught handler: thread main exiting due to uncaught exceptionERROR/AndroidRuntime(4905): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.bluetooth.BluetoothSettings}: java.lang.NullPointerExceptionERROR/AndroidRuntime(4905):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)ERROR/AndroidRuntime(4905):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)ERROR/AndroidRuntime(4905):     at android.app.ActivityThread.access$2200(ActivityThread.java:126)ERROR/AndroidRuntime(4905):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)ERROR/AndroidRuntime(4905):     at android.os.Handler.dispatchMessage(Handler.java:99)ERROR/AndroidRuntime(4905):     at android.os.Looper.loop(Looper.java:123)ERROR/AndroidRuntime(4905):     at android.app.ActivityThread.main(ActivityThread.java:4595)ERROR/AndroidRuntime(4905):     at java.lang.reflect.Method.invokeNative(Native Method)ERROR/AndroidRuntime(4905):     at java.lang.reflect.Method.invoke(Method.java:521)ERROR/AndroidRuntime(4905):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)ERROR/AndroidRuntime(4905):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)ERROR/AndroidRuntime(4905):     at dalvik.system.NativeStart.main(Native Method)ERROR/AndroidRuntime(4905): Caused by: java.lang.NullPointerExceptionERROR/AndroidRuntime(4905):     at com.android.settings.bluetooth.BluetoothSettings.onCreate(BluetoothSettings.java:135)ERROR/AndroidRuntime(4905):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)ERROR/AndroidRuntime(4905):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)ERROR/AndroidRuntime(4905):     ... 11 more</p><p>After investigating, I found that at line 135 in BluetoothSettings.java there is:</p><p>public class BluetoothSettings extends PreferenceActivity {</p><p>... 132             mNeedAuth = intent.getBooleanExtra(BluetoothDevicePicker.EXTRA_NEED_AUTH, false); 133             mFilterType = intent.getIntExtra(BluetoothDevicePicker.EXTRA_FILTER_TYPE, 134                     BluetoothDevicePicker.FILTER_TYPE_ALL); 135             mLaunchPackage = intent.getStringExtra(BluetoothDevicePicker.EXTRA_LAUNCH_PACKAGE); 136             mLaunchClass = intent.getStringExtra(BluetoothDevicePicker.EXTRA_LAUNCH_CLASS);...</p><p>I looked into BluetoothDevicePicker to find the names of the extras:</p><p>public interface BluetoothDevicePicker {    public static final String EXTRA_NEED_AUTH =            ""android.bluetooth.devicepicker.extra.NEED_AUTH"";    public static final String EXTRA_FILTER_TYPE =            ""android.bluetooth.devicepicker.extra.FILTER_TYPE"";    public static final String EXTRA_LAUNCH_PACKAGE =            ""android.bluetooth.devicepicker.extra.LAUNCH_PACKAGE"";    public static final String EXTRA_LAUNCH_CLASS =            ""android.bluetooth.devicepicker.extra.DEVICE_PICKER_LAUNCH_CLASS"";</p><p>so I use them in my code to prepare those particular extras.</p><p>Thanks.</p>","510148","","510148","","2010-11-17 14:10:48","2010-11-17 14:10:48","Android: trying to start BluetoothSettings activity Force Closes with NullPointerException","<android><bluetooth><settings>","0","2","","",""
"4199795","1","4200155","","2010-11-16 22:40:09","5","2343","<p>I have created an <code>ArrayList&lt;HashMap&lt;String, String&gt;&gt;</code> collection to hold my data for <code>ListView</code>. I'm using <code>SimpleAdapter</code>.</p><p>Is it possible to change background of list item when list item's ID % 10 == 0?</p><p>Here is the code (method generating layout):</p><pre><code>private void fillData() {    Cursor c = this.mDbManager.getNgOrderDetailByOrderNumber(this.mNumber);    ArrayList&lt;HashMap&lt;String, String&gt;&gt; items = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();    if (!c.isAfterLast()) {       do {           // ... filling HashMap and putting it to ArrayList       } while (c.moveToNext());       }    SimpleAdapter adapter = new SimpleAdapter(this, items, R.layout.list_item,         new String[] { ""product"", ""ordered"", ""price"", ""discount"" },         new int[] { R.id.ProductTextView, R.id.OrderedTextView,        R.id.PriceTextView, R.id.DiscountTextView });     ListView l = (ListView) findViewById(android.R.id.list);     l.setAdapter(adapter);}</code></pre>","295141","","2218452","","2013-05-23 07:21:59","2013-05-23 07:25:44","How to do custom ListView with colorful items' backgrounds?","<android><android-listview><listviewitem><android-sdk-2.1>","3","0","3","",""
"4199959","1","","","2010-11-16 23:04:43","5","1811","<p>I'm currently trying to build an android application to take pictures and I need to freeze the camera preview on a given event (i.e. picture taken) and restart it only after another event.</p><p>What I want, in other words, is for the view to display whatever the camera sees until the freeze event occurs and then to freeze the image (i.e. display whatever was on screen at the time of this event -- as if a picture was taken) until the unfreeze event occurs.</p><p>Now, I'm currently using a SurfaceView with a SurfaceHolder.Callback to do this and I tried to use a PreviewCallback to freeze the screen, but unfortunately, I can't find an example or a tutorial and I'm really stuck at this point.</p><p>If anyone has a guide or some pointers on how to get this done, I would really appreciate the help...</p><p>I'm pasting the relevant parts of my code below:</p><p>public class CustomCameraView extends SurfaceView {</p><pre><code>Camera camera;SurfaceHolder previewHolder;//Callback for the surfaceholderSurfaceHolder.Callback surfaceHolderListener = new SurfaceHolder.Callback() {    public void surfaceCreated(SurfaceHolder holder) {        camera=Camera.open();        try         {            camera.setPreviewDisplay(previewHolder);        }        catch (Throwable t) {        }    }    public void surfaceChanged(SurfaceHolder surfaceHolder, int format, int w, int h)    {        Parameters params = camera.getParameters();        params.setPictureFormat(PixelFormat.JPEG);            camera.setParameters(params);            camera.startPreview();    }    public void surfaceDestroyed(SurfaceHolder arg0)    {        camera.stopPreview();        camera.release();    }};public CustomCameraView(Context ctx){    super(ctx);    previewHolder = this.getHolder();        previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);        previewHolder.addCallback(surfaceHolderListener);        setBackgroundColor(Color.TRANSPARENT);}public CustomCameraView(Context context, AttributeSet attrs){    super(context, attrs);}protected void onDraw (Canvas canvas){}public void closeCamera(){    if(camera != null)        camera.release();}public void dispatchDraw(Canvas c){    super.dispatchDraw(c);}</code></pre><p>}</p><p>Thank you very much for your help!</p><p>-Billy</p>","510159","","","","","2011-12-09 13:03:57","Android Camera Preview -- How to 'freeze' the camera?","<android><camera><preview><freeze><image>","1","0","","",""
"4199964","1","","","2010-11-16 23:05:35","1","950","<p>Using RelativeLayout - I am trying to add an EditText box and place it on vertical and horizontal center of a background image </p><p>say an image about 480x100pixels - and i want to place an EditText box in the center.</p><pre><code>  RelativeLayout rl = new RelativeLayout(this);   image.setId(1);   search.setId(2);    rl.addView(image);    LayoutParams params1 = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);    params1.addRule(RelativeLayout.CENTER_HORIZONTAL);    params1.addRule(RelativeLayout.ALIGN_BASELINE , image.getId());    rl.addView(search, params1);</code></pre>","510164","","","","","2013-08-05 20:41:37","Android - RelativeLayout - Add Text on Image","<android><relativelayout>","2","0","","",""
"4200011","1","4200718","","2010-11-16 23:12:56","15","15195","<p>Today for one of my app (Android 2.1), I wanted to stream a video from an URL.</p><p>As far as I explored Android SDK it's quite good and I loved <em>almost</em> every piece of it.But now that it comes to video stream I am kind of lost.</p><p>For any information you need about Android SDK you have thousands of blogs telling you how to do it. When it comes to video streaming, it's different. Informations is that abundant.</p><p>Everyone did it it's way tricking here and there.</p><p>Is there any well-know procedure that allows one to stream a video?</p><p>Did google think of making it easier for its developers?</p>","290613","","","","","2013-06-04 07:44:33","Video Streaming and Android","<android><streaming><video-streaming>","2","0","14","",""
"4200119","1","5198624","","2010-11-16 23:30:50","5","6744","<p>I need read about 100 samples per second off the accelerometer on a Android, and at a fixed sample rate. The current sensormanager does or offers neither.</p><p>I've read <a href=""http://stackoverflow.com/questions/1916660/need-to-read-android-sensors-really-fast"">Need to read android sensors really fast</a></p><p>He seems to have access to the driver code which made his life easier.</p><p>I am curious if anyone has been able to do something like this through the NDK w/o that type of knowledge.</p><p>Thanks in advance!</p>","360785","","","","","2011-03-05 00:09:55","Access Android sensors via NDK","<android><android-ndk><accelerometer><sensor>","3","0","3","",""
"4200235","1","4200261","","2010-11-16 23:52:26","2","170","<p>I see three folders within my eclipse project drawable-hdpi,mdpi,ldpi</p><p>Do I need to put images in all three of these folders?Or can I just use one of them.My imagesseem to scale fairly well.I do not want to have duplicate images if it is uneccessary.</p><p>I guess what I am asking is will the app be able to find my images if I just use one of the above mentioned folders?</p>","509087","","213269","","2010-11-17 00:06:22","2010-11-17 00:06:22","Images in android app","<android><image><drawable>","2","0","","",""
"4200259","1","4977247","","2010-11-16 23:55:16","36","12144","<p>I created my own WebView and set the WebChromeClient and WebViewClient objects. When I start this WebView, the HTML form fields react when I touch them (a cursor appears), but they do not get selected, nor does the soft keyboard start. If I use the trackball to choose the form and press it, the keyboard does appear.</p><p>I tried to call <code>myWebview.requestFocusFromTouch()</code> as <a href=""http://stackoverflow.com/questions/3098186/android-how-to-add-custom-soft-keyboard-when-form-field-is-selected-in-webview"">this answer</a> suggested, but it returns false and doesn't help.</p>","355039","","114066","","2011-12-20 12:49:55","2013-04-08 18:18:08","Tapping form field in WebView does not show soft keyboard","<android><webview>","2","0","7","",""
"4200357","1","4200524","","2010-11-17 00:10:01","0","257","<p>I would like to use a .jar file generated by SWIG in an Android application.  What is the best way to deploy all of the underlying dll's with the Android application?  </p><p>In a desktop environment, my PATH variable includes the folder containing these dll's.</p>","163757","","","","","2010-11-17 00:43:30","Deploying SWIG dependent dll's with Android Application","<android><swig>","1","0","","",""
"4200406","1","5452854","","2010-11-17 00:18:14","7","3608","<p>So anybody worth their salt in the android development community knows about issue 3434 relating to low latency audio in Android.  For those who don't, you can educate yourself here. <a href=""http://code.google.com/p/android/issues/detail?id=3434"">http://code.google.com/p/android/issues/detail?id=3434</a></p><p>I'm looking for any sort of temporary workaround for my personal project.  I've heard tell of exposing private interfaces to the NDK by rolling your own build of android and modifying the NDK.</p><p>All I need is a way to access the low level alsa drivers which are already packaged with the standard 2.2 build.  I'd like to have the ability to send PCM directly to the audio hardware on my device.  I don't care that the resulting app won't be distributable over the marketplace, and likely won't run with any other device than mine.</p><p>Anybody have any useful ideas?</p><p>-Griff</p><p>EDIT: I should mention, I know AudioTrack provides this functionality, but I'd like much lower latency -- AudioTrack sits around 300ms, I'd like somewhere around 20-30 ms.</p>","383288","","","","","2012-09-13 17:59:27","Android Audio Latency Workarounds","<android><audio><android-ndk>","2","0","3","",""
"4200450","1","","","2010-11-17 00:26:34","0","234","<p>Is it possible to trigger a hardware event from a service? At the very least, I'm hoping to emulate trackball movements and clicking events such that an active app will process them normally.</p><p>Many thanks.</p>","391978","","","","","2010-12-22 03:57:52","trigger android hardware event from a service","<android><events><android-service>","1","0","","",""
"4200451","1","","","2010-11-17 00:26:50","2","271","<p>Does anyone have a clue what could be causing this?</p><pre><code>11-16 16:23:26.745: ERROR/AndroidRuntime(9549): Uncaught handler: thread main exiting due to uncaught exception11-16 16:23:26.765: ERROR/AndroidRuntime(9549): java.lang.NullPointerException11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:692)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:692)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at android.view.ViewRoot.performTraversals(ViewRoot.java:722)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1658)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at android.os.Handler.dispatchMessage(Handler.java:99)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at android.os.Looper.loop(Looper.java:123)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at android.app.ActivityThread.main(ActivityThread.java:4363)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at java.lang.reflect.Method.invokeNative(Native Method)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at java.lang.reflect.Method.invoke(Method.java:521)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)11-16 16:23:26.765: ERROR/AndroidRuntime(9549):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","413414","","418183","","2010-11-17 00:32:02","2014-04-10 07:54:59","Using ViewGroup throws NullPointerException","<android><view><nullpointerexception>","1","4","","",""
"4200596","1","","","2010-11-17 01:00:59","0","609","<p>our engineer test video and audio player using streaming aac mono contents and 128x98 video content.</p><p>aac and mp4 decoder can't decoding content. and return error.</p><p>android not support low level contents?</p>","510250","","","","","2011-01-30 01:02:47","android 2.2 can't play AAC Mono and 128x98 Video?","<android><streaming>","1","1","","",""
"4200723","1","4200799","","2010-11-17 01:29:18","0","1258","<p>Greetings Everyone.</p><p>I was wondering how would I go about drawing an ached line on a canvas.  If I were to continue this line it would make a perfect circle.  I've got pie wedges which is close but I just want the outside of the wedge and it needs to be circular.  What should I do</p>","445342","","30618","","2010-11-17 03:44:45","2010-11-17 03:44:45","Drawing a Thick, Arched Line in Android","<android><canvas><view><drawing><geometric-arc>","1","4","","",""
"4201065","1","","","2010-11-17 02:58:05","2","1570","<p>I have an activity (say activity A) which displays video using a mediaplayer, rendered in a surfaceview.<br>The use case is to pause the video, start another activity (say activity B), then come back to activity A.<br>Activity A is stopped but not destroyed when going to B, which is good.<br>The surface view (since not visibile) IS destroyed (as observed from the notification callbacks).<br>When coming back to activity A, and restarting the mediaplayer using start(), the media player does play back the audio, but video is not seen. Errors like this one are output on Logcat:  </p><pre><code>11-16 18:14:44.532: ERROR/Overlay(8630): Error = Invalid argument from qbuf</code></pre><p>Unfortunately, using the new instance of <code>SurfaceHolder</code> as provided by <code>surfaceCreated()</code> doesn't help (i.e. provides the same error).  </p><p>I have read in various posts a solution would be to reset the <code>mediaplayer</code> and restart it completely, however it is not efficient, as the end user would have to wait for the whole player preparation <code>cycle + seekTo last positio</code>n within the stream.</p><p>As shown with the fact the audio plays back, it should be a matter of plumbing between the the video decoder and the new <code>surfaceholder/view</code>.</p><p>What should be the best solution (best = fastest) to resume video playback when resuming the activity?</p>","510307","","948041","","2012-03-31 11:03:22","2012-03-31 11:28:23","can a mediaplayer be restarted when the surfaceview is being recreated? (Android)","<android><video><media-player><surface>","4","0","2","",""
"4201094","1","4201111","","2010-11-17 03:03:09","0","1109","<p>I'm writing an Android application that allows a user to maintain a list of products. In the EnterProductData activity, the user can enter information about the product into form fields, which will then save the info to a SQLite DB. The EnterProductData activity also allows the user to initiate a barcode scan via the Barcode Scanner app in order to capture the UPC code. </p><p>The problem I'm facing is trying to set the value of the UPC text field in onActivityResult() once the barcode scan activity is complete and returns the value. What is ending up happening is my onResume() method is calling a function (populateFields()) that sets the values of the text fields to whatever is currently saved in the DB. And this seems to be happening <em>after</em> onActivityResult() is called. This means the scanned UPC is set as the text field value, only for an empty value to be set to it immediately after. The line of code to blame is commented with asterisks next to it.</p><p>I imagine that if I immediately save the scanned UPC to the DB in the onActivityResult() method, I can avoid this problem, but that doesn't seem to be the best practice, in my opinion. Can someone advise me on what I should do?</p><p><strong>EnterProductData.java</strong></p><pre><code>public class EnterProductData extends Activity {    private Button mScanButton;    private EditText mUPC;    private Button mSaveButton;    private Long mRowId;    private DbAdapter mDbHelper;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mDbHelper = new DbAdapter(this);        mDbHelper.open();        setContentView(R.layout.enter_product_data);        mUPC = (EditText) findViewById(R.id.UPC);        mScanButton = (Button) findViewById(R.id.scanButton);        mSaveButton = (Button) findViewById(R.id.saveButton);        mRowId = (savedInstanceState == null) ? null :        (Long) savedInstanceState.getSerializable(DbAdapter.KEY_PRODUCT_ROWID);        if (mRowId == null) {            Bundle extras = getIntent().getExtras();            mRowId = extras != null ? extras.getLong(DbAdapter.KEY_PRODUCT_ROWID): null;        }        populateFields();        mScanButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                IntentIntegrator.initiateScan(EnterProductData.this);            }        });        mSaveButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                setResult(RESULT_OK);                finish();            }        });    }    private void populateFields() {        if (mRowId != null) {            Cursor product = mDbHelper.fetchProduct(mRowId);            startManagingCursor(product);            mUPC.setText(product.getString(                product.getColumnIndexOrThrow(DbAdapter.KEY_UPC))); //******        }    }    @Override    protected void onSaveInstanceState(Bundle outState) {        super.onSaveInstanceState(outState);        saveState();        outState.putSerializable(DbAdapter.KEY_PRODUCT_ROWID, mRowId);    }    @Override    protected void onPause() {        super.onPause();        saveState();    }    @Override    protected void onResume() {        super.onResume();        populateFields();    }    private void saveState() {     String upc= mUPC.getText().toString();        if (mRowId == null) {            long id = mDbHelper.createProduct(mRowId, UPC);            if (id &gt; 0) {                mRowId = id;            }        } else {            mDbHelper.updateProduct(mRowId, UPC);        }    }    protected void onActivityResult(int requestCode, int resultCode, Intent data) {  switch(requestCode) {   case IntentIntegrator.REQUEST_CODE: {    if (resultCode != RESULT_CANCELED) {     IntentResult scanResult =     IntentIntegrator.parseActivityResult(requestCode, resultCode, data);     if (scanResult != null) {      String upc = scanResult.getContents();      mUPC.setText(upc);     }    }    break;   }  } }}</code></pre>","453354","","","","","2010-11-17 03:07:33","Android - avoiding conflict of setting text field values in onResume vs. onActivityResult","<java><android><onresume>","1","0","","",""
"4201183","1","","","2010-11-17 03:20:50","0","1820","<p>I wrote this code for log into my website and check if I'm logged or not.</p><pre><code>public class smerdLearning extends Activity {/** Called when the activity is first created. */final HttpParams params = new BasicHttpParams();final HttpClient client = new DefaultHttpClient(params);@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    String url, user, pwd, user_field, pwd_field;    url = ""http://SMERDER.org/login/"";    user_field = ""username"";    pwd_field = ""password"";    user = ""robert"";    pwd = ""fanello"";    final List&lt;NameValuePair&gt; myList = new ArrayList&lt;NameValuePair&gt;(2);    myList.add(new BasicNameValuePair(user_field, user));     myList.add(new BasicNameValuePair(pwd_field, pwd));    final HttpPost post = new HttpPost(url);    Button login_button = (Button)findViewById(R.id.login_button);    login_button.setOnClickListener(new OnClickListener(){        public void onClick(View v) {            try {                post.setEntity(new UrlEncodedFormEntity(myList));            } catch (UnsupportedEncodingException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }             try {                HttpResponse response = client.execute(post);                System.out.println(""Am I logged in?"");                String am_i_logged= ""http://smerder.smerder.org/api/am-i-logged-in/"";                try {                    URLreader(am_i_logged, response);                } catch (Exception e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }          }    });}void URLreader(String url, HttpResponse response) throws Exception{    response = client.execute(new HttpGet(url));    HttpEntity entity = response.getEntity();    BufferedReader in = new BufferedReader(new InputStreamReader(entity.getContent()));    String inputLine;    while ((inputLine = in.readLine()) != null){        System.out.println(inputLine);    }    in.close();}</code></pre><p>}</p><p>But, if I see the log with LogCat, I see 2 warning:11-17 03:07:40.976: WARN/SingleClientConnManager(1195): Make sure to release the connection before allocating another one.</p><p>How can I release the connection?</p><p>Thank you!</p>","496371","","28641","","2010-11-17 03:22:17","2011-03-16 02:43:36","Android release connection SingleClientConnManager login","<android><login><connection><close>","1","0","1","",""
"4201205","1","4201283","","2010-11-17 03:25:26","7","418","<p>We have a great software foundation based on Microsoft MVC 2, Entity Framework 4, Repositories, POCOs, Service and Control layers, C# Views, JQuery and html.Firefox pulls 100 records in 250 ms, drops it in to a template, links the data to themarkup, and we sit back and drink margaritas.  </p><p>Boss walks in and says he wants an iPhone app.  I bet we need an Android app too.</p><p>What frameworks could we use to easily jump from our Microsoft comfort zone in to the wide, wide world of the Apple iPhone / iPad, along with a follow-up Android baby.</p><p>I imagine we could use our JSON controller methods to communicate.  <strong>Is there some type of a client side JavaScript consuming app framework we could get a reasonable Website like interface re-working?</strong>  They didn't like the idea of simply running the whole thing in Safari, which works pretty well.</p><p>Needs:</p><ul><li>Send and receive JSON objects</li><li>Some type of template engine so we can pair up objects to markup, or at least some way to separate design from programming</li><li>Something similar to JQuery would be nice</li><li>A good editor with auto-complete and highlighting, something that compares to VS2010</li></ul><p>It took us two years to incorporate design patterns, Agile methods, and Domain Driven concepts using MVC and Javascript.  We may have two or three months to re-produce the same functions.</p>","84424","","","","","2010-11-18 01:36:20","Boss says ""We need an IPhone app"", What frameworks are similar to Firefox, JQuery, templates, and data linking on an iPhone?","<c#><iphone><android><asp.net-mvc-2>","5","4","1","",""
"4201482","1","","","2010-11-17 04:24:20","0","2073","<p>I have an activity that needs to display an alert to user when location is updated,but i need first to get current location (update last known location) and then start a location update listener to display alert in this activity.<br/>Basically what i need is to display an alert if location changed from time activity was created. <br/>If i use getLastKnownLocation when activity is created, it might be outdated, then the requestLocationUpdate listener is called a few seconds from activity creation time.<br/>How can i do this? </p><p><br/>Thanks in advance,</p>","456234","","456234","","2010-11-18 04:43:03","2011-08-03 12:16:12","android location update problem","<android>","2","0","1","",""
"4201594","1","4212098","","2010-11-17 04:47:56","0","2031","<p>Sorry to make people confused. I simplified the question, which is the checkbox. Basically I want a listview like this, I want the checkbox be toggled when clicked.</p><blockquote>  <p>[textview][checkbox]</p>    <p>[textview][checkbox]</p>    <p>[textview][checkbox]</p>    <p>[textview][checkbox]</p></blockquote><p>The problem is the checkbox cannot work correctly. When I clicked a checkbox, it never be toggled.</p><p>Could anyone gives any suggestion? Thank you. </p><p>This is my codes right now:</p><pre><code>public class MyAdapter extends SimpleAdapter {    Map&lt;Integer, Boolean&gt; map;    LayoutInflater mInflater;    private List&lt;? extends Map&lt;String, ?&gt;&gt; mList;    public MyAdapter(Context context, List&lt;Map&lt;String, String&gt;&gt; data, int resource, String[] from, int[] to) {        super(context, data, resource, from, to);        map = new HashMap&lt;Integer, Boolean&gt;();        mInflater = LayoutInflater.from(context);        mList = data;        for (int i = 0; i &lt; data.size(); i++) {            map.put(i, false);        }    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        if (convertView == null) {            convertView = mInflater.inflate(R.layout.rapid_diagnosis_row, null);        }        TextView textView = (TextView) convertView.findViewById(R.id.multiple_question);        textView.setText((String) mList.get(position).get(""value""));        CheckBox checkBox = (CheckBox) convertView.findViewById(R.id.multiple_checkbox);        checkBox.setChecked(map.get(position));        // save position and checking status into tag        checkBox.setTag(new int[] { position, checkBox.isChecked() == true ? 1 : 0 });        checkBox.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // get position and checking status from tag, works fine                int[] tag = (int[]) (v.getTag());                int p = tag[0];                int c = tag[1];                // try to get checking status from the clicked view, not works                // which is always true                boolean checked = ((CheckBox) v).isChecked();                // try to toggle the clicked (checkbox) view, not works                // the checkbox pressed never be toggled                ((CheckBox) v).toggle();                // save status into a hashmap, works fine                mSimpleAdapter.map.put(p, (c == 1 ? true : false));            }        });        return convertView;    }</code></pre>","479927","","479927","","2010-11-18 00:19:40","2010-11-18 06:05:43","How to make [textview][imagebutton][checkbox] as every row in a listview","<android><listview><checkbox>","3","4","","",""
"4201776","1","","","2010-11-17 05:29:32","0","1788","<p>I have an apk (App1) that has a raw resource (res/raw/mytextfile.txt) and I would like to read that text file from another apk (App2).  I define a content provider in App1 and I override the <code>openFile(Uri, String)</code> method as follows:</p><pre><code>Resources res = getContext().getResources();return res.openRawResourceFd(R.raw.mytextfile).getParcelFileDescriptor();</code></pre><p>App2 does the following to try to get access to mytextfile.txt:</p><pre><code>ContentResolver cr = getApplicationContext().getContentResolver();ParcelFileDescriptor fd = cr.openFileDescriptor(uri, ""r"");InputStream is = new FileInputStream(fd.getFileDescriptor());BufferedReader bis = new BufferedReader(new InputStreamReader(is));</code></pre><p>However, when I read and write out the contents of the BufferedReader, I get way more than just the contents of mytextfile.txt.  Clearly I'm doing something wrong so I'd appreciate it if somebody could point me in the right direction.Thanks,</p><p>Mirza</p><hr><p>I played with this some more and found that the file desriptor returned to App2 is pointing to the App1 apk file.  I wrote out the contents of the BufferedReader to a file and did a binary comparison to App1.apk.  The two files were identical.</p>","389950","","389950","","2010-11-20 07:08:01","2012-02-23 20:43:01","Share raw resource between apk's","<android>","2","0","1","",""
"4201804","1","4208363","","2010-11-17 05:36:16","0","2570","<p>I am displaying a custom marker on my Google Map. They are placed fine, but they have this funny shadow. How can I remove the shadow?<img src=""http://i.stack.imgur.com/laquO.png"" alt=""alt text""></p><pre><code>@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(geoPnt, screenPts);            // ---add the marker---            /*Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pushpin);            canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 67, null);*/            return true;        }    }</code></pre>","19875","","19875","","2010-11-17 19:25:46","2013-04-08 15:54:42","How can I remove the shadow on the markers on my map?","<java><android><google-maps><overlay><android-mapview>","2","1","1","",""
"4201831","1","4201906","","2010-11-17 05:42:27","2","568","<p>I have an activity <code>Alert</code>, which is defined in the manifest like so :</p><pre><code>        &lt;activity android:name=""Alert""              android:label=""@string/app_name""              android:theme=""@android:style/Theme.Dialog""              android:launchMode=""singleInstance""              android:noHistory=""true""&gt;    &lt;/activity&gt;</code></pre><p>I also have another activity <code>Config</code> which is a setting page for a homescreen widget and is defined as</p><pre><code>        &lt;activity android:name="".Config""              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;</code></pre><p>The <code>Alert</code> activity is shown when the user clicks on the widget. Now my problem is that, after running the application and returning to Home screen, when I long press the home-key and select the app, the <code>Alert</code> activity is shown. Is there a way to prevent this from happening and always start from the <code>Config</code> activity?</p>","481239","","","","","2010-11-17 06:03:47","Android: How do I always start the app from a particular activity?","<android><activity><widget>","1","0","","",""
"4201855","1","4202006","","2010-11-17 05:49:10","0","680","<p>I want to get the number of launcher:cellWidth in xml:</p><pre><code>&lt;mobi.intuitit.android.p.launcher.CellLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:launcher=""http://schemas.android.com/apk/res/mobi.intuitit.android.p.launcher""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    launcher:cellWidth=""80dip""/&gt;</code></pre><p>I know that I can get it in a Custom view by:</p><pre><code>public CellLayout(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CellLayout, defStyle, 0);        mCellWidth = a.getDimensionPixelSize(R.styleable.CellLayout_cellWidth, 100);</code></pre><p>But how Can I get it in a Activity? not a Custom view.Thanks!</p>","354459","","","","","2010-11-17 06:22:54","how to get custom xml values in android?","<android><xml><custom-attributes>","1","0","","",""
"4201879","1","4201932","","2010-11-17 05:55:53","5","17530","<p>I am trying to use an array of images then set my ImageView to one of the images in the array.My first instinct was to use an array of strings with the image names but this did not work.</p><p>How do I do this.Make a drawable array with the image names without quotes or what?</p>","509087","","","","","2011-08-29 02:41:06","Image array in android","<android><image>","3","0","2","",""
"4201886","1","4201899","","2010-11-17 05:57:54","1","309","<p>The Android's VM is called 'Dalvik' on its offical site, but I found the name 'Delvik' has also been used with Android's VM in some forums and kind of articles. So could someone helps me to figure out what's 'Delvik'? it's just a miss spelling or something else? Thanks very much:).</p>","510404","","","","","2010-11-17 06:02:37","Delvik or Dalvik?","<android><dalvik>","1","1","","",""
"4201971","1","","","2010-11-17 06:16:43","1","987","<p>I'm having some issues with sending data from an Android client to a desktop server over TCP via wifi. The emulator works fine, but on the actual phone, the connection cannot be established. A ""socket not connected"" exception was thrown.</p><p>I have attached my code below. Any help please? Many thanks!</p><p>// CODE inside an Activity</p><pre><code>public boolean onOptionsItemSelected(MenuItem item) {   switch (item.getItemId()) {   case R.id.send:           sendMessage();           return true;   /// ...other items   }}private void sendMessage() {   String serverAddr = ""18.xxx.xx.xxx"";   Socket socket = null;   try {           socket = new Socket(serverAddr, 4444);  // EXCEPTION HAPPENS HERE   } catch (Exception e) {           //show exception on screen   }   String message = ""some message"";   try {           PrintWriter out = new PrintWriter(socket.getOutputStream(), true);           out.println(message);   } catch (Exception e) {           //show exception on screen   } finally {           socket.close();   }}</code></pre>","510421","","","","","2012-11-26 21:45:37","Android: ""Socket Not Connected"" Exception","<android>","3","2","0","",""
"4202020","1","","","2010-11-17 06:26:22","0","276","<p>How much effort ISVs and freelancers spend to test mobile apps on android &amp; iOS before submission?. How they are testing these apps at present in terms of manual testing &amp; test automation.</p>","510427","","","","","2012-11-13 21:58:14","testing effort for mobile apps","<android><ios>","2","2","","2012-11-14 03:13:58",""
"4202030","1","4202054","","2010-11-17 06:28:07","1","797","<p>can any one tell me which classes supports to read &amp; display svg files in android.  </p>","481455","","","","","2011-11-22 06:01:13","how to read svg file","<android>","1","0","2","",""
"4202046","1","","","2010-11-17 06:31:23","2","3747","<p>I am using the manifest file for creating broadcast receiver, for <code>ACTION_HEADSET_PLUG</code>.But I can't get the broadcast when headset is connect/disconnect,Which <code>permission</code> should I use inside the manifest file in order to be able to receive <code>ACTION_HEADSET_PLUG</code> broadcast intent?</p>","274146","","1887603","","2013-01-05 13:53:35","2013-01-05 13:53:35","Which permission required in order to get ACTION_HEADSET_PLUG inside broadcast receiver","<android><android-manifest>","2","0","2","",""
"4202064","1","","","2010-11-17 06:34:41","4","4416","<p>I'm trying this with my Nexus One. I have the android SDK and have used the command adb pull /data/data/com.myapp.android/databases C:\pullsbut all I get ispull: building file list...0 files pulled. 0 files skipped.Also, it seems no matter how much data I add to the tutorial NotePad app I installed, the data size for the app (as shown in Settings) never exceeds 8KB.  How is this possible?  Is there some other place where databases are stored?  When I use the File Explorer view (that's part of ADT) in Eclipse, I see there's nothing in /data.To add a twist, I have no trouble pulling any other files from the device.  It's just databases I have trouble with.Am I missing something?  Thanks much.</p>","369722","","31161","","2011-08-05 11:15:24","2013-04-09 09:03:05","How can I pull databases off my android onto my desktop?","<android><database><location><pull><nexus-one>","3","0","6","",""
"4202069","1","4202092","","2010-11-17 06:35:00","0","517","<p>hii, in my android application there are number of images in drawable folder. in my layout two buttons:back and forward button.on clicking next and back buttons different-2 image get loaded on the same layout(common for all images).<strong>Problem</strong>:i am able to load images in next/back button click but after reaching to the last image i want to make my next button click disable and same for the back button.As the user is on the first image the back button would be disable .Code is as:</p><pre><code>public class SequencerActivity extends Activity implements OnClickListener</code></pre><p>{    private int imageCounter = 0;    private ImageView imageLoader;</p><pre><code>private int[] imageList = {R.drawable.image_wo_lbl_0, R.drawable.image_wo_lbl_1, R.drawable.image_wo_lbl_2, R.drawable.image_wo_lbl_3, R.drawable.image_wo_lbl_4, R.drawable.image_wo_lbl_5,        R.drawable.image_wo_lbl_6, R.drawable.image_wo_lbl_8, R.drawable.image_wo_lbl_9,R.drawable.image_wo_lbl_10, R.drawable.image_wo_lbl_11};@Overridepublic void onCreate(Bundle savedInstanceState) {    setContentView(R.layout.parent_frame);//this one is the common parent layout for all image views    super.onCreate(savedInstanceState);    /*requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,    WindowManager.LayoutParams.FLAG_FULLSCREEN);*/    //int image1 = R.drawable.image_w_lbl_0;    imageLoader = (ImageView) findViewById(R.id.imageLoader);    //imageLoader.setImageResource(image1);    ImageButton next = (ImageButton) findViewById(R.id.next);    ImageButton back = (ImageButton) findViewById(R.id.back);    next.setOnClickListener(this);    back.setOnClickListener(this);    //show the default image    this.loadImage(imageList[imageCounter]);}@Overridepublic void onClick(View v) {    int imagePath = 0;    // TODO Auto-generated method stub    switch (v.getId())    {    case R.id.next:        Log.i(""Tag"",""tag"");        if(imageCounter &lt; imageList.length)        {            imageCounter++;            imagePath = imageList[imageCounter];            if (imageCounter==(imageList.length)-1)            {                //**how to make my next button disable for last image**            }        }        break;    case R.id.back:        if(imageCounter &gt; 0)        {            imageCounter--;            imagePath = imageList[imageCounter];            if (imageCounter==0)            {                //**how to make my back button disable for 1st image**            }        }        break;    }    this.loadImage(imagePath);}private void loadImage(int imagePath){    imageLoader.setImageResource(imagePath);}</code></pre><p>}</p><p>help please.Thanks.</p>","490953","","490953","","2010-11-17 07:53:05","2010-11-17 07:53:05","problem in loading image on clicking back button","<android>","1","0","","",""
"4202106","1","","","2010-11-17 06:43:32","0","2433","<p>I am very new to Android development. I am trying to install the working environment in Windows Vista . I installed java EE with jdk 6.0, Android SDK and the eclipse. When I try to install the ADT plugin in the software updates, I am not finding any available software list. I am confused where I went wrong. Did anybody face this kind of problem.</p><p>Regards,Viji</p>","510444","","21234","","2010-11-17 07:53:02","2011-07-19 11:10:42","Problem in installing the ADT plugin","<android><eclipse><installation><adt>","3","0","","",""
"4202149","1","4202219","","2010-11-17 06:53:30","0","95","<p>I have used my main.xml and the layout manager to test if my app fit on all available sizes via the pulldown menu (except 2.7) in the layout manager.</p><p>I have not run emulators with all these sizes but is that necessary seeing they fit in the layout manager?</p><p>Also reffering to the supported screen sizes here <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a> it seems from 1.6 on they are all set to true by default.So is this the correct syntax I should put in the manifest.xml?</p><pre><code>&lt;manifest ""STUFF""&gt;    &lt;supports-screens android:smallScreens=[""false""]                       android:normalScreens=[""true""]                       android:largeScreens=[""true""]                       android:anyDensity=[""true""] /&gt;&lt;/manifest&gt;</code></pre><p>Just want to be sure I am targeting all available devices here.Am I missing anything before I launch this first app?</p>","509087","","21234","","2010-11-17 07:52:31","2010-11-17 07:52:31","Android getting ready to publish","<android><android-manifest>","1","0","","",""
"4202165","1","4202506","","2010-11-17 06:57:54","5","29046","<p>Can somebody help me in suggesting some good tutorial where I can start. I want to build a simple application with a dashboard and a login screen. For the first time user is asked for a log-in screen. login check is carried out via a POST call to a remote PHP script. Once the user is logged in he/she should be redirected to dashboard. Once the user closes and reopens the application he'she should be redirected to login screen.</p><p>i know how to create forms and how to post, help is needed in the area of switching layouts based on user roles and how to import/extend classes, for example I prefer to have a separate log in (activity) class. but this login class need to be imported to Main (main should extend Activity)</p>","174261","","174261","","2010-11-17 07:24:03","2013-07-18 06:39:04","Android application login","<android><login>","3","0","5","",""
"4202192","1","4202748","","2010-11-17 07:03:01","1","2194","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2883355/how-to-render-pdf-in-android"">How to render PDF in Android</a>  </p></blockquote><p>Does any one know how to open a office documents(.doc,.xls) and pdf files in android? I have open a doc from my own app - any ideas?</p>","467615","","","","","2011-01-14 08:50:28","How to open a office documents, pdf files in android?","<android>","1","0","","2012-05-18 11:53:21",""
"4202266","1","","","2010-11-17 07:17:19","0","614","<p>I want to display the color selected on touch of an image in an enlarged baloon just above the touch point . Similar to showing my current location in maps using itemized overlays. How can that be achieved ?</p>","335429","","","","","2011-06-13 00:00:43","Showing color selected from an image on touch event in an overlay","<android>","2","0","","",""
"4202282","1","4202675","","2010-11-17 07:19:53","0","361","<p>I have 2 queries:</p><p>1). I want to display kind of screen lik</p><pre><code>Heading        ImageButton1 ImageButton2Value1                      Value2</code></pre><p>Same way number of records</p><p>So i have used absolute layout programmatically instead of using xml, is it advisable or there is some other way?</p><p>2). At that time of displaying this view, i have to set unique Id to each record and get Id whenever any of 2 buttons pressed of any record.  Can anyone tel me how is that possible?Means in short how to set and get id which button of which record is selected??</p><p>Thanks in advance.</p>","457146","","","","","2010-11-17 09:12:57","How to set and get id of a view","<java><android>","1","0","","",""
"4202305","1","4638064","","2010-11-17 07:24:08","0","2152","<p>I want to show image of contacts(form contact list) in my application. How to do it? </p>","484073","","135152","","2011-07-05 17:53:25","2011-07-05 17:53:25","How to Show  contact photo in my application?","<android>","2","0","","",""
"4202317","1","4202353","","2010-11-17 07:26:15","1","116","<p>I have written an activity that has 2 image buttons (1 for messaging and another for browser). On click on each will start messaging and browser android activities respectively.</p><p>My question is: whenever I start my app and click on any of the buttons say browser button for example, and after it starts the android browser app, and it allows me whatever to browse in this time if I press the home button  on android emulator and again if I start my app and select the browser button in my activity as usual the browser get started from the beginning rather than starting form where I left previously.</p><p>Should I start a service to call browser activity or should I set some flags while calling android browser activity?</p>","505580","","90848","","2010-11-17 07:34:21","2010-11-17 07:34:21","How to invoke browser without losing browsing state?","<java><android>","1","0","","",""
"4202392","1","","","2010-11-17 07:41:11","7","1109","<p>I am using the Android G1 default web browser, and I am developing in JavaScript - I have trouble getting the real visual width and height when I zoom in or out on a web page.</p><p>It seems that I am getting the wrong value out of window.innerWidth, when I am zooming in/out.</p><p>What I am trying to do is - showing an element on a visual fixed place, even when I am zooming and scrolling the page. - so the user can always see that element no matter if he is zooming or scrolling.</p><p>I already tried using position ""fixed"" with no success.The use of a viewport meta-tag is probably not a good solution since I don't want to limit the web page dimensions and I do want the zoom feature will be supported.</p><p>Does anyone have a solution or an idea how I can achieve this? </p>","510468","","467900","","2011-06-06 09:00:53","2013-03-21 05:06:59","Android Browser - Javascript window.innerWidth returns wrong value","<javascript><android><webkit><mobile-webkit>","1","2","2","",""
"4202429","1","4202640","","2010-11-17 07:48:27","3","1574","<p>I will like to know whether there is any problem getting location information in Samsung devices. The location fetching code works properly in all the devices except Samsung devices.</p><p>From whatever I have searched over the net it seems there is some problem with Samsung devices giving GPS fix. Is there any workaround for there? The application is working properly in Nexus one, HTC devices and Motorola Devices. But Samsung devices gives problem.</p><p>Can someone let me know of any solution?</p>","261566","","","","","2011-07-06 05:53:05","GPS problem on Samsung Android devices?","<android><gps>","1","0","1","2011-07-07 03:23:27",""
"4202457","1","4202608","","2010-11-17 07:54:54","20","24578","<p>I have a registration form in a <code>LinearLayout</code> as shown below:</p><p><img src=""http://i.stack.imgur.com/US13J.jpg"" alt=""alt text""></p><p>When emulator screen is in it's default position it is working fine. But when I rotate the emulator screen it only displays the elements which are fit to screen and remaining are wrap up. As shown in below screen:<img src=""http://i.stack.imgur.com/1asgs.jpg"" alt=""alt text""></p><p>Now I want to make this layout scrollable but not getting the idea. Any help will be highly appreciated.</p>","457982","","457982","","2011-01-11 07:33:08","2011-01-11 07:33:08","Scrollable layout in Android","<android><forms><android-linearlayout>","1","0","5","",""
"4202464","1","","","2010-11-17 07:56:53","0","779","<p>Im quite new on Android and I have some question for all of you who are experts!Ok, my problem...I implemented a client-server application based on socket programming. The server encode some packets, send them to the client through a socket and the clinet decode them.I tested the code with two linux machines and it works fine but in my experiment it is required to include another node (this will be the Android). So the server (linux machine) will encode the packets and send through socket to client1(linux machine) and client2(Android).For this reason I want to port the native binary of my code (which is in C++) to Android.In which way could I do this?</p><p>Please give me some help!Really im totally stucked!</p><p>Thanks,</p><p>Zenia</p>","510492","","","","","2010-11-17 17:48:33","port native C++ non static binary on Android","<c++><android><native><port>","4","0","","",""
"4202507","1","","","2010-11-17 08:04:19","-1","471","<p>This may sound stupid but for some reason I can't find anywhere on Eclipse that lets me generate blank .aidl files... Does anyone know how? </p>","480803","","2126831","","2013-03-24 12:11:02","2013-03-24 12:11:02","generate blank aidl file","<android>","2","0","1","",""
"4202508","1","","","2010-11-17 08:04:20","0","489","<p>I want to create call accept and reject buttons looks similar to default buttons and having functionality samepls. answer it</p>","510503","","21234","","2010-11-17 08:09:41","2010-11-17 08:17:50","how to create call accept and reject buttons similar to default buttons in android","<android><layout>","1","1","","",""
"4202531","1","","","2010-11-17 08:08:06","8","7124","<p>I want to ask, what is the best way to authenticate user with his Google account already configured on the phone.I have looked at the ClientLogin first, but it's not what I want because it requires users to enter login/password in my application.I can do it with OAuth but there I should ask user to enter his credentials in browser what is not preferable too.I want to use AccountManager (I've observed that it contains method <code>getPassword</code> for particular account but it didn't work for me), if it's possible to use somehow AccountManager + ClientLogin or AccountManager + OAuth tell me please. In result I want to have capabilities to log in with user Google account without asking his login/password (with confirmation on android device of course) I am not sure that it's possible but if there exists some way to implement this please point me how...</p>","390323","","159388","","2012-05-22 15:43:05","2013-01-29 11:27:34","Android: Google authentication","<android><authentication><oauth><accountmanager>","4","1","4","",""
"4202580","1","4236396","","2010-11-17 08:17:27","1","1069","<p>I need to scroll a MapView programatically to make sure something is in view.  I know how many pixels it needs to scroll in each direction.  I see methods (in MapController) to animate it to a particular GeoPoint, and to scroll it by pixels without animation.  But nothing to do it by pixels, with an animation.  </p><p>What is an easy way to do this?</p>","226507","","","","","2012-09-12 13:15:51","animate scroll of mapview (by pixels, not lat long)","<android>","1","0","3","",""
"4202620","1","4202704","","2010-11-17 08:24:07","2","562","<p>Manual is pretty vague even for regular views, and doesn't even mention mGLSurfaceView in the UI events overview page.</p><p>For starters, all the examples will not work because they rely on the Id for the view (e.g. <code>Button button = (Button)findViewById(R.id.corky);</code>). I'm having a bad time trying to send UI events back and forth. I used the shotgun solution and attached every input event from the mGLSurfaceView to the Activity... But i'm craving for something better.</p><p>So, anyone brave enough to conjure a simple example with an Activity, a mGLSurfaceView, and the activity onTouch event saying where was the click relative to the size of the screen? (e.g. w=50%, h=50% for a perfect click on the center of the screen)</p><hr><pre><code>public class GlClick extends Activity implements OnTouchListener {    @Override    public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);        mGLSurfaceView = new GLSurfaceView(this);        mGLSurfaceView.setRenderer(new GlRenderer());        setContentView(mGLSurfaceView);        mGLSurfaceView.setOnTouchListener(this);    }    public boolean onTouch(View v, MotionEvent event) {        Log.d(TAG, ""example output: click was on 234x211 for a 800x600 screen."")    }}</code></pre><hr><pre><code>class GlRenderer implements Renderer {    // here be lots of messy beginner GL code ...    // ... you'd have wished for dragons.    public void onSurfaceChanged(GL10 gl, int w, int h) {        screenWidth = w;        screenHeight = h;        //TODO: send that to the activity    }}</code></pre>","183132","","","","","2010-11-22 03:40:01","Handling UI events with mGLSurfaceView","<android><gui><opengl-es><event-handling>","1","0","2","",""
"4202655","1","","","2010-11-17 08:30:02","1","211","<p>I've created very simple project to show the issue I'm facing. There is one activity created by default. With one additional line of code in onCreate method: </p><pre><code>Drawable drawable = getResources().getDrawable(R.drawable.sample);</code></pre><p>Sample referes to ""sample.png"" file, which I've put in drawable-hdpi, -mdpi, -ldpi. Project is defined with minSdkVersion=""4"" (Android 1.6).</p><p>When I run this application on Android 2.0 Emulator, I get Resources$NotFoundException. On Android 1.6 Emulator everything works fine.</p><p>Please help.</p><p>EDIT: It looks like projects created with SDK v.1.6. won't run on 2.0 system. Does anyone has similar problem? Or maybe you simply don't use SDK from version 1.6?</p>","500425","","500425","","2010-11-18 07:50:09","2010-11-18 07:50:09","Resources$NotFoundException when running 1.6 application on Android 2.0","<android>","0","6","","",""
"4202670","1","4204490","","2010-11-17 08:32:00","4","3550","<p>I am developing a native application related to streaming, i am facing some problems in my c module... and what i have is some message from Logcat</p><hr><p>Here is the Logcat message</p><pre><code>INFO/DEBUG(28): Build fingerprint: 'generic/sdk/generic/:2.1-update1/ECLAIR/35983:eng/test-keys'11-17 12:40:07.550: INFO/DEBUG(28): pid: 5957, tid: 5957  &gt;&gt;&gt; com.mmstwo &lt;&lt;&lt;11-17 12:40:07.561: INFO/DEBUG(28): signal 11 (SIGSEGV), fault addr deadd00d11-17 12:40:07.561: INFO/DEBUG(28):  r0 00000354  r1 00129100  r2 0000000c  r3 deadd00d11-17 12:40:07.561: INFO/DEBUG(28):  r4 00000026  r5 ad07ff50  r6 00000000  r7 fffe72f811-17 12:40:07.579: INFO/DEBUG(28):  r8 afe3bdfc  r9 4509f020  10 00000000  fp 00135a4011-17 12:40:07.590: INFO/DEBUG(28):  ip ad080160  sp bef28f90  lr afe14cf7  pc ad035452  cpsr 2000003011-17 12:40:07.840: INFO/DEBUG(28):          #00  pc 00035452  /system/lib/libdvm.so11-17 12:40:07.850: INFO/DEBUG(28):          #01  pc 00027a98  /system/lib/libdvm.so11-17 12:40:07.869: INFO/DEBUG(28):          #02  pc 00027bba  /system/lib/libdvm.so11-17 12:40:07.879: INFO/DEBUG(28):          #03  pc 0002d98e  /system/lib/libdvm.so</code></pre><hr><pre><code>11-17 12:40:07.901: INFO/DEBUG(28):          #04  pc 0000142e  /data/data/com.mmstwo/lib/libnstreamer.so</code></pre><p>this is the line that represents the c class which i use.</p><hr><p>as per comments on <a href=""http://stackoverflow.com/questions/4171259/problem-in-my-appliction-cant-understand-what-does-the-error-message-says"">my previous question</a> i followed url given by rahul and dumped my .so file to a text file.</p><p>here is that text file </p><pre><code> 141e:  4a2d        ldr r2, [pc, #180]  (14d4 &lt;Java_com_mmstwo_NativeParser_stringFromJNI+0x408&gt;)    1420:   4b2d        ldr r3, [pc, #180]  (14d8 &lt;Java_com_mmstwo_NativeParser_stringFromJNI+0x40c&gt;)    1422:   2184        movs    r1, #132    1424:   5846        ldr r6, [r0, r1]    1426:   18aa        adds    r2, r5, r2    1428:   18eb        adds    r3, r5, r3    142a:   4651        mov r1, sl    142c:   1c38        adds    r0, r7, #0    142e:   47b0        blx r6    1430:   4b2a        ldr r3, [pc, #168]  (14dc &lt;Java_com_mmstwo_NativeParser_stringFromJNI+0x410&gt;)    1432:   4669        mov r1, sp</code></pre><p>so as per the <a href=""http://groups.google.com/group/android-ndk/browse_thread/thread/cce1848b309ed56c/5679f82418283f26?pli=1"" rel=""nofollow"">post in google groups</a> and specially suggested by Nicklas Ansman i had shown the snippet which is around my desired line <code>142e</code>.</p><p>Now can anyone here who can tell what does <code>47b0        blx r6</code> means? </p><p>What i knew is it is something written in assembly language that i don't know. So I need your help in understanding that line.</p><p>Thanks in advance</p>","246942","","","","","2010-11-17 12:48:57","objdump of a .so file? need help to understand the messages","<android><assembly><android-ndk>","2","1","","",""
"4202761","1","4203256","","2010-11-17 08:42:45","0","410","<p>I have an app that is setting the contentView when images are clicked.This one from my main.xml loads the options.xml fine.</p><pre><code>settings.setOnClickListener(new OnClickListener(){            @Override            public void onClick(View v) {                 setContentView(R.layout.options);            }        });</code></pre><p>But when I add a listener to an image that is inside the options.xml the app crashes upon launch.I am referencing the image via the code below and showing the clickListener I am adding.</p><pre><code>//ReturnHome is inside options.xml//Adding this in my mainapp.java returnHome = (ImageView)findViewById(R.id.returnHome);    returnHome.setOnClickListener(new OnClickListener(){            @Override            public void onClick(View v) {            ***APP CRASHES EVERY TIME WHEN I ADD THIS****               }    });</code></pre><p>Trying to see if there was an error thrown but LogCat does not seem to show anything.</p>","509087","","","","","2010-11-17 09:57:23","App crashes when adding clickListener","<android>","1","3","","",""
"4202794","1","6918067","","2010-11-17 08:49:12","6","1504","<p>I wrote a piece of code to add a ringtone from a URL in Android 2.1.  In Froyo it does not want to work at all.</p><pre><code>sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(file)));ContentValues values = new ContentValues();values.put(MediaStore.MediaColumns.DATA,file.getAbsolutePath());values.put(MediaStore.MediaColumns.TITLE, filenameBase);values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/mp3"");         values.put(AudioColumns.IS_RINGTONE, true);values.put(AudioColumns.IS_NOTIFICATION, false);values.put(AudioColumns.IS_ALARM, false);values.put(AudioColumns.IS_MUSIC, false);Uri uri = MediaStore.Audio.Media.getContentUriForPath(file.getAbsolutePath());Uri newUri = RingtoneModule.this.getContentResolver().insert(uri, values);RingtoneManager.setActualDefaultRingtoneUri(RingtoneModule.this, RingtoneManager.TYPE_RINGTONE,newUri);</code></pre><p>When I get to insert I get  this exception:</p><pre><code>11-17 09:54:51.802: ERROR/DatabaseUtils(379): java.lang.IllegalStateException: Unknown URL: content://media/external/audio/albumart/-111-17 09:54:51.802: ERROR/DatabaseUtils(379):     at com.android.providers.media.MediaProvider.query(MediaProvider.java:1666)11-17 09:54:51.802: ERROR/DatabaseUtils(379):     at com.android.providers.media.MediaProvider.getAlbumArtOutputUri(MediaProvider.java:2983)11-17 09:54:51.802: ERROR/DatabaseUtils(379):     at com.android.providers.media.MediaProvider.makeThumbInternal(MediaProvider.java:3192)11-17 09:54:51.802: ERROR/DatabaseUtils(379):     at com.android.providers.media.MediaProvider.getThumb(MediaProvider.java:3070)11-17 09:54:51.802: ERROR/DatabaseUtils(379):     at com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:2029)11-17 09:54:51.802: ERROR/DatabaseUtils(379):     at com.android.providers.media.MediaProvider.insert(MediaProvider.java:1843)11-17 09:54:51.802: ERROR/DatabaseUtils(379):     at android.content.ContentProvider$Transport.insert(ContentProvider.java:180)11-17 09:54:51.802: ERROR/DatabaseUtils(379):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:175)11-17 09:54:51.802: ERROR/DatabaseUtils(379):     at android.os.Binder.execTransact(Binder.java:288)11-17 09:54:51.802: ERROR/DatabaseUtils(379):     at dalvik.system.NativeStart.run(Native Method)</code></pre><p>I google my a** of for this error but can seem to get anything info about this error.I looked at android source and the problem seems to be that when you dont have album art it generates a url ""content://media/external/audio/albumart/-1"" and the urlmatcher  does not match any of the urls specified  and then i throws this error.</p><pre><code>URI_MATCHER.addURI(""media"", ""*/audio/albumart"", AUDIO_ALBUMART);URI_MATCHER.addURI(""media"", ""*/audio/albumart/#"", AUDIO_ALBUMART_ID);</code></pre><p>Does someone have any idea how I can get around that?</p>","106955","","1288","","2011-06-16 19:55:57","2013-12-09 12:18:17","Android Froyo setting ringtone","<java><android><ringtone>","2","0","3","",""
"4202803","1","","","2010-11-17 08:50:34","0","551","<p>I am new to Android and I have been trying to reuse the tutorial on the Android developer website about developing a TabActivity App but, unfortunately, it never worked, even when I constructed it the exact same way as it is described…Using the debugger it seemed the problem came from the main layout.</p><p><code>-&gt; setContentView(R.layout.main); //After this line the app stops.</code></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;LinearLayout          android:orientation=""vertical""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:padding=""5dp""&gt;          &lt;TabWidget               android:id=""@android:id/tabs""               android:layout_width=""fill_parent""               android:layout_height=""wrap_content"" /&gt;          &lt;FrameLayout               android:id=""@android:id/tabcontent""               android:layout_width=""fill_parent""               android:layout_height=""fill_parent""               android:padding=""5dp"" /&gt;     &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>If anyone had the same problem, or if someone have some advices they are welcome :) </p><p>Tanks a lot!</p><p>Randy</p>","510548","","418183","","2010-11-17 08:56:42","2010-11-17 10:05:12","Android simple app with TabActivity","<android><tabactivity>","1","3","","",""
"4202811","1","4202956","","2010-11-17 08:51:58","-1","1769","<p>What is the ideal resolution value that can i choose for my android application.</p>","510553","","","","","2011-07-13 11:22:00","ideal resolution value for android application","<android>","1","1","1","",""
"4202843","1","4202858","","2010-11-17 08:56:27","1","441","<p>I understand calling onTouchEvent from views to get the location of the last touch as a motion event. How the heck  can I tell that a fingure is down on the screen and has not been lifted and when the finger is lifted?  <BR>For instance there is onKeyDown and onKeyUp for use when you are dealing with keyboard input.<BR> So how can I find out when on fingureUp happens? </p>","310678","","","","","2010-11-17 23:01:55","Android how to tell a finger is down","<android><events><interface>","2","0","1","",""
"4202865","1","4203187","","2010-11-17 08:59:43","0","512","<p>I'm trying to add a header to the top of a ListView that is declared in a ListActivity and I am trying to use the method where one includes the ListView inside a LinearLayout and id's the listview as @android:id/list.</p><p>I am receiving a java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView</p><p>after my setContentView() call in the activity.  I can't seem to find the problem and I assume it is with formatting or something, can someone help me out?  </p><p>Here is the xml:</p><p>             </p><pre><code>&lt;ListView    android:id=""@android:id/list""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""?android:attr/listPreferredItemHeight""    android:padding=""0dip""&gt;    &lt;ImageView        android:id=""@+id/icon""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_marginRight=""6dip""/&gt;&lt;LinearLayout       android:orientation=""vertical""        android:layout_width=""224dip""        android:layout_weight=""1""        android:layout_height=""fill_parent""        android:layout_marginRight=""20dip""&gt;        &lt;TextView            android:id=""@+id/toptext""            android:layout_width=""fill_parent""            android:singleLine=""true""            android:layout_height=""0dip""            android:layout_weight=""1""            android:gravity=""center_vertical""            android:textStyle=""bold""            android:textSize=""21sp""            android:textColor=""@color/white""/&gt;&lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""            android:id=""@+id/bottomtext""            android:textSize=""19sp""            android:textStyle=""italic""            android:maxLines=""1""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""100dip""        android:layout_weight=""1""        android:layout_height=""fill_parent""&gt;        &lt;TextView            android:id=""@+id/toprighttext""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:layout_weight=""1""            android:textSize=""18sp""            android:gravity=""top""            android:textColor=""@color/blue""        /&gt;        &lt;TextView            android:id=""@+id/bottomrighttext""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:layout_weight=""1""            android:textSize=""18sp""            android:gravity=""bottom""            android:textColor=""@color/red""        /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","487840","","","","","2010-11-17 09:46:42","Proper format for custom ListActivity layouts","<android><xml><layout><listactivity>","1","0","0","",""
"4202934","1","4203179","","2010-11-17 09:09:54","1","1138","<p>I'm trying to define a reusable layout element I want to include in another layout. But I'm not sure what's the best way to archive the layout I want. </p><p>The reusable component should look like this.</p><p><img src=""http://i.stack.imgur.com/puQ8t.png"" alt=""Layout""></p><p>It should be separated into 3 areas. Each area will get a separate background image.The both areas on the left should each contain 2 TextViews whereas the right area should contain 3 TextViews. The whole component should fill the width of the screen. </p><p>I've already started to build the layout but I'm still not sure whether to do it by nesting multiple LinearLayouts or by using a TableLayout. </p><p>Which way should I go? Or would you suggest a totally different approach? </p>","19601","","","","","2010-11-17 09:45:40","Android: Linear vs. table layout for a reusable UI component","<android><android-layout><android-linearlayout><tablelayout>","1","0","1","",""
"4202952","1","4202986","","2010-11-17 09:14:16","1","279","<p>I've got the ""No space left on device"" IOException when writing file.I wish to avoid it happens before writing.How should I do?</p><p>Thanks!</p>","428022","","","","","2011-06-24 07:18:18","How to know the sdcard has enough free size to write in on Android?","<android><android-sdcard>","1","2","1","",""
"4202981","1","4203013","","2010-11-17 09:18:57","6","656","<p>I'm fairly new in Android/Java programming, so some of the basic stuff is still quite confusing. So, lets say my application gets all data (articles) it requires from external XML files, it parses them to data models (Article class) and those articles will be used (displaying in lists or single article) all over the application for all it's lifecycle.</p><p>Where should I keep them? Can I create singleton class with an array containing all the articles I've parsed? Or should I save them to database and then query it on demand? (that sounds like too much work, I don't need to cache them for now) What's the best practice here?</p>","90571","","","","","2010-11-17 09:55:47","Where should I globally keep/cache data needed for all application lifecycle?","<android>","2","0","1","",""
"4203203","1","4203363","","2010-11-17 09:49:28","0","1795","<p>Is it possible to make android show the incoming call dialog. Like forcing a PHONE_STATE_RINGING. </p>","470991","","","","","2010-11-17 10:18:56","android show incoming call dialog","<android><call>","2","1","","",""
"4203356","1","","","2010-11-17 10:11:41","0","451","<p>does anybody know where i can download the src code or even a lib jar file of this package?</p><p>the reason i ask is because i wish to use xpath on android devices that are lower than android 2.2</p><p>Android 2.2 is the only API that supports and uses the xpath package which is very strange as xpath has been in J2SE for a long time.</p>","444668","","327426","","2010-12-08 06:19:32","2010-12-08 06:19:32","javax.xml.xpath jar/src available?","<java><android><xpath>","1","0","","",""
"4203374","1","5675601","","2010-11-17 10:15:16","4","1496","<p>I am a beginner on android platform, and i want to build a tracerouting app. So these are some my queries that I want to ask:</p><ol><li><p>Is it possible to make such application in Android? if possible then guide me the way that I follow.</p></li><li><p>Does Android support low level programming to capture ICMP packets? or do I need to add some kind of JAR (in java) or some other libraries to support this application.</p></li><li><p>In Java there are JPCAP and docjar etc kind of libraries that we can import in our IDE or Eclipse so that Java support for making such kind of api's?</p></li></ol><p>I need valuable suggestions.</p>","510617","","213269","","2010-11-17 10:58:42","2014-01-12 17:07:25","Traceroute on android","<android><traceroute><jpcap>","2","0","3","",""
"4203447","1","4203489","","2010-11-17 10:26:43","8","5537","<p>I want to add the jTwitter library to my application.</p><p>How can I add and build the path for it?</p>","493193","","418183","","2012-07-09 16:51:45","2012-07-09 16:53:24","Adding a JAR file to an Android application","<android><twitter><jar>","2","2","2","",""
"4203506","1","4203731","","2010-11-17 10:34:36","5","23269","<p>I try to add a TextView to a LinearLayout dynamically such as in the following code, but it doesn't appear when I run the application?</p><pre><code>setContentView(R.layout.advanced);m_vwJokeLayout=(LinearLayout) this.findViewById(R.id.m_vwJokeLayout);m_vwJokeEditText=(EditText) this.findViewById(R.id.m_vwJokeEditText);m_vwJokeButton=(Button) this.findViewById(R.id.m_vwJokeButton);TextView tv=new TextView(this);tv.setText(""test"");this.m_vwJokeLayout.addView(tv);</code></pre><p>What's the problem?</p>","508377","","403455","","2012-07-30 15:06:41","2012-07-30 15:06:41","How can I add a TextView to a LinearLayout dynamically in Android? ","<android><textview><android-linearlayout>","1","3","3","",""
"4203511","1","4205272","","2010-11-17 10:35:02","0","292","<p>The default behavior of a list when one of it's items is touched is for that item to gain focus while it is being touched. I need a way to make the list items unfocusable ,so that when they are being touched  , nothing should happen.</p>","304866","","304866","","2010-11-17 14:18:28","2010-11-17 14:19:53","Make List items unfocusable","<android>","3","1","2","",""
"4203525","1","","","2010-11-17 10:37:31","1","2122","<p>I'm trying to capture an image using Android Camera via simple activity.</p><p>Image is clicked and stored. But the problem is, image is either distorted or fragments of older image is concatenated with the currently clicked image. Image is too dark. Here's the CODE : -</p><pre><code>public class Cameras extends Activity {    public Camera camera;    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        camera=Camera.open();        camera.lock();        Parameters parameters = camera.getParameters();        parameters.setJpegQuality(1);        parameters.setJpegThumbnailQuality(1);        parameters.setJpegThumbnailSize(0,0);        parameters.setSceneMode(""night"");        parameters.setFocusMode(""fixed"");        parameters.setPictureSize(640,480);        camera.setParameters(parameters);        camera.takePicture(null,null, jpegCallback);    }    PictureCallback jpegCallback = new PictureCallback() { // &lt;8&gt;        public void onPictureTaken(byte[] data, Camera camera) {          FileOutputStream outStream = null;          try {            // Write to SD Card            outStream = new FileOutputStream(String.format(""/sdcard/%d.jpg"",System.currentTimeMillis())); // &lt;9&gt;            outStream.write(data);            outStream.close();            camera.unlock();            camera.release();            Toast.makeText(Cameras.this,""Picture Taken"",Toast.LENGTH_SHORT).show();          } catch (FileNotFoundException e) {             e.printStackTrace();          } catch (IOException e) {            e.printStackTrace();          } finally           {          }        }      };}</code></pre><p>Please help regarding this... I want a neat and clean small size image every time i execute the code.  </p><p>Thanks... :-)</p>","510657","","418183","","2010-11-21 21:09:25","2010-11-21 21:09:25","I'm trying to simply capture an image with Camera using an activity and finish the activity as soon as it is clicked","<android><image><camera><capture>","1","0","2","",""
"4203579","1","4203658","","2010-11-17 10:45:34","0","3004","<p>I am writing a small program to periodically poll the RSSI of the WIFI connection.I am using <code>SystemClock.Sleep(2000)</code> in the program.</p><p>The problem, I would like to display the RSSI every 2 seconds. But, currently, even though it polls every 2 seconds, the result is displayed only at the end of the loop.</p><p>Here is the code snippet:</p><pre><code>for(int i=0;i&lt;10;i++)        {            Date dt=new Date();            WifiInfo info = wifi.getConnectionInfo();            int rssi = info.getRssi();            textStatus.append(""\n\nRSSI :"" +Integer.toString(rssi));             SystemClock.sleep(2000);        }</code></pre><p>Would be glad, if you have some suggestion.</p><p>RegardsKiran</p>","276859","","","","","2010-11-19 08:41:22","Sleep command for Android","<android><android-emulator><rssi><wifimanager>","2","0","","",""
"4203650","1","4206649","","2010-11-17 10:55:49","1","1158","<p>I'm new to Android application development.I would like to ask the use of image button in Android programming when simple button can also add the image with the button. How can we generate click event of image button?</p>","493193","","213269","","2010-11-17 11:31:59","2010-11-24 14:34:41","what is use of image button?","<android><image><events><button><imagebutton>","2","1","","",""
"4203716","1","4204060","","2010-11-17 11:03:12","0","459","<p>I developing an android application in which i want to integrate faceebookand twitter.</p><p>I want to post pre-written message on wall of logged in person just on click on ""wall post""button.</p><p>Can anyone help me.Thanks in advance.sunit</p>","361288","","229745","","2010-11-23 07:55:42","2010-11-23 07:55:42","face book integration in android application","<android><facebook><twitter>","1","0","","",""
"4203762","1","4203954","","2010-11-17 11:10:41","0","644","<p>I have searched and searched and I just can't get this code to work.I have a main.xml layout and a setting.xml.I have some values I would like the Settings.class to change in my main apps class.Three string to be exact.</p><p>I have tried this simple test code in my main app class</p><pre><code>settings.setOnClickListener(new OnClickListener(){   @Override   public void onClick(View v) {    Intent intent = new Intent(v.getContext(), Settings.class);     startActivityForResult(intent, 0);   }   });//Then a function @Override  protected void onActivityResult(int requestCode, int resultCode, Intent intent){      super.onActivityResult(requestCode, resultCode, intent);      Bundle extras = intent.getExtras();      String value = extras.getString(""myKey"");      if(value!=null){      Log.d(""hmmm"",value);      }  }}</code></pre><p>In my settings.class I have the following</p><pre><code> returnHome.setOnClickListener(new OnClickListener(){    @Override    public void onClick(View v) {     Intent intent = new Intent();     intent.putExtra(""myKey"", ""YEAH"");                  setResult(RESULT_OK, intent);                 finish();    }         });</code></pre><p>Back in main app class it is not getting logged.</p><p>Like I said I have three string in the main class that I want settings class to change and send back.Any help is greatly appreciated</p>","509087","","","","","2010-11-17 12:28:12","Passing values with intents","<android>","2","1","","",""
"4203786","1","","","2010-11-17 11:14:36","0","1508","<p>i need a some help , executing fallowing task. can any one help to sort out this ?</p><p>I have list view . each row contains </p><ol><li>Title (Textview)</li><li>sub title(TextView)</li><li>Progress bar</li><li>progress count(TextView)</li><li>Download/ Cancel(ToggleButton)</li></ol><p>while loading adapter i passed List . from where am displaying title , subtitle for each row. </p><p>here is myadapter code , generating views for each row.</p><p>My problem is that . In run time when i entered download button, its goes to downloadQueue to download, and updates respective progress bar . But Whwn am scrolling down the listview., progress bar visible for other row instead current row where i started Downloading. Can some one tell me t, how to bind view and state object so that it wont misplace progressbar.</p><p>`</p><pre><code>@Override    public View getView(int position, View convertView, ViewGroup parent) {        final int pos= position;        final StateViewHolder viewHolder;        final State state = stateList.get(pos) ;        if (convertView == null) {             inflater = LayoutInflater.from(context);            convertView = inflater.inflate(R.layout.adapter_view, null);            TextView title = (TextView) convertView.findViewById(R.id.text);            TextView subTitle = (TextView) convertView.findViewById(R.id.subText);            TextView progresstext = (TextView) convertView.findViewById(R.id.progressText);            ProgressBar progressBar = (ProgressBar) convertView.findViewById(R.id.progress);            ImageView cancel = (ImageView) convertView.findViewById(R.id.cancel);            ImageView download = (ImageView) convertView.findViewById(R.id.download);             viewHolder = new StateViewHolder(title, subTitle, progresstext, download, cancel, progressBar);             hashMap.put(state, viewHolder);             convertView.setTag(viewHolder);             Log.i(""DownloadAdapter"", ""InGetView"");        }else{            viewHolder = (StateViewHolder)convertView.getTag();        }         state.setViewHolder(viewHolder);        viewHolder.getDownload().setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                     viewHolder.getDownload().setVisibility(View.GONE);                     viewHolder.getCancel().setVisibility(View.VISIBLE);                     Log.i(""DownloadAdapter"", """"+state.getName());                    DownloadQueue.addToQueue(state);                }            });         viewHolder.getCancel().setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                     viewHolder.getCancel().setVisibility(View.GONE);                     viewHolder.getDownload().setVisibility(View.VISIBLE);                    DownloadQueue.RemoveFromQueue(state);                }            });        viewHolder.getTitle().setText(state.getName());        viewHolder.getSubTitle().setText(state.getEffective());        return convertView;    }}</code></pre><p>Thanking you,Srinivas</p><p>`</p>","414777","","","","","2011-03-23 04:51:16","How to bind object(data) and ViewHolder(listview row) in android?","<android><listview>","1","1","1","",""
"4203801","1","4204026","","2010-11-17 11:17:28","2","1158","<p>Is it possible to use the text-to-speech engine to send a message through a voice call? Like an answering machine.</p><p>It's also possible to monitor an outgoing voice call to read out loud a text when the other point answers the phone?</p><p>Thanks!</p>","366253","","","","","2013-03-07 14:20:51","Use text to speech on a voice call","<android><text-to-speech>","2","0","","",""
"4203877","1","","","2010-11-17 11:29:19","0","1514","<p>I want to display a table in my application, it should contain name, phone no, email as the column names and the table has many rows.After that I want to capture each item on the onClick listener, please help as I am new to this development. I was stopped here, I have implemented a table but unable to capture each item click. Please help with example code.</p>","487604","","213269","","2010-11-17 11:34:58","2010-11-17 11:39:05","how to display a table in Android?","<android><events><table>","2","1","","",""
"4203931","1","","","2010-11-17 11:35:12","0","484","<p>I am building an application in which I need to start a service when the time is 7pm. Is there any way to do this?</p>","510686","","881229","","2014-04-01 19:53:20","2014-04-01 19:53:20","How to start a service in android when the time is 7pm on the device","<android><android-intent><broadcastreceiver>","1","0","","",""
"4204017","1","4204131","","2010-11-17 11:43:17","1","24599","<p>In my android application, there are number of images in drawable folder. In my layout there are two buttons: Back and Next buttons. On clicking next and back buttons 2 different images get loaded on the same layout(common for all images).</p><p><strong>Problem</strong>:I am able to load images on Next/Back button's click but after reaching the last image, I want to make my Next button disable and same for the back button.As the user is on the first image the back button should be disabled. Code is as:</p><pre><code>public class SequencerActivity extends Activity implements OnClickListener    {        private int imageCounter = 0;        private ImageView imageLoader;        private int[] imageList = {R.drawable.image_wo_lbl_0, R.drawable.image_wo_lbl_1, R.drawable.image_wo_lbl_2, R.drawable.image_wo_lbl_3, R.drawable.image_wo_lbl_4, R.drawable.image_wo_lbl_5,                R.drawable.image_wo_lbl_6, R.drawable.image_wo_lbl_8, R.drawable.image_wo_lbl_9,R.drawable.image_wo_lbl_10, R.drawable.image_wo_lbl_11};        @Override        public void onCreate(Bundle savedInstanceState)         {            setContentView(R.layout.parent_frame);//this one is the common parent layout for all image views            super.onCreate(savedInstanceState);            /*requestWindowFeature(Window.FEATURE_NO_TITLE);            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,            WindowManager.LayoutParams.FLAG_FULLSCREEN);*/            //int image1 = R.drawable.image_w_lbl_0;            imageLoader = (ImageView) findViewById(R.id.imageLoader);            //imageLoader.setImageResource(image1);            ImageButton next = (ImageButton) findViewById(R.id.next);            ImageButton back = (ImageButton) findViewById(R.id.back);            next.setOnClickListener(this);            back.setOnClickListener(this);            //show the default image            this.loadImage(imageList[imageCounter]);        }        @Override        public void onClick(View v)         {            int imagePath = 0;            // TODO Auto-generated method stub            switch (v.getId())            {            case R.id.next:                Log.i(""Tag"",""tag"");                if(imageCounter &lt; imageList.length)                {                    imageCounter++;                    imagePath = imageList[imageCounter];                    if (imageCounter==(imageList.length)-1)                    {                        //how to make my next button disable                    }                }                break;            case R.id.back:                if(imageCounter &gt; 0)                {                    imageCounter--;                    imagePath = imageList[imageCounter];                    if (imageCounter==0)                    {                        //how to make my back button disable                    }                }                break;            }            this.loadImage(imagePath);        }        private void loadImage(int imagePath)        {            imageLoader.setImageResource(imagePath);        }    }</code></pre>","490953","","1777090","","2012-12-07 11:55:31","2013-09-18 00:12:26","How to disable button click?","<android><button>","4","0","4","",""
"4204073","1","4204219","","2010-11-17 11:52:14","2","867","<p>When I launch email client from my application, a compose window of email client gets opened but when I launch like this, I am unable to see inbox, sent items etc...</p><p>In short how to launch email client from app exactly like launching from desktop?</p><p>Any suggestions will be appreciated. </p>","505580","","573034","","2013-07-25 08:49:58","2013-07-25 08:49:58","How to launch email client from my app in such a manner that I could see inbox, sent items etc","<android><android-intent>","3","0","","",""
"4204088","1","4204229","","2010-11-17 11:56:14","3","1355","<p>Android documents starting the email intent for sending emails with Intent.ACTION_SEND.</p><p>Is there an intent which directs the user to reading his email, or which launches the default email application?</p><p>The application that launches the ""read mail"" intent would get no access to the email data.</p>","217891","","","","","2012-01-05 18:07:00","Android read mail intent","<android><android-intent>","2","1","1","",""
"4204093","1","","","2010-11-17 11:57:08","1","17159","<p>I am unable to connect to the Internet through android emulator 2.2 which is behind a proxy that requires proxy authentication. </p><p>Searched a lot over the Internet to find a proper solution but none of them are working for me.</p><p>I am running the emulator on a Ubuntu machine. </p><p>Situation:I have an application which is designed to run on both ubuntu(linux) and android. </p><p>This application has a feature to connect to internet by providing proxy details and it connects properly when run on ubuntu after providing correct details. however this fails to connect through the emulator.Even the web browser on the emulator doesn't connect to internet. Doing some changes in APN settings, it atleast gave me a webpage saying that the ISA server needs authentication, but never got any popup requesting to enter those details. </p><p>By applying -debug-proxy flag to emulator, the logs showed that it is trying to connect to the requested proxy server, but the server is challenging with authentication and none of the applications seem to get a chance to fill in this details and hence failing. This is what is happening with my application. </p><p>Does anyone have any clue why this could be happening and how i can resolve this issue? Thanks in advance. </p><p>P.S. This is happening on actual android devices as well, so it may not be the problem of just the emulator.</p>","473184","","","","","2012-08-22 05:19:34","Internet access on Android device behind proxy with authentication","<android><proxy><https>","6","0","1","",""
"4204141","1","4204411","","2010-11-17 12:04:01","0","38","<p>i need that my user interface haves 3 sections</p><p>NORTH SECTION: four textviews with info about a user</p><p>MIDDLE SECTION:  a googlemap view with the position of the user</p><p>SOUTH SECTION: a textview with time of last position, and a button to actualice the position (retrieving it from a database)</p><p>is this possible? i can't find any information about that on google or android developers guide...</p>","479886","","","","","2010-11-17 12:39:18","Can i put a googlemap in the middle section of my user interface?","<android><google-maps><user-interface>","1","0","","",""
"4204232","1","","","2010-11-17 12:16:11","21","43853","<p>Does anyone know what to edit in the android_winusb.inf file of the usb_driver folder inside the android sdk folder if I want to add the new HTC Desire HD device to it?</p><p>I've read people posting different things to add for different devices. I could not find what to add for HTC Desire HD.</p><p>Your help is greatly appreciated. Thanks!</p>","510751","","","","","2013-07-04 17:51:45","android usb adb driver for htc desire hd","<android>","4","2","3","",""
"4204251","1","4206014","","2010-11-17 12:18:27","3","2387","<p>This is my fist stackoverflow post so please be gentle with me! I'm sure that what i'm trying to do is possible and it is something I have done (or not done?) that is causing the problem... I'm just not sure what that <em>something</em> is.</p><p><strong>What i'm trying to do:</strong><br>Show a ProgressDialog while my app synchronises and processes the downloaded data.</p><p><strong>The problem:</strong><br>The ProgressDialog shows but doesn't spin (which makes it look like it has frozen), the synchronisation and processing happens, the ProgressDialog closes, the app continues as normal.</p><p><strong>How I am currently tring to do that:</strong><br>Create a ProgressDialog - in my Activity<br>Do the synchronisation - in my Service<br>Process the data - in my Service<br>Dismis the ProgressDialog - in my Activity</p><p><strong>The things I have tried:</strong><br>Using a Thread  (code below)Using a AsynTask (can provide code if needed)Using a Handler (can provide code if needed)</p><p>After spending lots of time searching for the answer to my question it seems others have had the same or similar problem and managed to solve it using one of the ideas above. However I have been unable to implement any of these ideas to solve my particular issue. This makes me sure that it is something I am doing wrong... I'm just not sure what.</p><p><strong>The original code I wrote and am using as a basis for all my attempted fixes:</strong><br>First</p><pre><code>public class myActivity extends ListActivity {    private ProgressDialog dialog;    private boolean mIsBound;    private myService mBoundService;    private ServiceConnection mConnection;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        /*if we need to login start login activity for result*/        ...    }    ...    /*other methods*/    ...}</code></pre><p>then</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent intent) {    super.onActivityResult(requestCode, resultCode, intent);    switch (requestCode){        case ACTIVITY_LOGIN:            /*after login we know we always need to sync*/         dialog = new ProgressDialog(myActivity.this);         dialog.setMessage(""Synchronising..."");         dialog.setIndeterminate(true);         dialog.setCancelable(false);         dialog.show();            Thread doBind = new Thread(new Runnable(){public void run(){doBindService();}});            doBind.start();            break;    }}</code></pre><p>so now i am assuming that doBind is happening in a different thread leaving the UI thread with nothing to do other than show the ProgressDialogue...?</p><pre><code>private boolean doBindService() { mConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName className, IBinder service) {            mBoundService = ((myService.LocalBinder)service).getService();                  while (mBoundService.isRunning()){                /*wait for service to finish before doing anything else... myMethod() is expecting the sync to have completed*/                /*I suspect this loop to be the thing causing the problem. But I'm not sure why because it is in a different thread so shouldn't interfear with the dialog?! And if that is what is causing the problem then how else can I do this?*/            }            /*get the activity to do Stuff with the downloaded data*/            myMethod();            /*finished with the service for now so unbind*/            doUnbindService();            if (dialog != null) {                dialog.dismiss();            }        }        public void onServiceDisconnected(ComponentName className) {            mBoundService = null;        }    };    boolean myReturn = bindService(new Intent(myActivity.this, myService.class), mConnection, Context.BIND_AUTO_CREATE);    mIsBound = myReturn; return myReturn;}private void doUnbindService() {    if (mIsBound) {        unbindService(mConnection);        mIsBound = false;    }}</code></pre><p>Please let me know if you require any further information in order to assist me with this issue.</p><hr><p>EDIT:</p><p>Here is the code I am using to use a handler instead. This displays the same behavior (spinner doesn't spin) as before.</p><pre><code>Thread doBind = new Thread(new Runnable(){    public void run(){        doBindService();    }});doBind.start();</code></pre><p>.</p><pre><code>private Handler handler = new Handler() {    @Overridepublic void handleMessage(Message msg) {    dialog.dismiss();}};</code></pre><p>.</p><pre><code>private boolean doBindService() { mConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName className, IBinder service) {            mBoundService = ((myService.LocalBinder)service).getService();                  while (mBoundService.isRunning()){            }            //...do stuff same as before...            handler.sendEmptyMessage(0);        }        public void onServiceDisconnected(ComponentName className) {            mBoundService = null;        }    };    boolean myReturn = bindService(new Intent(myActivity.this, myService.class), mConnection, Context.BIND_AUTO_CREATE);    mIsBound = myReturn; return myReturn;}</code></pre>","498463","","498463","","2010-11-17 15:03:28","2010-11-18 04:47:28","Android ProgressDialog wont spin","<java><android><progressdialog><serviceconnection><ui-thread>","3","6","","",""
"4204295","1","19451256","","2010-11-17 12:23:51","5","511","<p>I have an Android TextView displaying some text, and it's multi-line.  However, in the text, I sometimes have domain names; how can I stop the TextView from splitting the lines up on the periods in them?</p><p>Is there a unicode non-breaking-period, for example?</p><hr><p>To see the issue in action in wrapping an email address, run<br><code>android create project --target 16 --path demo --package com.example.demo --activity MainActivity</code><br>and change the text in <code>res/layout/main.xml</code> to ""<code>Hello World, MyActivity filler text + email foo@foo.com</code>"".  That produces this output on a Galaxy S3 (API level 16):</p><p><img src=""http://i.stack.imgur.com/hxIzQ.png"" alt=""Email wrapping""></p><p>(Adjust text as appropriate to see wrapping on devices with other screen sizes.  Notably, the wrapping is done correctly in Intellij's layout preview, it's only on the device that it's faulty.)</p>","15721","","85950","","2013-10-16 06:03:43","2013-10-22 18:44:24","Stopping text from splitting to multiple lines on the periods in web addresses","<android><unicode><textview><android-textview><textwrapping>","3","6","","",""
"4204308","1","4207517","","2010-11-17 12:25:14","0","3241","<p>I am having a serious problem.<br>What i have in my hand :   </p><ul><li>Linux Kernel 2.6.29 with Android Eclair patches and some board specific patches(as <strong>.patch</strong> files).</li><li>Linux Kernel 2.6.32 with Android Froyo patches.</li></ul><p>What i want to achieve : </p><ul><li>I want to merge the <strong>board specific patches</strong> to my Linux Kernel 2.6.32 with Android Froyo patches.</li></ul><p>I am not able to get an idea on how to do that. I tried applying the Board specific patches directly on to the 2.6.32 kernel, but it failed with many errors.</p><p>Please guide me with some valuable pointers.  </p><p>Thanks,<br>Sen</p>","449378","","","","","2010-11-17 17:56:03","How to patch the Linux kernel?","<android><linux-kernel>","1","3","","",""
"4204338","1","4204704","","2010-11-17 12:28:18","0","2032","<p><br><br>I need to download a mp3 file from a server URL, and then play that mp3 file.<br>Basically the main motive is to play a remote mp3 file, now there are two options for me, either i stream that file and play it onto media player,<br><br></p><p>or i first download it and then play it. I am still trying the first one, but with one success, so just thinking on the second alternative.<br><br></p><p>So if any help can be provided it will be great for me.......<br>Thanks</p>","405521","","","","","2013-08-06 07:59:39","Android: download mp3 from URL","<android><mp3>","3","0","","",""
"4204356","1","","","2010-11-17 12:30:39","1","2689","<p>I am trying to save some values in the onSaveInstanceState(Bundle) method of my activty by following the example here: <a href=""http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state"">How do I save an Android application's state?</a></p><p>But it doesnt seem to load it from the Oncreate(). the bundle object is always null but whenever i call another activity, it does indeed go into the onSaveInstanceState method to save my values.</p><p>Now i read that question i just posted and someone noted how they could not get it to work in an emulator? unfortunately that is all im working on. On an emulator and cant test the app on the device as i have no device available to me right now And the web services i am interacting with are in a local VM on my work machine that cannot be accesses remotely at the moment.</p><p>My question is, is it true that saved bundles dont work on emulators? I also noticed how when i do dismiss or bring up a new activity , the activity calles onPause and then onStop. when i bring back the same activty, it goes straight to onCreate?</p><p>now according to the docs here <a href=""http://developer.android.com/guide/topics/fundamentals.html#actlife"" rel=""nofollow"">http://developer.android.com/guide/topics/fundamentals.html#actlife</a> That is correct in terms of what the lifecycle diagram shows but if you read below that diagram on the onStop() section it says the next step it goes into is either onRestart() or onDestroy()? no mention of onCreate? Type on the docs?</p><p>Anyways here is my onSaveInstanceState() and onCreate() both in the same activity:</p><pre><code>@Overridepublic void onSaveInstanceState(Bundle savedInstanceState) {    Log.d(TAG, ""SAVING OauthManager in onSaveInstanceState"");    // TODO: if works, we need to save the my network list HashMap as well    // so we dont make a call to the platform everytime we refresh this    // screen    // savedInstanceState.putSerializable(""oauthManager"", mOathManager);    // Log.d(TAG, ""finished saving"");    // super.onSaveInstanceState(savedInstanceState);    // Log.d(TAG, ""super.onSaveInstanceState(savedInstanceState)"");    savedInstanceState.putString(USER_CONSUMER_ID,            mSavedUserConsumerTokenId);    savedInstanceState.putString(USER_CONSUMER_SECRET,            mSavedUserConsumerSecret);    savedInstanceState.putString(URL_REQUEST_TOKEN, mSavedRequestTokenUrl);    savedInstanceState.putString(URL_ACCESS_TOKEN, mSavedAccessTokenUrl);    savedInstanceState.putString(URL_AUTHORIZE_TOKEN,            mSavedAuthorizeTokenUrl);    super.onSaveInstanceState(savedInstanceState);}</code></pre><p>My onCreate</p><pre><code>@Override    protected void onCreate(Bundle savedInstanceState) {        // TODO Auto-generated method stub        Log.d(TAG, ""    "");        Log.d(TAG, ""onCreate"");        Log.d(TAG, ""///////////////////////////////////////"");        Log.d(TAG, ""///////////////////////////////////////"");        super.onCreate(savedInstanceState);        Log.d(TAG, ""super.onCreate(savedInstanceState);"");        setContentView(R.layout.network_list);        mContext = getApplicationContext();        mIntent = getIntent();        mGoogleButton = (Button) findViewById(R.id.googleAddOrRemoveButton);        mFacebookButton = (Button) findViewById(R.id.facebookAddOrRemoveButton);        mLinkedInkButton = (Button) findViewById(R.id.linkedInAddOrRemoveButton);        mPopEmailButton = (Button) findViewById(R.id.popEmailAddOrRemoveButton);        if (savedInstanceState != null) {            Log.d(TAG, ""inside if (savedInstanceState != null) {"");            Log.d(TAG, ""savedInstanceState != null"");            // mOathManager = (OAuthManager) savedInstanceState            // .getSerializable(""oauthManager"");            mSavedUserConsumerTokenId = savedInstanceState                    .getString(USER_CONSUMER_ID);            mSavedUserConsumerSecret = savedInstanceState                    .getString(USER_CONSUMER_SECRET);            mSavedRequestTokenUrl = savedInstanceState                    .getString(URL_REQUEST_TOKEN);            mSavedAccessTokenUrl = savedInstanceState                    .getString(URL_ACCESS_TOKEN);            mSavedAuthorizeTokenUrl = savedInstanceState                    .getString(URL_AUTHORIZE_TOKEN);            mOathManager = new OAuthManager(mContext, getIntent(),                    mSavedUserConsumerTokenId, mSavedUserConsumerSecret,                    mSavedRequestTokenUrl, mSavedAccessTokenUrl,                    mSavedAuthorizeTokenUrl, CALLBACK_URI);            mOathManager.requestUserRequestToken();        } else{            Log.d(TAG, ""savedInstanceState is null and loading the list again"");            GetNetworkListTask getNetworkListTask = new GetNetworkListTask();            getNetworkListTask.execute();        }    }</code></pre>","444668","","444668","","2010-11-17 13:22:25","2010-11-17 13:22:25","Android wont save the current state of an activity","<android>","1","1","","",""
"4204373","1","4208199","","2010-11-17 12:32:50","1","4114","<p>I want to resize an <code>ImageView</code> on <code>doubleTapEvent</code>. A code example will be really helpful.</p>","493423","","1455421","","2012-09-28 04:52:33","2012-09-28 04:52:33","Resize imageview on onDoubleTapEvent","<android><resize><imageview>","2","0","1","",""
"4204388","1","4204432","","2010-11-17 12:34:39","4","678","<p>I have a long list to display in a listview. Let's say 200 items. This is a long list, but i can't reduce it. Now my list is slow and is not convenient for the user.</p><p>I need something like a paging system: at the beginning I load 25 items. When the user reach the end I show a button, or something like it, to load other 25 items. An Iphone style solution.</p><p>Is there a better way? Or what is the best solution?</p><p>Thanks!</p>","50455","","","","","2010-11-17 12:41:50","Long ListView optimization and usability","<android>","1","0","3","",""
"4204511","1","","","2010-11-17 12:53:08","0","779","<p>Error message is: planets_array cannot be resolved or is not a field. I have it declared in my strings.xml file </p><pre><code>package com.android.hellospinner1;import android.app.*;import android.os.*;import android.view.View;import android.widget.*;import android.widget.AdapterView.OnItemSelectedListener;import android.*;import java.util.*;public class hellospinner1 extends Activity { @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.main);     Spinner spinner = (Spinner) findViewById(R.id.spinner);     ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(             this, R.array.planets_array, android.R.layout.simple_spinner_item);     adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);     spinner.setAdapter(adapter);     spinner.setOnItemSelectedListener(new MyOnItemSelectedListener()); } public class MyOnItemSelectedListener implements OnItemSelectedListener {     public void onItemSelected(AdapterView&lt;?&gt; parent,         View view, int pos, long id) {       Toast.makeText(parent.getContext(), ""The planet is "" +           parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();     }     public void onNothingSelected(AdapterView parent) {       // Do nothing.     } }}</code></pre>","510792","","418183","","2010-11-17 12:54:40","2011-11-08 11:34:31","Resource won't get resolved","<android><spinner>","3","1","","",""
"4204599","1","4204937","","2010-11-17 13:04:26","2","2062","<p>I have a listview that displays categories from my server. It works fine but when i change orientation it reloads it...</p><p>What should I do to avoid reloads ?</p><p>Thanks.  </p>","472882","","1675954","","2013-04-15 15:49:32","2013-04-15 15:49:32","Reload Data in ListView When Change Orientation","<android><android-manifest><android-layout>","1","0","","",""
"4204642","1","4205073","","2010-11-17 13:08:35","0","359","<p>i'm having the above problem when switching my activity. In the first activity i have a GalleryView showing all my images and an ImageView show the selected image from the gallery. Now i want to switch to the next activity and keep the same image from the ImageView on screen in the second activity. Here is how i show my images:</p><pre><code>Integer[] imageIDs = {R.drawable.img1, R.drawable.img2, R.drawable.img3};Gallery gallery = (Gallery) findViewById(R.id.gallery1);        gallery.setAdapter(new ImageAdapter(this));                gallery.setOnItemClickListener(new OnItemClickListener()         {            @SuppressWarnings(""rawtypes"")   public void onItemClick(AdapterView parent, View v, int position, long id)             {                                ImageView imageView = (ImageView) findViewById(R.id.image1);                                imageView.setImageResource(imageIDs[position]);            }        });</code></pre><p>Is there like an id or something saying what's on screen at the moment of the switch? How can i accomplish this?</p><p>Thanks in advance</p>","499488","","499488","","2010-11-17 13:20:31","2010-11-17 22:44:28","problem showing image after switching activity Android","<android><activity>","2","0","","",""
"4204706","1","4204999","","2010-11-17 13:16:36","2","877","<p>I get the following warning when I instantiate my ArrayAdapter (compiles fine):</p><pre><code>warning: [unchecked] unchecked call to ArrayAdapter(android.content.Context,int,java.util.List&lt;T&gt;) as a member of the raw type android.widget.ArrayAdapter      ArrayAdapter spinnerArrayAdapter = new ArrayAdapter(CFAMain.this, android.R.layout.simple_spinner_dropdown_item, spinnerArray);</code></pre><p>And here's the problem line:</p><pre><code>ArrayAdapter spinnerArrayAdapter = new ArrayAdapter(CFAMain.this, android.R.layout.simple_spinner_dropdown_item, spinnerArray);</code></pre><p>Anyone have any ideas as to why it's giving me this warning?</p>","380579","","105224","","2010-11-17 13:28:31","2010-11-17 13:49:15","unchecked call to ArrayAdapter","<java><android><warnings><compiler-warnings>","1","1","","",""
"4204719","1","","","2010-11-17 13:17:50","3","1876","<p>When I get my activity chooser for my ACTION_GET_CONTENT Intent there is applications I don't want to be there, like the ones who will first create content and then pass the URI to me, like the Voice Recorder.</p><p>When you use Gmail and try to attach a file you will only see the applications/activities that picks data from your SDCard like Gallery, and in my case Astro (file manager application).</p><p>So my question is, what kind of Intent does Gmail use for their Attach?</p><p>Here is my code, something must be missing since I get applications like Voice Recorder and so on.</p><pre><code>Intent action = new Intent(Intent.ACTION_GET_CONTENT);  action = action.setType(""*/*"").addCategory(Intent.CATEGORY_OPENABLE);  startActivityForResult(Intent.createChooser(action, ""Upload file from...""), 1);</code></pre><p>Thank you!</p><p>Regards<br>Tobias</p>","510824","","510824","","2010-11-17 13:27:50","2011-02-18 05:28:46","Android Intent like Gmail's attach Intent","<android>","1","0","1","",""
"4204778","1","6321268","","2010-11-17 13:24:37","0","483","<p>Hi i am doing one project,I failed to display two listViews in a SingleActivity,one list am getting from xml as product catalog other one contains Images(LazyImagelo ader)....  here i am not understanding how i can getcan you help me to display  each product catalog and it's related image in a Single row of List..</p>","487629","","","","","2011-06-12 16:19:59","How to display two list Views in a Single Activity","<android>","1","1","","",""
"4204816","1","5174681","","2010-11-17 13:28:52","1","438","<p>I would like to use <code>UriMatcher</code> to match custom http links.</p><p>I have following code:</p><pre><code>UriMatcher mUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);mUriMatcher.addURI(""myLink"", ""http://a.b.c/?id="", 1);mUriMatcher.addURI(""myLink"", ""http://d.e.f/?id="", 2);int match = mUriMatcher.match(Uri.parse(""http://a.b.c/?id=123""));</code></pre><p>But I always get ""-1"" in match result...</p>","296427","","","","","2011-03-02 23:08:10","Is UriMatcher capable of matching custom http links?","<android><uri><matcher>","1","0","","",""
"4204829","1","4204960","","2010-11-17 13:30:44","1","440","<p>HelloIn my android application i would like to shift from 2G or 3G depending on the bitrte available.Is there any method that i can get the bitrate in android.</p><p>Please forward your valuable suggestions.</p><p>Thanks i advance :)</p>","420261","","","","","2010-11-17 13:45:13","adaptive bitrate in android","<android>","1","1","0","",""
"4204894","1","4212352","","2010-11-17 13:37:40","4","169","<p>I'm trying to add a stikcy header to a listview. I've put the header-field and the listview inside a relativelayout and defined the listview's android:layout_below=""@id/header"".</p><p>The problem is that I want the listview and the header to be positioned at the same place when the listview is not scrolled to the top. The header's background is transparent. I drew an amazing image in paint to illustrate how I want them to interact.</p><p><img src=""http://i.stack.imgur.com/Vzjo1.png"" alt=""Header and ListView""></p><p>I figured I could override the listviews onscrollistener and change the listviews layout_below-tingy at runtime when it's getScrollY() == 0, but that seems to happen all the time.</p><p>Has anyone done something similar that could point me in the right direction?</p>","397060","","","","","2010-11-18 06:55:27","Any way of knowing when a listview has scrolled to top?","<android><listview><header>","1","0","1","",""
"4204964","1","","","2010-11-17 13:45:29","-4","173","<p>I am forwarding linkto see,I am really getting problems to do this,i need to get images(.jpg,.jpeg) and text from server ,Please help how to solve this plz send me any sample i have deadlines till now work not in progress</p><p><a href=""http://www.google.com/imgres?imgurl=http://openhandsetmagazine.com/wp-content/uploads/2009/03/friendmobilizer.png&amp;imgrefurl=http://openhandsetmagazine.com/tag/friendmobilizer/&amp;h=480&amp;w=320&amp;sz=33&amp;tbnid=cHOSF9xqU3JsfM%3a&amp;tbnh=275&amp;tbnw=183&amp;prev=/images?q=facebook%2bandroid%2bimages&amp;zoom=1&amp;q=facebook%20android%20images&amp;hl=en&amp;usg=__K7mRdgTTt_xn_r1Yif9p9p6sr34=&amp;sa=X&amp;ei=w9fjTNf4D5HKvQPS1oC5Dg&amp;sqi=2&amp;ved=0CBYQ9QEwAA"" rel=""nofollow"">link</a></p>","487629","","127880","","2013-02-19 00:26:27","2013-02-19 00:26:27","Android Custom list view","<android>","3","4","","2010-11-17 14:09:13",""
"4205120","1","","","2010-11-17 14:02:44","1","817","<p>I've been trying to make a RESTful POST call from an Android app for several days now. I've tried a number of different methods and I haven't had any luck so far. There seem to be several issues, Firstly I added </p><p><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code> to the manifest to ensure I could work with sockets/network. </p><p>Then I've tried the following different methods to try and get a call out:</p><pre><code>    System.setProperty(""java.net.useSystemProxies"", ""true""); HttpURLConnection c = (HttpURLConnection) new URL(url+mUrl).openConnection(); c.setUseCaches(false); c.setDoOutput(true); c.setRequestMethod(""POST""); c.setRequestProperty(""Content-length"",""9""); c.setRequestProperty(""Content-type"", ""application/x-www-form-urlencoded""); c.setRequestProperty(""Accept"",""application/json""); c.setRequestProperty(""Authorization"", ""basic "" + Base64.encodeBytes((username+"":""+password).getBytes())); c.connect(); OutputStream os = c.getOutputStream(); os.write(""mode=Push"".getBytes()); os.flush(); os.close();</code></pre><p>I'm not sure if Android automatically deals with any required proxy settings, I tried adding that in but in this method the c.connect() just hangs forever, no exception, no timeout, no return.</p><p>The next method was as follows:</p><pre><code>        DefaultHttpClient httpClient = getClient(); HttpResponse response = null;   HttpPost postMethod = new HttpPost(this.url + mUrl); postMethod.addHeader(""Content-type"", ""application/x-www-form-urlencoded""); postMethod.addHeader(""Accept"",""application/json""); postMethod.addHeader(""Authorization"", ""basic "" + Base64.encodeBytes((username+"":""+password).getBytes())); if (hm == null) return null;   try  {    List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);    Iterator&lt;String&gt; it = hm.keySet().iterator();    String k, v;    while (it.hasNext())   {     k = it.next();     v = hm.get(k);     nameValuePairs.add(new BasicNameValuePair(k, v));    }    postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));    response = httpClient.execute(postMethod); </code></pre><p>This now either returns UnknownHostException when I run it from work, behind a proxy/firewall or when I run it from home then I get a Challenge empty exception.This is all running under the emulator, Droid 1.6 app. I've got Fiddler2 running and I'm not seing anything coming out over port 80 at all... Help :)</p>","510865","","510865","","2010-11-17 17:47:21","2010-11-17 17:47:21","RESTful HTTP call from Android","<android><restful-authentication>","0","3","","",""
"4205125","1","4214650","","2010-11-17 14:03:10","0","983","<p>I have an ExpandableListView with the following set as the style</p><pre><code>&lt;style name=""expendable_list_view""&gt;    &lt;item name=""android:background""&gt;@color/background&lt;/item&gt;    &lt;item name=""android:cacheColorHint""&gt;@color/background&lt;/item&gt;&lt;/style&gt;</code></pre><p>Now, the bottom fading edge behaves normally, but the top one always fades to black.I have tried setting</p><pre><code>android:fadingEdge=""none""</code></pre><p>and again, only the bottom fading edge is gone.</p><p>Any ideas?</p>","235910","","","","","2010-11-18 12:18:45","ExpandableListView top fading edge always visible","<android><android-widget>","2","0","1","",""
"4205128","1","4205818","","2010-11-17 14:03:26","1","813","<p>guysIs there possibility to add some custom actions to Android phone calls log? For example, user is entering to phone calls log, make long tap on some item and standard context menu appears. I need to add item like ""bill call"" to this context menu. Is this possible?Thanks.</p>","416037","","","","","2010-11-17 15:14:30","Custom actions in phone call log","<android><call><logging><phone>","1","0","0","",""
"4205277","1","4205311","","2010-11-17 14:20:11","2","986","<p>I have an AdView in the main activity with its requestInterval set to (the recommended) 20 seconds. </p><p>The problem is that the Advert never seems to change.</p><p>I know that the refreshes are occurring as I get callbacks to onReceiveRefreshedAd on the AdListener, furthermore the impressions are being counted in the Sites and Apps Reporting control panel.</p><p>I can see that the AdView flickers just after the onReceiveRefreshedAd callback occurs, so my assumption is that AdMob is simply serving the same ad time after time. </p><p>The only way to get a new/different advert is to restart the activity.</p><p>This isn't the way its supposed to behave surely?</p><p>I'm not in test mode nor am I using a registered test device.</p><p>Thanks,</p>","510831","","","","","2010-11-17 14:24:23","Android AdMob SDK - requesting a new Advert returns same Advert","<android><admob>","1","0","1","",""
"4205460","1","4205501","","2010-11-17 14:37:33","2","1308","<p>I would like to change the height and width of the image. Displays the image using the <code>canvas</code>:</p><pre><code>canvas.drawBitmap (_image, 0, 0, null);</code></pre><p>How to change the size of the bitmap?</p>","500067","","213269","","2010-11-17 15:11:17","2010-12-06 14:08:48","Changing the image width and height","<java><android><image><bitmap>","2","0","0","",""
"4205468","1","5057274","","2010-11-17 14:37:56","28","7394","<p>Here s the scenario.</p><p>I need to write an application for android to create a RFCOMM socket to a pc with a BT dongle (I'm going to write the server too).</p><p>My requirement is that the user doesn't have to pair device manually.</p><p>Actually, with a big hack, I'm using the <a href=""http://www.kiwidoc.com/java/l/p/android/android/5/p/android.bluetooth/c/BluetoothDevice#createInsecureRfcommSocket%28I%29"">createInsecureRfcommSocket</a>.</p><p>A little <em>scenario</em>: I've an android application which exchanges information with a linux box with rfcomm socket opened. I can manually set the PIN on the devices (hardcoding it IS an option)</p><p>I'm looking for different roads:</p><p><strong>Write a JNI wrapper</strong></p><p>As has been done <a href=""http://max.kellermann.name/projects/blue-nmea/"">here</a> by Max Kellermann, I can write a jni layer to make all the pairing phase. This should be a good options, but there's a problem:</p><p><em>The NDK 4b does not provide libbluetooth libraries, so -lbluetooth fails, as well as the NDK v.3.</em></p><p>Options:</p><ol><li>Find the NDK 1.5 (which includes lib bluetooth). After days of web search I've been not able to find out. Anyone has or knows where I can find it?</li><li>Compile libbluetooth for android by myself and use them for -lbluetooth. No lucky there, I'm not able to build them. Any hint?</li></ol><p><strong>Use something exposed by the APIs</strong></p><p>Any one know how can I use <a href=""http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#createRfcommSocketToServiceRecord"">createRfcommSocketToServiceRecord</a> and have the user not to manually pair the device? Is it possible? How should I write the server?</p><p><strong>Something I do not know</strong></p><p>Maybe (sure!) there is something I do not know. Maybe I can use something else? Not RFCOMM? SDP?</p><p>Maybe I can manyally pair with android api?</p><p>I hope to have been clear enough, if not just ask. And again, as it's not the first time, I'm in your hands :)</p><p>Thanks for all the support guys!</p>","258267","","","","","2011-05-02 15:07:01","Create an android RFCOMM socket without any input from the user. How?","<android><bluetooth><jni><android-ndk><rfcomm>","2","9","9","",""
"4205520","1","4205959","","2010-11-17 14:44:19","1","2212","<p>I have implemented the action bar (not the quick action bar) in my app. The action bar is based on the one used in the Google IO app and the facebook app. I am stumped though, trying to understand how to keep the action bar fixed. When an activity needs scrolling, the action bar needs to be remain fixed. Can anyone help with this problem?</p><p>Thanks in advance.</p>","450534","","","","","2010-11-17 15:26:36","Fixed action bar similiar to the facebook app","<android>","2","0","3","",""
"4205656","1","","","2010-11-17 14:59:07","0","1609","<p>I have a wapsite where i am implementing forceful download.</p><p>The script is in PHP</p><p>It works great for all the other mobile browsers, but when I access the site using ANDROID phone, it downloads the actual php file.</p><p>following is my code snippet of file downloadFiles.php.</p><hr><p>$fileExt = ""jpg"";$strOrgFileName = ""abc.jpg"";</p><p>switch($fileExt) {</p><p>case ""jpeg"":</p><p>case ""jpg"": $ctype=""image/jpg""; break;</p><p>case ""gif"": $ctype=""image/gif""; break;</p><p>case ""png"": $ctype=""image/png""; break;</p><p>case ""zip"": $ctype=""application/zip""; break;</p><p>default: $ctype=""application/force-download"";</p><p>}</p><p>header(""Pragma: public"");</p><p>header(""Expires: 0"");</p><p>header(""Cache-Control: must-revalidate, post-check=0, pre-check=0"");</p><p>header(""Content-Type: $ctype"");</p><p>header(""Content-Description: File Transfer"");</p><p>header(""Content-Disposition: attachment; filename=\"""".$strOrgFileName.""\"";"" );</p><p>readfile($strOrgFileName);</p><hr><p>In Android system it downloads the php file.</p><p>ie. downloadFiles.php</p><p>Please help through this.</p>","425063","","","","","2011-10-18 13:54:11","forceful download not working for browser on Android phone on wap site","<php><android>","2","0","","",""
"4205775","1","4205822","","2010-11-17 15:10:53","1","3396","<p>I am developping an android app which downloads an xml and displays a layout with a number of edittexts, checkboxes, spinners, etc. added dynamically like this:</p><pre><code>LinearLayout ll = new LinearLayout(this);EditText nameField = new EditText(this);ll.addView(nameField);ScrollView sv = new ScrollView(this);sv.addView(ll);setContentView(sv);</code></pre><p>I'm having trouble with setting some properties to an EditText added this way. For examle android:maxLength attribute can easily be set in an xml layout but I found no method to do the same in the java code.</p><p>How can I do it when hawing to add dynamically?</p><p>Thanks,Zoltán from Hungary</p>","510944","","","","","2012-12-24 13:21:51","Setting attributes of an EditText added dynamically in Android","<android><layout><attributes><edittext>","1","0","","",""
"4205832","1","","","2010-11-17 15:15:37","1","241","<p><br>i got this JSONArray but i cant figure out how to put it in a listview. i figured out the ArrayAdapter but is doesnt give me the right result</p><pre><code>[{""id"":""1"",""name"":""Joris"",""sex"":""1"",""birthyear"":""1987""},{""id"":""2"",""name"":""bjorn"",""sex"":""1"",""birthyear"":""1987""},{""id"":""3"",""name"":""Mel"",""sex"":""0"",""birthyear"":""1992""},{""id"":""4"",""name"":""Peter"",""sex"":""1"",""birthyear"":""1955""},{""id"":""5"",""name"":""Geer"",""sex"":""1"",""birthyear"":""1979""}]</code></pre><p>this is my result on the phone in a list after using ArrayAdapter. <br>Can somebody help me?<br></p><pre><code>{""id"":""1"",""name"":""Joris"",""sex"":""1"",""birthyear"":""1987""}{""id"":""2"",""name"":""bjorn"",""sex"":""1"",""birthyear"":""1987""}{""id"":""3"",""name"":""Mel"",""sex"":""0"",""birthyear"":""1992""}{""id"":""4"",""name"":""Peter"",""sex"":""1"",""birthyear"":""1955""}{""id"":""5"",""name"":""Geer"",""sex"":""1"",""birthyear"":""1979""}</code></pre>","488500","","169346","","2010-11-17 16:40:18","2011-07-01 07:14:08","multi JSONarray Problem","<java><android><json>","2","3","1","",""
"4205935","1","","","2010-11-17 15:25:00","0","954","<p>I just try to creating WCF REST Webservice for androidby following this tutorial <a href=""http://fszlin.blogspot.com/2010/05/comsuming-wcf-services-with-android.html"" rel=""nofollow"">http://fszlin.blogspot.com/2010/05/comsuming-wcf-services-with-android.html</a></p><p>But I get an error when I try to use JSONArray in Android.</p><pre><code>JSONObject t = new JSONObject(new String(buffer));</code></pre><p>""A JSONArray text must start with '[' at character 1 of ""testing""""</p><p>I try to put character [ in the service method that I return the string ['testing']. but I doesnot work.</p><p>Any help would be appreciateThanks</p>","492708","","418183","","2010-11-17 17:41:06","2010-11-17 17:41:06","Consuming WFC REST Webservice in Android","<android><wcf><web-services>","1","0","","",""
"4205950","1","4207000","","2010-11-17 15:25:45","2","280","<p>I'm very new to Android and I have the following layout xml 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=""1""android:background=""#CCC""&gt;    &lt;TableRow    android:background=""#333""    android:padding=""10px""&gt;     &lt;Button      android:text=""Sign-up""     android:id=""@+id/signUp""     android:layout_width=""wrap_content""     android:textSize=""18px""     android:layout_height=""wrap_content""     android:layout_gravity=""left""&gt;     &lt;/Button&gt;     &lt;Button      android:text=""About""     android:id=""@+id/about""     android:layout_width=""wrap_content""     android:textSize=""18px""     android:layout_height=""wrap_content""     android:layout_gravity=""right""     android:gravity=""""&gt;     &lt;/Button&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>This produces the following layout:</p><p><img src=""http://i.stack.imgur.com/AJxlv.png"" alt=""alt text""></p><p>How can I nudge the rightmost button to the left?</p>","395974","","213269","","2010-11-17 15:29:00","2010-11-17 16:58:42","Android: nudge a button to the left","<android><table><button><tablelayout>","2","1","","",""
"4206039","1","5459685","","2010-11-17 15:34:18","1","2656","<p>i try to make a post request, witch contains a file, the problem is, i have to use ssl and the BasicCredentialprovider. The following code works for me with normal POST requests:(url is the url, nvps is the nameValuePair)</p><pre><code>    DefaultHttpClient http = new DefaultHttpClient();    SSLSocketFactory ssl =  (SSLSocketFactory)http.getConnectionManager().getSchemeRegistry().getScheme( ""https"" ).getSocketFactory();     ssl.setHostnameVerifier( SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER );    final String username = ""xxx"";    final String password = ""xxx"";    UsernamePasswordCredentials c = new UsernamePasswordCredentials(username,password);    BasicCredentialsProvider cP = new BasicCredentialsProvider();     cP.setCredentials(AuthScope.ANY, c);     http.setCredentialsProvider(cP);    HttpResponse res;    try {        HttpPost httpost = new HttpPost(url);        httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.DEFAULT_CONTENT_CHARSET));        res = http.execute(httpost);        InputStream is = res.getEntity().getContent();        BufferedInputStream bis = new BufferedInputStream(is);        ByteArrayBuffer baf = new ByteArrayBuffer(50);        int current = 0;        while((current = bis.read()) != -1){              baf.append((byte)current);         }        res = null;        httpost = null;        return  new String(baf.toByteArray());       }     catch (ClientProtocolException e) {        // TODO Auto-generated catch block        return e.getMessage();    }     catch (IOException e) {        // TODO Auto-generated catch block        return e.getMessage();    } </code></pre><p>I found the following code to perform a Fileupload, the code works, but i'm not able to combine the Upload with the autenthification an let him ignore the ssl errors (the cetificate is not valid)</p><pre><code>String BOUNDRY = ""=================================="";final String username = ""xxx"";final String password = ""xxx"";HttpURLConnection conn = null;try {     String contentDisposition = ""Content-Disposition: form-data; name=\""userfile\"";         filename=\"""" + file.getName() + ""\"""";            String contentType = ""Content-Type: application/octet-stream"";            // This is the standard format for a multipart request            StringBuffer requestBody = new StringBuffer();            requestBody.append(""--"");            requestBody.append(BOUNDRY);            requestBody.append('\n');            requestBody.append(contentDisposition);            requestBody.append('\n');            requestBody.append(contentType);            requestBody.append('\n');            requestBody.append('\n');            requestBody.append(new String(getBytesFromFile(file)));            requestBody.append(""--"");            requestBody.append(BOUNDRY);            requestBody.append(""--"");            // Make a connect to the server            URL url = new URL(targetURL);            conn = (HttpURLConnection) url.openConnection();            // Put the authentication details in the request            conn.setDoOutput(true);            conn.setDoInput(true);            conn.setUseCaches(false);            conn.setRequestMethod(""POST"");            conn.setRequestProperty(""Content-Type"", ""multipart/form-data; boundary="" + BOUNDRY);            // 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));            }            // Read the response            InputStream is = conn.getInputStream();            ByteArrayOutputStream baos = new ByteArrayOutputStream();            byte[] bytes = new byte[1024];            int bytesRead;            while((bytesRead = is.read(bytes)) != -1) {                baos.write(bytes, 0, bytesRead);            }            byte[] bytesReceived = baos.toByteArray();            baos.close();            is.close();            String response = new String(bytesReceived);            ret = response;            // TODO: Do something here to handle the 'response' string        } finally {            if (conn != null) {                conn.disconnect();            }        }</code></pre><p>Any suggestions?</p>","432657","","432657","","2010-11-18 11:19:16","2011-03-28 13:29:48","android fileupload with https and Credentials","<android><ssl><file-upload><credentials>","1","0","1","",""
"4206047","1","4206541","","2010-11-17 15:35:29","1","1614","<p>I'm in a trouble managing a spinner, so may I ask for your help ?</p><p>I have a spinner with its adapter.I initialize the spinner with a list of values when starting my activity.Then I force the selected value to be the one used in the object that I manage.</p><p>Once the screen is initialized :When the user selects a value in the spinner, according to the selected value, I may continue (or not) to another activity for let the user choose a complementary and necessary value.If the user ""cancels"" this second activity, I want to rollback the spinner to its previous selected value, and cancel some actions made in the meantime.If the user goes to the end of the second activity, everything is fine and I want juste to refresh the spinner display with the datas selected in the second activity (I overload the getView method in the adapter to do this).</p><p>Overall, I can easily do all of this, however, when I force the selected value in the spinner at the begining of my activity, or whene returning back from the second activity by ""Cancel"", the change value event is catched and the second activity is triggered (the user did not click anything at all).</p><p>How would you allow the second activity to be lauched only if the change of the selected value in the spinner is due to a manual action from the user, and prevent that same second activity to be launched when the value of spinner is changed ""in the code ""?</p><p>I tried many solutions, as setting a boolean into the adapter that tells if the next event will be raised because of an ""in the code"" action.Or also putting a boolean in the adapter that tells if the adapter has initialised itself, and I force that boolean to true on the forst change catched event.But nothing that really works fine.</p><p>Thank you for your help.</p><p>Oliver</p>","499417","","499417","","2010-12-29 00:54:56","2010-12-29 00:54:56","Android - Spinner : how may I distinguish user's actions from computer's actions in a OnItemSelectedListener","<android><action><listener><spinner>","1","0","","",""
"4206058","1","4206135","","2010-11-17 15:36:29","1","243","<p>I'm designing an app, which flicks through a series of pictures, like flicking through a photo album. Pretty standard stuff I'm sure. Since the picture must be viewed for a few seconds before it automatically changes ot the next pic, I decided to ake a thread that shows the pic, waits  couple of second and then moves on.</p><pre><code>Picthread(ImageView Image1) {        this.image = Image1;    }    public void run(){        showPicture(image);        animal_array = new String[7];        while (counter &lt; 7){            try{                int timer = 0;                while (timer &lt; 2000){                    sleep(500);                    timer+=500;                }                image.post(new Runnable(){                    public void run() {                         showPicture(image);                    }                });            }             catch (InterruptedException e) {                  }         }    }</code></pre><p>This actualy worked. showPictures is a very simple method that just chooses a picture and puts it on an ImageView. It isn't necessary to know about it for my problem.At first itdidn't work, the logcat said I couldn't touch a view on a view heirarchy that wasnt created in this thread. I wasn't sure what that meant so I did the</p><pre><code>image.post(...)</code></pre><p>code. Which worked. My main question is: Why was this necesary? If you look at my above code, the first showPicture() method is not inside the image.post() code. But no exception is registered. I don't understand this, why isn't a post needed? But also why do I need to post, since Image is a class variable, and I thought could be viewed by all threads. I was happy it worked, but puzzled.</p><p>Please bare in mind, this is my first attempt at threading in Java on anything more than trivial textbook examples. SO I'm still pretty confused.</p><p>By the way, in the end I ditched the whole thread, and just did</p><pre><code>new Thread(new Runnable() {            public void run() {...}</code></pre>","485498","","","","","2010-11-17 15:42:56","Threading Problem with Java and Android","<java><android><multithreading><runnable>","1","0","","",""
"4206150","1","4208068","","2010-11-17 15:43:52","1","1461","<p>I want to store Location objects into my database, and then be able to load them. How can I build a Location object from its attributes?</p><ul><li>Should I create a blank Location and then set the attributes? (If yes, how?)</li><li>Should I use my database as a LocationProvider? (If yes, how?)</li></ul><p>Thanks!</p><p><strong>EDIT: The only working solution I found so far is to retrieve the current Location, and override all the attributes... There has to be a better way!</strong></p><p>my code:</p><pre><code>public Location selectLocationById(int id){    String query = ""SELECT * FROM "" + LOCATIONS_TABLE + "" WHERE id = "" + id + "";"";    Cursor c = db.rawQuery(query, null);    Location l = null;    if(c.getCount() == 1) {        c.moveToFirst();        if(c.getColumnCount() == 8){            l = new Location(MyProject.getCurrentLoc());            l.setAccuracy(c.getFloat(1));            l.setAltitude(c.getDouble(2));            l.setBearing(c.getFloat(3));            l.setLatitude(c.getDouble(4));            l.setLongitude(c.getDouble(5));            l.setSpeed(c.getFloat(6));            l.setTime(c.getLong(7));        }    }    if(c != null &amp;&amp; !c.isClosed()) {        c.close();    }    return l;}</code></pre>","488054","","488054","","2010-11-17 18:22:13","2012-01-31 08:21:03","How to retrieve Location Objects from a database?","<android><database><gps><location>","1","0","","",""
"4206296","1","4209817","","2010-11-17 15:55:27","2","4548","<p>I'm new to Facebook API on Android, and basically, what I'm trying to do is creating custom wall post for an application I'm developing.Like when you listen a Shazam a song and you can share the result with your friends.I believe I've got to create a custom attachment. Here's my code for setting the attachment:</p><pre><code>mPostButton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Bundle myParams = new Bundle();        String attachment=""{\""name\"":\""Gran Turismo 5\"","" +           ""\""href\"":\""http://www.unknown.com/?lang=fr\"","" +           ""\""caption\"":\""Sony Computer Entertainment\"",\""description\"":"" +           ""\""Une vidéo proposée par Cedemo.\"",\""media\"":"" +           ""[{\""type\"":\""image\"",\""src\"":"" +           ""\""http://www.unknown.com/prepicture//thumb_title/15/15061_1.jpg\"","" +           ""\""href\"":\""http://www.unknown.com/?lang=fr\""}],\""properties\"":"" +           ""{\""Autre lien\"":{\""text\"":\""Cedemo\"",\""href\"":\""http://www.unknown.com\""}}}"";        myParams.putString(""attachment"", URLEncoder.encode(attachment);        mFacebook.dialog(Option.this, ""stream.publish"",myParams,                new SampleDialogListener());</code></pre><p>And then, later on:</p><pre><code>public class SampleDialogListener extends BaseDialogListener {    public void onComplete(Bundle values) {        final String postId = values.getString(""post_id"");        if (postId != null) {            Log.d(""Facebook-Example"", ""Dialog Success! post_id="" + postId);            mAsyncRunner.request(postId,values, new WallPostRequestListener());        } else {            Log.d(""Facebook-Example"", ""No wall post made"");        }    }}</code></pre><p>I didn't wrote the attachment String, It's just a test taken from another question made in this forum. Anyway, when I call myAsync.request, my app shows an error message, how am I supposed to pass the attachment to my dialog?Hope I've been clear enough.</p>","510975","","2352432","","2013-03-13 17:50:33","2013-03-13 17:50:33","Creating a custom Wall Post with Facebook API on Android","<android><api><facebook>","1","0","2","",""
"4206510","1","4207046","","2010-11-17 16:16:03","4","715","<p>I need to explore the world ""You wrote a killer application, but do you have an Android/iPhone/iPad client?"".</p><p>My questions are:</p><p>1) which is the best way to send data to those devices? Soap and Rest as suggested <a href=""http://stackoverflow.com/questions/3736129/android-how-to-upload-data-from-android-phone-to-remote-database"">here</a>? Or are there some specific techniques? (My app is written in Delphi and I can expose data with webservices if needed)</p><p>2) For x-platform (where by x I mean basically apple prodcuts and android) developement is there a tool? Or the only solution is write one client per platform that ""embeds"" a web application optimized for mobile devices?</p><p>3) which are the techinques for caching locally some data / working offline? Is it different in the 2 worlds or is it common?</p>","193655","","106224","","2010-11-17 17:05:37","2010-11-17 17:05:37","Techiniques for writing Android, iPad, iPhone clients using remote data","<iphone><android><delphi><ipad>","2","2","3","",""
"4206535","1","4223402","","2010-11-17 16:18:23","4","2382","<p>I attempted to generate a Sine Wave using AudioTrack initially. The result was not satisfactory. I then moved to the Soundpool class. I used Audacity to create audiofiles of 1 second and then modified the playback speed (.5 - 2.0) to get the desired frequencies. (Arrays, as there are also saw and triangle wavefiles)</p><pre><code>    sig10000[0]=soundPool01.load(context,R.raw.sine10000,1);    sig2500[0]=soundPool01.load(context,R.raw.sine2500,1);    sig625[0]=soundPool01.load(context,R.raw.sine625,1);    sig157[0]=soundPool01.load(context,R.raw.sine156,1);    sig40[0]=soundPool01.load(context,R.raw.sine40,1);</code></pre><p>I then, depending on the chosen frequency, play the audio:</p><pre><code>    public void play(){    Signal s=null;    float factor;    for(int i=0;i&lt;this.size();i++){        s=this.get(i);            if(s.getFreq()&gt;4999){                factor = s.getFreq()/10000f;                s.setStreamID(soundPool01.play(sig10000[s.getWaveType()],.99f,.99f,0,-1,factor));                               }else if(s.getFreq()&gt;1249){                factor = s.getFreq()/2500f;                s.setStreamID(soundPool01.play(sig2500[s.getWaveType()],.99f,.99f,0,-1,factor));            }else if(s.getFreq()&gt;312){                factor = s.getFreq()/625f;                s.setStreamID(soundPool01.play(sig625[s.getWaveType()],.99f,.99f,0,-1,factor));            }else if(s.getFreq()&gt;77){                factor = s.getFreq()/156f;                s.setStreamID(soundPool01.play(sig157[s.getWaveType()],.99f,.99f,0,-1,factor));            }else {                factor = s.getFreq()/40f;                s.setStreamID(soundPool01.play(sig40[s.getWaveType()],.99f,.99f,0,-1,factor));            }    }}</code></pre><p>Now as I see it, the method works fine except for the range 5000-20000 Hz. I'm breaking my head over this, not sure why its not working and I can't find any patterns to the problem.</p><p>Is there some fundamental problem with this method? </p><p>Thanking you in advance</p><p><strong>Edit: ""not working explained""</strong> When I play sine waves in the range 5000-20000 Hz it is very obvious that the frequency is inaccurate. This means the pitch is way off. E.g. 19000 Hz is too low and easily detectable by ear. What I can say is that 10000 Hz (as does 5000Hz- my mistake), so normal playback rate, is correct. <strong>At around 14kHz the signal pitch is no longer correct.</strong></p><p><strong>Thoughts/Possible Causes(?):</strong> <em>(A)</em> How many steps are there for the playbackspeed (SoundPool)? The documentation says 0.5-2.0 is it possible that this means there is 15 different playbackspeeds? <em>(B)</em> I used Audacity to generate the .ogg files. When I zoom in on the 10000Hz sine I can see it is not too smooth (sample rate 44100) and the wave does not precisely start and end at 0. Could this superposition unwanted signals? </p>","482800","","482800","","2011-02-09 12:55:34","2011-02-09 12:55:34","Generate Sine Wave between 10 and 20000Hz using SoundPool","<android><generator><wave><soundpool><sine>","1","1","0","",""
"4206641","1","4206735","","2010-11-17 16:25:55","1","729","<p>I would like to send an email with an Intent.</p><p>I would like to programatically open up an dialog that shows the different programs that handle this Intent and lets the user show his favourite mail program. In the program I want to specify a Title, an receiver and a message body. </p><p>Could you give me an example on how to this?</p>","114066","","","","","2010-11-17 16:34:48","How can I send a mail through an Intent in android?","<android><email><android-intent>","1","0","2","",""
"4206675","1","","","2010-11-17 16:29:50","8","1800","<p>Is it possible to make the phone vibrate for ANY toast message in your program?Or do you have to insert a vibrate command on each toast?</p><p>Cheers.</p>","497517","","21234","","2010-11-17 21:34:20","2011-05-24 11:30:27","Android Vibrate on toast (Homer: Mmmm vibrate on toast)","<android><toast><vibrate>","2","1","","",""
"4206780","1","4208136","","2010-11-17 16:37:12","0","1868","<p>I need help :D. I am using web service that returns similar xml file to the one below:</p><pre><code>&lt;books&gt;&lt;item_1&gt;    &lt;name&gt;&lt;/name&gt;    &lt;type&gt;&lt;/type&gt;&lt;/item_1&gt;&lt;item_2&gt;    &lt;name&gt;&lt;/name&gt;    &lt;type&gt;&lt;/type&gt;&lt;/item_2&gt;&lt;item_3&gt;    &lt;name&gt;&lt;/name&gt;    &lt;type&gt;&lt;/type&gt;&lt;/item_3&gt;......&lt;/books&gt;</code></pre><p>The problem is that I don't know how to parse it in Android. Everything would be fine if the child elements of the 'books' tag would have the same name (item instead of: item_1, item_2, item_3...) Then I could easily use SAX parser.</p><p>Do you know how I could pare this kind of document in Android?</p><p>Thanks,marqs </p><p><strong>EDITED:</strong></p><p>My problem is that the child elements of &lt;&lt;>books> tag ale numbered (item1,item2,item3 and so on) so I cannot identify them. That would not be a problem if the 'books' tag would have only 'item' child - so then I could use SAX parser and fetch 'item' list</p>","400493","","400493","","2010-11-17 17:19:35","2010-11-18 11:07:57","Android XML parsing with different element names","<android><xml><parsing><sax>","4","2","","",""
"4206792","1","4207185","","2010-11-17 16:38:34","0","1292","<p>I am using preferences, and this snippet of XML always causes my application to stop unexpectly when I hit a menu settings button which is supposed to display a list of preferences. I can use CheckBoxPreference and ListPreference successfully but I cannot use DialogPreference. I cannot seem to find an example XML snippet anywhere.</p><p></p><p>I need this dialog to collect a phone number in a string.</p>","479542","","479542","","2010-11-17 17:02:45","2010-11-17 17:16:41","DIalogPreference Problem","<android>","1","1","","",""
"4207041","1","4207554","","2010-11-17 17:02:23","0","317","<p>I want to know which activity calls current activity.I have three activity namely A,B and C. i am calling activity C from A or B. In activity C i want to know which activity calls A or B.</p><p>I used bundle to identify activity but i dont want this.. Is any other smart way to find my case?</p><p>Thanks in Advance...  </p>","405640","","","","","2010-11-17 18:02:29","Identify activity in Android?","<android><activity>","1","0","","",""
"4207067","1","4207237","","2010-11-17 17:04:58","9","24518","<p>I am developing an application,In my application i am display images using <code>ImageView</code> from url using xml parsing,i want to display zoom image,when i double touch on the Image,then again double touch on zoomImage,i want to reset image.How to implement in image using andorid</p><p>Thanks All</p>","500595","","","","","2012-11-07 09:03:30","How to implement touch listener on image?","<android>","1","0","11","",""
"4207068","1","4208110","","2010-11-17 17:05:01","1","5378","<p>I have some strings in a xml, for example</p><pre><code>&lt;string name=""String1""&gt;My String 1&lt;/string&gt;&lt;string name=""String2""&gt;My string 2&lt;/string&gt;</code></pre><p>and I want to show in the activity something like <strong>My String 1: My string 2</strong></p><p>Is it possible to add to the same TextView more than a</p><pre><code>&lt;TextView android:text=""@string/String1""/&gt;&lt;TextView android:text="": ""/&gt;&lt;TextView android:text=""@string/String2""/&gt;</code></pre><p>The problem of this is that if you insert them inside a TableLayout they are considered as cells and the "":"" symbol is not written next to String1 (it's written in the middle of both Strings).</p><p>Is it possible to join the string in just one TextView in the xml code (without doing it programmatically in Java)?I mean is there any syntax to append strings something like</p><pre><code>&lt;TextView android:text=""@string/String1+:+@string/String2""/&gt;</code></pre><p>Thanks</p>","249699","","","","","2010-11-17 22:12:37","Add more than one String to a TextView","<android><xml><layout><textview>","4","0","","",""
"4207120","1","4207229","","2010-11-17 17:10:38","0","2292","<p>I have an Object that I need to be able to pass between Activites. It implements Parcelable and I've written all the code related to that.</p><p>The problem is that one of the properties of the Object is a Drawable - and really needs to be. Unfortunately, Drawable is neither Parcelable or Serializable.  I don't understand how to pass it.</p><p>The reason for having the Drawable is that I need to cache an Image that I've downloaded from the internet at runtime.  I don't want to cache the images on the filesystem, since this would  potentially end up using up a lot of space over time.</p><p>I'm putting the image into a Drawable so that I can easily put it into an ImageView.</p><p>Any Ideas?</p>","398293","","","","","2013-09-10 16:09:27","Need to pass an un parcelable object between activities","<android>","4","1","","",""
"4207142","1","4207219","","2010-11-17 17:12:55","1","108","<p>I'm trying to understand why android uses two sets on numbers , platform version and API level. API Level, documentation states that ""Each Android platform version supports exactly one API Level"", does that mean, Google can provide a new(improved) platform, but still decides to go with earlier API level thus not making any change in Java API's for the developers in the new platform. Is my understanding correct? Also, what changes happen when platform version changes? </p>","260298","","","","","2010-11-17 17:18:39","why two numbers in android","<android>","1","1","","",""
"4207150","1","","","2010-11-17 17:13:36","0","131","<p>As in Java (android) to duplicate the bitmap?Displaying them with canvas.</p><pre><code>canvas.drawBitmap (_image, 0, 0, null);</code></pre>","500067","","881229","","2014-02-14 21:13:16","2014-02-14 21:13:16","Duplicate objects","<java><android><image><duplicates>","1","5","","2014-02-14 22:23:33",""
"4207227","1","4207280","","2010-11-17 17:19:38","3","2760","<p>I'd like to highlight the text in an EditText when a keyboard opens for user input (this could be a hardware keyboard or the virtual keyboard).</p><p>Highlighting isn't my problem, my problem is a trigger to highlight.  Is there a handler that gets executed when the keyboard appears on a specific View (in this case, my EditText)?  Are there different handlers for hardware keyboard vs virtual keyboard?</p>","406790","","","","","2010-11-17 17:27:37","Highlight text in EditText when keyboard opens","<android><keyboard>","1","0","","",""
"4207284","1","4207309","","2010-11-17 17:28:21","0","243","<p>Here's some brief background on my question; maybe the real answer is to just change my approach. </p><p>I have an application that can run all by itself, but certain activities can be called using intents from outside the application.  Lately, I've been using a little test app I built to try this out, and any time I change the code in my main application, I have to run it, close it, then run the test app.  </p><p>Not too big a deal, really.  Still, I'm curious to find out if there's a way to just install new code without having the app launch on the phone.  </p>","387781","","","","","2010-11-17 22:09:15","How do I install my apk on the phone without running it?","<android><eclipse>","2","0","","",""
"4207295","1","","","2010-11-17 17:29:24","0","374","<p>In android i wrote a program that sends a string value to a servlet post method.</p><p>in the servlet, by using request.getParameter() i can receive the data.</p><p>Is the same applied to struts2? how to get the request parameter string in struts2 or anyother way to obtain the request parameter string. </p>","511102","","","","","2010-11-17 20:39:06","In struts2 how can i get request parameter from android","<android><struts2>","1","0","","",""
"4207322","1","4212097","","2010-11-17 17:31:49","0","399","<p>I would like to get in my file browser <code>File</code> reference to external disk not SD Card. I mean I know that there is method</p><pre><code>Environment.getExternalStorageDirectory();</code></pre><p>But to my knowledge this will get reference to SD Card. But how to get external disk (say kind of USB storage attached to Android device)? You know that device can have both SD card and external USB stick attached to them.</p>","472270","","","","","2010-11-23 16:55:27","How to get `File` reference to external disk?","<android>","2","0","","",""
"4207387","1","4223997","","2010-11-17 17:39:05","2","541","<p>I'm having three strings that I have to glue together.</p><p>I have an input string (string 1), which I have to run a regex (which has groups) on (string 2) and extract these groups to put them in a template (string 3) using backreferences.</p><p>A short example could be :</p><pre><code>input: ""foo1234bar5678""regex: "".*?(\\d*).*?(\\d*).*""template: ""answer: $1 $2""</code></pre><p>which should be expanded in ""answer: 1234 5678"".</p><p>I have been using java.util.regex.Pattern, but I can't figure out a way to do this with matchers. Obviously, replaceAll is not the expected behaviour, nor is append*. </p><p>Is there a way to do this nicely using the android API ?</p><p>EDIT:Here is a basic implementation :</p><pre><code>public static String genOutput(String regex, String input, String template) {    Pattern p = Pattern.compile(regex);    Matcher m = p.matcher(input);    if (m.find()) {         for (int i = 1; i &lt;= m.groupCount(); i++) {             template = template.replaceAll(""\\$"" + i, m.group(i));         }    }        return template;}</code></pre>","441509","","441509","","2010-11-18 09:08:32","2010-11-19 12:54:08","Extract data and format them using RegEx","<java><android><regex>","4","0","1","",""
"4207434","1","4207605","","2010-11-17 17:44:18","0","394","<p>I need to make a screen that will add options as the user clicks on another preference.</p>","511082","","","","","2010-11-17 18:09:00","Can I make part of my preferences a dynamic list?","<android><android-layout>","1","2","","",""
"4207562","1","","","2010-11-17 18:03:43","24","23431","<p>I need to scale down images coming from a Network stream without losing quality.</p><p>I am aware of this solution <a href=""http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue"">Android: Strange out of memory issue</a> but it is too coarse - <code>inSampleSize</code> is an integer and does not allow finer control over the resulting dimensions. That is, I need to scale images to specific h/w dimensions (and keeping aspect ratio).</p><p>I dont mind having a DIY bicubic/lancoz algorithm in my code but I cant find any examples that would work on Android as they all rely on Java2D (JavaSE).</p><p>EDIT:Ive attached a quick source. The original is 720x402 HD screen capture. Please ignore the top 2 thumbnails. The top large image is resized automatically by android (as part of layout) to about 130x72. It is nice and crisp. The bottom image is resized with API and has severe artifacting</p><p><img src=""http://i.stack.imgur.com/kp3he.png"" alt=""alt text""></p><p>I've also tried using the BitmapFactory and, as I said earlier, it has two problems - no way to scale to exact size and the scaled image is blurry.</p><p>Any ideas on how to fix the artifcating?</p><p>Thanks, S.O.!</p><pre><code>    package qp.test;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Matrix;import android.os.Bundle;import android.widget.ImageView;public class imgview extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Bitmap original = BitmapFactory.decodeResource(getResources(), R.drawable.a000001570402);        Bitmap resized = getResizedBitmap(original, 130);        //Bitmap resized = getResizedBitmap2(original, 0.3f);        System.err.println(resized.getWidth() + ""x"" + resized.getHeight());        ImageView image = (ImageView) findViewById(R.id.ImageViewFullManual);        image.setImageBitmap(resized);    }    private Bitmap getResizedBitmap(Bitmap bm, int newWidth) {        int width = bm.getWidth();        int height = bm.getHeight();    float aspect = (float)width / height;    float scaleWidth = newWidth;    float scaleHeight = scaleWidth / aspect;        // yeah!    // create a matrix for the manipulation    Matrix matrix = new Matrix();    // resize the bit map    matrix.postScale(scaleWidth / width, scaleHeight / height);    // recreate the new Bitmap    Bitmap resizedBitmap = Bitmap.createBitmap(bm, 0, 0, width, height, matrix, true);        bm.recycle();        return resizedBitmap;    }    private Bitmap getResizedBitmap2(Bitmap bm, float scale) {    /*    float aspect = bm.getWidth() / bm.getHeight();        int scaleWidth = (int) (bm.getWidth() * scale);        int scaleHeight = (int) (bm.getHeight() * scale);*/        // original image is 720x402 and SampleSize=4 produces 180x102, which is        // still too large        BitmapFactory.Options bfo = new BitmapFactory.Options();        bfo.inSampleSize = 4;        return BitmapFactory.decodeResource(getResources(), R.drawable.a000001570402, bfo);    }}</code></pre><p>And the 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    &gt;&lt;!-- &lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""hullo"" android:background=""#00ff00""    /&gt;     --&gt;    &lt;ImageView android:id=""@+id/ImageViewThumbAuto""            android:layout_width=""130dip"" android:layout_height=""72dip""            android:src=""@drawable/a000001570402""  /&gt;    &lt;ImageView android:id=""@+id/ImageViewThumbManual""            android:layout_width=""130dip"" android:layout_height=""72dip""            android:src=""@drawable/a000001570402""              android:layout_toRightOf=""@id/ImageViewThumbAuto""            /&gt;&lt;ImageView android:id=""@+id/ImageViewFullAuto"" android:layout_width=""300dip""            android:layout_height=""169dip""            android:scaleType=""fitXY""            android:src=""@drawable/a000001570402""            android:layout_below=""@id/ImageViewThumbAuto""            /&gt;&lt;ImageView android:id=""@+id/ImageViewFullManual"" android:layout_width=""300dip""            android:layout_height=""169dip""            android:scaleType=""fitXY""            android:src=""@drawable/a000001570402""            android:layout_below=""@id/ImageViewFullAuto""            /&gt;&lt;/RelativeLayout&gt;</code></pre>","450741","","450741","","2010-11-18 18:54:01","2014-03-25 11:02:31","Android: high quality image resizing / scaling","<android><algorithm><image><scaling>","3","2","11","",""
"4207628","1","","","2010-11-17 18:10:50","0","172","<p>I am trying to work out a solution here. I am currently developing an App that streams live recordings.  If the User manually changes the Volume Control Keys, I would like this change to notify the App and reflect/update this change on the Virtual Volume Slider Bar in the App?</p>","511150","","","","","2010-11-17 18:13:28","How to send a notification to an Android App that the User has manually changed the Volume Control Keys?","<android><development-environment>","1","1","","",""
"4207709","1","4209356","","2010-11-17 18:19:44","3","23965","<p>I am using Windows 7 64bit and I am trying to get my computer to detect my HTC Desire, but it's not picking it up. I have everything available installed through the Android Updater and I have got my phone running through Ubuntu, so it is definitely a problem with Windows. Does anyone know what's wrong or how to get it working or both?</p><ul><li><p>I am using Windows 7 64 bit</p></li><li><p>I have a HTC Desire running Stock 2.2 (Froyo) that works with USB Debugging on my Ubuntu machine</p></li><li><p>Windows does detect that my phone is plugged in. It shows as a mass storage device.</p></li><li><p>I have all the available things installed via the Android Updater.</p></li></ul>","348261","","348261","","2010-11-17 18:38:36","2014-04-05 21:52:23","Problems trying to get USB Debugging working on Windows 7 (Android)","<android><windows><debugging><usb><htc>","6","2","1","",""
"4207872","1","4207960","","2010-11-17 18:37:24","1","1088","<p>I'm trying to insert text into my SQLite database, but for some reason it doesn't work. It never executes..</p><p>Code below (this is my function that I'm calling):</p><pre><code>public void setInfo(final String tableName, final int id, final String title, final String time, final String content) {    final String sql = ""INSERT INTO "" + tableName + ""(""+DB_COLUMN_ID+"", ""+DB_COLUMN_TITLE+"", ""+DB_COLUMN_TIME+"",""+DB_COLUMN_CONTENT+"")"" +     "" VALUES ('""+id+""', '""+title+""', '""+time+""','""+content+"""";    final SQLiteStatement stmt = mDatabase.compileStatement(sql);     stmt.execute();} </code></pre><p>Thanks in advance!</p>","386562","","","","","2010-11-17 18:46:04","Can't insert text into my SQLite database","<android>","1","3","","",""
"4207880","1","4208067","","2010-11-17 18:38:17","46","24053","<p>I have a vertical sliding drawer at the bottom of my app. When the soft keyboard opens, it pushes the tab for the drawer up, so it sits atop the keyboard. I actually want it to remain at the bottom of the screen, becoming hidden when the keyboard is shown. </p><p>Anyone else run into this issue? Know how to fix it?</p>","413414","","","","","2014-04-02 21:09:06","Android: How do I prevent the soft keyboard from pushing my view up?","<android><layout><keyboard><view>","6","2","9","",""
"4208058","1","","","2010-11-17 18:57:37","1","3895","<p>I'm trying to encapsulate certain layouts that I've made, to help me dry up my android xml ui files. </p><p>I have the following code:</p><pre><code>        &lt;LinearLayout            android:id=""@+id/LinearLayout02""            android:layout_height=""wrap_content""            android:layout_width=""fill_parent""            android:orientation=""horizontal""&gt;            &lt;TextView                style=""@style/text_view_small""                android:id=""@+id/time""&gt;&lt;/TextView&gt;            &lt;TextView                style=""@style/text_view_small""                android:id=""@+id/number_of_worlds""&gt;            &lt;/TextView&gt;        &lt;/LinearLayout&gt;</code></pre><p>I want to simply convert it to the following</p><pre><code>&lt;DoubleTextView&gt;&lt;/DoubleTextView&gt;</code></pre><p>Once done I want to be able to use the ""widgit"" in other xml files.Are there any particular resources or examples that I can look at to help me figure out how to do this?</p>","431435","","50776","","2012-07-12 12:45:05","2012-07-12 12:45:05","Creating custom XML widgets for Android UI","<android><refactoring><android-ui><android-xml>","1","0","1","",""
"4208082","1","4208121","","2010-11-17 19:00:15","4","3106","<p>So I want an intent to start an Activity that simply brings up a dialog popup box telling the user how to use the app.</p><p>I have the code:</p><pre><code>private final View.OnClickListener btnClick = new View.OnClickListener() {    @Override    public void onClick(View v) {        switch (v.getId()) {        case R.id.about_box:            Intent i = new Intent(this, About.class);            startActivity(i);            break;        }    }}</code></pre><p>but the Intent is giving me the error:</p><blockquote>  <p>The constructor Intent(new View.OnClickListener(){}, Class) is  undefined</p></blockquote><p>Any idea on workarounds?</p><p>Thanks.</p>","496686","","844882","","2012-03-21 07:44:44","2013-11-15 03:51:15","Creating an intent in a new method","<android><button><activity><android-intent>","5","1","2","",""
"4208184","1","4208220","","2010-11-17 19:13:22","1","1987","<p>I want to create layout like this on facebook app. ?o appear with effect from bottom to top.</p><p>I don't know where to find example (xml and code) for this </p><p>Thanks</p><p><img src=""http://i.stack.imgur.com/dYlZK.jpg"" alt=""alt text""></p>","432848","","","","","2010-11-17 19:43:09","Android floating layout with buttons","<android>","1","0","1","",""
"4208346","1","4212083","","2010-11-17 19:31:56","4","5080","<p>Is there a plugin or something I can use to develop Android Apps with visual studio 2010, I'm most interested in free plugins, I know about <a href=""http://www.monodroid.net"" rel=""nofollow"">monodroid</a>, but to my knowledge it's quite a price solution, so if there are other ways I'd be very happy.</p>","347904","","347904","","2010-11-17 20:05:28","2013-01-14 14:36:19","Is it possible to develop Android apps with visual studio 2010","<android><visual-studio-2010>","5","4","1","",""
"4208401","1","4208721","","2010-11-17 19:38:44","3","2774","<p><strong>Info</strong></p><ul><li>I have a class SensorClass that manages some sensors.</li><li>I have an interface with method A().</li><li>I have a tester class TestClass that implements the interface with method A() and passes this implementation to SensorClass. TestClass extends Activity.</li></ul><p><strong>Objective</strong></p><ul><li>Every X seconds I need to call the implemented method of the interface stored in SensorClass. It's a callback.</li><li>I don't know how is implemented method A(), so it can modify views of its activy.</li><li>I need a Timer because I want to start the callback -executing method A() from the stored interface in SensorClass- every X seconds. Thus, I do the following:</li></ul><pre>public void do (){ timer.scheduleAtFixedRate (new TimerTask (){  public void run (){   storedInterface.A ();  } }, 0, speed);}</pre><ul><li>But as I said I don't know how is implemented A(). I have to run the method within runOnUIThread() because it can modify views.</li></ul><pre>private void startCallback (){ runOnUiThread (new Runnable (){  public void run (){   storedInterface.A ();  } });}public void do (){ timer.scheduleAtFixedRate (new TimerTask (){  public void run (){   startCallback ();  } }, 0, speed);}</pre><ul><li>Problem: SensorClass is not an Activity, so runOnUIThread() will cause an error.</li></ul><p><strong>Posible workaround</strong></p><p>Extend SensorClass from an Activity but SensorClass is not an Activity with methods onCreate(), onPause(), etc!!! I don't like this solution.<br/><br/><br/>My question is: How can I call runOnUIThread() within a class that only recieves a context from an Activity? Or... Is there any other solution for my problem?</p><p>Thanks.</p>","458093","","458093","","2013-05-03 16:31:25","2013-05-03 16:31:25","Timer with callback","<android><multithreading><timer>","1","0","2","",""
"4208443","1","4208483","","2010-11-17 19:42:43","0","639","<p>I have android code the display a list of users information , and sometime it needs to have a scroll bar to display all users ?? and sometimes not.. how can i set scrolllayout dynamically not in xml layout file ??</p>","508377","","","","","2010-11-17 19:54:35","how to add scrollview dynamically in android","<android>","3","0","","",""
"4208445","1","4209991","","2010-11-17 19:43:04","0","412","<p>From what I can tell, there is no way to load a string from a specific locale's language file.</p><p>What I want to do is run all my locales' (I have 24 of them) time format strings through unit tests to make sure they don't crash.  For example, here's a date format string in French: ""'Hier à' h:mm a"".</p><p>These really need to be unit tested, because translators aren't great about properly escaping these strings, causing crashes unless we manually verify every string in every language every time we get a translation pass back.</p><p><a href=""http://stackoverflow.com/questions/2264874/android-changing-locale-within-the-app-itself"">This question</a> has a sort-of answer.  Is that really the only way?  Is there a better way to specify the locale of a Context in unit tests?</p>","205192","","","","","2013-07-30 22:06:32","Android - Unit testing localizations","<android><unit-testing><localization>","2","0","","",""
"4208458","1","4208479","","2010-11-17 19:44:50","2","4192","<p>I'm looking to see if there's a system notification I can listen for to see when the screen turns off/on.  Any thoughts?  Something similar to when the network connects/disconnects.</p>","227313","","","","","2013-09-26 05:01:45","Android notification of screen off/on","<android>","3","0","1","",""
"4208567","1","4208630","","2010-11-17 19:56:44","0","326","<p>I have an android activity which has a header, some title text, and then I want to dynamically generate a given number of tables. In addition, I want to be able to scroll down to view all of the tables on the activity (not scroll the individual tables). Is this possible? If so, can someone provide me with some guidance?</p><p>If not, the only other thing that I can think of is a list view. However my problem here is that I don't want the list view look and feel. I want a ""break"" between the different groupings of information. So, for example:</p><pre><code>-------------------| January 7, 2010 |-------------------|  Item #1        ||  Item #2        |--------------------------------------| January 8, 2010 |-------------------|  Item #1        ||  Item #2        |   |  Item #3        |-------------------etc...</code></pre><p>Does anyone have any ideas?</p>","123891","","","","","2010-11-17 20:03:02","Android dynamically generating tables","<java><android><table><listview>","1","0","","",""
"4208689","1","","","2010-11-17 20:07:59","4","8821","<p>I have an image that I have created at a larger dimension than how it will most likely be displayed.  Let's say it's 200x200.  I'm testing on a device that is 800x480 in landscape mode.  My goal is to have this image resize to 1/4th the height of the current view, dock to the top right corner, and also maintain the aspect ratio.  This would mean when viewing at 800x480, my image would be in the top right corner displaying at 120x120.</p><p>I thought the way to do this was to use a vertical LinearLayout with a weightSum and layout_weights among the elements (using empty elements with layout_weight for padding if necessary) and adjustViewBounds=true on the ImageView, but I'm not able to get the effect I'm going for.  Any ideas?</p>","53501","","","","","2011-09-22 13:04:52","Android layout, resize by percentage and maintain proportion","<android><layout>","2","0","1","",""
"4208730","1","4210524","","2010-11-17 20:13:13","23","11380","<p>User start MyAPP and logs in.Selects Session Timeout to be 5 mins.Does some operations on the app.......(all in foreground)Now User bring Myapp to background and starts some other app  ----> Count down timer starts and logs out user after 5 minsOR user turns the screen OFF  ----> Count down timer starts and logs out user after 5 mins</p><p>My Question:</p><p>I want this same behavior even when the app is in the foreground but user doesn't interact with the app for a long-time say 6-7 mins... Assume the screen is ON all the time... I want to detect kind of USER INACTIVITY (No interaction with app even though the app is in the foreground) and kick start my count down timer.</p><p>Thanks in advance.</p>","324446","","179850","","2011-02-21 19:11:11","2013-08-14 13:08:33","How to detect USER INACTIVITY in android","<android><user-interface><user-experience><user-inactivity>","6","1","8","",""
"4208761","1","4208822","","2010-11-17 20:17:49","0","2078","<p>I need to develop an app that reads info from google calendar on Android.The question is, is there a way to connect to the local calendar or should I use the google calendar API and read the info from the internet?  (or maybe another way)  </p><p>as far as I know, there are ways to connect to the local calendar, but non of them are official ones, and it breaks in different versions of android.</p><p>(by google calendar API I mean  <a href=""http://code.google.com/apis/calendar/"" rel=""nofollow"">http://code.google.com/apis/calendar/</a> )</p><p>Thanks</p>","237115","","","","","2010-11-29 21:18:51","android - google calendar","<android><api><google-api><google-calendar>","2","0","1","",""
"4208789","1","4208818","","2010-11-17 20:20:19","2","592","<p>I have an app that snaps a picture and displays the picture on an Imageview.  The problem is, I can only snap a pic in landscape mode in order for the bmp to be displayed right side up - Is there a way I can rotate it to right side up if the pic is taken in portrait mode/</p><p>Thanks!</p><p>Here is the code I use to place the image in the img view - </p><pre><code>  private void processCameraImage(Intent intent) {    setContentView(R.layout.detectlayout);    ((Button) findViewById(R.id.detect_face)).setOnClickListener(btnClick);    ImageView imageView = (ImageView) findViewById(R.id.image_view);    cameraBitmap = (Bitmap) intent.getExtras().get(""data"");    imageView.setImageBitmap(cameraBitmap);</code></pre><p>There is a detect faces button that will detect if there are faces present.</p>","496686","","","","","2011-08-03 18:37:59","Rotating a bmp and displaying it right-side-up","<android><imageview><bmp><autorotate>","2","0","","",""
"4208886","1","4208947","","2010-11-17 20:34:12","58","37131","<p>I'm working on a fairly complex Android application that requires a somewhat large amount of data about the application (I'd say a total of about 500KB -- is this large for a mobile device?).  From what I can tell, any orientation change in the application (in the activity, to be more precise) causes a complete destruction and recreation of the activity.  Based on my findings, the Application class does not have the same life-cycle (i.e. it is, for all intents and purposes, always instantiated).  Does it make sense to store the state information inside of the application class and then reference it from the Activity, or is that generally not the ""acceptable"" method due to memory constraints on mobile devices?  I really appreciate any advice on this topic.  Thanks!</p>","459783","","","","","2013-06-19 14:54:54","Using the Android Application class to persist data","<android><application-lifecycle>","5","2","31","",""
"4208887","1","4208949","","2010-11-17 20:34:16","1","80","<p>I was studying some sample examples for Android and one of them got me really curious: the NoteList (or Notepad) example application - <a href=""http://developer.android.com/resources/tutorials/notepad/index.html"" rel=""nofollow"">here</a></p><p>My question is: Is there any way to make a NoteList shortcut, that always starts the application with its 'Editor' activity, for example.  [of course if the creator of that 'third-party' application intended to make it possible by describing the entry points of its application in a proper way in the manifest file. I do not intent to create malware.]</p><p>in other words:</p><p>Can a third-party application (like the one I wish to make :) ) to get to internal application intents {i.e. action, activity, data} or this is handled by Android and no one else?</p><p>What gave the idea that this is possible was the following case:I opened NoteList, created a few note, and when I was editing the title of one of the notes - I pressed HOME, when I clicked on the icon of NoteList I got the exact same state of the application - editing the title of the note.</p><p>thanks!</p>","481828","","","","","2010-11-17 20:59:08","Who manages interlal application intents?","<android><android-intent>","1","0","","",""
"4208889","1","","","2010-11-17 20:34:24","0","76","<p>Hi Im new to android. I want to display text such that it would be like:</p><ol><li>TITLE 1.1</li></ol><p>text about title 1.1</p><ol><li>TITLE 1.2</li></ol><p>text about title 1.2</p><ol><li>TITLE 2.1</li></ol><p>text about title 2.1</p><blockquote>  <blockquote>    <p>and so on</p>  </blockquote></blockquote><p>it would be a scrolling windows, but another problem is text could be lengthy and could span multiple lines. What do you recommend i should breakup my layout with. The length will be more then the screen height so i need scrollbars. Plus need to keep title bold.</p><p>Basically i would be printing this text from a String Array. Is it possible to display it directly from arrays or i can also work with simple strings but need to know how should i breakup my layout. like scrollview -> table layout or what??</p><p>Thanks,</p>","507112","","","","","2011-03-17 07:12:02","Android Layout, displaying Multiple Colums","<android>","1","0","","",""
"4208928","1","4209448","","2010-11-17 20:39:26","3","3887","<p>I'm fading out an imageview with alpha animation. I'd like the image to stay transparent after the animation. Tried with different combinations of fillAfter and fillEnabled, no luck. How can this be achieved?</p><p>pom</p>","54155","","","","","2011-02-21 05:24:18","Android alpha animation: Staying in last animation frame when animation is completed","<android><animation>","2","0","","",""
"4208978","1","4209143","","2010-11-17 20:44:25","0","434","<p>In my app, I snap a picture, display it, and detect for faces.  Is there a way, for when the user hits the 'Detect Faces' button, for me to have the app delay for a few seconds, and have a popup box with the dialog: 'Detecting...' show up?  Also, can I get a tiny animation below it (like an hourglass, or a spinning circle)?</p><p>Thanks!</p>","496686","","","","","2010-11-17 21:03:22","How to pause the app for a second, and display a popup with animation","<android><animation><popup>","1","2","0","",""
"4209054","1","4228144","","2010-11-17 20:53:29","5","1791","<p>Does anyone know how to enable blending in OpenGL (android) on a HTC Desire. I am trying to draw colored triangles and using the alpha value of the color buffer to blend them with the background (or another triangle).</p><p>It works both on the emulator (2.1) and on a htc hero 2.1 but not on my desire with 2.2. Is there some hardware difference between a hero and a desire that causes this?</p><p>The main stuff from the code is (not in order): </p><pre><code>gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);gl.glEnable(GL10.GL_BLEND);         gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);private final static float[] colors = {       1f, 0f, 0f, 0.5f, // point 0 red       1f, 0f, 0f, 0.5f, // point 1 red       1f, 0f, 0f, 0.5f, // point 2 red       1f, 0f, 0f, 0.5f, // point 3 red       1f, 0f, 0f, 0.5f, // point 4 red       1f, 0f, 0f, 0.5f, // point 5 red       1f, 0f, 0f, 0.5f, // point 6 red       1f, 0f, 0f, 0.5f, // point 7 red};</code></pre><p>PS. I can provide more code if someone needs it...</p>","511299","","387076","","2012-05-12 20:18:19","2012-05-12 20:18:19","Why does OpenGL blending not work on HTC Desire?","<opengl-es><alphablending><android><glblendfunc>","1","8","1","",""
"4209070","1","4209087","","2010-11-17 20:54:34","2","245","<p>I'm very much a creature of habit, and feel most at home editing in vim, jumping back and forth in screen.  That said, I'm really enjoying Android development, with Eclipse being the only major point that I find a PITA (no offense to Eclipse fans, I'm sure it's a great tool, it's just not the bee's knees for me).  </p><p>Can anyone point me to a tutorial or resource on getting set up to do Android development entirely outside the Eclipse tool chain?</p>","458290","","","","","2010-11-17 22:20:45","Android Development Outside Eclipse","<android>","2","0","","",""
"4209270","1","4209385","","2010-11-17 21:19:07","3","5301","<p>I want to make a dummy progress dialog appear for 2 or 3 seconds.  It won't actually do anything other than say detecting.  I have the code:</p><pre><code>    ProgressDialog dialog = ProgressDialog.show(this, """", ""Detecting..."",            true);    dialog.show();    dialog.dismiss();</code></pre><p>But what do I put in between the show, and the dismissal to have the dialog appear for a few seconds?  Thanks!</p>","496686","","","","","2012-10-17 08:00:07","Add a delay to Progress Dialog","<android><delay><progressdialog>","3","0","0","",""
"4209339","1","4306230","","2010-11-17 21:27:54","0","4526","<p>I'm trying to replace MultiAutoCompleteTextView Drop down list with a ListView, which it should have same functionality as drop down list, that means, when I click in one of items it should be added to MultiAutoCompleteTextView box, o so on, but filtering the ListView as you type.</p><p>So I came up with this raw code without success:</p><p>filterable_listview.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=""vertical""&gt; &lt;MultiAutoCompleteTextView  android:layout_height=""wrap_content"" android:layout_width=""fill_parent""  android:hint=""@string/To"" android:id=""@+id/search_box""&gt;&lt;/MultiAutoCompleteTextView&gt; &lt;ListView android:id=""@android:id/list"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" android:layout_weight=""1""/&gt;&lt;/LinearLayout&gt;</code></pre><p>AutoCompleteActivity.java</p><pre><code>protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.filterable_listview);manager = new ContactManager();adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, manager.getContacts());searchEdit = (MultiAutoCompleteTextView) findViewById(R.id.search_box);searchEdit.addTextChangedListener(filterTextWatcher);searchEdit.setTokenizer(new SpaceTokenizer());setListAdapter(adapter);getListView().setOnItemClickListener(  new ListView.OnItemClickListener() {  public void onItemClick(AdapterView&lt;?&gt; parent, View view,                          int position, long id) {                    //Here is one issues    searchEdit.append(adapter.getItem(position));  } });}private TextWatcher filterTextWatcher = new TextWatcher() {      public void afterTextChanged(Editable s) {      }       public void beforeTextChanged(CharSequence s, int start, int count,int after) {      }      public void onTextChanged(CharSequence s, int start, int before, int count) {           adapter.getFilter().filter(s);      }};</code></pre><p>I have to main problems:</p><p>1) When I click an item, the whole selected text is appended,   I know the problem relies on:</p><p>searchEdit.append(adapter.getItem(position)); </p><p>but, How can I do spanning text like regular autocomplete does ?</p><p>2) Once one item was selected, next input don't show the suggestion any more (despite of SpaceTonekizer)</p><p>I hope my explanation was clear.</p><p>Thanks in advance</p>","470322","","470322","","2010-11-17 21:38:11","2010-12-08 13:52:44","How to replace MultiAutoCompleteTextView drop down list","<android><listview><autocomplete><filter>","1","0","2","",""
"4209382","1","4574317","","2010-11-17 21:32:58","9","6312","<p>SDK level 8 (Froyo) has introduced the native capability for the MediaPlayer to connect to a streaming source, like Shoutcast. Previous SDK versions were able to do workarounds, such as run a local proxy on the device (see <a href=""http://code.google.com/p/npr-android-app/"" rel=""nofollow"">NPR</a>).</p><p>I took the same approach as NPR and am using a StreamProxy. However, NPR first checks if the currently running SDK is less than 8. If so, it uses the proxy. Otherwise, it connects directly.</p><p>My StreamProxy requests metadata from the Shoutcast server, so it does not simply route the data from Shoutcast to my client. Instead, it parses out metadata and uses it accordingly, and only routes the music data.</p><p>When trying to use the StreamProxy at SDK level 8 or above, the MediaPlayer fails to prepare. My StreamProxy receives the connection and accepts it, but after successfully writing out the status line and headers to the client, the next write produces <code>java.net.SocketException: Connection reset by peer</code>. This results in the client's mediaplayer throwing an <code>Error(1,-1007)</code>.</p><p>I am trying to figure out why the MediaPlayer is unable to connect to my local proxy. It should be the same as connecting to the original source without the metadata, which <strong>does</strong> work. I am forwarding on all headers from the external source, through my proxy, which includes content-type.</p><p>I will continue looking into it, but I feel like I'm at a dead-end. Let me know if more details are needed.</p>","499610","","995926","","2012-05-22 07:58:16","2012-05-22 07:58:16","Streaming with Android MediaPlayer in SDK 8","<android><proxy><stream><media-player><android-2.2-froyo>","2","1","9","",""
"4209404","1","4219248","","2010-11-17 21:36:50","4","7407","<p>If (in Android) I have an EditText box, how can I trigger an event when the user has finished entering data and hits return/Next?</p><p>I have tried using the code below but it seems to have no effect. I also get an 'The method onEditorAction(EditText, int, KeyEvent) from the type new extView.OnEditorActionListener(){} is never used locally' error.</p><pre><code>myEditText.setOnEditorActionListener(new EditText.OnEditorActionListener() {            public boolean onEditorAction(EditText v, int actionId, KeyEvent event) {                if (actionId == EditorInfo.IME_ACTION_NEXT)                {</code></pre>","497517","","497517","","2010-11-18 15:35:27","2013-04-10 00:33:59","How do I trigger an action when the user has hit enter?","<android><triggers><edittext>","3","0","0","",""
"4209416","1","","","2010-11-17 21:38:03","0","409","<p>I want to display contact information in a custom layout.  My app lets the user select a contact, then I retrieve key pieces of info on that contact (phone #'s, email addy's, etc).  I want to display them to the user so they look grouped logically.  Sort of like a series of tables, so phone numbers, then email addys, then organization, etc.</p><p>I have a table format that I've been using in a different part of the app where I know the exact number of rows I'm adding and I have defined styles for the rows already.  I want to reuse those styles for this data, but android sdk won't allow for you to set the style attribute programmatically.</p><p>I could create the tables in code and set all the attributes the same as in my defined styles, but it seems like a lot of extra coding.  Any ideas on how I should approach this problem?  Thx.</p><p>Rob W.</p>","326430","","","","","2010-11-17 21:49:27","How to deal with dynamic lists of data in a layout","<android><table><layout><dynamic><coding-style>","1","0","","",""
"4209579","1","4209672","","2010-11-17 21:59:19","1","1662","<p>I have a simple java code which gets html text from the input url:</p><pre><code>try {    URL url =  new URL(""www.abc.com"");    // Get the  response    BufferedReader rd = new BufferedReader(new  InputStreamReader(url.openStream()));      while ((line  = rd.readLine()) != null) {      String code = code + line;     } catch (IOException  e){}</code></pre><p>I am using this code in an android project. Now the problem comes when there is no internet connectivity. The application just halts and later gives error.</p><p>Is there some way to break this after some fixed timeout, or even return some specific string after an exception is thrown. Can you please tell me how to do that??</p>","507112","","21234","","2010-11-17 22:18:14","2010-11-17 23:00:01","How to handle problem with Network Connectivity in Java","<java><android>","4","0","","",""
"4209582","1","4209653","","2010-11-17 21:59:41","5","18631","<p>How can I add an image to a button, rather than text?</p>","508377","","104223","","2013-07-18 00:40:03","2013-12-17 14:27:38","How to add image for button in android?","<android><image><button><imagebutton>","6","0","2","",""
"4209587","1","4222356","","2010-11-17 22:00:09","8","18450","<p>OK, I must be overlooking something silly because I am unable to get my tabhost to display in my Activity class.  I am getting the dreaded force close when I try to run the app.  It will work if i extend TabActivity, <strong>but I can't do that</strong> [see edit below] because once I move the code from my prototype project its going to be in a custom class that inherits from Activity.</p><p>Here is the XML 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=""@+id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;        &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;                &lt;TabWidget             android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;                    &lt;FrameLayout             android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>And here is the class that is trying to create and display the TabHost:</p><pre><code>import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.widget.TabHost;public class my_proto extends Activity{      /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState)   {      Log.i(this.toString(), ""OnCreate"");      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      Log.i(this.toString(), ""get tab host"");      TabHost host = (TabHost)findViewById(R.id.tabhost);       host.setup();      Log.i(this.toString(), ""add tabs"");      host.addTab(host.newTabSpec(""one"")                      .setIndicator(""First Results"")                      .setContent(new Intent(this, FirstResultsListViewActivity.class)));      host.addTab(host.newTabSpec(""two"")                      .setIndicator(""Second Results"")                      .setContent(new Intent(this, SecondResultsListViewActivity.class)));      Log.i(this.toString(), ""adjust tab size"");      host.getTabWidget().getChildAt(0).getLayoutParams().height = 35;      host.getTabWidget().getChildAt(1).getLayoutParams().height = 35;   }// end onCreate}// end class my_proto</code></pre><p>This is the error I get in the log.</p><pre><code>11-17 16:49:51.271: INFO/com.my_proto.my_proto@43b80b50(1302): OnCreate11-17 16:49:51.472: INFO/com.my_proto.my_proto@43b80b50(1302): get tab host11-17 16:49:51.480: INFO/com.my_proto.my_proto@43b80b50(1302): add tabs11-17 16:49:51.521: DEBUG/AndroidRuntime(1302): Shutting down VM11-17 16:49:51.521: WARN/dalvikvm(1302): threadid=3: thread exiting with uncaught exception (group=0x4001b188)11-17 16:49:51.530: ERROR/AndroidRuntime(1302): Uncaught handler: thread main exiting due to uncaught exception11-17 16:49:51.552: ERROR/AndroidRuntime(1302): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my_proto/com.my_proto.my_proto}: java.lang.IllegalStateException: Did you forget to call 'public void setup(LocalActivityManager activityGroup)'?11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.os.Handler.dispatchMessage(Handler.java:99)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.os.Looper.loop(Looper.java:123)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.app.ActivityThread.main(ActivityThread.java:4363)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at java.lang.reflect.Method.invokeNative(Native Method)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at java.lang.reflect.Method.invoke(Method.java:521)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at dalvik.system.NativeStart.main(Native Method)11-17 16:49:51.552: ERROR/AndroidRuntime(1302): Caused by: java.lang.IllegalStateException: Did you forget to call 'public void setup(LocalActivityManager activityGroup)'?11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:646)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.widget.TabHost.setCurrentTab(TabHost.java:320)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.widget.TabHost.addTab(TabHost.java:213)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at com.mc_proto.mc_proto.onCreate(my_proto.java:29)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)11-17 16:49:51.552: ERROR/AndroidRuntime(1302):     ... 11 more</code></pre><p>Its complaining about not calling setup, but I am calling it.  There is another version of setup that needs some kind of LocalActivityMananger.  I have tried replacing the call to setup the call below but no luck. </p><pre><code>LocalActivityManager mLocalActivityManager = new LocalActivityManager(this, false);host.setup(mLocalActivityManager);</code></pre><p>[edit] The call above didn't work so I took it back out.  Although I was getting a new error logged.</p><pre><code>11-17 20:24:58.382: ERROR/AndroidRuntime(1432): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my_proto/com.my_proto.my_proto}: java.lang.IllegalStateException: Activities can't be added until the containing group has been created.</code></pre><p>[edit] Based on some of the comments below I realized I need to be clearer about why I can't inherit from TabActivity.  Once I have the prototype working I need to port this into an existing app's screen that inherits from Activity.  I will need to load the TabHost into a Layout within that Activity.  It will basically be a LinearLayout with a row of status icons, followed my a LinearLayout with the Tabhost in it.  I know that if I can get this working I can move onto the next phase.  Thanks!</p><pre><code>---------------------------|      status icons       |---------------------------|    Tab, Tab, Tab        ||                         ||                         ||                         | ---------------------------|      status icons       |---------------------------</code></pre>","418714","","418714","","2010-11-18 02:17:02","2013-10-23 19:22:20","Android - Tabhost working in Activity class","<android><android-tabhost>","8","0","4","",""
"4209592","1","4209637","","2010-11-17 22:01:25","0","217","<p>How can I detect whether or not an Image View has a picture in it upon a button click.  I had a class that displays a picture and some results, but I don't want the user to be able to access those results (pushing the button) until the results have been written to that class.</p><p>So, I figured I needed to check to see if there was a picture displayed in the ImageView yet.</p><p>So something like:</p><pre><code>        case R.id.previous_box:            if (R.id.photoResultView == null){                            //throw up a dialog box saying they need to snap a pic first.            }            Intent j = new Intent(DTF.this, Result.class);            startActivity(j);            return;</code></pre><p>but obviouslt R.id.photoResultView == null isn't the right way to do it...anyone know how?</p><p>Tanks!</p><p>EDIT:  Line 184 </p><pre><code>    if (photoResultView.getDrawable() == null) {</code></pre><p>EDIT:</p><pre><code>        case R.id.previous_box:            if (photoResultView.getDrawable() == null) {                showToast(DTF.this, ""You have to take a picture first"");                return;            }            Intent j = new Intent(main.this, Result.class);            startActivity(j);            return;</code></pre>","496686","","496686","","2010-11-17 22:48:46","2010-11-17 22:55:27","Calling an id in an xml file in your class","<android><xml><if-statement><imageview>","2","0","","",""
"4209739","1","4209794","","2010-11-17 22:18:32","1","347","<p>Like the title says, is it possible? My purpose is to make a little logo on top of the ListView centered in the view pane</p><p>Thanks!</p>","133055","","495904","","2012-11-23 20:23:25","2012-11-23 20:23:25","Is it possible to add an image on top of a ListView?","<android>","1","0","1","",""
"4209814","1","4210482","","2010-11-17 22:27:18","9","16651","<p>My application launches a thread to query the web for some data.  I want to display a Toast message when nothing is found, but my application always crashes.</p><p>I've tried using the application Context from within the thread, like so:</p><pre><code>Toast.makeText(getApplicationContext(), ""testttt"", Toast.LENGTH_LONG).show();</code></pre><p>I've also tried creating a Runnable with the Toast call and calling runOnUiThread(runnable) from the Thread (the Toast call in this runnable uses the Activity as the first parameter).</p><p>Does anyone have any ideas on how to accomplish this?</p>","406790","","","","","2013-10-03 12:36:40","Posting Toast message from a Thread","<android><multithreading><toast>","4","2","1","",""
"4209918","1","4209949","","2010-11-17 22:42:00","0","446","<p>Does anyone know how to print stack traces for exceptions caught while running in the Android emulator in Eclipse?  I catch the exception and call .printStackTrace() but I cannot find where it is being written.  I have tried .printStackTrace(System.out) and .printStackTrace(System.err). I would be nice to be able to direct them to the Eclipse console.</p>","60231","","418183","","2010-11-17 22:44:11","2010-11-17 22:48:03","Reporting stack traces from ADT emulator","<java><android><exception-handling><android-emulator>","2","0","","",""
"4209960","1","4210221","","2010-11-17 22:47:32","1","576","<p>I know there are questions posted elsewhere about how to implement in-app purchases on iPhone and Android, but none answer the legality of the solutions today.  At the time of release, there was some dispute over whether some of these solutions violate terms of service, but it's now several months later.  There are also now several exceptions like Amazon, which seem to circumvent iTunes for purchases.</p><p>Anyone have a definitive answer?</p>","144088","","","","","2010-11-17 23:20:19","Do in-app purchasing providers like Zong, Paypal, and Boku violate iPhone and Android terms and conditions?","<iphone><android><paypal><itunes><in-app-purchase>","1","3","1","",""
"4209986","1","4212319","","2010-11-17 22:50:04","0","1344","<p>I developed a mobile website using jqtouch. It works fine in iPhone but doesnt work in android. </p><p>First the page loads properly in android but when we scroll then it doesnt display anything on the screen. But I am able to click on links and it navigates properly. So am assuming that there is text on the screen but its not getting displayed.</p><p>I did look at issues posted in google code where they said that its the problem with transparent gif and suggested to use base64 value. I tried that, even then its not working.</p><p>Any suggestions?</p><p>Thanks.</p>","420556","","","","","2011-11-11 00:19:18","jqtouch website not working properly in android","<android><scrolling><jqtouch>","3","0","","",""
"4210086","1","4210454","","2010-11-17 23:01:42","2","1804","<p>I'm trying to display a list of all the Input Methods that are currently installed on the phone. I'm getting a list of InputMethodInfo objects by doing this:</p><pre><code>InputMethodManager imeManager = (InputMethodManager)getApplicationContext().getSystemService(INPUT_METHOD_SERVICE);List&lt;InputMethodInfo&gt; InputMethods = imeManager.getEnabledInputMethodList();</code></pre><p>This works, but the InputMethodInfo object doesn't have a friendly name on it anywhere. For example, instead of ""Swype"" it will give me ""com.swype.android.inputmethod.SwypeInputMethod""</p><p>That isn't a very friendly way to display the list to the user, and these package names don't follow a strict pattern so there's no way for me to reliably parse the keyboard name out of the class name.</p><p>I even tried to get really fancy and get the InputMethodInfo's corresponding ServiceInfo object so I could resolve its Label Resource integer, but I just get NameNotFoundExceptions every time this runs.</p><pre><code>ComponentName componentName = inputMethodInfo.getComponent();ServiceInfo serviceInfo = packageManager.getServiceInfo(componentName, 0);Resources resources = getResources();try { String imeServiceLabel = resources.getString(serviceInfo.labelRes);} catch (NameNotFoundException e) { }</code></pre><p>Does anybody know how to accomplish this? I don't care how I have to do it, I just need to be able to produce a list of Input Methods as they appear in the phone's Language and Keyboards menu and then store the user's selection. I thought maybe I could just use the InputMethodManager to launch the standard Input Method selection menu and then see which one the user picked by looking at which IME is currently selected after the menu closes, but as far as I can tell there's no way to see which IME is currently selected in the system.</p>","319506","","","","","2010-11-18 00:00:31","How can I get a list of all the Input Methods (and their names) that are installed on the phone?","<android><methods><input><ime>","1","0","","",""
"4210135","1","4210232","","2010-11-17 23:08:26","7","7110","<p>I think that it should be possible to get all the activities from 'third-party' application, described in the manifest file.I can't figure out how.</p><p>for example:</p><pre><code>List&lt;Activity&gt; aList = packManager.getActivitiesForPackage(""package.name"");</code></pre><p>thanks in advance!</p>","481828","","418183","","2010-11-17 23:19:22","2013-03-11 21:10:40","How to list all activities exposed by an application?","<android><activity>","3","0","1","",""
"4210154","1","4215496","","2010-11-17 23:09:57","7","6456","<p>My app requires that the use manually copy a file from their PC to the SD card in a subdirectory that my app creates there (or I will look for it in the root directory). So far, so good (most people not having a problem except when they try to run my app while the phone is still connected and then ask why it tells them ""SD card not mounted"" :-) ).</p><p>Anyway, I'm wondering how the Samsung Galaxy phones work since my understanding is that they have an external AND internal SD card. My app currently calls ""Environment.getExternalStorageDirectory()""; does this return the root of the EXTERNAL card?</p><p>Also, when the user mounts the device to their PC, what does it look like? Do they see two mounted drives, or only the external card as a drive, or something else? </p>","446874","","","","","2012-11-26 07:18:34","Android SD Card Characteristics on Samsung Galaxy","<android>","2","0","6","",""
"4210181","1","4210214","","2010-11-17 23:14:27","5","8172","<p>I'm trying to inflate a FrameLayout in a GridView and I'm getting an exception. Here is the getView method from the adapter (a subclass of BaseAdapter):</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {    // TODO: Create compound view with image and name overlayed on top    FrameLayout personFrame;    if (convertView == null) {        LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        personFrame = (FrameLayout)inflater.inflate(R.layout.thumbnail, null);        //personFrame = (FrameLayout)View.inflate(mContext, R.layout.thumbnail, null);        personFrame.setLayoutParams(new GridView.LayoutParams(85,85));    } else {        personFrame = (FrameLayout) convertView;    }</code></pre><p>.... and so on</p><p>Here's the layout I'm inflating:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""85px""android:layout_height=""85px""&gt;&lt;ImageView    android:id=""@+id/thumbnail_image""    android:layout_height=""85px""    android:padding=""2px""    android:layout_width=""85px""    android:scaleType=""centerCrop"" /&gt;&lt;TextView    android:id=""@+id/person_name""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginBottom=""2dip""    android:layout_gravity=""center_horizontal|bottom""    android:padding=""2dip""    android:background=""#AA000000""    android:textColor=""#ffffffff""    android:text=""Me"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>I've tried with and without setting the LayoutParams explicitly and I get the same exception each time, which is:</p><pre><code>E/AndroidRuntime(  420): java.lang.ClassCastException:        android.widget.FrameLayout$LayoutParamsE/AndroidRuntime(  420):    at android.widget.GridView.onMeasure(GridView.java:934)E/AndroidRuntime(  420):    at android.view.View.measure(View.java:8171)E/AndroidRuntime(  420):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)E/AndroidRuntime(  420):    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)E/AndroidRuntime(  420):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)E/AndroidRuntime(  420):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)E/AndroidRuntime(  420):    at android.view.View.measure(View.java:8171)E/AndroidRuntime(  420):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)E/AndroidRuntime(  420):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)E/AndroidRuntime(  420):    at android.view.View.measure(View.java:8171)E/AndroidRuntime(  420):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)E/AndroidRuntime(  420):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)E/AndroidRuntime(  420):    at android.view.View.measure(View.java:8171)E/AndroidRuntime(  420):    at android.view.ViewRoot.performTraversals(ViewRoot.java:801)E/AndroidRuntime(  420):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)E/AndroidRuntime(  420):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  420):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  420):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(  420):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  420):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  420):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(  420):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(  420):    at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Can anyone point out where I've gone wrong here? Many thanks</p>","50878","","","","","2011-06-08 22:05:44","ClassCastException when inflating a FrameLayout in a GridView","<android>","4","0","","",""
"4210201","1","4210483","","2010-11-17 23:17:53","0","141","<p>Your project contains error(s), please fix them before running your application , i have this error message when running my application m with the red (x) mark on the project folder andi don't know where the error is (in which file ?? )</p><p>can you help me ??!</p>","508377","","","","","2012-11-23 10:16:21","what is the error in my android application?","<android>","4","0","","",""
"4210210","1","","","2010-11-17 23:19:11","1","16603","<p>I have an activity that queries from sqllite and display the output to xml</p><p>this is part of the activity</p><pre><code>( (TextView) view.findViewById(R.id.tv_id) ).setText( listItem.getId()+"""");( (TextView) view.findViewById(R.id.tv_name) ).setText( listItem.getName() );( (TextView) view.findViewById(R.id.tv_age) ).setText( listItem.getAge()+"""" );</code></pre><p>and this is the xml:</p><pre><code>&lt;TableLayout   android:layout_width=""wrap_content""   android:id=""@+id/TableLayout01""   android:layout_below=""@+id/tv_age""   android:layout_height=""wrap_content""   android:layout_toRightOf=""@+id/tv_name""&gt;  &lt;TableRow    android:layout_width=""wrap_content""    android:layout_below=""@+id/tv_age""    android:layout_height=""wrap_content""    android:layout_toRightOf=""@+id/TableLayout01""      android:id=""@+id/TableRow01""&gt;   &lt;TextView     android:layout_width=""10dip""     android:layout_height=""30dip""         android:id=""@+id/tv_id""     android:text=""""         android:layout_centerVertical=""true""&gt;   &lt;/TextView&gt;   &lt;TextView     android:layout_width=""100dip""     android:layout_height=""wrap_content""     android:text="""" android:id=""@+id/tv_name""     android:layout_centerVertical=""true""     android:layout_toRightOf=""@+id/tv_id""     android:layout_marginLeft=""10px""&gt;   &lt;/TextView&gt;   &lt;TextView     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text="""" android:id=""@+id/tv_age""     android:layout_centerVertical=""true""     android:layout_toRightOf=""@+id/tv_name""     android:layout_marginLeft=""10px""&gt;   &lt;/TextView&gt;  &lt;/TableRow&gt; &lt;/TableLayout&gt;</code></pre><p>Now this works fine.  It displays the resulting query.  Now, I want to create another activity which responds to the long press or just one touch when the query is displayed.  How can I get the ID of the pressed textview so I can use it for the other activity?</p><p>many thanks for your help.</p>","511457","","330180","","2010-11-17 23:23:21","2013-11-06 07:34:22","android: How to get the ID of a textview when clicked?","<android><contextmenu>","3","0","1","",""
"4210259","1","4210382","","2010-11-17 23:26:28","0","456","<p>I am doing a custom editbox class. It starts something like:</p><pre><code>public class AmountField extends EditText {</code></pre><p>and has overriden the constructor to implement the EditText widget style</p><pre><code>/** * Make a new AmountField Object. *  * @param context *            the context of the field * @param attrs *            attributes for the view */public AmountField(Context context, AttributeSet attrs) {    this(context, attrs, R.style.Widget_EditText);}</code></pre><p>However when I implement this on my XML I get an editable TextView instead of the EditText (there is only text but not the surrounding white box) and also when I click on it nothing happens, only text color changes.</p><p>Are there any ideas on why this happens? I've done list components the same way and style is not altered.</p><p>Thanks in advance</p>","505152","","505152","","2010-11-17 23:34:35","2010-11-17 23:45:37","My Android EditText class is appearing without ""edit box""","<android><class><coding-style><edittext>","1","0","","",""
"4210270","1","4217617","","2010-11-17 23:28:22","3","6530","<p>I'm trying to develop an Android app that could be used by advocacy groups or campaigners such that they would be able to create their own forms (surveys) for which they can go out canvassing and collect opinion data from people who don't have Internet connections and thus can't take surveys/polls online. Could also be used at events or anything else that requires data collection ""in the field""</p><p>The benefit is allowing data collection on the spot without having to transfer data from paper to the office computer by hand.</p><p>I've been looking over this tutorial by Frank Abelson: <a href=""http://www.ibm.com/developerworks/xml/tutorials/x-andddyntut/section6.html"" rel=""nofollow"">http://www.ibm.com/developerworks/xml/tutorials/x-andddyntut/section6.html</a></p><p>And have also been pouring through the Open Data Kit, but the ODK is a little more intense than I am prepared for and the Abelson tutorial doesn't discuss much how users could create their own forms.</p><p>I suppose users could just create their own XML files for custom forms in the office and store them on the server, but I was wondering if there was a way for them to do this on the Android app?</p><p>Just a hint about possible architecture or simple resources would be helpful, I am having a hard time picturing the solution at the moment.</p>","340648","","","","","2014-02-06 20:09:17","allow users to create forms within android survey/data collection app","<android><xml><database><json><survey>","3","0","4","",""
"4210328","1","","","2010-11-17 23:37:01","1","1232","<p>I have created a directory in my app's internal storage (/data/data/com.my_app) and gave global read/write permissions to the directory via the method</p><p><code>context.getDir(DATA_DIR_NAME, Context.MODE_WORLD_READABLE | Context.MODE_WORLD_WRITEABLE);</code></p><p>Through my app, I verified that the linux file permissions are correct: </p><p><code>drw-rw-rw- app_71   app_71            2010-11-16 18:38 app_data</code></p><p>And I was able to read/write files in-to/out-of the directory app_data just fine.  However, one of my developers suddenly wasn't able to write to the directory anymore.  Our application has trouble accessing the directory on his device as well.  </p><p>The strange thing is that the file permission for the directory is still the same.  We can't do any sort of writes to the directory, and we can't read any files within the directory anymore either (the files were given global rw permission previously). </p><p>The only thing we can do is <code>adb shell ls /data/data/my_app/app_data</code> to see our list of files.  Doing <code>adb shell ls -l /data/data/my_app/app_data</code> strangely doesn't return anything.  And we can't CD into the directory either.</p><p>Does anyone have any pointer on what the problem is or how to solve this?  We are at our wit's end.</p><p>Much appreciated.</p>","511458","","511458","","2010-11-18 00:37:53","2010-11-18 08:40:15","Android/Linux File Permissions Problem","<android><linux><permissions><adb>","1","3","","",""
"4210362","1","4210396","","2010-11-17 23:41:59","10","649","<p>I'm an Android newbie so I apologize if this is a dumb question . . . </p><p>Intents are essentially messaging objects that can be used to activate 3 kinds of components:  Activities, Services or Applications.    </p><p>Especially with regard to Activities, are intents always the preferred way to activate an Activity, despite the overhead of constructing an intent object and using the overhead of the built-in Android OS for passing it?</p><p>If the Activity in question is known by the programmer to be the only legitimate one to perform a particular activity is it ever acceptable to invoke it by some more direct means such as a direct invocation via a method call?</p><p>Thanks in advance.</p>","424690","","","","","2010-11-18 19:51:14","Android ""Best Practice"" use of Intents","<android>","2","3","6","",""
"4210487","1","4210595","","2010-11-18 00:06:20","0","300","<p>I snap a photo, and it gets placed onto an ImageView.  When the user sees the page where the Image View is, and I turn the phone sideways where the orientation is horizontal, the app immediately returns to the app's main screen.  Any ideas?</p>","496686","","","","","2010-11-18 00:34:30","Is there a way I can prevent an app from going to the home screen when orientation is changed?","<android><layout><orientation><return><fixed>","1","1","","",""
"4210636","1","","","2010-11-18 00:42:34","1","281","<p>I was working on an app that included camera preview, and with my old phone running 1.6 I could take screenshots with DDMS.  After getting a new phone with FroYo and updating to the latest SDK on the same dev machine, the camera preview layer is black when I do a screen capture.  I have an overlay layer on top, and that shows just fine.  The app runs fine on my phone and shows the preview as expected, it's just not showing up in screen caps.</p><p>Is there something I can look for in the debug output?  Is this a known issue that others are experiencing? </p>","53501","","","","","2010-11-18 00:42:34","DDMS not capturing camera preview on FroYo","<android><ddms>","0","1","","",""
"4210641","1","","","2010-11-18 00:43:44","8","1683","<p>Does anyone know of any video encoding/decoding libraries written entirely in java?Bonus points if it works on Android.</p><p>I'm trying to write a video decoding application for android, where I have access to the frame level decoding functions (which is absent in the android API MediaPlayer class)</p>","12649","","","","","2011-08-01 22:20:33","Pure java video endcoding/decoding libraries","<java><android>","2","1","1","",""
"4210679","1","","","2010-11-18 00:55:42","5","707","<p>I have Google Checkout javascript code inside of an <code>HTML</code> file hosted on a server. I can view the cart inside of the Android Emulator Browser, but when I point a WebView <code>Activity</code> to the URL, the error I get is <code>Unsafe JavaScript attempt to access frame with URL</code> and a blank page displays.</p><p>How come this doesn't work in the app but on the same browser the phone uses?</p>","375566","","1315962","","2012-10-03 14:44:42","2012-10-21 18:57:20","Android 2.2 SDK - Unsafe JavaScript attempt to access frame with URL - Google Checkout","<javascript><android><android-emulator><android-webview><google-checkout>","1","0","","",""
"4210795","1","","","2010-11-18 01:21:22","0","675","<p>I have a RelativeLayout that includes three elements:  a TableLayout at the top that contains some controls (layout_alignParentTop = true), a LinearLayout at the bottom (layout_alignParentBottom = true) that contains a couple buttons and a ListView that stretches between them (using layout_below and layout_above the two elements).  That works great, but under certain circumstances, the bottom LinearLayout needs to go away.  If I use setVisibility to set it to View.GONE or set its height to 0 using setLayoutParams(), the ListView is stubbornly refusing to resize to take up the newly freed space.  I've tried calling requestLayout() on basically everything in the hierarchy, and nothing seems to work.  If I fire up the hierarchy viewer, I can see that the view is gone/has layout_height of 0, but it still doesn't work.</p><p>Ironically, after the hierarchy viewer is done, the layout corrects itself.  I'm thinking that having my users run hierarchy viewer is probably unacceptable, though.</p><p>EDIT:  The middle layout is actually a RelativeLayout containing the ListView, which might matter, I'm going to try and eliminate it.  I've posted a simplified version of my XML that gives an idea of what I'm looking at.</p><pre><code>&lt;RelativeLayout    android:id=""@+id/main_container""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TableLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:id=""@+id/top_table""        android:layout_alignParentTop=""true""        android:stretchColumns=""2""        android:shrinkColumns=""1""&gt;        &lt;!-- removed for simplicity --&gt;    &lt;/TableLayout&gt;    &lt;RelativeLayout        android:id=""@+id/main_content""        android:descendantFocusability=""afterDescendants""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_below=""@id/title_table""        android:layout_above=""@id/ad_toolbar""&gt;        &lt;!-- removed for simplicity --&gt;        &lt;ListView             android:id=""@+id/android:list""            android:layout_alignParentTop=""true""            android:descendantFocusability=""afterDescendants""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;    &lt;/RelativeLayout&gt;    &lt;LinearLayout        android:id=""@+id/bottom_layout""        android:orientation=""vertical""        android:layout_alignParentBottom=""true""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""&gt;        &lt;!-- removed for simplicity --&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","104918","","104918","","2010-11-18 17:52:44","2010-11-18 17:52:44","Android: Setting View height to 0","<android><android-layout>","1","2","","",""
"4210838","1","4210915","","2010-11-18 01:29:37","0","393","<p>Just submitted my first app and was surprised to see there was nowhere to enter keywords.How is our app supposed to be found on the marketplace if we can't enter keywords?</p>","509087","","","","","2010-11-18 01:47:53","Android marketplace keywords","<android>","1","0","","",""
"4210846","1","","","2010-11-18 01:31:21","8","12674","<p>Does Android HttpClient has auto-management for cookies?</p>","511544","","","","","2011-10-07 22:23:06","Android HttpClient Cookie","<android><cookies><login><httpclient>","1","0","2","",""
"4210911","1","4210996","","2010-11-18 01:47:34","0","1692","<p>Hey all - I have tried to only display my app in portrait view orientation to no avail.</p><p>I have the code:  android:screenOrientation=""portrait""  in every button, ImageView, TextView, etc... in my xml files but when I tilt the phone to the side, it still goes into landscape view.</p><p>I do call the camera in my app, but I don't think that is the issue - any thoughts?</p>","496686","","","","","2010-11-18 02:09:23","Forcing 'portrait' orientation not working - any tips?","<android><xml><view><orientation><portrait>","2","1","","",""
"4211119","1","","","2010-11-18 02:26:53","1","4613","<p>Hi I am using buttons in my list view. I would like to add border to my button. How can i do that. My XML code for creating button look like this.android:text=""Search""></p><p>Please suggest me some solution or provide me some source code for doing this.</p><p>Thanks in advance.</p>","503795","","","","","2010-11-18 03:13:19","How to add border for the buttons in android","<android><button><border>","1","0","","",""
"4211149","1","5854167","","2010-11-18 02:32:51","1","1739","<p>I am trying to write a small application in Android. My application is on Widgets. I have a basic doubt on using RemoteViews. I found that whenever , I update some button or some UI layout a new object of the remoteviews is created . Will that be a problem with the performance? an example code is this:</p><p><a href=""http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html"" rel=""nofollow"">http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html</a></p><pre><code>updateViews = new RemoteViews(context.getPackageName(), R.layout.widget_message);</code></pre><p>even for updating the views everytime, new remoteview object is created. Please help me in understanding this. </p>","291364","","73488","","2010-11-18 02:34:50","2012-03-27 13:45:33","Performance RemoteViews in Android","<android><performance><android-widget><widget>","2","1","","",""
"4211189","1","4220984","","2010-11-18 02:41:53","0","7260","<p>i have id ""@+id/call"" in single_item.xml when i use findVewById it (the layout setcontextview(R.layout.main))   .the app crash .how to fix the error  </p>","510992","","71724","","2010-11-18 02:48:43","2010-11-19 01:15:38","how to get id in different layout","<android><android-layout>","2","1","","",""
"4211266","1","4211367","","2010-11-18 02:56:27","0","404","<p>I have a list of about 10 strings that all have different sayings (adages).  How can I go about randomly displaying them for the user to read on an XML?</p><p>I have a math().random; that generates a random # between 1 and 10.  When that number is hit, I use a simple switch/case that displays a saying to the user in an xml file.  How do I go about displaying that predefined string in the xml?</p><p>ie:</p><pre><code>private void randomIdioms(){int saying = math.random()*10;if (saying = 3){ //THe code I am looking for that displays a string on a view in the XML file}else if (saying = 2){}</code></pre><p>etc....</p><p>Thanks!</p>","496686","","","","","2010-11-18 03:16:47","Using a method to get multiple, random strings to show as text in an XML","<android><xml><text><formatting>","1","3","","",""
"4211381","1","6931525","","2010-11-18 03:19:44","0","501","<p>The format of my app is all in portrait mode.  Oddly, when I snap a photo in portrait mode, it is displayed on the ImageView sideways (like it was snapped in landscape)...the only way it is displayed right side up is if I snap the pic in landscape mode.</p><p>Anyone know of a simple workaround that displays the photo ride side up, regardless of the camera's orientation?  I can easily provide my code if anyone needs to take a look.</p><p>Thanks!   </p>","496686","","","","","2011-08-03 21:17:55","Getting camera to always return a snapped photo right side up?","<android><rotation><orientation><bmp>","1","0","","",""
"4211396","1","4211438","","2010-11-18 03:22:12","0","498","<p>I'm looking to replicate and improve upon the following <code>AlertDialog</code> in my app:</p><p><a href=""http://i.stack.imgur.com/aU3Ep.png"" rel=""nofollow"">http://i.stack.imgur.com/aU3Ep.png</a></p><p>Is this a built-in <code>AlertDialog</code>, or was this made from scratch? If it was made from scratch, what control/widget is the number picker? Or is that built from scratch too?</p><p>Thanks!</p><p>btw.. screenshot is from Math Alarm Clock Pro</p>","502630","","","","","2010-11-18 03:38:19","Is this a standard AlertDialog or is it custom?","<android>","2","1","","",""
"4211408","1","4211835","","2010-11-18 03:24:39","2","730","<p>I am working to implement some simple preferences to an app I have and I am trying to figure out how to use a preference to manipulate a view defined in an XML file. I have a List with the following LinearLayout (player_row.xml) being used for each row:</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=""fill_parent""&gt;  &lt;ImageView android:id=""@+id/player_icon""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_gravity=""center""/&gt;  &lt;TextView android:id=""@+id/player_name""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:textSize=""30sp""   android:textColor=""#F0F0F0""   android:layout_weight=""1""   android:layout_marginLeft=""5dp""/&gt;  &lt;TextView android:id=""@+id/player_score""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:textSize=""30sp""   android:textColor=""#F0F0F0""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Right now I am specifying the textSize attribute manually. I'd like to create a preference menu that lets the user select from several options, say ""Small"", ""Medium"", and ""Large"". I figure I should be able to set up the arrays for the entry and font sizes and then reference that in player_row.xml, but I don't seem to be able to.</p><p>preferences.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""   android:key=""preference_main""&gt;   &lt;ListPreference      android:key=""fontSizePreference""      android:title=""Font size""      android:entries=""@array/fontSizeList""      android:entryValues=""@array/fontSizeList_Values""/&gt;&lt;/PreferenceScreen&gt;</code></pre><p>arrays.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;  &lt;string-array name=""fontSizeList""&gt;    &lt;item&gt;Small&lt;/item&gt;    &lt;item&gt;Medium&lt;/item&gt;    &lt;item&gt;Large&lt;/item&gt;  &lt;/string-array&gt;  &lt;string-array name=""fontSizeList_Values""&gt;    &lt;item&gt;22sp&lt;/item&gt;    &lt;item&gt;26sp&lt;/item&gt;    &lt;item&gt;30sp&lt;/item&gt;  &lt;/string-array&gt;&lt;/resources&gt;</code></pre><p>If this can't be done, what is the appropriate way to configure a layout using preferences? My searching has led me to find multiple resources on accessing the preferences programmatically but none of that seems to be the appropriate way to configure a layout defined in an XML file.</p>","216345","","","","","2010-11-18 05:03:37","Can preferences be accessed in an XML layout?","<android><android-layout>","1","0","","",""
"4211509","1","4211535","","2010-11-18 03:43:36","4","485","<p>I created a new xml file, and had an errant ? in it that prevented R.java from regenerating.  I tried Cleaning the Project, and Fixing the Project Properties but no luck.</p><p>Then I realized the XML was creating the R.java from recreating itself, so I deleted the XML file and the R.java was back.</p><p>Now though, I am getting an error on all the calls to R.<em>.</em> calls saying that :</p><ul><li>cannot be resolved or is not a field</li></ul><p>So, for instance I have </p><pre><code>setContentView(R.layout.detectlayout);</code></pre><p>ERROR:  detectlayout cannot be resolved or is not a field</p><p>for all of my calls to 'R.'.  Any ideas?</p><p>I have tried all of the suggestions on SO already to no luck =/</p>","496686","","213269","","2010-11-30 12:54:55","2010-11-30 12:54:55","R.java malfunctioning","<android><generator><r.java-file>","3","0","1","",""
"4211598","1","","","2010-11-18 04:06:31","1","989","<p>I am New to android my intention is to play video using Http.</p><p>But i am getting  ""Http Request Failed 404"" Exception when iam trying to run my application in  emulator.can any one know this error?</p><p>plz help me Thanks in advance.</p>","486291","","","","","2011-07-07 10:29:52","How to play video from remote URL in android?","<android>","2","1","","",""
"4211677","1","","","2010-11-18 04:25:22","3","940","<p>Use Case:Activity A is main activity. Whereas Activity B is SearcActivity (SearchManager). Activity B is ListActivity, so whatever result comes, result is displayed in the list. Once user clicks on the list, I want to get that list selected item to be returned to ActivityA.</p><p>What I did?I could call SearchActivity on button using ""onSearchRequested()"". In ActivityB, I am displaying searchresult via ""setListAdapter(adapter)"". Using ""onListItemClick"", I can get what option in list was selected by user. </p><p>Now I tried sending result back to ActivityA by following code</p><pre><code>Intent intent = new Intent();Bundle bundle = new Bundle();bundle.putString(""item"", l.getItemAtPosition(position).toString());intent.putExtras(bundle);setResult(RESULT_OK, getIntent() );finish();</code></pre><p>And in ActivityA, I tried reading the result in ""onActivityResult"".</p><pre><code>Bundle bundle = data.getExtras();String strItem = bundle.getString(""item"");AlertDialog alertDialog = new AlertDialog.Builder(this).create();alertDialog.setTitle(""Item Selected"");alertDialog.setMessage(""Item = "" + strItem);alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) {  return; }});alertDialog.show();</code></pre><p>Problem:I noticed that, once Activity A is resumed, ""onActivityResult"" is not called at all. Hence I am not seeing any dialog. Plus I can't verify whether SearchActivity actually sends anything to ActivityA.</p><p>So friends, how can I capture the data sent by ActivityB.</p>","511655","","","","","2011-05-12 16:36:20","Get result from SearchManager activity to Main Activity in android","<android><callback><activity>","2","0","2","",""
"4211708","1","4211745","","2010-11-18 04:35:32","5","643","<p>Is it possible to create subfolders under res/layout and place the layout XML files there so that one can call a view like <code>setContentView(R.layout.questions.create);</code> or <code>setContentView(R.layout.questions/create);</code> ?</p>","174261","","","","","2010-11-18 04:43:17","Android layouts under subfolders","<android><layout>","1","0","","",""
"4211771","1","","","2010-11-18 04:49:09","2","1725","<p>I have a ragged hierarchy of parents and children.Some parents have 5 children, while others have 0 children.</p><p>The expandableListView displays the ""Expand/Collapse"" icon even if there are no children.</p><p>Is there a way to hide the icon for only those Parents (rows) that have no children?I still want to show the row of the Parents with no children, and allow a user to click on them, but the ""Expand/Collapse"" icon is confusing.</p>","511662","","1221571","","2014-01-09 23:01:55","2014-01-09 23:01:55","Android ExpandableListView - handling parents with no children","<android><android-widget><expandablelistview>","2","0","","",""
"4211782","1","4212350","","2010-11-18 04:52:36","4","14505","<p>Is it possible to use JavaScript in Android?? if so, how? Please provide some examples.</p><p>Thanks.</p>","472882","","42769","","2010-11-18 05:01:49","2010-11-18 06:54:39","JavaScript in Android","<java><javascript><android>","3","2","","",""
"4211792","1","4211836","","2010-11-18 04:55:05","0","1172","<p>How to add a background theme and/or background wallpaper to my app? Right now my app background is plane.</p>","505580","","244296","","2010-11-18 13:08:58","2010-11-18 13:08:58","How to add a background theme and/or background wallpaper to my app?","<java><android>","2","2","","",""
"4211815","1","4211834","","2010-11-18 04:59:55","2","320","<p>How can I display back to the user a basic popup with a saying based on a random number generated.  I wanted to use a switch statement, but that just displays all the sayings, ie:</p><pre><code>int random = (int) Math.ceil(Math.random() * 5);      switch(random){            case 1:                showToast(this, ""Saying 1."");            case 2:                showToast(this, ""Saying 2."");}</code></pre><p>etc....</p><p>Like I said, this displays all 5 case statements, is there a better way to random generate and display based on the number, or am I doing it all wrong?</p><p>Thanks!</p>","496686","","","","","2010-11-18 07:41:12","How do I display different sayings, based on a random number","<android><integer><random><switch-statement>","3","2","","",""
"4211838","1","4211860","","2010-11-18 05:04:03","1","323","<p>I want to localize my application to Spanish. Which qualifier should I use to accomplish this? For example, for Japanese we are using the ""ja"" qualifier.</p>","479027","","404469","","2011-03-31 11:11:00","2011-03-31 11:11:00","Qualifier for Spanish","<android>","3","0","2","",""
"4211847","1","","","2010-11-18 05:05:54","0","4586","<p>Okay, so I've seen a few tutorials about sliding left to right, but the only one's all lead down to one place <a href=""http://www.anddev.org/viewtopic.php?p=16622"" rel=""nofollow"">http://www.anddev.org/viewtopic.php?p=16622</a> which does not help me, because now that it has been so HUGELY developed, it no longer works for me to find the RAW code I would like, as I hate just implementing stuff and not knowing why or how it works. Can anybody help me with this? Thanks</p>","481082","","","","","2012-07-11 08:52:43","Sliding Drawer left to right Android","<android><slidingdrawer>","0","0","","",""
"4211851","1","4211969","","2010-11-18 05:06:17","7","20608","<p>I'm having some problems with the control focusing. My interface definition below has:</p><p>source (RadioGroup/optional)destination (EditText)quantity (EditText)transfer (Button)</p><p>I'm changing the visibility of the ""source"" into my code. When the times I don't display it, focus is automatically goes to ""quantity"" which I would expect that to be ""destination"" instead. I don't know what I'm missing. I suspect it could be an Android bug, I don't know. Is there anybody know how to solve this?</p><p>Thanks</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;RadioGroup android:id=""@+id/source""     android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:orientation=""vertical""   android:visibility=""gone""&gt;   &lt;RadioButton android:id=""@+id/default""    android:checked=""false""    android:text=""@string/default""/&gt; &lt;/RadioGroup&gt; &lt;TableLayout  android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:stretchColumns=""1""&gt;     &lt;TableRow&gt;   &lt;TextView     android:text=""@string/destination""    android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:textSize=""16sp""       android:textColor=""#ffffff""       android:paddingRight=""10sp""       android:layout_weight=""1""/&gt;      &lt;EditText android:id=""@+id/destination""       android:layout_width=""fill_parent""        android:layout_height=""wrap_content""       android:layout_weight=""1""       android:singleLine=""true""&gt;&lt;requestFocus/&gt;&lt;/EditText&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;   &lt;TextView     android:text=""@string/quantity""    android:layout_width=""wrap_content""        android:layout_height=""wrap_content""       android:textSize=""16sp""       android:textColor=""#ffffff""       android:paddingRight=""10sp""       android:layout_weight=""1""/&gt;      &lt;EditText android:id=""@+id/quantity""       android:layout_width=""fill_parent""        android:layout_height=""wrap_content""       android:layout_weight=""1""       android:singleLine=""true""/&gt;  &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;Button android:id=""@+id/transfer""  android:layout_width=""fill_parent""      android:layout_height=""wrap_content""     android:text=""@string/transfer""/&gt;&lt;/LinearLayout&gt;</code></pre>","304796","","2117902","","2013-03-28 02:03:29","2013-03-28 02:03:29","requestFocus skipping next EditText","<android><focus><edittext>","4","3","0","",""
"4211867","1","","","2010-11-18 05:08:42","0","945","<p>I am looking for the feasibility of implementing an ad-hoc type messaging service on Android. Basically I want a several Android users to be able to communicate (text is enough at this point) without having a cellular connection. But there can be a centralized access point. For example a low-power computer with a wireless router.</p><p>What is the best way to implement something like this? I was thinking using XMPP. Could use the computer as the XMPP server and let Android users connect to it. Is this a reasonable approach?</p><p>Any suggestions are greatly welcomed.Thank you.</p>","455048","","","","","2012-12-12 17:06:28","Ad-hoc communication (messaging) system over Android","<android><communication><xmpp><messaging><adhoc>","2","4","","",""
"4211944","1","4444411","","2010-11-18 05:25:20","0","449","<p>I'm planning a project which will uses JSON objects to display data on andorid mobile.</p><p>My application is some what similar to facebook application for android. It seems making detailed ui like facebook's like,comment will be time time consuming &amp; webview seems to be better option in this case ?need your suggestion.</p><p>I'm also planning same app to be developed on iPhone as well.  </p><p><a href=""http://www.ibm.com/developerworks/library/x-andbene2/index.html"" rel=""nofollow"">Refrence link </a></p>","236732","","185655","","2012-01-17 10:58:49","2012-01-17 10:58:49","Should I use Webview or Android widgets for webbased Android Application?","<android><json><webview>","1","1","","",""
"4211994","1","","","2010-11-18 05:38:04","0","2057","<p>I an using tabslayout.I choose tabcontentfactory to load views from xml layout.Like in an activity we have oncreate method which acts as onLoad so that i can fill datasource to various views.</p><p>But in tabcontentfactory approach,I can not do this since oncreate has already been fired which is mainly used for creating tabs..Is there a better way to tell activity that inflated view has been attached to window and now you can use inflated view</p>","485305","","","","","2010-11-18 17:05:27","android tabcontentfactory and view load events","<android><tabactivity>","1","0","","",""
"4212041","1","","","2010-11-18 05:51:12","0","241","<p>i published the rest service.. but the android app is showing null pointer exception.. but if it access my local machine's service its working well.. the service hosted has anonymous access.. </p><p>this is my android code </p><pre><code>URL=""published url"";try{    response = client.execute(new HttpGet(URL));     android.util.Log.i(""status"", String.valueOf(response .getStatusLine().getStatusCode()));    InputStream is = response.getEntity().getContent();     String str = convertStreamToString(is);     android.util.Log.i(""callRestService"", str);     parse(str,checkClient);}</code></pre>","483898","","162407","","2010-11-18 06:25:49","2010-11-24 09:03:21","android could not access the published rest service","<android><rest>","0","5","","",""
"4212049","1","4212073","","2010-11-18 05:53:54","0","6872","<p>I am working on an application where I need to go to the next Screen form the Main Actvity when I Click on the Image Button of the Main Activity Screen.</p><p>I had searched a bit on Net regarding this and found something like the OnClickListener method. I am still stuck for what exactly I want to do actually.</p><p>Can anyone please tell me how to do the same.</p><p>Thanks,david</p>","422859","","","","","2013-04-09 10:11:00","Switching over to next Screen from the main Activity by clicking on the Button","<android><switching><buttonclick>","4","0","","",""
"4212162","1","","","2010-11-18 06:21:04","-3","2557","<p>when i press the only  character button a to z to perform some action in android what is key ascii code for a to z can anybody tell  how to do in android?  </p>","426344","","298479","","2012-08-19 13:28:47","2012-08-19 13:28:47","keypress event in android","<android>","1","1","","",""
"4212195","1","4212444","","2010-11-18 06:27:05","0","83","<p>How to find out mobile information.for installing corresponding app on mobile.</p><p>right now i am using useragent.what i will do for useragent not supported mobile </p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2010-11-18 07:13:31","find mobile and install app","<android><blackberry><mobile><nokia>","1","1","1","",""
"4212320","1","4212417","","2010-11-18 06:49:18","138","68721","<p>How can we get the current language selected in the Android device?</p>","479027","","648313","","2011-12-25 16:07:58","2014-04-19 09:36:24","Get the current language in device","<android><localization>","9","0","34","",""
"4212325","1","","","2010-11-18 06:49:42","0","379","<p>How do i do an edit form functionality in android. I am a new bee to android. How do i pass on database values to XML and then submit it back</p>","396543","","","","","2011-03-03 08:02:55","Pass values to XML from database in Android","<android>","1","1","","",""
"4212362","1","4220581","","2010-11-18 06:56:59","1","585","<p>To my knowledge, in the <a href=""http://code.google.com/p/zxing/"" rel=""nofollow"">ZXing</a> Android source code, there is a custom layout to display key points in the QR code image (<code>ViewfinderView</code>). It then displays analysis of the byte stream of the image. </p><p>Can I detach from this design and use the Android ZXing source code to develop an approach which can be used in both the Android and BlackBerry platforms? </p><p>It will be a JAR file which can be used to decode QR codes, using the Android ZXing source. </p><p>Can this be done? Have anyone tried this approach?</p>","511737","","64174","","2013-02-27 08:44:44","2013-02-27 08:44:44","ZXing Android source for Blackberry","<android><blackberry><barcode-scanner><qr-code><zxing>","4","0","","",""
"4212396","1","4212604","","2010-11-18 07:02:52","1","895","<p>I want to send an sms message containing current location of user. How do I make the sending function wait till the location is calculated?</p>","481239","","","","","2010-11-18 07:39:36","Android: How to make function wait for another?","<android><function><wait>","2","1","","",""
"4212418","1","4212484","","2010-11-18 07:07:30","1","493","<p>I am developing an app where I need an image to be positioned precisely at a certain x and y position.The image will randomly be moving to new positions.</p><p>I cannot see how to accomplish this.</p>","509087","","","","","2010-11-18 08:37:41","Precise positioning in Android","<android>","1","4","","",""
"4212520","1","","","2010-11-18 07:24:42","3","1447","<p>I am customizing quick search to display data from my app. Its working fine. Now the issue is, When I click on search button, I am not able to see the search history. What should I do get the search history (previously searched keywords)?</p><p>It's very urgent, can anyone help me how to get this?</p>","262523","","317773","","2011-08-10 06:04:25","2011-08-10 06:04:25","search history in android quick search","<android><history><quick-search>","1","0","2","",""
"4212688","1","4212744","","2010-11-18 07:52:35","3","3563","<p>I'd like to make a looping ListView. That means, it behaves a bit like the picker widget on iOs, so when the user scrolls either up or down, the list just keeps looping its contents. I'd guess that one needs to write some fancy custom adapter for this, but I'm not sure if it's possible.</p><p>Afaik, the ListView needs to know the number of elements containted in the adapter in advance. That would be a problem in this case, for example. </p><p>Do you have any tips on this matter?</p><p>Thanks</p>","446529","","","","","2010-11-18 08:04:51","Android looping infinite ListView?","<android><user-interface><listview><loops><infinite>","1","1","","",""
"4212799","1","","","2010-11-18 08:14:17","0","270","<p>I have used 2 tabs in my app.</p><p>when i click on first tab it is showing an list view( default) and when i click on any particular item in list view it is taking me to the next activity to display the selected data. Here when i click on tab again i want that i should go to the listview screen which is default screen.</p><p>but nothing happens on clicking the tab but when i press the back button i m going back on the screen. but i want to go to home list view screen on tab click,</p><p>pls help me in this case...</p>","383597","","","","","2010-11-18 08:23:44","Android Tabs problem","<android>","1","2","","",""
"4212824","1","4212858","","2010-11-18 08:18:55","17","10831","<p>If I use the AlarmManager to schedule an alarm (a PendintIntent which should be send), how can I identify that alarm later to cancel it? Can I cancel all alarms scheduled by my app?</p>","474326","","","","","2010-11-18 08:24:41","Identify and cancel an alarm send to an AlarmManager","<android><schedule><alarm><alarmmanager><android-alarms>","1","0","0","",""
"4212942","1","5701155","","2010-11-18 08:38:48","1","679","<p>I'm using an <code>IntentService</code> to access different web service methods and update my <code>ContentProvider</code>. The issue I'm seeing is that, <em>sometimes</em>, I send a new Intent to the IntentService but <code>onHandleIntent()</code> of the <code>IntentService</code> is not called. And after a while, playing with the application and clicking stuff to trigger other Intents, the <code>onHandleIntent()</code> method is called and all the queued <code>Intents</code> are run.</p><p>Has anyone else encountered this problem? It seems that the <code>IntentService</code> gets stuck at some point. I know it is asynchronous but I still expect it to run in a timely fashion. Any thoughts?</p>","292263","","","","","2011-04-18 09:53:51","IntentService not getting called sometimes","<android><android-intent>","1","2","","",""
"4212992","1","4213851","","2010-11-18 08:45:45","24","13761","<p>I am an Android developer and I want to write an if statement in my application. In this statement I want to check if the default browser(browser in Android OS) is running. How can I do this programmatically? Waiting for your help.</p>","511853","","","","","2011-05-10 10:51:04","How can i check if an app running in Android?","<java><android><browser><if-statement>","1","0","11","",""
"4212993","1","6093166","","2010-11-18 08:45:52","1","584","<p>where does the sp&lt;> gets defined in the android source code. please answer in terms of surfaceflinger.</p>","507466","","","","","2011-05-23 05:28:36","how does the interface of surfaceflinger works?","<android><interface><service><surfaceview>","1","1","","",""
"4213083","1","4214445","","2010-11-18 09:01:05","3","101","<p>It looks like the naming style for android attributes varies between underscore and camel case. Does the variation mean anything, or is it arbitrary?</p><p>edit: examples would be <em>layout_width</em> and <em>columnWidth</em>.</p>","389828","","389828","","2010-11-18 09:08:48","2010-11-18 11:54:09","Does the variation in android attribute naming styles mean anything?","<android><attributes><naming-conventions>","1","0","1","",""
"4213115","1","4390236","","2010-11-18 09:05:30","8","10484","<p>I want to consume WCF web service from android application. I have worked on .asmx web service but I don't know how to consumign SCF web service in Android application. I have googled it but didn't find any thing. If any one has done it before please help me. </p><p>Thanks in advance.</p>","307585","","437301","","2010-11-18 11:39:39","2012-07-02 19:04:08","consuming WCF web service from android application?","<android><wcf><web-services>","1","0","2","",""
"4213308","1","5044159","","2010-11-18 09:30:19","1","748","<p>I try to search about voice recognition in android. Almost of search result, I have only founded the voice recognition api which provided by Google. Moreover, I want to know which other api that provide for android. Because I would to use my voice recognition to search in my file.Could anyone solve this problem or give me some suggestion? </p>","473659","","321731","","2013-10-21 20:45:52","2013-10-21 20:45:52","Voice recognition","<android><voice-recognition><voice>","2","0","1","2013-09-09 01:48:17",""
"4213375","1","4213910","","2010-11-18 09:37:14","1","1326","<p>Now the Android Market requires developers to upload a:  </p><blockquote>  <p>Hi Resolution Application Icon, 512w x 512h, 24 bit PNG or JPEG (no alpha)</p></blockquote><p><b>Problem</b>: my application's icon is <b>not a square</b>, and because alpha is forbidden I will have to fill with some color like black. Or maybe white.</p><p><b>Which color</b> should I choose?</p>","226958","","21234","","2010-11-18 10:35:36","2010-11-30 13:00:47","Which background color to use for Android Market's no-alpha ""Hi Resolution Application Icon""","<android><google-play>","1","0","","",""
"4213393","1","4214490","","2010-11-18 09:38:38","10","28609","<p>I want an image to move horizontally.i.e image should move from left end bottom corner to right end bottom corner once.No need to come back again to left end bottom corner. </p><p>The piece of code which I tried was</p><pre><code>&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""android:interpolator=""@android:anim/linear_interpolator""&gt;&lt;translate android:fromXDelta=""0%p"" android:toXDelta=""200%p"" android:duration = ""2000""/&gt;&lt;/set&gt;</code></pre><p>this moves the image from left till right. But its again coming to the left side.Can anyone tell me how to solve this?</p>","504162","","","","","2014-03-03 08:18:10","translate animation","<android>","3","0","5","",""
"4213400","1","4213433","","2010-11-18 09:39:31","2","1757","<p>I created a simple application that shows add using ad whirl .it does not show any adi added logcat file</p><p>thanks in advance</p><pre><code>11-18 15:08:55.940: ERROR/AdWhirl SDK(619): Caught IOException in fetchConfig()11-18 15:08:55.940: ERROR/AdWhirl SDK(619): java.net.UnknownHostException: mob.adwhirl.com11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.net.InetAddress.lookupHostByName(InetAddress.java:513)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.net.InetAddress.getAllByName(InetAddress.java:242)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at com.adwhirl.AdWhirlManager.fetchConfig(AdWhirlManager.java:221)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at com.adwhirl.AdWhirlLayout$InitRunnable.run(AdWhirlLayout.java:293)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:114)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:229)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)11-18 15:08:55.940: ERROR/AdWhirl SDK(619):     at java.lang.Thread.run(Thread.java:1096)11-18 15:08:55.970: ERROR/AdWhirl SDK(619): Unable to parse response from JSON. This may or may not be fatal.11-18 15:08:55.970: ERROR/AdWhirl SDK(619): java.lang.NullPointerException11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at org.json.JSONTokener.nextValue(JSONTokener.java:90)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at org.json.JSONObject.&lt;init&gt;(JSONObject.java:154)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at org.json.JSONObject.&lt;init&gt;(JSONObject.java:171)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at com.adwhirl.AdWhirlManager.parseConfigurationString(AdWhirlManager.java:279)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at com.adwhirl.AdWhirlManager.fetchConfig(AdWhirlManager.java:246)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at com.adwhirl.AdWhirlLayout$InitRunnable.run(AdWhirlLayout.java:293)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:114)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:229)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)11-18 15:08:55.970: ERROR/AdWhirl SDK(619):     at java.lang.Thread.run(Thread.java:1096)11-18 15:09:26.019: ERROR/AdWhirl SDK(619): Caught IOException in fetchConfig()11-18 15:09:26.019: ERROR/AdWhirl SDK(619): java.net.UnknownHostException: mob.adwhirl.com11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.net.InetAddress.lookupHostByName(InetAddress.java:513)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.net.InetAddress.getAllByName(InetAddress.java:242)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at com.adwhirl.AdWhirlManager.fetchConfig(AdWhirlManager.java:221)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at com.adwhirl.AdWhirlLayout$InitRunnable.run(AdWhirlLayout.java:293)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:114)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:229)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)11-18 15:09:26.019: ERROR/AdWhirl SDK(619):     at java.lang.Thread.run(Thread.java:1096)11-18 15:09:26.029: ERROR/AdWhirl SDK(619): Unable to parse response from JSON. This may or may not be fatal.11-18 15:09:26.029: ERROR/AdWhirl SDK(619): java.lang.NullPointerException11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at org.json.JSONTokener.nextValue(JSONTokener.java:90)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at org.json.JSONObject.&lt;init&gt;(JSONObject.java:154)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at org.json.JSONObject.&lt;init&gt;(JSONObject.java:171)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at com.adwhirl.AdWhirlManager.parseConfigurationString(AdWhirlManager.java:279)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at com.adwhirl.AdWhirlManager.fetchConfig(AdWhirlManager.java:246)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at com.adwhirl.AdWhirlLayout$InitRunnable.run(AdWhirlLayout.java:293)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:114)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:229)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)11-18 15:09:26.029: ERROR/AdWhirl SDK(619):     at java.lang.Thread.run(Thread.java:1096)</code></pre>","482604","","180538","","2010-11-18 09:41:40","2011-05-25 08:21:15","application does not show adwhirl ads","<android><adwhirl>","2","2","1","",""
"4213487","1","","","2010-11-18 09:50:19","0","173","<p>I am using SQLiteOpenHelper class to create, open database. for my application i am creating writable object SQLiteDatabase which i am using to read and write data to database. This object is static for main class and used in all application to read write in to database. my application is working properly on emulator. but on device after some read write query fires. why it is happening, please if any one has solution help me.</p>","395627","","21234","","2010-11-18 09:51:58","2010-11-18 10:14:29","android sqlite application is being forcefully closed on device","<android><sqlite>","2","0","","",""
"4213520","1","","","2010-11-18 09:54:12","1","544","<p>At the moment, I would like to know the detail of method tracing on android emulator.My purpose is modify QEMU source code (e.g: 0.12.4) for tracing of function calls of application which ran on QEMU (with ARM Linux), with below information:</p><h2>Sim_Time  PC  Call_Type Process_ID</h2><p>After investigated the source code of android emulator (located in android/platform/external/qemu), I just know a little about the method tracing. My understanding is:for this purpose, android emulator creates a trace device for trace methods (call/return pair), trace_dev_write() function calls the trace_interpreted_method() function.But I don't know the root cause to invoke trace_dev_write() function, when is this function is invoked and what is clarify is is invoked for method tracing.So my question is: How to know the call stack of method tracing (trace_interpreted_method func) in android emulator?or Could you explain to me about the methodology of method tracing in android emulator ?</p><p>Please help me to answer above questions.</p><p>Thanks in advance,</p><p>Quynh Nguyen</p>","511934","","3052751","","2014-01-08 14:09:13","2014-01-08 14:09:13","Trace method in android emulator?","<android><methods><android-emulator><trace><qemu>","0","0","","",""
"4213552","1","4214861","","2010-11-18 09:58:54","3","1672","<p>I am getting this error in android with webservice. </p><p>When i run android webservice and run android project that time this will occur</p><p>So what's problem here?</p><p>pls anyone know?</p><p>Thanks Prashant Adesara</p>","487253","","418183","","2010-11-18 12:42:47","2010-11-18 12:43:42","XmlPullParserException expected end_tag","<android><xml>","1","0","","",""
"4213646","1","","","2010-11-18 10:10:34","0","1446","<p>I am using a system() call in a program , that is in c library. For 1st 9 calls it returns '0'(zero) after 10th call it returns 256. I do not know what does it mean. Please anybody help me. Following is the line of code</p><pre><code>int returnValue= system(""/system/bin/cat /dev/graphics/fb0 &gt; /tmpdata/Screenshot/screenshot.bin"");</code></pre>","511945","","","","","2010-11-25 09:51:48","Problem with system() call","<android><system>","1","2","","",""
"4213735","1","4219086","","2010-11-18 10:21:20","0","1009","<p>I am having too many confusions in native coding for android. My application wants to play mms:// stream and I'm facing some serious problems in that. But the basic question is </p><p><strong>What is the difference between ndk-build</strong>  (that i usually use) <strong>and make APP</strong> (i have seen many blogs on them one of them is <a href=""http://marakana.com/forums/android/examples/49.html"" rel=""nofollow"">this</a>) </p><p>Another related question</p><p>Suppose my project is in E:\WorkSpace\mmsTests\AnotherMMS (<em>path edited if you want to test : it contained whitespace</em>)And my ndk path is D:\android-ndk-r4b-windows\android-ndk-r4b</p><p><strong>How can i use make APP with cygwin?</strong>My os is windows xp sp2.</p><p><strong>EDIT</strong> : I have added ndk location in my PATH variable</p><p>Thanks in advance</p>","246942","","","","","2010-11-18 20:10:34","what is the difference between ndk-build and make APP for android?","<android><c><jni><android-ndk>","1","0","","",""
"4213767","1","4376415","","2010-11-18 10:25:47","14","45339","<p>I am using facebook sdk and with the help of example given with that SDK i developed a code to login and store access_token into database</p><p>i have 2 problems:</p><p>1). when i try to fetch access_token from database and pass it to facebook it doesn't allow me to post on wall using that example given with that facebook sdk, why is that so??</p><p>2). i gone through that facebook.java code, but what i got is that to post on a wall i got to open a dialogue box as there is no other method to pass my message straight away and post. Please tell me solution towards it or tel me wat should i do when i want to post on a wall without opening a dialogue box</p><pre><code>   mPostButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                String message = ""Post this to my wall"";                Bundle params = new Bundle();                             params.putString(""message"", message);                mAsyncRunner.request(""me/feed"", params, ""POST"", new WallPostRequestListener());            }        }); public class WallPostRequestListener extends BaseRequestListener {        public void onComplete(final String response) {            Log.d(""Facebook-Example"", ""Got response: "" + response);            String message = ""&lt;empty&gt;"";            try {                JSONObject json = Util.parseJson(response);                message = json.getString(""message"");            } catch (JSONException e) {                Log.w(""Facebook-Example"", ""JSON Error in response"");            } catch (FacebookError e) {                Log.w(""Facebook-Example"", ""Facebook Error: "" + e.getMessage());            }            final String text = ""Your Wall Post: "" + message;            Example.this.runOnUiThread(new Runnable() {                public void run() {                    mText.setText(text);                }            });        }    }</code></pre><p>Whats wrong with above code.. its not posting on wall and giving me Wall Post: empty on phone and emulator both</p><p>Thanks in advance..</p>","457146","","457146","","2010-11-18 13:53:12","2012-12-19 10:04:17","How to post on facebook wall using Facebook android SDK, without opening dialog box","<android><facebook>","5","2","20","",""
"4213784","1","7506847","","2010-11-18 10:27:42","4","2495","<p>ho can I set a spacing beween the stars? Thats my ratingbar:</p><pre><code>ratingBar = (RatingBar) inflater.inflate(R.layout.ratingbar, null);ratingBar.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));</code></pre><p>The layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RatingBar xmlns:android=""http://schemas.android.com/apk/res/android""    style=""@style/myStyle"" android:layout_alignParentRight=""true""    android:layout_height=""19dp"" android:layout_width=""wrap_content""    android:numStars=""5""&gt;&lt;/RatingBar&gt;</code></pre><p>The style:</p><pre><code> &lt;style name=""myStyle"" parent=""@android:style/Widget.RatingBar""&gt;    &lt;item name=""android:progressDrawable""&gt;@drawable/android_r2_ratingstar_yellow&lt;/item&gt;    &lt;item name=""android:indeterminateDrawable""&gt;@drawable/android_r2_ratingstar_grey&lt;/item&gt; &lt;/style&gt;</code></pre><p>Thanks, cheers</p>","472355","","","","","2011-09-21 21:24:00","Spacing between the stars of a rating bar?","<android>","1","2","1","",""
"4213841","1","4213880","","2010-11-18 10:34:54","1","1735","<p>I'm stuck with the following situation. I have a service in my app. The activity started it with startService() to prevent it from closing on unbind in the future. Than binds to the service with bindService() and unbinds later with unbindService(). All that works fine and as expected: onBind/onUnbind is called and service remains running. But when i call bindService() again from this or another activity i've got another behavior: neither onBind nor onRebind are called, but onServiceConnected() still called and i get IBinder implementation that's returned in onBind(). Any ideas? Thx in advance!</p>","505494","","","","","2010-11-18 10:40:38","onBind/onRebind doesn't called in Service","<android><service>","1","0","1","",""
"4213848","1","4214043","","2010-11-18 10:35:46","1","261","<p>I am interesting in: what is the best way to write applications (for example games or business apps) for so different platforms like Android and Phone 7 with minimal changes in source code, logic and other developing artefacts? Or it is impossible and i must write my application two times from the ""ground"" for each of devices? Please tell me about your experience?</p><p>Thank you for any advice!</p>","352555","","424723","","2010-11-18 13:25:44","2010-11-18 13:25:44","Android and Phone 7 porting?","<c#><android><windows-phone-7><porting>","3","1","","",""
"4213876","1","4214359","","2010-11-18 10:39:42","2","3266","<p>i am new to android and xml. so, i would like to know what is xml parsing and how and where we can use it in android application development.I would also like to know the syntax to be used for this purpose.thanks</p>","493193","","","","","2012-04-20 02:12:06","how to do XML parsing in android?","<android><xml><parsing>","3","2","1","",""
"4213881","1","4214708","","2010-11-18 10:41:13","4","1972","<p>Can any one tell me about <strong>Context</strong>"" ? I know we need to use context for ui modification. </p><p>Can any one  brief , what is about please . i have seen like getApplicationContext() , getBaseContext() ? What is the difference beteween them ?</p><p>Thanking your,Srinivas</p>","414777","","","","","2010-11-18 12:39:17","What is 'Context' in android?","<android><context>","1","2","1","2013-12-31 00:42:00",""
"4213906","1","","","2010-11-18 10:44:45","0","788","<p>I'm building an AIR Application for Android devices and I'm using the Camera.</p><p>I found a really strange behaviour. When I first start the app and the camera initializes, I get around 1fps(!).</p><p>If I then press the home Button and klick on the app icon again, it's all good and I get the full framerate.</p><p>This same behaviour also occurs within the Tour de Mobile Flex app when I start the Raw Camera part.</p><p>As soon as I press home and then return to the app, everythings fine...</p><p>Anybody out there having the same issues and maybe a soulution?</p><p>Help is highly apreciated.</p>","511980","","","","","2013-01-27 17:04:09","Android Camera really choppy on Samsung Galaxy Tab with AIR Application","<android><air><camera><galaxy>","2","2","","",""
"4213960","1","4213996","","2010-11-18 10:52:03","4","5939","<p>i need to save a simple field to configurate my APP, cause this, i wont use a database (it's only a field...), i need to save true or false value for this field on a file, and everytimes a section of my app wanna check if it is true they have to check this textfile, and not to open a connexion to a database</p><p>i need to save the config for ever... i mean that when i exit from my app, and for example, i shut down my android device, when i start my device again and start my app, the config have to be saved</p><p>is this possible? how can i do it? i can't find any information about that</p><p>EDIT: i have problems with the first answer... this code is on my oncreate method:</p><pre><code>static SharedPreferences settings;static SharedPreferences.Editor configEditor;settings = this.getPreferences(MODE_WORLD_WRITEABLE);    if (settings.getBoolean(""showMeCheckBox"", true))      showMeCheckBox.setChecked(true);    else      showMeCheckBox.setChecked(false);applyButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Perform action on clicks             if (showMeCheckBox.isChecked()) {                 configEditor.putBoolean(""showMeCheckBox"", true);                 } else {                 configEditor.putBoolean(""showMeCheckBox"", false);                }            }});</code></pre><p>ok, but this doesn't works... allways is selected... always true, like the default value... doesn't matter if i checked or unchecked it.... :S</p>","479886","","479886","","2010-11-18 11:34:28","2011-08-05 15:16:03","How can i save the config of my app without using a database??? (using simple textfile)","<android><persistence>","1","1","3","",""
"4213965","1","4214622","","2010-11-18 10:52:27","1","211","<p>Basically, in Android an Activity represents a screen lifecycle. With startActivity(intent) , the app goes on a new Activity.How to achieve ""change page"" in the same activity à la iPhone like ? with touch screen in option.</p><p>The reason behind this question isI discovered an Android app Diet2Go. When you pick a diet.In the tab ""My diet"" , you can browse your diet page by page.I know it's in the same activity because when you press on Back button, you return back to your home screen.</p>","311420","","1228","","2013-07-10 17:13:28","2013-07-10 17:13:28","Android : how to browse page in the same activity à la iPhone","<android><activity><navigation>","1","0","","",""
"4214255","1","4214832","","2010-11-18 11:30:19","0","448","<p>I'm  trying to schedule my alarm manager to fire up an intent every hour in a day. this is what I do , and it doesnt work properly.</p><p>code:</p><pre><code> new code after edit:          Calendar cal = Calendar.getInstance();    cal.set(Calendar.HOUR_OF_DAY , 22); //22:00 of every evening    cal.set(Calendar.MINUTE , 0); //initiate minute time    cal.set(Calendar.SECOND , 0);    cal.add(Calendar.MINUTE, randomMinutes); //adding mintues so we get random time btw 22:00-07:00    cal.add(Calendar.DAY_OF_YEAR, 1); //switching to the next day.    am.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(),            AlarmManager.INTERVAL_DAY, pi);</code></pre><p>randomMinutesis some number from 0 to 600</p><p>thanks,</p><p>ray.</p>","260511","","260511","","2010-11-18 14:21:56","2010-11-18 14:21:56","AlarmManager scheduling","<android>","1","0","","",""
"4214271","1","4214315","","2010-11-18 11:32:19","0","901","<p>I am trying to extend the ""android.content.Intent"" class by adding a private attribute of a custom class. My goal is to send complex objects from the main Activity to a background Service. The extension itself is not a problem, the class gets compiled without any errors and the project runs. The only problem is that the BroadcastReceiver does not receive the modified Intent and the ""onReceive"" method gets never called. It there any way to pass complex objects with the help of Intents?</p><p>Thanks in advance, Martin</p>","512047","","","","","2010-11-18 11:37:17","Extending Intent class in Android?","<android><android-intent>","1","0","1","",""
"4214389","1","4214962","","2010-11-18 11:47:00","8","17971","<p>Today I tried to launch my Android app from within eclipse but nothing happened. Everything worked fine yesterday. I tried a few things like adb kill-server, adb-start-server. At some point I got the ""user data image is used by another emulator"" error, so I went about deleting the .lock folders in the avd image but to no avail. </p><p>I created a new avd and the emulator doesnt even start with this image. I tried to start it with </p><pre><code>emulator -avd avdname</code></pre><p>->nothing. No error. emulator.exe is running in Taskmanager. </p><p>Windows 7Android SDK Tools, revision 7</p><p><strong>Update:</strong> Now I know when I get the error </p><blockquote>  <p>emulator: ERROR: the user data image is used by another emulator. aborting</p></blockquote><p>it's when I try to run the application again after the emulator.exe is already dangling in Taksmanager.</p><p><strong>Update:</strong> waited for 20mins. emulator.exe is just sitting there with 00:00:00 cpu time. </p>","510827","","510827","","2010-11-18 13:43:48","2013-01-30 10:02:12","Android emulator not starting at all","<android><android-emulator>","6","6","1","",""
"4214441","1","","","2010-11-18 11:53:46","8","6041","<p>I want to convert TextView into Edit Text and vice versa in a button click event in android. I don't know how to achieve this , please help if anyone knows the solution.</p><p>Regards,Rajapandian.K   </p>","131062","","","","","2013-08-12 12:28:22","How to convert TextView to EditText in android?","<android>","4","0","1","",""
"4214462","1","4215250","","2010-11-18 11:56:06","1","305","<p>I'm confused why is my activity still lagging, I use remote service that has few methods and each has its own work like download stuff, process data, compare stuff, etc... It will run in background and update data at selected intervals and notify user of changes over notify system.</p><p>The reason why remote service, because I will eventually add a widget, and service needs to stay running even if android kills the activity, so I unbind it on each onPause().But as far I understand that part doesn't cause my issue.</p><p>But back to my problem... so my is Activity still lagging when I run stuff in service and handler.post method.</p><p>here is the code:</p><pre><code>public class WarnService extends Service {  private Bitmap pic;  private boolean dataUpToDate;  private void loadData(){    //code that downloads new data and sets the dataUpToDate variable  }  private void updateLayer(Bitmap bt){    //code that updates some stuff if downloaded and local data differ  }  private IWarnService.Stub WServiceStub = new IWarnService.Stub() {    @Override    public void refreshData() throws RemoteException {      serviceHandler.post(new Runnable() {        @Override        public void run() {          loadData();          if(!dataUpToDate){            updateLayer(pic);          }        }      });       }  }}</code></pre><p>Also I wanted to add progressDialog to be updated in updateLayer(...) through Activity is a listener to this service, but thats not working well. Whats the best way to update progressDialog? Ever listener, handler, intent, or what?</p><p>So how do I do this correctly?</p>","491320","","","","","2010-11-18 13:31:38","Why is my Activity still lagging when I run stuff in service and handler.post method?","<android><service><handler>","2","0","","",""
"4214628","1","","","2010-11-18 12:16:21","0","701","<p>Hi friends          I have editbox and list view .I am adding the company name in list view .I have the requirment suppose if user type 'A' in editview   .i have to display  only A  value in list view  and if user type ab in editview I have to display ab value in list view at the time of key press event i have to change the value  in list view in android</p><p>can anybody give example</p><p>Thanks </p>","426344","","426344","","2010-11-19 06:16:39","2010-11-19 06:16:39","key press event change the value of list view in android","<android>","1","1","","",""
"4214648","1","4215072","","2010-11-18 12:18:29","0","97","<p>I want to create an application in which- Create a listener which listens for outgoing/incoming messages and calls- UI is shown/hide based on listener results</p>","505011","","","","","2010-11-18 13:43:42","Design suggestion required","<android>","3","0","","",""
"4214675","1","","","2010-11-18 12:21:48","7","1081","<p>Is it at all possible to get 2 Android handsets to see each other using the wireless interface? I'm not talking full-blown access-point mode. It would be cool if both devices could be actively looking for networks / devices whilst at the same time being 'discoverable' to other devices.</p><p>Is this possible in any way?</p><p>Thanks</p><p>Martin</p>","512096","","","","","2012-10-26 04:52:38","Allowing two devices to see each other on Android using wifi interface?","<android><bluetooth><wifi>","6","2","1","",""
"4214683","1","4216068","","2010-11-18 12:23:32","0","3219","<p>I give description of My project</p><p>In my project In the first section i have parsed the xml data of Video categories and image url links from My web service.I have parsed that data and receive that data in <code>ArrayList</code> in My main activity.The first <code>ArrayList</code> is the list of video categories and the second <code>ArrayList</code> is the the list of video image urls and i have to display <code>ArrayList</code> of image urls as <code>ImageView</code> in <code>ListView</code> ,i have no idea for that,please give me some solution.</p>","509412","","244296","","2010-11-18 12:44:03","2012-02-14 10:48:20","Android List Activity with dynamically loaded images form the web in android","<android>","1","3","1","",""
"4214715","1","","","2010-11-18 12:27:14","1","724","<p>I'm getting seeming random crashes (though they always happen at the same time) on the Android 1.5 Emulator (running under OS X). Code is built against 1.5 APIs and runs fine on other versions. App doing the same on an HTC Hero so it appears to be an Android issue rather than just an emulator issue.</p><p>By random I mean a screen will display OK for a few seconds and then crash with no user input or state change. In at least one case it seems to be drawing a fullscreen image that causes it (though the image is drawn fine for a few frames). Stacktrace below which means nothing to me, any help appreciated...</p><pre><code>I/DEBUG   (  836): Build fingerprint: 'generic/sdk/generic/:1.5/CUPCAKE/150240:eng/test-keys'I/DEBUG   (  836): pid: 948, tid: 949  &gt;&gt;&gt; com.bitbull.meat.android &lt;&lt;&lt;I/DEBUG   (  836): signal 11 (SIGSEGV), fault addr 00000004I/DEBUG   (  836):  r0 00000004  r1 4001d040  r2 00000004  r3 ad3296c5I/DEBUG   (  836):  r4 00000000  r5 00000000  r6 ad33cce1  r7 41039fb8I/DEBUG   (  836):  r8 100ffd00  r9 41039fb0  10 41039fa0  fp 00000001I/DEBUG   (  836):  ip ad35b874  sp 100ffce8  lr ad3296cf  pc afb045a8  cpsr 00000010I/DEBUG   (  836):          #00  pc 000045a8  /system/lib/libcutils.soI/DEBUG   (  836):          #01  lr ad3296cf  /system/lib/libandroid_runtime.soI/DEBUG   (  836): stack:I/DEBUG   (  836):     100ffca8  00000000  I/DEBUG   (  836):     100ffcac  00000000  I/DEBUG   (  836):     100ffcb0  00000000  I/DEBUG   (  836):     100ffcb4  00000000  I/DEBUG   (  836):     100ffcb8  00000000  I/DEBUG   (  836):     100ffcbc  41f84728  I/DEBUG   (  836):     100ffcc0  00000001  I/DEBUG   (  836):     100ffcc4  41f84728  I/DEBUG   (  836):     100ffcc8  00000001  I/DEBUG   (  836):     100ffccc  00000000  I/DEBUG   (  836):     100ffcd0  00000000  I/DEBUG   (  836):     100ffcd4  410903b0  I/DEBUG   (  836):     100ffcd8  100ffd30  I/DEBUG   (  836):     100ffcdc  00000005  I/DEBUG   (  836):     100ffce0  df002777  I/DEBUG   (  836):     100ffce4  e3a070ad  I/DEBUG   (  836): #00 100ffce8  00000000  I/DEBUG   (  836):     100ffcec  ad3296cf  /system/lib/libandroid_runtime.soI/DEBUG   (  836):     100ffcf0  100ffd20  I/DEBUG   (  836):     100ffcf4  ad33ccf1  /system/lib/libandroid_runtime.soI/DEBUG   (  836):     100ffcf8  4001d040  I/DEBUG   (  836):     100ffcfc  ad00e3b8  /system/lib/libdvm.soI/DEBUG   (  836):     100ffd00  410903b0  I/DEBUG   (  836):     100ffd04  00141858  [heap]I/DEBUG   (  836):     100ffd08  ad33cce1  /system/lib/libandroid_runtime.soI/DEBUG   (  836):     100ffd0c  4001d040  I/DEBUG   (  836):     100ffd10  00001071  I/DEBUG   (  836):     100ffd14  00141858  [heap]I/DEBUG   (  836):     100ffd18  100ffd20  I/DEBUG   (  836):     100ffd1c  ad040a8d  /system/lib/libdvm.soI/DEBUG   (  836):     100ffd20  41039fb0  I/DEBUG   (  836):     100ffd24  420000f8  I/DEBUG   (  836):     100ffd28  ad33cce1  /system/lib/libandroid_runtime.soI/DEBUG   (  836):     100ffd2c  100ffd98  I/ActivityManager(  568): Process com.bitbull.meat.android (pid 948) has died.I/WindowManager(  568): WIN DEATH: Window{4360bbf8 com.bitbull.meat.android/com.bitbull.meat.android.MEATActivity paused=false}I/WindowManager(  568): WIN DEATH: Window{4366abe0 SurfaceView paused=false}W/InputManagerService(  568): Got RemoteException sending setActive(false) notification to pid 948 uid 10019</code></pre>","509383","","418183","","2010-11-18 12:32:55","2011-03-09 06:37:19","Android 1.5 emulator crashing apparently randomly [WIN DEATH]","<android><crash>","1","0","0","",""
"4214847","1","4223760","","2010-11-18 12:42:00","0","1031","<p>I am using the Bluetooth Chat sample app from android website. I want to send a long message in a particular format (mentioned below in the code) and receive it on the other side and display on my phone (HTC Desire). I will parse this message further, extract few things and use it for my app.</p><p>I am not able to receive all the characters in the above message (few characters get randomly omitted). Is it because of a problem in the InputStream ""read"" method of the bluetooth socket or that the bluetooth SPP profile has bugs and problems in HTC Desire or any other reason? I have tried the InputStream to be a byte buffer, a char buffer and then create a string out of the buffer contents (using normal new String, StringBuilder and StringBuffer). But somehow I am not able to display the entire message in the required format on my phone.</p><p>Any help/suggestion is greatly appreciated.</p><p>Thank you for your time</p><p>Cheers,Madhu Nandan</p><p>/**     * This thread runs during a connection with a remote device.     * It handles all incoming and outgoing transmissions.     */</p><pre><code>private class ConnectedThread extends Thread {    private final BluetoothSocket mmSocket;    private final InputStream mmInStream;    private final OutputStream mmOutStream;    public ConnectedThread(BluetoothSocket socket) {        Log.d(TAG, ""create ConnectedThread"");        mmSocket = socket;        InputStream tmpIn = null;        OutputStream tmpOut = null;        // Get the BluetoothSocket input and output streams        try {            tmpIn = socket.getInputStream();            tmpOut = socket.getOutputStream();        } catch (IOException e) {            Log.e(TAG, ""temp sockets not created"", e);        }        mmInStream = tmpIn;        mmOutStream = tmpOut;    }    public void run() {        Log.i(TAG, ""BEGIN mConnectedThread"");        char[] buffer = new char[1024];        int bytes;          //Writer writer = new StringWriter();        // Keep listening to the InputStream while connected        while (true) {            try {                // Read from the InputStream             Reader reader = new BufferedReader(                        new InputStreamReader(mmInStream, ""UTF-8""));                //int n;                while ((bytes = reader.read(buffer)) != -1)                  //writer.write(buffer, 0, bytes);                //String str = writer.toString();                // Send the obtained bytes to the UI Activity                mHandler.obtainMessage(BluetoothChat.MESSAGE_READ, bytes, -1, buffer)                        .sendToTarget();            } catch (IOException e) {                Log.e(TAG, ""disconnected"", e);                connectionLost();                break;            }        }    }</code></pre><hr><pre><code>case MESSAGE_READ:                      char[] readBuf = (char[]) msg.obj;                         // construct a string from the valid bytes in the buffer          //StringBuffer sb = new StringBuffer("""");         String Incoming = new String (readBuf, 0, msg.arg1);         StringBuilder sb = new StringBuilder("""");                         String readMessage = sb.append(Incoming).toString();                      //String readMessage = new String(sb.append(Incoming));            mConversationArrayAdapter.add(mConnectedDeviceName+"":  "" + readMessage);              mTitle.setText(readMessage);            //String readMessage = new String(sb);            //Make sure there is a received message. Extract it's name and value            //int msgLen = readMessage.length();            //if( msgLen!= 0)            //Message format: &lt;MSG&gt;&lt;N&gt;xxx&lt;!N&gt;&lt;V&gt;yyy&lt;!V&gt;&lt;!MSG&gt; (xxx-name of the  //message, yyy-value of the message)            if (readMessage.matches(""&lt;MSG&gt;&lt;N&gt;.*&lt;!N&gt;&lt;V&gt;.*&lt;!V&gt;&lt;!MSG&gt;""))                             extractData(readMessage);             //else mTitle.setText(R.string.floor_it);             sb.setLength(0);</code></pre>","487851","","387076","","2012-05-12 20:34:45","2012-05-12 20:34:45","Do bugs/problems in bluetooth SPP profile of HTC Desire affect Bluetooth Chat app?","<bluetooth><profile><android>","1","0","1","",""
"4214917","1","4771907","","2010-11-18 12:50:21","3","1956","<p>As google tasks has no public api I want to write workaround and request data like a browser and then parse results to further display.</p><p>To access data I've implemented a OAuth authentication with google to access this url: <a href=""https://mail.google.com/"" rel=""nofollow"">https://mail.google.com/</a></p><p>For OAuth I've used sign-post library and it works well.</p><p>The problem is when I am trying to access <a href=""https://mail.google.com/tasks/ig"" rel=""nofollow"">https://mail.google.com/tasks/ig</a> with signed request it returns me login page instead of desired list with tasks.</p><p>To be more specific here is my code:</p><pre><code>public class GoogleOAuthActivity extends Activity {    private static final String TAG = GoogleOAuthActivity.class.getSimpleName();    private CommonsHttpOAuthProvider provider;    private CommonsHttpOAuthConsumer consumer;    @Override    @SuppressWarnings(""unchecked"")    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        provider = new CommonsHttpOAuthProvider(OAuthPrefs.GET_REQUEST_TOKEN_URL, OAuthPrefs.GET_ACCESS_TOKEN_URL,                OAuthPrefs.TOKEN_AUTHORIZATION_URL);        consumer = new CommonsHttpOAuthConsumer(OAuthPrefs.CONSUMER_KEY, OAuthPrefs.CONSUMER_SECRET);        consumer.setMessageSigner(new HmacSha1MessageSigner());        Log.v(TAG, ""Starting google authentication activity"");        new RequestGoogleOAuth(this, provider, consumer).execute();    }    @Override    @SuppressWarnings(""unchecked"")    public void onNewIntent(Intent intent) {        super.onNewIntent(intent);        final Uri uri = intent.getData();        if (uri != null &amp;&amp; uri.getScheme().equals(OAuthPrefs.CALLBACK_SCHEME)) {            Log.v(""OAUTH MAIN"", ""STARTING STAGE TWO"");            new ConfirmGoogleOAuthTask(this, provider, consumer).execute(uri);            finish();        }    }}</code></pre><p>The first OAuth stage</p><pre><code>public class RequestGoogleOAuth extends OAuthGoogleTask {    public static final String TAG = RequestGoogleOAuth.class.getSimpleName();    public RequestGoogleOAuth(Context context, CommonsHttpOAuthProvider provider, CommonsHttpOAuthConsumer consumer) {        super(context, provider, consumer);    }    protected Object doInBackground(Object... params) {        final String TAG = getClass().getName();        try {            final String url = provider.retrieveRequestToken(consumer, OAuthPrefs.CALLBACK_URL);            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)).setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP                    &amp; Intent.FLAG_ACTIVITY_NO_HISTORY &amp; Intent.FLAG_FROM_BACKGROUND);            context.startActivity(intent);            Log.v(TAG, ""Request google authentication"");        } catch (Exception e) {            Log.e(TAG, ""ERROR during google authentication request"", e);        }        return null;    }}</code></pre><p>The second OAuth stage and attempt to access google tasks</p><pre><code>public class ConfirmGoogleOAuthTask extends OAuthGoogleTask {    public ConfirmGoogleOAuthTask(Context context, CommonsHttpOAuthProvider provider, CommonsHttpOAuthConsumer consumer) {        super(context, provider, consumer);    }    @Override    public Object doInBackground(Object... params) {        final Uri uri = (Uri) params[0];        final String TAG = getClass().getName();        final SharedPreferences prefs = context.getSharedPreferences(OAuthPrefs.PREF_NAME, Context.MODE_PRIVATE);        final String oauthVerifier = uri.getQueryParameter(OAuth.OAUTH_VERIFIER);        try {            provider.retrieveAccessToken(consumer, oauthVerifier);            final Editor edit = prefs.edit();            edit.putString(OAuth.OAUTH_TOKEN, consumer.getToken());            edit.putString(OAuth.OAUTH_TOKEN_SECRET, consumer.getTokenSecret());            edit.commit();            CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(OAuthPrefs.CONSUMER_KEY, OAuthPrefs.CONSUMER_SECRET);            consumer.setMessageSigner(new HmacSha1MessageSigner());            consumer.setTokenWithSecret(consumer.getToken(), consumer.getTokenSecret());            HttpClient httpClient = HttpUtils.createHttpClient();            HttpGet httpGet = new HttpGet(consumer.sign(""https://mail.google.com/tasks/ig""));            HttpResponse response = httpClient.execute(httpGet);            int statusCode = response.getStatusLine().getStatusCode();            Log.d(TAG, ""Status code = "" + statusCode);            if (statusCode == HttpStatus.SC_OK) {                String xml = ConvertUtils.convertStreamToString(response.getEntity().getContent(), true);                Log.d(TAG, ""XML = "" + xml);            }            Log.v(TAG, ""Successfully receive access token"");        } catch (Exception e) {            Log.e(TAG, ""ERROR during request for access token"", e);        }        return null;    }}</code></pre><p>At this line:</p><pre><code>String xml = ConvertUtils.convertStreamToString(response.getEntity().getContent(), true);                    Log.d(TAG, ""XML = "" + xml);</code></pre><p>I can see that I receive ""Login page""</p><p>I think the reason is that google doesn't provide access to this service and even I've already authenticated with OAuth it restricts my access to this resource (even I've defined scope as <a href=""https://mail.google.com/"" rel=""nofollow"">https://mail.google.com/</a>). I am not sure how to implement it right now but it looks like I need to simulate browser exactly how it interacts with google (retrieve and send appropriate coockies). But I am asking, because I am not sure how to be int this situation, because as I've mentioned google tasks API has no public API (soap, rest or any other) so it's not obvious for me how to implement client for this feature...</p><p>If somebody has examples where app access google resources without public API I will be very happy to see that.</p><p>Thanks, hoply somebody knows the answer!</p>","390323","","","","","2011-06-22 07:10:09","Android: Problem to access google tasks with OAuth","<android>","2","0","3","",""
"4214939","1","4214965","","2010-11-18 12:53:07","16","12564","<p>I have some shared preferences (latitude, longitude) that I want to access from a service, that is not subclassed from Activity. </p><p>In particular, when I try to access getPreferences, this function doesn't exist's on a service.  My code is posted below</p><p>My goal here is to allow WRITE these shared preferences with my service. Any suggestions/examples that can help me along?</p><pre><code>public class MyService extends Service implements Runnable {    LocationManager mLocationManager;    Location mLocation;    MyLocationListener mLocationListener;    Location currentLocation = null;    static SharedPreferences settings;    static SharedPreferences.Editor configEditor;    public IBinder onBind(Intent intent) {        return null;    }    public void onCreate() {        settings = this.getPreferences(MODE_WORLD_WRITEABLE);        configEditor = settings.edit();        writeSignalGPS();    }    private void setCurrentLocation(Location loc) {        currentLocation = loc;    }    private void writeSignalGPS() {        Thread thread = new Thread(this);        thread.start();    }    @Override    public void run() {        mLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);        if (mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {            Looper.prepare();            mLocationListener = new MyLocationListener();            mLocationManager.requestLocationUpdates(            LocationManager.GPS_PROVIDER, 1000, 0, mLocationListener);            Looper.loop();            //Looper.myLooper().quit();        } else {            Toast.makeText(getBaseContext(),              getResources().getString(R.string.gps_signal_not_found),              Toast.LENGTH_LONG).show();        }    }    private Handler handler = new Handler() {        @Override        public void handleMessage(Message msg) {            if (currentLocation!=null) {                configEditor.putString(""mylatitude"", """"+currentLocation.getLatitude());                configEditor.putString(""mylongitude"", """"+currentLocation.getLongitude());                configEditor.commit();            }        }    };    private class MyLocationListener implements LocationListener {        @Override        public void onLocationChanged(Location loc) {            if (loc != null) {                Toast.makeText(getBaseContext(),                getResources().getString(R.string.gps_signal_found),                  Toast.LENGTH_LONG).show();                setCurrentLocation(loc);                handler.sendEmptyMessage(0);            }        }    @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>I get the error on the line <code>settings = this.getPreferences(MODE_WORLD_WRITEABLE);</code></p>","479886","","281545","","2013-03-11 12:21:25","2013-09-06 10:30:11","Problems using SharedPreferences on a Service (getPreferences doesn't exist on a service)","<android><service><sharedpreferences>","4","0","4","",""
"4214969","1","4215029","","2010-11-18 12:57:18","3","2846","<p>I have a latitude and longitude values as a double value(37.33168900, -122.03073100). </p><p>I want to convert it to the degree value like (37 19' 54 ,48 11' 52 ).</p><p>Any Idea? Thanx in advance. </p>","267269","","","","","2010-11-18 13:24:29","How to find degree from the latitude value in android?","<java><android><location>","3","1","1","",""
"4215047","1","","","2010-11-18 13:06:14","6","16426","<p><strong>bookmark and add to my homescreen 60x60 icon does not apprear.</strong> Make </p><pre><code>&lt;link rel=""apple-touch-icon"" href=""images/iphone.png""/&gt;</code></pre><p>Size: 60x60 pixels. tried 8bit and 24bit ping! Does not work. Site is on a localhost and not 'online'.</p><p>on <a href=""http://news.bbc.co.uk/sport"">http://news.bbc.co.uk/sport</a> if I bookmark and add to my homescreen it works! <strong>Why?</strong>They use: <code>&lt;link rel=""apple-touch-icon"" href=""/sol/shared/img/iphone-sport.png""/&gt;</code></p><p>Any help appreciated</p>","512146","","","","","2013-05-16 11:09:32","Android | bookmark icons on homescreen","<android><website><icons><homescreen>","2","0","2","",""
"4215070","1","4216124","","2010-11-18 13:09:36","0","2020","<p>I was having the problem in here : <a href=""http://stackoverflow.com/questions/4197135/how-to-start-activity-in-adapter"">How to start Activity in adapter?</a> . however, i would like to modify the transition animation direction. since, inside an adapter, you cannot call overridePendingTransition(). So do you guys know how to do it by using context and intent?</p><p>also, i have an activity using my customized adapter, and do you guys know how to call my own function in activity from the adapter?</p><p>thank you so much!penny</p>","502958","","502958","","2010-11-18 13:16:33","2010-12-16 17:46:19","android start Activity in adapter (transition animiation direction problem)","<java><android><activity><adapter><transition>","1","0","1","",""
"4215081","1","","","2010-11-18 13:10:59","1","2963","<p>I need to set IP adress on Android phone from my own application, any idea?</p>","499056","","","","","2011-09-28 17:25:29","set Android IP address from my own android application","<android><ip-address>","3","0","","",""
"4215093","1","","","2010-11-18 13:12:49","1","309","<p>I wrote an application working with contacts and store some data in db using contactId as key. Being far from computer (terrible english?) I noticed that data tied on a contact is gone. Can it possible that contactId for contact is changed by Android (or any application?). Thanks</p>","344053","","","","","2010-11-18 13:51:20","Android ContactId may change?","<android><database><contacts>","1","0","","",""
"4215117","1","","","2010-11-18 13:14:35","1","1373","<p>I want to know the FM Radio signal strength in Android. For this I have to interact with hardware or not? Or is there any API which can directly give me the value of signal strength?</p>","512152","","28169","","2010-11-18 13:48:30","2010-11-18 16:21:53","FM signal strength of Android","<android><radio><signals>","1","1","","",""
"4215198","1","","","2010-11-18 13:23:53","0","319","<p>I have SQLITE DB query which returns me one record at a time. This is the query :-rawQuery(""SELECT id, category_id, title, text FROM customer WHERE (reads = (SELECT MIN(minReads) FROM categories)) AND status = 'a' ORDER BY rating DESC, rand_index DESC LIMIT 1 "",null);</p><p>If I want to fetch next record as we are applying limit in my sqlite query above i m unable to get next record. Limit 1 is necessary as i have thousands of record in my db. </p><p>How can I fetch next record without modifying the existing query. I cannot apply loop on this as I have lots of records and I don't want all the record at the same time. I want it to be fetched dynamically one by one. I want to be be something like where I can store result in an array as I might need old record as well while getting next record. </p><p>Any input will be a great help.</p><p>Thanks in advance,</p>","104004","","","","","2010-11-18 13:44:47","Need to put a query in a loop to return result set one by one","<android><sqlite><limit><clause>","2","0","","",""
"4215360","1","","","2010-11-18 13:43:17","5","2172","<p>I run my android application with camera functionality implemented in an android-powered phone, but the camera image I got always has small resolution. It seems by default, the android camera resolution is small (e.g. 640*480), how to increase the resolution?? </p><p>I use the following code to implement the camera part: </p><pre><code>Intent i = new Intent(""android.media.action.IMAGE_CAPTURE""); File photo=new File(Environment.getExternalStorageDirectory(), ""123.jpg""); i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo)); startActivityForResult(i, 1); </code></pre><p>any suggestions on this???</p>","475850","","","","","2010-11-18 15:55:55","how to increase camera resolution when using IMAGE_CAPTURE intent","<android><camera>","1","0","2","",""
"4215398","1","4255161","","2010-11-18 13:47:29","0","6308","<p>I'd like to establish a Bluetooth communication between an Android phone and a remote device. The class of the remote device is a basic one just a simple Bluetooth adapter. When I use the Bluetooth scan devices function, the phone recognizes devices from different class (ex. computer, phone, Bluetooth headset) but not this one. I tried it on a Samsung Galaxy Theos and a HTC Wildfire with Android 2.1 but I got the same result with both.Is that possible that the phone manufacturer or Android filters certain class of devices? Otherwise, is there another way to make this device discoverable? </p><p>Thanks in advance. </p><p>lorenth</p>","491053","","","","","2011-12-20 14:04:43","Bluetooth device not discoverable","<android><bluetooth>","4","5","3","",""
"4215424","1","4216049","","2010-11-18 13:50:28","1","769","<p>Hi I am searching for functionality which works like the itemizedOverlay on the mapview, only for Imageview. So that I can add items on specific locations on the image and trigger actions on tap of the item.</p><p>I am building an application for Android where you get Floorplans and on this Floorplan the rooms should be marked and clickable to get more information.</p><p>Thank you very much for any help or hint in this matter</p>","509249","","","","","2010-11-18 14:53:52","Is there anything like an itemized Overlay for Images?","<android><image>","1","0","","",""
"4215476","1","","","2010-11-18 13:55:12","1","3182","<p>Hi i won't want to show virtual keyboard even user touch the editText field.</p>","512192","","","","","2013-01-09 12:21:04","hide virtual keyboard in android?","<android>","4","0","","",""
"4215606","1","4215707","","2010-11-18 14:07:38","0","410","<p>I want to set in project properties build target 2.2 (api level 8)</p><p>In the manifest.xml <code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""4""/&gt;</code> is declared.</p><p>Did anybody tried, if any user (with min. Android 1.5) see application in the market?</p><p>Could some other problems occur because of different SDK for building and in manifest?!</p><p>Thank you,</p><p>Mur</p><p>P.s.You would probably ask, why do I want to do that thing.Just wanted that users of Android 2.2. could move app to SD card and and have read this tutorial <a href=""http://mobile.tutsplus.com/tutorials/android/move-to-sd-card/"" rel=""nofollow"">http://mobile.tutsplus.com/tutorials/android/move-to-sd-card/</a></p>","408780","","408780","","2010-11-18 14:36:45","2010-11-18 14:36:45","Android Market Filters and Build Target","<android><google-play>","2","0","","",""
"4215771","1","4215978","","2010-11-18 14:25:42","1","3278","<p>I am new so I may not explain the situation well. Please let me know if you need more info.</p><p>I am trying to implement a listview like this:</p><pre><code> [textview][button][checkbox]  [textview][button][checkbox] [textview][button][checkbox]  [textview][button][checkbox] </code></pre><p>I want other checkbox unchecked automatically when I click one of them. So it is like a single choice. I write following codes which can implement multiple choice but when I try to switch it to single choice I got trouble. </p><p>in checkBoxOnClickListener I cannot find other (checkbox)view and toggle them. Any suggestion pals? Let me know if you think my express skills poor.</p><p>Thank you.</p><pre><code>    public class MyAdapter extends SimpleAdapter {    Map&lt;Integer, Boolean&gt; map;    LayoutInflater mInflater;    private List&lt;? extends Map&lt;String, ?&gt;&gt; mList;    public MyAdapter(Context context, List&lt;Map&lt;String, String&gt;&gt; data, int resource, String[] from, int[] to) {        super(context, data, resource, from, to);        map = new HashMap&lt;Integer, Boolean&gt;();        mInflater = LayoutInflater.from(context);        mList = data;        for (int i = 0; i &lt; data.size(); i++) {            map.put(i, false);        }        if (data.get(0).get(""value"").equals(""Male"") || data.get(0).get(""value"").equals(""Yes"")) {            map.put(1, true);        }    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        if (convertView == null) {            convertView = mInflater.inflate(R.layout.rapid_diagnosis_row, null);        }        TextView textView = (TextView) convertView.findViewById(R.id.multiple_question);        textView.setText((String) mList.get(position).get(""value""));        CheckBox checkBox = (CheckBox) convertView.findViewById(R.id.multiple_checkbox);        checkBox.setChecked(map.get(position));        // save position and checking status into tag        checkBox.setTag(position);        checkBox.setOnClickListener(checkBoxOnClickListener);        return convertView;    }    public OnClickListener checkBoxOnClickListener = new OnClickListener() {        public void onClick(View v) {            // ((CheckBox) v).toggle();            boolean checked = ((CheckBox) v).isChecked();            if (checked) {                ((CheckBox) v).setChecked(true);            } else {                ((CheckBox) v).setChecked(false);            }            int p = (Integer) (v.getTag());            mSimpleAdapter.map.put(p, checked);                            // this cannot works, helppp            ListView lv = ((ListView) (v.getParent().getParent()));            (CheckBox) cb = lv.findViewWithTag(1);            cb.toggle();                   .....................</code></pre><p>...............            }        };    }</p>","479927","","","","","2012-08-08 07:30:05","how to find other (checkbox)view in a custom listview","<android><listview><checkbox><listener>","2","0","1","",""
"4215833","1","4216291","","2010-11-18 14:32:32","0","644","<p>I was wondering if it's possible to have a contextMenu without any view..?Or any Dialog, acting simply like a contextMenu (a list of clickable items in fact)..?</p><p>I can explain: on the first use of the app, a pop-up (ContextMenu) list all option modes.The actual trick is a button, registered for the ContextMenu and the firing is done by button.performLongClick()...</p><p>I don't want to have that button anymore, but I still want the ContextMenu</p><p>Any idea?</p><p>Thanks in advance,jo</p>","474411","","","","","2010-11-18 15:13:32","howto fire onCreateContextMenu or howto have a contextMenu without any View","<android><contextmenu>","1","0","","",""
"4215915","1","4215999","","2010-11-18 14:38:03","1","87","<p>I'm trying to show all images from a selected category on screen. Which is the best way to accomplish this? because the drawable folder won't allow me to create subfolders :( i will be using a database but i don't want to save the whole image in it, can this be done?Thanks in advance </p>","499488","","","","","2010-11-18 14:48:19","problem showing image in Android","<android>","1","0","","",""
"4215940","1","4216185","","2010-11-18 14:41:58","0","1110","<p>I am a beginner and I have two question.</p><ol><li><p>Why does the video in the attached code is not running (get a message from the emulator that the application cannot run the video).</p></li><li><p>Can anyone please help me to understand how should I implement the onTouchEvent in order to capture a touch on the screen (don't care where on the screen) while a video is running.</p></li></ol><p>Thanks in advanceAmihay</p><blockquote>  <p>public class VidShow extends Activity {</p></blockquote><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.videoscrn);/*run the video*/VideoView video = (VideoView) findViewById(R.id.video);// Load and start the movievideo.setVideoPath(""raw/samplevideo.3gp"" );video.start();}</code></pre><p>}</p>","495967","","","","","2010-11-18 15:05:06","android - detect a touch on the screen while video is running","<android><video><ontouchevent>","1","0","","",""
"4215984","1","","","2010-11-18 14:46:58","-1","2758","<p>how to find checked events in choice mode multiple.</p><p>I am using ontemselected method it is not working for me</p><pre><code> ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_multiple_choice,getIntent().getStringArrayExtra(""agents""));            ListView list = (ListView)findViewById(R.id.ListView01);            list.setAdapter(adapter);            list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);            list.setSelected(true);            list.setClickable(true);            list.setOnItemSelectedListener(new OnItemSelectedListener() {                public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,                        int arg2, long arg3) {                    // TODO Auto-generated method stub                   Log.d(""checked"",""""+arg2);                        }                @Override                public void onNothingSelected(AdapterView&lt;?&gt; arg0) {                    // TODO Auto-generated method stub                }            });            }catch (Exception e) {                // TODO: handle exception                e.printStackTrace();            }</code></pre>","1746300","","174261","","2011-08-18 06:34:21","2012-08-06 05:25:35","find list view choice mode multiple events","<android>","1","1","1","",""
"4216082","1","4216182","","2010-11-18 14:56:37","5","3407","<p>I have preferences working and I am using a combination of CheckBoxPreference and EditTextPreference. I would like to replace one of them with a DatePickerDialog.</p><p>When my settings screen is showing, if you click on one of the preferences, I would like the date picker dialog to pop up for the user to select a date, and save the picked date in preferences. I have seen this work in other apps, but I cannot see how to do this.</p><p>I have the date picker dialog working from a regular view (as per tutorial), but I would to like to use it from a preference.</p>","479542","","","","","2014-01-27 15:52:15","How to use DatePickerDialog as a Preference","<android>","3","0","","",""
"4216097","1","4216883","","2010-11-18 14:57:46","0","126","<p>I'm used to working in J2ME. I wanted to do something on Android, but I just can't get how to replace the command class in the events Android scenario.</p>","495904","","210719","","2010-11-18 16:44:02","2010-11-18 16:44:02","From Command to Android","<java><android><java-me>","1","1","","",""
"4216147","1","","","2010-11-18 15:02:13","5","5187","<p>i am trying to use the old facebook connect authentication to authenticate my android client to get the necessary session id's and other credentials thats needed to start using the web service of facebook.</p><p>the issue i am having is that when my android application launces and tries to load the login page for facebook, that very same login page is blank and it only displays the the facebook logo as the title of the screen.</p><p>No login fields or buttons are visible leaving me nowhere to login and authenticate a user.</p><p>i have tried two API's one is facebook connect api for android <a href=""http://code.google.com/p/fbconnect-android/"">http://code.google.com/p/fbconnect-android/</a>  and the other one is the official android facebook sdk that is recommended to be used instead of the previous one i have just mentioned <a href=""https://github.com/facebook/facebook-android-sdk/"">https://github.com/facebook/facebook-android-sdk/</a> .</p><p>please see the image below of how it looks like on my app.</p><p><img src=""http://i.stack.imgur.com/vRkSZ.png"" alt=""alt text""></p><p>Here is code that uses the latest android sdk facebook:</p><pre><code>/** * Authenticate facebook network */private void authenticateFacebook() {    // TODO: move this away from this activty class into some kind of    // helper/wrapper class    Log.d(TAG, ""Clicked on the facebook"");    Facebook facebook = new Facebook(OAUTH_KEY_FACEBOOK_API);    facebook.authorize(this, new AuthorizeListener());}class AuthorizeListener implements DialogListener{    @Override    public void onComplete(Bundle values) {        // TODO Auto-generated method stub        Log.d(TAG, ""finished authorizing facebook user"");    }    @Override    public void onFacebookError(FacebookError e) {        // TODO Auto-generated method stub    }    @Override    public void onError(DialogError e) {        // TODO Auto-generated method stub    }    @Override    public void onCancel() {        // TODO Auto-generated method stub    }}</code></pre><p>And a simple example of how to use it: <a href=""http://developers.facebook.com/docs/guides/mobile/"">http://developers.facebook.com/docs/guides/mobile/</a></p><p>My code is more or less identical to the above example.</p><p>edit: i did not catch what logcat was inputing in my first attempted at my code above but their was no exceptions or warnings thrown at the time. just a blank page.</p><p>i then tried it again and diddnt touch my code and what happens now is that a loading dialogue view pops up and stays their for a few minutes until the facebook windows disapears and the logcat outputs the error below:</p><blockquote>  <p>11-18 17:26:19.913:  DEBUG/Facebook-WebView(783): Webview  loading URL:  <a href=""https://www.facebook.com/dialog/oauth?type=user_agent&amp;redirect_uri=fbconnect%3A%2F%2Fsuccess&amp;display=touch&amp;client_id=e"">https://www.facebook.com/dialog/oauth?type=user_agent&amp;redirect_uri=fbconnect%3A%2F%2Fsuccess&amp;display=touch&amp;client_id=e</a>???????????????????  11-18 17:27:01.756:  DEBUG/Facebook-authorize(783): Login  failed:  com.kc.unity.agent.util.oauth.facebook.DialogError:  The connection to the server was  unsuccessful. 11-18 17:27:01.783:  DEBUG/Facebook-WebView(783): Webview  loading URL:  <a href=""https://www.facebook.com/dialog/oauth?type=user_agent&amp;redirect_uri=fbconnect%3A%2F%2Fsuccess&amp;display=touch&amp;client_id="">https://www.facebook.com/dialog/oauth?type=user_agent&amp;redirect_uri=fbconnect%3A%2F%2Fsuccess&amp;display=touch&amp;client_id=</a>???????????????</p></blockquote><p>please note that the client id i have amended for obvious reasons but the rest of the logcat is untouched</p>","444668","","444668","","2010-11-18 17:30:39","2014-01-29 03:30:50","facebook connect for android returns a blank login screen?","<android><facebook>","2","5","3","",""
"4216231","1","4217626","","2010-11-18 15:08:57","0","113","<p>i have a googlemap app that displays two items (itemizedoverlay class) and i have a Update button. When i press the update button, i want to remove the items from the map, and put again the same items but with the new latitude and longitude values (i have a service that actualice the latitude and longitude fields that i have in sharedPreferences, and also i recibe the other position by a bundle)</p><p>what i am doing wrong? when i try my code, the items of the map doesn't be removed.... just new items appear... but i want to remove the old ones</p><pre><code>updateButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                mapOverlays.clear();                updateMyPosition();                updateFriendPosition();            }        });</code></pre><p>and these are my two functions:</p><pre><code>private void updateFriendPosition()     {        Bundle bundle = this.getIntent().getExtras();//get the intent &amp; bundle passed by X        userText.setText(bundle.getString(""user""));        permissionText.setText(bundle.getString(""permission""));        lastUpdateText.setText(bundle.getString(""lastupdate""));        String coordinates[] = {bundle.getString(""lat""), bundle.getString(""lon"")};          lat = Double.parseDouble(coordinates[0]);        lng = Double.parseDouble(coordinates[1]);        p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));        OverlayItem overlayitem1 = new OverlayItem(p, bundle.getString(""user""), ""Hi Friend!"");        itemizedoverlay.addOverlay(overlayitem1);        mapOverlays.add(itemizedoverlay);// dibujo la estrella con la posicion actual del friend        mc.animateTo(p); ///nos centra el mapa en la posicion donde esta nuestro amigo        mc.setZoom(10);  /// ajusta el zoom a 10            }private void updateMyPosition()    {        String coordinates[] = {settings.getString(""mylatitude"", null),settings.getString(""mylongitude"", null)};            lat = Double.parseDouble(coordinates[0]);        lng = Double.parseDouble(coordinates[1]);        p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));        OverlayItem overlayitem1 = new OverlayItem(p, ""Me"", ""My Position"");        itemizedoverlay2.addOverlay(overlayitem1);        mapOverlays.add(itemizedoverlay2);//dibujo mi icono para mostrarme a mi    }</code></pre><p>i also tryed with invalidate() on the mapview but it doesn't works... still paint the old items...</p>","479886","","245205","","2010-11-18 17:16:46","2010-11-18 17:16:46","How to actualice the positions of the items in a googlemap?","<android><google-maps><android-mapview>","1","0","","",""
"4216367","1","4216477","","2010-11-18 15:19:05","2","309","<p>We have a tab based application that needs to support the ability for a customer to add their own plug-in tab(s).  When starting our app I need to find out about the plug-in so that I can create the tab, place it in the correct spot, label it, assign icons for it and launch the plug-in activity as it's content.  It appears that this is the data I need to do this:</p><ul><li>Tab priority (used to order the tabs)</li><li>Tab Label</li><li>Tab Icon(s)</li><li>Tab Activity (for launching via Intent)</li></ul><p>These are some of the options I've considered:</p><ol><li><p>Plug-in service.  This would require each plug-in activity to have a related service.  I would then use PackageManager.queryIntentServices() to find plug-in services with a known interface, then request the information I need about the activity via that interface.  </p></li><li><p>Plug-in Intent Filter Query.  I'm not sure if this is even possible, but the thought is to store the data I need in the Intent Filter for the plug-in activity.  I would use PackageManager.queryIntentActivities() to find the plug-in activities and the filter field of the ResolveInfo to get information about the filter.  However, I don't have the details of how to store/retrieve that information in the Intent Filter.</p></li><li><p>Configuration data.  In the C++ world, this data would be placed in an XML configuration file that is read in by the app at start-up.  This would require modifying the config any time a plug-in is added.  In our case it's not a big deal as we're targeting a custom device that we're the main app on.  But I'd still prefer to do it dynamically.  Where does this data reside on Android?</p></li></ol><p>So does anyone have any recommendations on how to do this?  What other solutions are there?  What is most efficient?</p><p>As you can probably tell, I'm new to Android.  I've done my best to find ways to implement this, but I might be working outside the expected norm for Android.</p>","512309","","681588","","2011-11-22 21:24:49","2011-11-22 21:24:49","Dynamic tab plugins","<android>","2","0","2","",""
"4216414","1","","","2010-11-18 15:23:27","2","2717","<p>I am very new to android development so forgive my ignorance.I need to be able to read some text from a remote webpage at say 15 minute intervals. The webpage itself contains just one word with no html tags or formatting. If this is possible if someone could point me in the right direction I'd appreciate it.</p><p>Thanks</p>","512307","","","","","2011-10-15 14:49:23","Read remote text file in android","<java><android>","2","0","2","",""
"4216422","1","4510172","","2010-11-18 15:24:19","2","947","<p>I use library which uses sfl4j-api for logging in android application. So I use slf4j-android to get logs, but I only got following messages:</p><pre><code>I/AndroidLoggerFactory(  267): Logger name 'org.apache.mina.util.NamePreservingRunnable' exceeds maximum length of 23 characters, using 'o*.a*.m*.u*.NamePreser*' instead.</code></pre><p>And no more logs from that library, but I see in code there are plenty of them. I tried to change the level of logging for tags in emulator by:</p><pre><code>emulator -avd default -debug '*'</code></pre><p>or by</p><pre><code>emulator -avd default -verbose</code></pre><p>and nothing changed.</p><p>Any help will be appreciated. </p>","217852","","","","","2010-12-22 14:29:15","Android: No logs while logging via slf4j-android","<android><logging><slf4j>","1","0","","",""
"4216443","1","","","2010-11-18 15:27:10","2","933","<p>I've implemented a ContextMenu where the items have checkboxes enabled via setCheckable(true).  What seems strange to me is that the context menu closes as soon as I click the checkbox.  These are not set up as radio buttons (implying single selection) and since the nature of checkboxes are to allow multiple selection, I'm unsure of how to prevent the context menu from closes when the checkbox is clicked.</p><p>Am I overlooking some property?  Thanks in advance...</p>","207880","","","","","2010-11-18 18:02:09","Checkbox within ContextMenu closes menu. Any way to keep it open?","<android>","2","1","1","",""
"4216595","1","4216672","","2010-11-18 15:40:29","0","670","<p>I have a listview that has a photograph from the gallery for each entry but it was blowing up and running out of memory so I resized the image</p><pre><code>BitmapFactory.Options opts = new BitmapFactory.Options();opts.inSampleSize = 8; Bitmap yourSelectedImage = BitmapFactory.decodeFile(photo,opts);imgView.setImageBitmap(yourSelectedImage);</code></pre><p>The problem I have is that each image in the list has to be resized before it is displaying the view.</p><p>Is there a way to link to the thumbnail view instead of the full size image so that I don't have to resize them or is there a way to load each picture as it is sized instead of having to wait for them all.</p>","497494","","","","","2010-11-18 15:47:04","ListView with photos from Gallery","<android><android-layout>","1","0","","",""
"4216714","1","","","2010-11-18 15:50:09","0","1181","<p>I'd like to show a png in the built-in image viewer.Here is my code : </p><pre><code>Intent intent = new Intent();intent.setAction(android.content.Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(new File(path)), ""image/png"");startActivity(intent);</code></pre><p>It displays a msgbox with a list wich contains more than 10 differents applications thatcan display the image.How to limit the msgbox to two or three applications (the most significant if possible) ?</p>","164460","","","","","2010-11-18 16:00:22","android display image in image viewer","<android><image>","1","0","","",""
"4216789","1","4305816","","2010-11-18 15:58:03","3","799","<p>My question may look naive but I do not know how to formulate it more correctly. The problem is that I create and use large simple type arrays in my application. And I get errors like:</p><pre><code>ERROR/dalvikvm-heap(1763): Out of memory on a 7907344-byte allocation.</code></pre><p>Yes, it's big enough but task management tools claim that my application is using only 30MB of memory, while other at the same time use 50MB and even 110MB (have seen once) and there is still 190MB of free memory in the system (not system applications, just other ordinary applications I have installed). If all applications are provided with the same heap size at startup how can they grow so big?</p>","488489","","","","","2012-08-18 03:19:32","Why my application has less heap memory than others?","<java><android><memory-management>","3","3","1","",""
"4216840","1","4217185","","2010-11-18 16:01:41","1","4523","<p>Another newbie question.  I have a context menu that I apply for a ListView that simply allows the user to move items up or down, or delete the item.  </p><p>I have code in onContextItemSelected() to prevent things from moving up past top or bottom of the list, etc., but I'd rather hide the context menu items in the first place if (for instance) the top item in the list is selected.</p><p>I assume that I need to do this in onCreateContextMenu, but I'm not sure how.</p><p>Here is my onCreateContextMenu code:</p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,        ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.mycontextmenu, menu);}</code></pre><p>Thanks,<br/>wTs</p>","285417","","","","","2014-03-19 12:06:10","Hide Android Context Menu Item","<android><contextmenu>","4","0","","",""
"4216914","1","","","2010-11-18 16:09:31","1","1584","<p>Im trying to do the backing up of my application's data into the Google Servers..</p><p>For doing this I've implemented a <code>BackupAgent</code> in my code and I included this in the Android  Manifest file and ""Meta-data"" ( Got after registered my Application's package with the <a href=""https://developers.google.com/android/backup/"" rel=""nofollow"">Android Backup Service</a>)</p><p>When I run the application to do the backup this is not performing the backup.. Im using Nexus one device (connected to WIFI also) .</p><p>Could any one please let me know why it is not calling my BackupAgent's <code>onBackup()</code> method?</p><p>Am I missing some thing, to include in the Android manifest file or some where in the program?</p><hr><p>The below is my manifest file..</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""org.simpledatabackup""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""                 android:backupAgent=""MyBackupAgent""                 android:debuggable=""true""&gt;        &lt;activity android:name="".SimpleDatabackup""                  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;meta-data android:name=""com.google.android.backup.api_key""                   android:value=""AEdPqrEAAAAIZn2ysSLR5wNbcq1uaoWQO0HuipMetQENVTsilw"" /&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>and the source file is </p><pre><code>public class SimpleDatabackup extends Activity {    private SharedPreferences myPrefs ;         // Shared Preferences    BackupManager mBackupManager;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        myPrefs = this.getSharedPreferences(""shared_prefs"", MODE_WORLD_READABLE);        SharedPreferences.Editor edit = myPrefs.edit();        edit.putString(""firstname"", ""uday"") ;        edit.putString(""lastname"", ""kiran"") ;        edit.commit() ;        mBackupManager.dataChanged();       }}</code></pre><p>My Backup Agent is some thing like this: I have not implemented the functionality inside is onBackup() and onRestore(). Once if it is called i will implement what ever i want.. </p><pre><code>public class MyBackupAgent extends BackupAgent {@Overridepublic void onCreate() {    System.out.println(""In MyBackuAgent's onCreate() method"");}@Overridepublic void onBackup(ParcelFileDescriptor arg0, BackupDataOutput arg1,        ParcelFileDescriptor arg2) throws IOException {    System.out.println(""In MyBackuAgent's onBackup()"");    // TODO Auto-generated method stub}@Overridepublic void onRestore(BackupDataInput data, int appVersionCode,        ParcelFileDescriptor newState) throws IOException {}}</code></pre>","419389","","810368","","2012-10-29 09:28:29","2013-09-02 11:10:35","Data Backup into Google Servers using Android Backup Service in Android","<android><android-backup-service>","1","2","1","",""
"4216960","1","4217383","","2010-11-18 16:13:34","0","3595","<p>I have created my first android app. It's just printing a string ""Hello World"" but when I try to run it in emulator. It just stuck on </p><p>""Waiting for HOME ('android.process.acore') to be launched...""</p><p>Following is the log in DDMS</p><blockquote>  <p>[2010-11-18 20:45:55 - ddms]Created: [Debugger 8600-->3670 inactive]<br>  [2010-11-18 20:45:55 - ddm-heap]Sending REAQ<br>  [2010-11-18 20:45:55 - ddms]Adding new client [Client pid: 3670]<br>  [2010-11-18 20:45:55 - ddms]Good handshake from client, sending HELO to 3670<br>  [2010-11-18 20:45:55 - ddm-hello]Sending HELO ID=0x400004a5<br>  [2010-11-18 20:45:55 - ddm-heap]Sending FEAT<br>  [2010-11-18 20:45:55 - ddm-prof]Sending MPRQ<br>  [2010-11-18 20:45:55 - ddms]broadcast 2: [Client pid: 3670]<br>  [2010-11-18 20:45:55 - ddm-hello]Now ready: [Client pid: 3670]<br>  [2010-11-18 20:45:55 - ddm-thread]Now ready: [Client pid: 3670]<br>  [2010-11-18 20:45:55 - ddms]Calling handler for REAQ [com.android.ddmlib.HandleHeap@13651ed] (len=1)<br>  [2010-11-18 20:45:55 - ddm-heap]handling REAQ<br>  [2010-11-18 20:45:55 - ddm-heap]REAQ says: enabled=false<br>  [2010-11-18 20:45:55 - ddms]Calling handler for HELO [com.android.ddmlib.HandleHello@34c748] (len=42)<br>  [2010-11-18 20:45:55 - ddm-hello]handling HELO<br>  [2010-11-18 20:45:55 - ddm-hello]HELO: v=1, pid=3670, vm='Dalvik v1.2.0', app=''<br>  [2010-11-18 20:45:55 - ddms]Calling handler for FEAT [com.android.ddmlib.HandleHello@34c748] (len=208)<br>  [2010-11-18 20:45:55 - ddm-hello]handling FEAT<br>  [2010-11-18 20:45:55 - ddm-hello]Feature: hprof-heap-dump-streaming<br>  [2010-11-18 20:45:55 - ddm-hello]Feature: hprof-heap-dump<br>  [2010-11-18 20:45:55 - ddm-hello]Feature: method-trace-profiling-streaming<br>  [2010-11-18 20:45:55 - ddm-hello]Feature: method-trace-profiling<br>  [2010-11-18 20:45:55 - ddms]Calling handler for MPRQ [com.android.ddmlib.HandleProfiling@8d23f9] (len=1)<br>  [2010-11-18 20:45:55 - ddm-prof]handling MPRQ<br>  [2010-11-18 20:45:55 - ddm-prof]Method profiling is not running<br>  [2010-11-18 20:45:56 - ddms]Calling handler for APNM [com.android.ddmlib.HandleAppName@1077c64] (len=32)<br>  [2010-11-18 20:45:56 - ddm-appname]handling APNM<br>  [2010-11-18 20:45:56 - ddm-appname]APNM: app='system_process'<br>  [2010-11-18 20:46:02 - ddms]Closing [Client pid: 3670]<br>  [2010-11-18 20:46:02 - ddms]broadcast 3: [Client pid: 3670]  </p></blockquote><p>I am using Windows 7 + Eclipse</p><p>Any help is more than welcomed.</p>","438627","","12707","","2010-11-18 16:24:17","2010-11-18 16:50:29","Hello World doesn't proceed from ""Waiting for HOME ('android.process.acore') to be launched...""","<android><android-emulator>","1","1","","",""
"4216972","1","4217012","","2010-11-18 16:15:09","0","501","<p>how can i create an application which support korean as well as english language? </p>","512383","","","","","2012-03-27 06:13:17","multilanguage support","<android>","1","0","0","2012-08-18 05:13:47",""
"4217013","1","4217257","","2010-11-18 16:18:29","15","10386","<p>I was wondering, when creating new <code>Activity</code> classes and then overriding the <code>onCreate()</code> method, in eclipse I always get auto added: <code>super.onCreate()</code>. How does this happen? Is there a java keyword in the abstract or parent class that forces this?</p><p>I don't know if it is illegal not to call the super class, but I remember in some methods that I got a exception thrown for not doing this. Is this also built-in into java? Can you use some keyword to do that? Or how is it done?</p>","107029","","785326","","2012-07-05 21:42:48","2012-07-05 21:42:48","How to force derived class to call super method? (Like Android does)","<java><android><override><super>","8","2","2","",""
"4217090","1","4218801","","2010-11-18 16:24:03","1","1014","<p>i have an android app, with a actitity, that shows a map, with a position. This possition is updated on sharedPreferences with a service... ok, that works fine.</p><p>I need that my activity implements runnable to be a thread that read's the position of sharedPreferences each 1000ms and then update the item position on the map... but it doesn't works.</p><p>As i saw in debug mode, my thread doesn't work fine, ONLY ENTER ONE TIME on RUN() method... i mean that never enters into RUN() method again, only one time, cause this, the positions doesn't be updated on the map</p><p>What is wrong? why this thread doesn't work fine?</p><p>public class Locate extends MapActivity{   </p><pre><code>private TextView userText = null;private TextView permissionText = null;private TextView lastUpdateText = null;private Button locateButton = null;private Button traceButton = null;private MapView mapView = null;List&lt;Overlay&gt; mapOverlays = null;double lat;double lng;GeoPoint p;MapController mc;Drawable drawable;Drawable drawable2;MyItemizedOverlay itemizedoverlay;MyItemizedOverlay itemizedoverlay2;//para almacenar la config local de mi app, mostrarme o no en el mapa...static SharedPreferences settings;static SharedPreferences.Editor configEditor;private MyLooper mLooper;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.locate);    userText = (TextView) findViewById(R.id.User);    permissionText= (TextView) findViewById(R.id.Permission);    lastUpdateText= (TextView) findViewById(R.id.LastUpdate);    locateButton = (Button) findViewById(R.id.locate);    traceButton = (Button) findViewById(R.id.trace);    mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);    mapOverlays = mapView.getOverlays();    mc = mapView.getController();    settings=PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());    configEditor = settings.edit();    drawable = this.getResources().getDrawable(R.drawable.minifriend); // Icono de la cara, para posiciones de mis amigos    drawable2 = this.getResources().getDrawable(R.drawable.miniicon2); // Icono del programa, para mi posicion GPS    itemizedoverlay = new MyItemizedOverlay(drawable, this); // Aqui almaceno otras posiciones gps    itemizedoverlay2 = new MyItemizedOverlay(drawable2, this); // Aqui almaceno mi posicion gps    if (this.getIntent().getExtras() != null) /// si he recibido datos del friend en el Bundle    {        updateFriendPosition();    }    if (settings.getBoolean(""showMeCheckBox"", true))    {        updateMyPosition();    }    locateButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // Perform action on clicks            //itemizedoverlay2.getItem(0).            itemizedoverlay.clear();            updateFriendPosition();            itemizedoverlay2.clear();            updateMyPosition();        }    });    traceButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // Perform action on clicks                     }    });     ///////////////////////////////////////////////////////////////////////////////////////////    /// CODIGO PARA QUITAR EL FOCO DEL PRIMER TEXTEDIT Y QUE NO SALGA EL TECLADO DE ANDROID ///    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);    ///////////////////////////////////////////////////////////////////////////////////////////    //Thread thread = new Thread(this);    //thread.start();    mLooper = new MyLooper();    mLooper.start();}private void updateFriendPosition() {    Bundle bundle = this.getIntent().getExtras();//get the intent &amp; bundle passed by X    userText.setText(bundle.getString(""user""));    permissionText.setText(bundle.getString(""permission""));    lastUpdateText.setText(bundle.getString(""lastupdate""));    String coordinates[] = {bundle.getString(""lat""), bundle.getString(""lon"")};      lat = Double.parseDouble(coordinates[0]);    lng = Double.parseDouble(coordinates[1]);    p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));    OverlayItem overlayitem1 = new OverlayItem(p, bundle.getString(""user""), ""Hi Friend!"");    itemizedoverlay.addOverlay(overlayitem1);    mapOverlays.add(itemizedoverlay);// dibujo la estrella con la posicion actual del friend    mc.animateTo(p); ///nos centra el mapa en la posicion donde esta nuestro amigo    mc.setZoom(10);  /// ajusta el zoom a 10        }public void updateMyPosition(){    String coordinates[] = {settings.getString(""mylatitude"", null),settings.getString(""mylongitude"", null)};        lat = Double.parseDouble(coordinates[0]);    lng = Double.parseDouble(coordinates[1]);    p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));    OverlayItem overlayitem1 = new OverlayItem(p, ""Me"", ""My Position"");    itemizedoverlay2.addOverlay(overlayitem1);    mapOverlays.add(itemizedoverlay2);//dibujo mi icono para mostrarme a mi}@Overrideprotected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;}/////metodos del hilo/*private Handler handler = new Handler() {    @Override    public void handleMessage(Message msg) {        Boolean fallo=false;        itemizedoverlay2.clear();        updateMyPosition();        try{ Thread.sleep(1000);}         catch (Exception e)        {            fallo=true;                 }    }};public void run() {       Looper.prepare();    handler.sendEmptyMessage(0);    Looper.loop();}*/private class MyLooper extends Thread {    public void run() {           while (mLooper==Thread.currentThread()) {            // Your code here            Boolean fallo=false;            itemizedoverlay2.clear();            updateMyPosition();            try{ Thread.sleep(5000);}             catch (Exception e)            {                fallo=true;                     }        }    }}</code></pre><p>}</p><p>EXCEPTION WHEN I TRY TO SOLVE MY PROBLEM THE METHOD'S OF TOMS AND MARVINLABS ANSWERS:</p><pre><code>    11-18 17:37:43.489: ERROR/AndroidRuntime(729): Uncaught handler: thread main exiting due to uncaught exception11-18 17:37:43.528: ERROR/AndroidRuntime(729): java.util.ConcurrentModificationException11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:66)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:41)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at com.google.android.maps.MapView.onDraw(MapView.java:471)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.View.draw(View.java:5838)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewGroup.drawChild(ViewGroup.java:1486)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewGroup.drawChild(ViewGroup.java:1484)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.View.draw(View.java:5944)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.widget.FrameLayout.draw(FrameLayout.java:352)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewGroup.drawChild(ViewGroup.java:1486)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.View.draw(View.java:5841)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.widget.FrameLayout.draw(FrameLayout.java:352)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewGroup.drawChild(ViewGroup.java:1486)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewGroup.drawChild(ViewGroup.java:1484)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.View.draw(View.java:5841)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.widget.FrameLayout.draw(FrameLayout.java:352)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1847)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewRoot.draw(ViewRoot.java:1217)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1030)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.os.Handler.dispatchMessage(Handler.java:99)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.os.Looper.loop(Looper.java:123)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at android.app.ActivityThread.main(ActivityThread.java:3948)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at java.lang.reflect.Method.invokeNative(Native Method)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at java.lang.reflect.Method.invoke(Method.java:521)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)11-18 17:37:43.528: ERROR/AndroidRuntime(729):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","479886","","479886","","2010-11-18 19:01:24","2010-11-18 20:28:32","Why this thread doesn't work?","<android><multithreading>","4","0","","",""
"4217114","1","4217561","","2010-11-18 16:25:35","2","3403","<p>I start service by using:</p><pre><code>private ServiceConnection _serviceConnection = new ServiceConnection() {...}bindService(new Intent(this, MainService.class), _serviceConnection, Context.BIND_AUTO_CREATE);</code></pre><p>I want to 'restart' the service. (Let's not argue why I want to do that)I do that by:</p><pre><code>unbindService(_serviceConnection);// Do some initialization on servicebindService(new Intent(this, MainService.class), _serviceConnection, Context.BIND_AUTO_CREATE);</code></pre><p>I noticed service doesn't die(onDestroy doesn't run) until I call next bindService();So some static initialization I did on service got cleared by onDestroy() implementation.</p><p>Question: How do you make sure unbindService() will stop service (run onDestory()),so that I could do initialization after and re-run bindService()?</p>","432056","","","","","2012-11-20 19:05:58","Android: How to Stop service that is started by bindService() with BIND_AUTO_CREATE option?","<android><service><bind><stop>","2","0","","",""
"4217551","1","4798547","","2010-11-18 17:06:34","21","11984","<p>I installed Titanium from appcelerator and built the ""KitchenSink"" example application.</p><p>All works well, I'm just wondering where does the javascript code ends up in a built app.</p><p>I grep-ed the Xcode project and also the result application as I found it in <code>Library/Application Support/iPhone Simulator/....KitchenSink.app</code>, but I can't find any function names from <code>.js</code> files, not even string texts used within the application.</p><p>Nearest information I found is an answer here : <a href=""http://stackoverflow.com/questions/2444001/how-does-appcelerator-titanium-mobile-work"">How Does Appcelerator Titanium Mobile Work?</a> but I  do not understand clearly how the process works.</p><p>Is the javascript code being compiled into a binary code (what compiler is used then?), or is it just transformed in some special data-format and interpreted in a running application ?</p><p><strong>Update:</strong></p><p>This is what I can see in a build/android directory of KitchenSink:</p><pre><code>michal:bin mac$ find . -name table_view_layout\*./assets/Resources/examples/table_view_layout.js./assets/Resources/examples/table_view_layout_2.js./assets/Resources/examples/table_view_layout_3.js./assets/Resources/examples/table_view_layout_4.js./assets/Resources/examples/table_view_layout_5.js./classes/org/appcelerator/generated/examples/table_view_layout.class./classes/org/appcelerator/generated/examples/table_view_layout_2.class./classes/org/appcelerator/generated/examples/table_view_layout_3.class./classes/org/appcelerator/generated/examples/table_view_layout_4.class./classes/org/appcelerator/generated/examples/table_view_layout_5.classmichal:bin mac$ unzip -t app.apk | grep table_view_layout    testing: assets/Resources/examples/table_view_layout.js   OK    testing: assets/Resources/examples/table_view_layout_2.js   OK    testing: assets/Resources/examples/table_view_layout_3.js   OK    testing: assets/Resources/examples/table_view_layout_4.js   OK    testing: assets/Resources/examples/table_view_layout_5.js   OK</code></pre><p>I didn't look into app.apk before, all I could see were these class files corresponding to each of the javascript files. Therefore I assumed that on Android javascript is being compiled for JVM. Why can't these be found in app.apk ?</p>","215276","","215276","","2010-11-23 20:56:57","2011-01-25 22:01:01","What happens to JavaScript code after app is compiled using Titanium Mobile","<javascript><iphone><android><objective-c><titanium>","2","1","13","",""
"4217580","1","","","2010-11-18 17:10:07","0","196","<p>I have an app that snaps a photo, detects for faces, and if faces are detected, it puts it onto an ImageView.  The problem is, if no faces are detected - the app crashes.</p><p>Here is what I have:</p><p>In my main class, I have the camera opened, then in this call I have the Image View Set, and the bitmap defined...the app then takes that bmp to detect faces:</p><pre><code>public void processCameraImage(Intent intent) {            setContentView(R.layout.detectlayout); // detectlayout    ImageView imageView = (ImageView) findViewById(R.id.image_view); // image_view    cameraBitmap = (Bitmap) intent.getExtras().get(""data"");    imageView.setImageBitmap(cameraBitmap);    detectFaces();}</code></pre><p>I declare all of my variables, and start to detect faces - I find faces:</p><pre><code>private void detectFaces() {        if (null != cameraBitmap) {                //variables set            canvas.drawBitmap(cameraBitmap, 0, 0, ditherPaint);            int facesFound = detector.findFaces(bitmap565, faces);</code></pre><p>then I have a simple conditional statement:</p><pre><code>        if (facesFound &lt; 1) {            falseView();        }</code></pre><p>So, if the detector found nothing, I call another method, falseView here, which should show the user the pic taken, tell them no faces were detected, and provide a Button that will allow for the user to take a new picture:</p><pre><code>private void falseView() {    ImageView falseView = (ImageView) findViewById(R.id.false_view);    falseView.setImageBitmap(cameraBitmap);    Intent j = new Intent(Main.this, False.class);    startActivity(j);</code></pre><p>I then have my False.class set to open up my falsedetect.xml via onCreate - and the false.class has an imageview, named false_view in it.</p><p>I defined the activity in my manifest, etc... and it still crashes when I snap a pic and it tries to put it on the false_view Image View - any ideas?</p><p>Thanks!</p><p>EDIT:</p><p>Here is my logcat - </p><pre><code>11-18 12:30:40.982: ERROR/AndroidRuntime(12879): FATAL EXCEPTION: main11-18 12:30:40.982: ERROR/AndroidRuntime(12879): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=100, result=-1, data=Intent { act=inline-data (has extras) }} to activity {com.project.detect/com.project.detect.DETECT}: java.lang.NullPointerException11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3589)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3631)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at android.app.ActivityThread.access$3000(ActivityThread.java:129)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2137)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at android.os.Handler.dispatchMessage(Handler.java:99)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at android.os.Looper.loop(Looper.java:143)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at android.app.ActivityThread.main(ActivityThread.java:4701)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at java.lang.reflect.Method.invokeNative(Native Method)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at java.lang.reflect.Method.invoke(Method.java:521)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at dalvik.system.NativeStart.main(Native Method)11-18 12:30:40.982: ERROR/AndroidRuntime(12879): Caused by: java.lang.NullPointerException11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at com.project.detect.DETECT.falseView(DETECT.java:174)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at com.project.detect.DETECT.detectFaces(DETECT.java:125)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at com.project.detect.DETECT.processCameraImage(DETECT.java:89)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at com.project.detect.DETECT.onActivityResult(DETECT.java:56)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at android.app.Activity.dispatchActivityResult(Activity.java:3890)11-18 12:30:40.982: ERROR/AndroidRuntime(12879):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3585)</code></pre>","496686","","418183","","2010-11-18 17:55:34","2010-11-18 17:55:34","Having issues getting app to redirect to a specific class","<android><xml><class><imageview>","0","10","1","",""
"4217607","1","","","2010-11-18 17:13:56","1","317","<p>When I create an android project in Eclipse (Helios) and open for example <code>main.xml</code> and click on layout view - program closes. If I start eclipse over again and try click in project view on <code>main.xml</code> it happens again.</p>","512440","","714965","","2011-12-29 12:17:21","2011-12-29 12:17:21","Android:fail Ecclipse when I click on layout tab","<android><eclipse>","3","3","","",""
"4217679","1","","","2010-11-18 17:21:50","6","1518","<p>As I say in the topic, I want my WebView to prevent from reloading the webpage when another activity comes to the foreground or just when the orientation is changed. The reason why is because the WebView content is generated by Javascript/AJAX almost completely. After searching on a couple of forums, I found out many people suggested to use ""saveState"" and ""restoreState"" methods, but when I look the documentation, it says:</p><blockquote>  <p>Please note that this method no longer restores the display data for this WebView. See savePicture(Bundle, File) and restorePicture(Bundle, File) for saving and restoring the display data.</p></blockquote><p>So, here I was using that savePicture and restorePicture as it follows:</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);</code></pre><p>... some other lines ....</p><pre><code>        setContentView(R.layout.main);        mWebView = (WebView) findViewById(R.id.webview);        if (savedInstanceState == null){            loadInicialWebUi();        }else{            mWebView.restoreState(savedInstanceState);            boolean restoredPic = mWebView.restorePicture(savedInstanceState, new File(""savedDisplayWebView.temp""));            Log.d(TAG, ""restored Picture:"" + restoredPic);        }    }@Overrideprotected void onSaveInstanceState(Bundle savedInstanceState) {    mWebView.saveState(savedInstanceState);    boolean savedPic = mWebView.savePicture(savedInstanceState, ""savedDisplayWebView.temp"");        Log.d(TAG, ""saved Picture:"" + savedPic);    super.onSaveInstanceState(savedInstanceState);}</code></pre><p>And well, those logs were revealing that it saves the picture, but it couldn't restore it. I suspect there might be something about the File references, but I couldn't think of a better way of getting the reference of the File I created when saving the state.</p><p>Anyone thrilled?I would appreciate any clues/suggestions.Thanks in advance.</p><p>Manuel.</p>","467900","","467900","","2011-10-21 07:40:12","2012-01-22 09:40:28","WebView's restorePicture method - Preventing webview to reload the page","<android><webview><android-webview>","1","0","2","",""
"4217757","1","4218128","","2010-11-18 17:30:51","0","1078","<p>I've an ImageView in a LinearLayout, how can I detect when user drag his finger from any place in the screen to inside of ImageView?</p>","508412","","234039","","2010-11-18 17:36:40","2010-11-18 18:18:35","How to detect if you move your finger inside ImageView","<android><imageview><move><drag><slide>","1","0","","",""
"4218277","1","4926822","","2010-11-18 18:35:15","0","874","<p>i have a variable on my ""<code>SharedPreferences</code>"", that is accesed by two different threads, one in a service, and one in a activity.</p><p>There is a easy way to protect this variable to be accesed by two threads at once?</p><p>i need to protect this code:</p><pre><code>            configEditor.putString(""mylatitude"", """"+currentLocation.getLatitude());            configEditor.putString(""mylongitude"", """"+currentLocation.getLongitude());            configEditor.commit();</code></pre><p>i tryed with this but doesn't works:</p><pre><code>Object LOCK = new Object();                synchronized (LOCK){                configEditor.putString(""mylatitude"", """"+currentLocation.getLatitude());                configEditor.putString(""mylongitude"", """"+currentLocation.getLongitude());                configEditor.commit();                }</code></pre><p>thanks</p>","479886","","479886","","2010-11-18 19:30:58","2011-02-08 09:54:15","There is a easy way to protect a variable to be accesed only by one thread at once?","<java><android><multithreading>","6","1","","",""
"4218359","1","","","2010-11-18 18:45:38","2","887","<p>First off, I did post this to the android google group first but its moderated and I'm not sure how long itll take to show up there so hoping someone here can help.</p><p>I created a simple app with a ListView following the ListActivityexamples I found on the net.</p><p>The app has 2 activities with the first having a button to create thesecond. When i hit the close button on the second activity I wouldlike it to release its memory (or at least allow it to be garbagecollected). Currently it will never release.</p><p>I must be doing something wrong here because the MyListActivity nevergets released. Can anyone tell me if I am doing something wrong withthe way my activities are created/destroyed? or if my usage of theListView is wrong?</p><p>Thanks.</p><p>My App as a zip - <a href=""http://www.mediafire.com/?l26o5hz2bmbwk6j"" rel=""nofollow"">http://www.mediafire.com/?l26o5hz2bmbwk6j</a></p><p>Screen Shot of Eclipse MAT showing the list activity never releasingmemory - www.mediafire.com/?qr6ga0k</p><pre><code>public class MyListActivity extends ListActivity {  /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.listlayout);            ListAdapter ada = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, GENRES);                   setListAdapter(ada);    }@Overridepublic void onDestroy(){                       super.onDestroy();    System.gc();}public void ClickHandler(View target){    switch (target.getId())    {        case R.id.LL_Btn1:            finish();            break;    }}   private static final String[] GENRES = new String[] {    ""Action"", ""Adventure"", ""Animation"", ""Children"", ""Comedy"", ""Documentary"", ""Drama"",    ""Foreign"", ""History"", ""Independent"", ""Romance"", ""Sci-Fi"", ""Television"", ""Thriller""};} public class MainActivity extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);}public void ClickHandler(View target){    switch (target.getId())    {        case R.id.M_Button01:            Intent intent = new Intent();            intent.setClassName(MyListActivity.class.getPackage().getName(), MyListActivity.class.getName());                     startActivity(intent);              break;    }}}</code></pre>","512583","","512583","","2011-02-24 21:22:58","2011-08-02 19:20:37","My Simple ListView app is leaking memory. What am I doing wrong??","<java><android><listview><memory-leaks><listactivity>","2","6","0","",""
"4218372","1","4222540","","2010-11-18 18:47:13","0","809","<p>I have an ImageView (image_view) in an xml and I have the layout gravity set to center and the scale set to center_inside....but when I pass my compressed bmp to the image_view, it puts it on the middle-left of the screen (in portrait mode)...any ideas on a workaround?</p><p>here is me setting it to the image view:</p><pre><code>        ImageView imageView = (ImageView) findViewById(R.id.image_view);        imageView.setImageBitmap(bitmap565);</code></pre><p>I also compress it in an output stream:</p><pre><code>        try {            FileOutputStream fos = new FileOutputStream(filepath);            bitmap565.compress(CompressFormat.JPEG, 90, fos);            fos.flush();            fos.close();        } catch (FileNotFoundException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        }</code></pre><p>Thanks all!</p><p></p><pre><code>    &lt;ImageButton android:id=""@+id/ImageButton01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@drawable/results"" android:layout_gravity=""top|center""&gt;&lt;/ImageButton&gt;&lt;ImageView            android:screenOrientation=""portrait""            android:layout_width=""fill_parent""            android:id=""@+id/image_view""            android:layout_gravity=""center"" android:layout_weight=""1.0"" android:layout_height=""wrap_content"" android:scaleType=""centerInside""/&gt;    &lt;Button            android:screenOrientation=""portrait""            android:layout_height=""wrap_content""            android:layout_gravity=""center_horizontal"" android:layout_width=""fill_parent"" android:textStyle=""bold"" android:id=""@+id/detect_face"" android:text=""Detect""/&gt;</code></pre><p></p>","496686","","496686","","2010-11-18 18:56:45","2010-11-19 06:09:46","Trouble centering a bitmap on an ImageView","<android><layout><imageview><center><bmp>","2","3","1","",""
"4218385","1","","","2010-11-18 18:48:54","1","420","<p>I'm working through a book samples programs and i get the same problem whether I create and type the code or whether i download the code already typed, so i'm thinking it's a setup problem.</p><p>I get this error in each each class:</p><p><code>setContentView(R.layout.menu)</code> where the ""R"" is underlined in red and the code won't compile. If i add <code>import android.r</code> like ""QuickFix"" suggests, the red line goes away from the ""R"", but then the red line appears under ""menu"" (in this example). The same behavior occurs in each of the 5 classes that make up the project. </p><p>I do have matching layouts for ""menu"" etc. And (to the best of my knowledge) I registered them as Application Nodes in the manifest file.</p><p>It's driving me nuts.  Thanks for any suggestions. </p>","512588","","418183","","2010-11-18 18:54:40","2012-04-12 23:53:02","Content won't resolve","<android>","5","4","","",""
"4218575","1","","","2010-11-18 19:12:18","0","378","<p>Is it possible to create just one class and use a variable for contentview?  I am thinking of creating a main layout with loads of buttons with IDs.  Once a button is pressed it'll then pass the ID to the class and use that ID to open a specific Layout.  One class, multiple layouts.</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); //is it possible to make 'main' a variable?    }}</code></pre>","511457","","427763","","2010-11-18 19:15:37","2010-11-18 19:18:30","Android: Is it possible to make a Contentview dynamic?","<android><class><variables><layout>","1","2","0","",""
"4218744","1","4218798","","2010-11-18 19:31:37","0","691","<p>I'm trying to create a new Eclipse Project where I can test android classes without having to start the emu or connect a device.</p><p>I imported the android libraries, but I can't get it to work... My project only contains one java file where I use an android class, I only want to start it as a simple java app.</p><p>The error I get is: ""Exception in thread ""main"" java.lang.RuntimeException: Stub!""</p><p>My question is:  How can I create a simple java project (in eclipse) which uses android classes?</p>","474326","","","","","2013-03-28 20:44:52","Create and run an android project without a device or emulator","<android><eclipse><android-emulator><project><device>","4","0","","",""
"4218807","1","4219911","","2010-11-18 19:39:17","3","6279","<p>The title is pretty self explanatory.</p><p>the following code...:</p><pre><code>    URL imageUrl = new URL(url);   try {                HttpURLConnection conn= (HttpURLConnection)imageUrl.openConnection();                conn.setDoInput(true);                conn.connect();                int length = conn.getContentLength();                InputStream is = conn.getInputStream();                return BitmapFactory.decodeStream(is);           } catch (IOException e) {            e.printStackTrace();           }</code></pre><p>Will fail if the url does not contain the file format. For example, some images hosted by google will display the image yet not have the file format (.png, .jpg, etc) as part of the url. </p><p>As a result, the content-type header of the url connection returns ""text/html"". I believe this is the issue.</p><p>I have tried setting a new content-type header, but that doesnt seem to change anything.</p><p>anybody know a workaround?</p><p>thanks.</p>","512640","","","","","2010-11-18 21:47:14","Android FileNotFound Exception - Cannot getInputStream from image URL that does not have file format","<java><android><image><httpurlconnection><filenotfoundexception>","2","1","1","",""
"4218914","1","","","2010-11-18 19:52:17","3","510","<p>We have an Android application that throws out of memory error on Android 1.6. It is working fine on 2.0 onwards. We are trying to cut down on the runtime memory usage at this point. </p><p>We were thinking of reusing images – such as the background image of each screen. Is it possible to load the background image once in the memory at the time of app launch and reuse this cached copy in each screen rather than each screen loading the same background image increasing the overall footprint in the RAM?</p><p>We understand that there many other ways and best practices around runtime memory usage. But at this point, we just wanted to know whether this “image reuse” approach is really feasible?</p><p>If yes, how can we do this? Will it at all save any memory or the Android OS will still create multiple copies of the same asset for each screen not giving any benefit from the memory perspective?</p><p>Thank you very much for your time in reading my post.</p>","512660","","","","","2010-11-18 20:55:40","Android App - Can we Reuse Images in the Run time?","<android><image><memory-management><reusability>","2","0","","",""
"4218942","1","4280541","","2010-11-18 19:54:28","0","2167","<p>I have been running and debugging my android app for quite a while now. All of a sudden I many of the break point I am setting are not being hit. I know the code is executed because of log messages.I have noticed that once the breakpoint is passed for the first time eclipse adds a little check mark next to it..</p><p>I have tried rebuilding, cleaning and reopening eclipse... Noting helped..</p><p>Does anyone know how to solve this?</p>","407133","","","","","2012-10-09 21:44:41","BreakPoints not being hit?","<java><android><eclipse><adb>","4","1","","",""
"4219023","1","4245080","","2010-11-18 20:04:38","1","707","<p>Take a look at: <a href=""http://groups.google.com/group/android-beginners/msg/61802d28a8335809"" rel=""nofollow"">http://groups.google.com/group/android-beginners/msg/61802d28a8335809</a></p><p>ive done that a got it to work but the progress does not change when clicking on a link in the webbrowser.</p><p>So the progressbar is showed when the app starts and load the home URL but when i click a link or search in google the bar is not showed. why?</p><p>Thank-you!</p>","502419","","","","","2010-11-22 11:47:49","Android Development: Webview progress Bar","<android>","1","0","","",""
"4219046","1","4219139","","2010-11-18 20:06:53","0","451","<p>Can you suggest me any good anti-crack approaches (other than a code obfuscation), considering that the paid apps on the Market are easily cracked, and the same goes for a basic server check after a PayPal transaction?</p><p>My idea is to have one (very important for the app) Java object saved on the server, and passed to the app each time when it starts. Do you think that this sounds good ?</p><p>Note that it is more like of a theoretical question, as I am not going to implement it in an app, I am more like seeking the knowledge for this rather than a concrete solution to a problem.</p><p>Any ideas would be appreciated, even ones that you are not very sure if they are good or not. Remember, the question is for Android apps. Thanks.</p><p>EDIT: I know that there can't be an unbreakable client side application, I am asking for a good option to prevent it other than a obfuscation</p>","506957","","506957","","2010-11-18 20:26:22","2010-11-18 20:45:15","Strong security precautions for an Android app to prevent it from being cracked","<android><security>","1","0","1","",""
"4219210","1","4219447","","2010-11-18 20:23:36","0","458","<p>I have a 800 kb xml file on a server. I download it, and parse with a SAXParser. And then i add all item elements to my SQLLite db on the phone. </p><p>All item has 50-60 element. One insert query take about: </p><p>11-18 21:15:54.079: ERROR/448 delay_<em>(9169): 4120711-18 21:15:54.099: ERROR/448 delay</em>__(9169): __ 41223</p><p>about 20-90ms , i have 500 row, and it takes 40 minutes, it is a good value for this? </p><p>How i can do it faster? Is it possible?</p>","472537","","236247","","2011-06-28 16:18:37","2011-06-28 16:18:37","Android best way to parse and add xml items in SQLite DB?","<android><sqlite>","1","0","","",""
"4219211","1","4259836","","2010-11-18 20:23:42","1","988","<p>I'm trying to parse some html using jsoup (1.3.3) in my android activity. When I call this code</p><pre><code>Jsoup.connect(""http://www.google.com"").get();</code></pre><p>It works fine in android 2.1 and 2.2 but in 1.6 I get a ""java.io.IOException: 403 Error loading URL"".</p><p>I'm using the emulator to test this and I've noticed that admob ads are also not showing in 1.6 but they work in 2.0, 2.1 and 2.2.</p><p>Using the web browser in the 1.6 emulator does work so I'm pretty confident the problem is in my code somewhere.</p><p>Is there some extra permission I need for internet access in 1.6 that you don't need in 2.0+?</p><p>This is how my manifest file is structured, does the position of the uses-permission tag have any effect?</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.foo.bar""  android:versionCode=""1""  android:versionName=""1.0""  android:installLocation=""auto""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:theme=""@android:style/Theme.NoTitleBar"" android:name=""blahblah"" android:description=""@string/app_desc""&gt;    &lt;activity android:label=""@string/app_name"" android:name="".activities.MainMenu""&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="".activities.FullList"" android:label=""@string/app_name""/&gt;&lt;!-- The application's publisher ID assigned by AdMob --&gt;&lt;meta-data android:value=""blahblahblah"" android:name=""ADMOB_PUBLISHER_ID"" /&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""4""/&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt;</code></pre><p>I've tried creating a new project from scratch with just a hello world screen that uses the Jsoup.connect() method and that works fine on the same 1.6 emulator, so it must be a code problem but I can't figure it out.</p>","350678","","350678","","2010-11-22 19:59:00","2010-11-23 19:14:24","Internet Access not working in Android 1.6, but works in 2.0/2.1/2.2","<android><permissions><jsoup>","3","3","","",""
"4219318","1","4219736","","2010-11-18 20:36:15","1","491","<p>In Android I have the following code to blank an EditText box when clicked. This is to remove any existing information in the box and start with a blank slate.It sort off works. When you first click in the edit box the soft keyboard appears, but the existing information in the EditBox is still there. If you click a second time in the EditBox the information dissapers.How can I get it to clear the data on the first click? I am guessing the first click is intercepted by the soft keyboard.Many thanks for any help.</p><pre><code>// Blank EditText field when clicked        myEditBox.setOnClickListener( new OnClickListener(){        @Override        public void onClick(View v) {            tcA.setText("""");            }        });</code></pre>","497517","","","","","2010-11-18 21:24:55","Soft-Keyboard intercepting my onClickListener?","<android><edittext><android-softkeyboard><soft-keyboard>","1","0","","",""
"4219335","1","","","2010-11-18 20:38:08","1","859","<p>i'm currently developing an application for android. Therefore i want to create a microphone widget, like the one in googles Searchdialog. This icon is filled with white color, like a bargraph, depending on the recorded volume level.I already found the icon (ic_btn_speak_now.png) in the drawable ressources, delivered with the SDK. </p><p>Unfortunately the icon isn't an simple shape with a transparent area for the microphone shape. Instead it consists of some different gray values. My question now is:</p><p>How do the google developers (and others, where i've seen it) fill only the microphone shape of the icon with color?</p><p>I hope that one of you has an idea!</p>","512699","","","","","2010-11-18 21:43:18","How to color gray ressource icons in android (especially microphone)","<android>","2","0","1","",""
"4219396","1","","","2010-11-18 20:43:06","5","2465","<p>Android devices become incredible cheap (especially those with android v1.6).  I'm considering to use one as a brain of autonomous robot. Unfortunately I didn't find any info on that.</p><p>I would like to connect two external USB-webcams and some DIY-selfmade USB ADC &amp; output-ports converter to steer the wheels and read analog distance sensors. If I choose some cheap netbook than they usually already have 3 usb ports. But if I will be forced to use a tablet, then it requires also an usb hub. </p><ol><li>Do android devices support usb-hubs?</li><li>Is there any API to grab still frames from external usb webcams (e.g. ""vfa://0"" &amp; ""vfa://1"")</li><li>Is there any API to read from USB custom device? Let assume that it will simulate serial port for simplicity.</li><li>Do I get all of this in android 1.6 or any newer version?</li></ol><hr><p>As an update for your information: Based on answers I assume that android device will be too expensive in comparison to effort. I will go for cheap atom netbook with standard linux &amp; arduinio USB device for controls &amp; sensors. At cost of half kg (one pound) heavier device I will save months on learning &amp; development.</p>","512708","","512708","","2010-11-20 13:55:09","2010-11-20 13:55:09","android: api to external usb devices for robotic applications","<android><usb><webcam><external><robot>","2","0","3","",""
"4219427","1","","","2010-11-18 20:45:51","2","2255","<p>I'm working with an Android app that generates a text file and stores it on the sdcard.I would like to open the file in a text editor. The one I have installed is Office Suite Professional.</p><p>I have the following code:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse    (""file:///sdcard/report.txt""));startActivity(intent);</code></pre><p>When I run this snippet of code, I get the following error:</p><p>Sorry! The application XXXX () has stopped unexpectedly. Please try again.</p><p>How can I get my app to load OfficeSuite Pro with a specific file?</p><p>ThanksMike</p>","490698","","473070","","2010-12-27 15:41:06","2010-12-27 15:41:06","Starting activity from Android app: view a text file","<android><file><android-intent>","1","0","","",""
"4219486","1","4219556","","2010-11-18 20:52:41","0","1274","<p>i have created a program, with a service - the service is ""START_STICKY"". So when i close the program (i am using Advanced Task Killer, to kill programs) the service is restarted automatically, but this presents a problem cause i get an error when trying to call ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203) (see stacktrace below).I have created a class to handle context, which will return my Activity's context if it is not null, or a fake one i created if the activity's context is null - and the activity's context is null so the fake one is used, i suspect this may be the problem, but have no idea.in my activity i have a constructor which gives a reference of it self to the contexthandling class, but it seems the activity is not instantiated (not before the service is started at least) when the system is restarting my service.</p><p>There is of cause no problem when the program is just started normally, the service starts fine then... which is why i am suspecting the fake context, i created it as follows (and it is referenced in the manifest application tag with android:name=FakeContext):</p><pre><code>public class FakeContext extends android.app.Application {   private static FakeContext m_instance = null;   public FakeContext()   {   }   public static synchronized Context getContext()   {      if(m_instance == null)      {         m_instance = new FakeContext();      }      return m_instance;   }}</code></pre><p>Stacktrace:</p><p>11-18 19:12:14.048: ERROR/AndroidRuntime(15655): FATAL EXCEPTION: main11-18 19:12:14.048: ERROR/AndroidRuntime(15655): java.lang.RuntimeException: Unable to create service sdo.GeoTracker.Services.DataService: java.lang.NullPointerException11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3140)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at android.app.ActivityThread.access$3300(ActivityThread.java:135)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2202)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at android.os.Handler.dispatchMessage(Handler.java:99)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at android.os.Looper.loop(Looper.java:144)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at android.app.ActivityThread.main(ActivityThread.java:4937)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at java.lang.reflect.Method.invokeNative(Native Method)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at java.lang.reflect.Method.invoke(Method.java:521)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at dalvik.system.NativeStart.main(Native Method)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): Caused by: java.lang.NullPointerException11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at sdo.GeoTracker.DataAccess.SqlAdapter.(SqlAdapter.java:51)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at sdo.GeoTracker.DataAccess.SqlAdapter.getInstance(SqlAdapter.java:61)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at sdo.GeoTracker.Services.DataService.startService(DataService.java:65)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at sdo.GeoTracker.Services.DataService.onCreate(DataService.java:40)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3125)11-18 19:12:14.048: ERROR/AndroidRuntime(15655): ... 10 more</p><p>Any help is greatly appreciated!- i am a beginner at android development, so please spell it out </p><p>Best regardsSimon</p>","512719","","236247","","2011-06-28 14:49:11","2011-06-28 14:49:11","Android SQLite ContextWrapper.openOrCreateDatabase() nullpointer?","<android><database><sqlite><context>","1","3","","",""
"4219577","1","4219725","","2010-11-18 21:04:58","1","2247","<p>I have a kid's app for Android and there are some unique considerations for this application since the app has basically no navigation (it's for young kids).  I do not want to break my app UI (which has been successful on iPhone) by adding a quit/restart button.</p><p>What I really need is fairly simple -- I want my activity/app to start clean and new every single time it starts.  Whether it's an initial load or whatever -- basically any time onResume is called I want a completely fresh instance of my app.  </p><p>I initially thought I could just exit/quit/finish the app when the user leaves.  But I haven't found a way to do this that doesn't cause crashes on start.  Also every thread/stack overflow post about that idea is filled with people wagging their fingers and saying you should never ever quit an app on android.</p><p>If I can't quit the app onExit, is there something I can do to restart my activity every time onResume is called? (or would that be an infinite loop?).</p><p>Would greatly appreciate any help!</p>","170286","","","","","2010-12-06 21:13:49","Android App/Activity To Start Fresh Completely every time it starts or resumes?","<java><android><application-lifecycle><onresume>","3","3","1","",""
"4219718","1","","","2010-11-18 21:22:51","0","1177","<p>I would like an html5 page that runs in Android 2.2 Browser that I can take a picture using the phone's built-in camera and save it to a sqlite database as a blob.</p>","512749","","","","","2010-11-18 21:30:48","How can I store a Photo image on an html5 sqlite database?","<android><database><html5><photo>","2","0","","",""
"4219756","1","4623938","","2010-11-18 21:27:29","0","499","<p>I'm trying to get my EditText field to not be as tall but to no avail. Is there some way to get the text field (the white part around the text) to take up less vertical space? paddingTop and paddingBottom and maxHeight and height all appear to be ignored. Do I need to replace it with my own drawable background for it to do what I want (is that even an option)?</p><p>[EDIT]So, for example in the code below I'm interested in the field being 10dip tall.</p><pre><code>&lt;EditText         android:id=""@+id/frame0""         android:width=""100dip""         android:singleLine=""true""        android:inputType=""phone""        android:maxLength=""4""        android:textStyle=""bold""           android:paddingLeft=""10dip""          android:paddingRight=""10dip""          android:textSize=""8dip""        android:height=""10dip""        android:maxHeight=""10dip""        android:paddingTop=""0dip""        android:paddingBottom=""0dip""        android:gravity=""center""          android:layout_gravity=""center""           /&gt;  </code></pre><p>[EDIT 2]</p><p>It would appear that a partial solution is to just scrap the style of the background and use one's own...</p><pre><code>style=""?android:attr/textViewStyle""         android:background=""@null""          android:textColor=""@null""</code></pre><p>Basically you get a clickable TextView that you can edit.  But this doesn't strike me as the most elegant solution, so, I'm still hoping someone will chime in with my simply overlooking something obvious.</p>","59947","","59947","","2010-11-19 03:03:16","2011-01-07 09:02:39","Android EditText not respecting size settings","<android>","1","1","1","",""
"4219808","1","","","2010-11-18 21:33:40","1","597","<p>I have an android project in Eclipse.  </p><p>I have produced a build process which preprocesses source files prior to the java compiler and resource builders consuming them. (accomplished by creating a build.xml file for the project which runs successfully with ant.)</p><p>2 questions ...</p><ol><li><p>How do I interactively debug the .apk file (which was produced by my build.xml) in eclipse? (when I push debug, the built in builders run instead of my build.xml)</p></li><li><p>Is there anyway to ""hook up"" the run/debug convenience buttons in eclipse to my build.xml so that the execution of my build.xml is persued rather than the built-in builders?</p></li></ol><p>Bottom line is I'd like to retain the convenience of getting into an emulator/debug session by pressing the run/debug button, and have those buttons respect my build.xml rather than the built ins.  It's not clear to me how to get the debugger to launch the .apk produced by my build.xml (especially since the .apk is not necessarily named as the builtins produce)</p><p>Thank you!</p>","512759","","","","","2010-11-18 21:33:40","How to debug a custom built .apk (via ant/build.xml) in Eclipse? and can I get this to happen when I push the Eclipse run/debug button?","<android><eclipse><ant><build.xml>","0","2","","",""
"4219903","1","4220391","","2010-11-18 21:45:49","0","346","<p>i have that problem, I actualice the positions of the items of mi googlemap but they only get repainted when i move or zoom the map...</p><p>i want that every time the possitions got updated then they get repainted on the map without having to move or zoom it with my finger</p><p>how i can do it?</p><p>invalidate is not the answer, because it makes a full repaint of all and needs to redownload the map from internet...</p><p>my code:</p><pre><code>public class Locate extends MapActivity{   private TextView userText = null;private TextView permissionText = null;private TextView lastUpdateText = null;private Button locateButton = null;private Button traceButton = null;private MapView mapView = null;List&lt;Overlay&gt; mapOverlays = null;double lat;double lng;GeoPoint p;MapController mc;Drawable drawable;Drawable drawable2;MyItemizedOverlay itemizedoverlay;MyItemizedOverlay itemizedoverlay2;//para almacenar la config local de mi app, mostrarme o no en el mapa...static SharedPreferences settings;static SharedPreferences.Editor configEditor;//private MyLooper mLooper;////////////////////////////////////////MANEJADOR SIMILAR A UN HILO, QUE ME PERMITE RECOGER MI POSICION ACTUAL Y ACTUALIZARLA EN EL MAPA UNA VEZ CADA 5 SEGUNDOSprivate Handler mHandler;private Runnable updateRunnable = new Runnable() {    @Override public void run() {        itemizedoverlay2.clear();        updateMyPosition();        queueRunnable();    }};private void queueRunnable() {    mHandler.postDelayed(updateRunnable, 5000);}/////////////////////////////////////////FIN MANEJADORpublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.locate);    userText = (TextView) findViewById(R.id.User);    permissionText= (TextView) findViewById(R.id.Permission);    lastUpdateText= (TextView) findViewById(R.id.LastUpdate);    locateButton = (Button) findViewById(R.id.locate);    traceButton = (Button) findViewById(R.id.trace);    mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);    mapOverlays = mapView.getOverlays();    mc = mapView.getController();    settings=PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());    configEditor = settings.edit();    drawable = this.getResources().getDrawable(R.drawable.minifriend); // Icono de la cara, para posiciones de mis amigos    drawable2 = this.getResources().getDrawable(R.drawable.miniicon2); // Icono del programa, para mi posicion GPS    itemizedoverlay = new MyItemizedOverlay(drawable, this); // Aqui almaceno otras posiciones gps    itemizedoverlay2 = new MyItemizedOverlay(drawable2, this); // Aqui almaceno mi posicion gps    if (this.getIntent().getExtras() != null) /// si he recibido datos del friend en el Bundle    {        updateFriendPosition();    }    if (settings.getBoolean(""showMeCheckBox"", true))    {        updateMyPosition();    }    locateButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // Perform action on clicks            //itemizedoverlay2.getItem(0).            itemizedoverlay.clear();            updateFriendPosition();            itemizedoverlay2.clear();            updateMyPosition();        }    });    traceButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // Perform action on clicks                     }    });     ///////////////////////////////////////////////////////////////////////////////////////////    /// CODIGO PARA QUITAR EL FOCO DEL PRIMER TEXTEDIT Y QUE NO SALGA EL TECLADO DE ANDROID ///    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);    ///////////////////////////////////////////////////////////////////////////////////////////    //Thread thread = new Thread(this);    //thread.start();    //mLooper = new MyLooper();    //mLooper.start();    ////////////////////////////////////////MANEJADOR SIMILAR A UN HILO, QUE ME PERMITE RECOGER MI POSICION ACTUAL Y ACTUALIZARLA EN EL MAPA UNA VEZ CADA 5 SEGUNDOS    mHandler = new Handler();    queueRunnable();    /////////////////////////////////////// FIN MANEJADOR}private void updateFriendPosition() {    Bundle bundle = this.getIntent().getExtras();//get the intent &amp; bundle passed by X    userText.setText(bundle.getString(""user""));    permissionText.setText(bundle.getString(""permission""));    lastUpdateText.setText(bundle.getString(""lastupdate""));    String coordinates[] = {bundle.getString(""lat""), bundle.getString(""lon"")};      lat = Double.parseDouble(coordinates[0]);    lng = Double.parseDouble(coordinates[1]);    p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));    OverlayItem overlayitem1 = new OverlayItem(p, bundle.getString(""user""), ""Hi Friend!"");    itemizedoverlay.addOverlay(overlayitem1);    mapOverlays.add(itemizedoverlay);// dibujo la estrella con la posicion actual del friend    mc.animateTo(p); ///nos centra el mapa en la posicion donde esta nuestro amigo    mc.setZoom(10);  /// ajusta el zoom a 10        }public void updateMyPosition(){    Object LOCK = new Object();    synchronized (LOCK){    String coordinates[] = {settings.getString(""mylatitude"", null),settings.getString(""mylongitude"", null)};        lat = Double.parseDouble(coordinates[0]);    lng = Double.parseDouble(coordinates[1]);    p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));    OverlayItem overlayitem1 = new OverlayItem(p, ""Me"", ""My Position"");    itemizedoverlay2.addOverlay(overlayitem1);    mapOverlays.add(itemizedoverlay2);//dibujo mi icono para mostrarme a mi    }}</code></pre>","479886","","","","","2010-11-18 22:43:18","I update the positions of the items of mi googlemap but they only get repainted when i move or zoom the map","<android><google-maps>","1","0","","",""
"4219912","1","4219957","","2010-11-18 21:47:24","-1","1254","<p>In a class, if I want to set the text to the text value of a string I have, what is the code for that?</p><p>I have:</p><pre><code>TextView textView = (TextView) findViewById(R.string.noFaceFive);textView.setText(textView);</code></pre><p>but setText says :</p><p>The method <code>setText(CharSequence)</code> in the type <code>TextView</code> is not applicable for the arguments <code>(TextView)</code>.</p><p>Is there a set Text to display the text of a string?  Serious mind fart on my part...Thanks!</p>","496686","","372239","","2014-01-04 16:02:28","2014-01-04 16:02:28","Setting text to a layout","<android><layout><text><settext>","1","3","0","",""
"4220023","1","","","2010-11-18 21:59:45","0","800","<p>in the scenario that I made up a user chooses an application and and I offer him/her the available pieces of data to operate on.</p><p>for example:</p><ul><li><p>if the user chooses to open a pdf reader application - I want to offer him the available .pdf files?</p></li><li><p>or if the user select some music player I want to offer him the music files he/she has stored.</p></li></ul><p>I agree that it is a strange use-case, but I got pretty curious about it.</p><p>I know that the possible data type for an application is specified in its manifest file and I suppose that this information is available, but I have some difficulty finding out what the data content type for application is?</p><p>thanks in advance!</p>","481828","","179850","","2011-02-21 19:11:19","2011-02-21 19:11:19","How to list the data types that android application operates with?","<android><data><types><content>","2","2","0","",""
"4220040","1","4220289","","2010-11-18 22:02:05","0","1552","<p>I have been trying to apply a style to my TabWidget.</p><p>I've tried several methods such as</p><blockquote>  <p>for(int i=0;i &lt; tabHost.getTabWidget().getChildCount();i++)               tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor(""#7392B5""));</p></blockquote><p>from<a href=""http://stackoverflow.com/questions/2099959/how-do-i-change-the-background-of-an-android-tab-widget"">How do I change the background of an Android tab widget?</a></p><p>However, this code does not work for me. I've also tried messing with some XML styles. The closest I have gotten is to set the Divider, however that makes the entire tab widget turn one solid color and the Tabs are no longer drawn on top.</p><p>Please help. Mark's books only touch on setting the Icons for the tabs, not changing the color. I feel this should be simple, but TabWidgets and Hosts make everything harder.</p><p>I've tried this code targeting both the 1.6 and 2.2 platforms, but neither API works.</p><p>Thanks</p>","418859","","","","","2010-11-18 22:30:25","Android TabWidget set background color error","<android><views><styles><tabwidget>","1","1","","",""
"4220077","1","","","2010-11-18 22:07:12","2","563","<p>I am developing an Android application that queries various statistics from a static on-phone database about cars, such as acceleration, engine displacement, doors, etc. I need to specify the format of the database from the client. The UI needs to be able to show a sorted list of information for a particular attribute from multiple cars, such as engine displacement, or cost, AND another view that shows all the attributes for a particular car.</p><p>My first thought, rather than creating a table with a column for each attribute: (which is what, 1st normal form?)</p><pre><code>Cars:ID - integer primary keyMake - textModel - textHorsePower - RealAcceleration - RealDoors - INtegeretc..</code></pre><p>Do this instead:</p><pre><code>CarsID - integer primary keyMake - textModel - textCarAttributes:ID - integer primary keyDisplayName - Text   (that gets shown as a column header, or for a line)Unit - Text (a short unit suffix that gets appended to the value such as mph)Values:ID - integer primary keyCarID - foreign keyCarAttributeID - foreign keyValue - Real</code></pre><p>This allows the view, given the CarID and the AttributeID to perform a couple queries and just display the results. With the first form, the view would have to somehow know what units/display name goes with what columns.</p><p>Is this a reasonable way to request they send me the schema? In other words, if you had a request to provide the data in that schema would you say ""ooh gross!""?</p><p>Edit: Added example of first schema, and provided more clarity.</p>","57114","","57114","","2010-11-19 00:16:50","2010-11-19 00:16:50","Sqlite schema for android application","<android>","1","4","1","",""
"4220167","1","4220266","","2010-11-18 22:17:20","4","3127","<p>In Android is there an easy way to insert commas into a numberical value?ie if I have an EditText with 12345 in it, how can I display this as 12,345?</p><p>I think I can do it using substring and chopping it up into x number of 3 number chunks then concatenating the answer with ',' between each 3 number chunk.This would be pretty easy if length of number was constant, but as the number could be from one digit to, say 20, it makes it more complex.</p><p>Just curious if there is a simple and clean way to achieve this before I go about making my  substring solution.</p><p>Cheers</p>","497517","","497517","","2010-11-18 23:24:16","2010-11-18 23:24:16","Inserting commas into integers","<android><integer><format><substring>","1","6","1","",""
"4220288","1","","","2010-11-18 22:30:07","0","139","<p>Can an android project in Eclipse be configured so that the built-in builders read from an alternative source directory?  ie. ""test/src"" instead of ""src""?  and possibly even ""test/res"" instead of ""res""?  (It appears that setting dirs in the property files will only affect ant and not the built-in builders)</p><p>If this can be done ... how?</p><p>Thank you!</p>","512759","","","","","2010-11-18 23:31:56","How to get Eclipse to compile files from ""test/src"" instead of ""src"" directory when building (using built in builders)?","<android><eclipse><build>","1","0","","",""
"4220292","1","","","2010-11-18 22:30:50","2","992","<p>It seems that Android ScrollView does not support bi-directional scroll.  Although, a HorizontalScrollView can be placed inside a ScrollView, which effectively provides bi-directional scrolling (as below).  </p><p>However, the horizontal scrollbar is now ""at the bottom of"" the vertical scroll view. So, if I scroll all the way to the bottom of the vertical scroll view, and then drag left to right, the horizontal scrollbar will show.  Otherwise, the horizontal scrollbar doesn't show, because it is ""off the screen"". </p><p>Any advice?</p><pre><code>&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/scrollview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:fillViewport=""true"" &gt;    &lt;HorizontalScrollView xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/horizontalscrollview""            android:fadingEdge=""none""            android:padding=""0dip""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:fillViewport=""true"" &gt;            &lt;LinearLayout                android:id=""@+id/pagepane""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:orientation=""vertical""&gt;           &lt;/LinearLayout&gt;    &lt;/HorizontalScrollView&gt; &lt;/ScrollView&gt;</code></pre>","426493","","426493","","2010-11-19 15:37:20","2010-11-19 15:37:20","In Android, how to have bi-directional scroll AND show both scroll bars?","<android>","0","2","","",""
"4220338","1","4220383","","2010-11-18 22:36:43","0","539","<p>I'm trying to create an introduction to my program with a helpful dialog message system.I don't want to overload the user with too much text at once so I want to break up my dialog into parts.Each part of course would have its own message.</p><p>I use a separate static class to handle message delivery and flow logic; and it's working fine.I also actually use 3 Dialogs.One for the first message (since you can't go back), one for the middle message and one for the final message (since you can't go forward).I'm able to call the middle message from the first message with no problem. I'm also able to return to the first message. But when I try to reshow the middle message from the middle message dialog the new dialog doesn't appear.</p><p>Example:Let's say I have 4 messages, so the middle message will need to appear twice:</p><ol><li>First message appears:  user clicks next</li><li>Middle message appears: user clicks previous</li><li>First message appears:  user clicks next</li><li>Middle message appears: user clicks next</li><li>Middle message appears: user clicks next</li><li>Final message appears</li></ol><p>The problem is that I get no dialog on step 5.I'm using onPrepareDialog to reinitialize the dialogs as they're used. Right now it's basically a clone of onCreateDialog where each case in the switch calls the builder method appropriate for that dialog.</p><p>This is the code for my middle dialog method. (The other 2 are about the same. You can guess what they look like from this.)</p><pre><code>protected AlertDialog buildMiddleNoticeDialog() {    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder        .setTitle(Notice.getTitle())        .setMessage(Notice.getMessage())        .setCancelable(false)        .setNegativeButton(resources.getString(R.string.notice_next_button),            new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    showDialog(Notice.next());                }            })        .setPositiveButton(resources.getString(R.string.notice_previous_button),            new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    showDialog(Notice.previous());                }            });    return builder.create();}</code></pre>","376766","","909742","","2013-12-08 21:49:59","2013-12-08 21:49:59","how to chain (immediately reuse) the same dialog","<android>","1","0","","",""
"4220492","1","","","2010-11-18 22:56:03","6","651","<p>I want to rename my published app during next upgrade, will the Android Market treat this as just another regular upgrade and preserve the associated ratings and comments?  The app will keep the same package name. </p>","489200","","80425","","2011-03-15 13:13:04","2011-07-15 07:23:25","Renaming app in Android Market during upgrade","<android><upgrade><rename><google-play>","1","1","1","",""
"4220523","1","","","2010-11-18 22:59:46","0","1160","<p>I need to place additional image button ""my current location"" to a top right corner of the MapView. Any ideas how to do this? </p><p>Making the questions generic:<br/>1) According to MapView documentation it is possible to attach additional view objects to a MapView. How to do this?<br/>2) How to place such additional controls into specific position on MapView?</p>","209310","","","","","2010-12-24 01:50:06","Android MapView - how to attach additional controls to a MapView in desired position","<android-mapview><android>","1","0","","",""
"4220547","1","6497892","","2010-11-18 23:02:37","1","3927","<p>I'm trying to create a game lobby for a project, and I'd like the game's status text to be a different color: red for an ""[IN PROGRESS]"" game and green for a game that's ""[Waiting for x players]"".  The ListView will be populated with data, and each ListView item will have a game ID and then immediately to the right of that the game's status.</p><p>Right now I'm essentially using the Hello ListView code to create my ListView.</p><p>(In constructor)</p><pre><code>ArrayList&lt;HashMap&lt;String, String&gt;&gt; gameList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();private ListView gamesListView;private SimpleAdapter gameItems.</code></pre><p>(In onCreate())</p><pre><code>gamesListView = (ListView) findViewById(R.id.listViewGames);gameItems = new SimpleAdapter(this, gameList, R.layout.gamelistitem,     new String[] { ""line1, ""line2},     new int[] { R.id.tvGameID, R.id.tvGameStatus });gamesListView.setAdapter(gameItems);</code></pre><p>Then, I have a refresh button that obtains data from our database.  It will get two Strings, one for the ID of the game, and the other for the status of the game.  If the game status is 0, then it's still waiting for players.  If the game status is 1, then the game has started.  So, I create a gameItem to add to the gameList:</p><pre><code>HashMap&lt;String, String&gt; gameItem = new HashMap&lt;String, String&gt;();gameItem.put(""line1"", gameIDString);gameItem.put(""line2"", renderGameStatus(gameStatusString));gameList.add(gameItem);gameItems.notifyDataSetChanged();private String renderGameStatus(String statusString) {    if (statusString.equals(""0"")) {        return ""[Waiting for players]"";    } else {        return ""[IN PROGRESS]"";    }}</code></pre><p>This is where I'm stuck.  I don't really understand how I can alter the specific TextView when I create the gameItem or when I add that to the gameList.  There isn't a way I can see of accessing the TextView's properties.  I see how the text of the view is set (through the mapping of the strings to ""line1"" and ""line2"", but I don't know how to change any of the properties.</p><p>Thanks for any help!</p>","255394","","","","","2011-06-27 19:27:38","Dynamically change text color of a TextView inside a ListView?","<android><textview><android-listview>","2","0","1","",""
"4220554","1","4221021","","2010-11-18 23:03:49","0","481","<p>Is there an easy way in android to get the pressure that the user extended during an onClick event?</p>","25282","","","","","2010-11-19 00:17:20","Getting the pressure with which a button gets pressed","<android>","1","0","","",""
"4220572","1","4220643","","2010-11-18 23:06:31","0","923","<p>I have this code:</p><pre><code>LinearGradient backlg = new LinearGradient(0, 0, 10, 10,            new int[]{Color.BLACK, Color.BLACK, Color.BLUE, Color.BLUE},            new float[]{0,0.5f,.55f,1}, Shader.TileMode.REPEAT);</code></pre><p>Which creates diagonal bands alternating between blue and black.  They go from Bottom left to top right so here is my question, what do I change to make it go from top left to bottom right?</p>","445342","","","","","2010-11-18 23:15:47","Reverse DIrection Linear Gradient","<android><gradient><reverse><linear>","2","0","","",""
"4220607","1","4222586","","2010-11-18 23:11:16","0","1155","<p>I have a class with a thread and a progress dialog. When the thread stops, the dialog must dismiss. But if the thread stops, the app crashes :S Has anyone an idea whats wrong?</p><p><pre><code>public class Main extends Activity {</p><p>public static ProgressDialog LoadingDialog = null;</p><p>@Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  LoadingDialog.show(AndroidRSSReader.this, ""Laden..."", ""Even geduld aub..."", true);  setContentView(R.layout.main);  startUp();</p><p>new Thread(new Runnable(){            public void run() {</p><pre><code>         try { Thread.sleep(1000);} catch (InterruptedException e) { e.printStackTrace();}         LoadingDialog.dismiss();        }    }).start();</code></pre><p>}</pre></code></p>","512870","","512870","","2010-11-19 06:06:00","2010-11-19 06:33:26","Android: Dialog crashes in Thread?","<java><android><multithreading><user-interface>","2","2","","",""
"4220625","1","","","2010-11-18 23:13:13","7","4710","<p>If I interpret this <a href=""http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html"">article</a> correctly, passing the activity context to <code>AsyncTasks</code> is a potential leak, as the activity might be destroyed while the task is still running.</p><p>How do you deal with this in <code>AsyncTasks</code> that are not inner clases and need access to resources or to update the UI?</p><p>Additionally, how can you avoid leaking the context if you need references to progress dialogs to dismiss them?</p>","143378","","143378","","2010-11-18 23:18:38","2010-11-18 23:30:54","Android context leaks in AsyncTask","<android><memory-leaks><context><android-asynctask>","1","1","","",""
"4220786","1","4220935","","2010-11-18 23:36:27","0","2664","<p>I'm trying to work out how to correctly align text to radio buttons. I have a number of radio buttons laid out vertically in a radio group and a TextView for each radio button that should line up with the radio button. The problem i'm finding is that because the radio buttons are in their own RadioGroup layout I can't reference the RadioButton so it lines up with the TextView. Does anyone know a good way of doing this?</p>","304795","","","","","2011-09-24 02:29:41","android radiobutton alignment","<android><layout><radio-button>","4","0","","",""
"4220832","1","","","2010-11-18 23:42:59","4","9130","<p>I've created an application which loads a WebView. In order to login,the website requires basic authentication. When i try to access the websitevia the default browser, I get a pop up box prompting me to enter my user nameand password.</p><p>If I try to access the website via my application, I get error 401 and no pop up.I was wondering if someone could help me out?</p><p>Thanks-Kyle</p>","407774","","","","","2012-01-21 13:59:01","WebView Basic Authentication help","<android>","3","0","3","",""
"4220948","1","","","2010-11-19 00:01:54","0","325","<p>I'm thinking about how to design a mobile commerce site so that it works well for iPhone/Android and Blackberry. I know that iPhone and Android browsers are based on webkit so they will have similar capabilities and render similarly. However, most Blackberries to-date do not use a webkit based browser. Are there simple design paradigms to follow so that the site displays well on all three types of handsets?</p>","512917","","73488","","2010-11-19 00:10:15","2010-11-19 00:23:01","Best Practices for Mobile Site Design with iPhone/Droid and Blackberry in mind","<iphone><android><design><blackberry><webkit>","1","0","","",""
"4220956","1","4221317","","2010-11-19 00:03:30","0","143","<p>I have multiple menu files menu_language_en, menu_language_es...etcI would like to load them using another variable, something like:</p><pre><code>String lang=""en"";inflater.inflate(eval(""R.menu.language_menu_""+lang), menu);</code></pre><p>Any idea??</p><p>Thanksjo</p>","474411","","","","","2010-11-19 01:20:26","dynamically build menu filename","<android><menu>","1","0","","",""
"4220974","1","","","2010-11-19 00:07:07","2","227","<p>I'm trying to take the text displayed in a TextView and apply tweening to individual characters.  I can't think of how to accomplish this without having a separate view for each character.  I hope that's not the only way to solve this problem, because it just seems incredibly messy.</p>","510092","","21234","","2012-03-17 17:21:38","2012-03-17 17:40:24","How can I animate individual characters in a TextView?","<android><animation>","1","1","","",""
"4220982","1","4221010","","2010-11-19 00:09:15","5","2150","<p>I have an Options menu up and running in my Android application and I've overridden the onCreateOptionsMenu, onOptionsItemSelected and onPrepareOptionsMenu methods to customize the menu a little.</p><p>My question is related to keeping the Options menu open after the user clicks on a menu item. Basically, I'd like to be able to hide the menu until the user clicks on the device menu key. Once the user clicks on this key, I'd like to be able to hold the menu in place regardless of how many times the user clicks on menu items. If the user wants to hide the Options menu, they'd just need to click on the device menu key again.</p><p>Is this type of interaction supported (or even advisable). If this interaction is not supported, any alternative suggestions are more than welcome.</p><p>Cheers!</p><p>Sean</p>","208427","","","","","2010-11-19 00:15:35","Android - keep options menu open","<android><menu>","1","0","1","",""
"4221106","1","4221161","","2010-11-19 00:32:54","0","849","<p>I am having a NPE on some code and I have no clue why.  I am sure it is something trivial, but I can't seem to find it - here is what I am trying to do.</p><p>Snap a photo, detect faces, if there are no faces then display the image on an ImageView and allow the user the option to snap another photo.</p><p>Here is my code:</p><pre><code>        if (facesFound &lt; 1) {            ImageView imageView = (ImageView) findViewById(R.id.false_view);            TextView textView = (TextView) findViewById(R.id.badPicText);            textView.setText(R.string.noFaceFive);               imageView.setImageBitmap(bitmap565);}</code></pre><p>this is inside my method:</p><pre><code>private void detectFaces() {</code></pre><p>Here is the method I use to snap a photo then detect for faces:</p><pre><code>public void processCameraImage(Intent intent) {    setContentView(R.layout.detectlayout); // detectlayout    ImageView imageView = (ImageView) findViewById(R.id.image_view); // image_view    cameraBitmap = (Bitmap) intent.getExtras().get(""data"");    imageView.setImageBitmap(cameraBitmap);    detectFaces();}</code></pre><p>The odd thing is, when a face is detected, it works just fine - and puts them image on an ImageView saying it did, as so</p><pre><code>if (facesFound &gt; 0){    //face detection code    //write the bmp to an output stream, compress            ImageView imageView = (ImageView) findViewById(R.id.image_view);            TextView textView = (TextView) findViewById(R.id.textViewGoodPic);            textView.setText(R.string.yesFace);            imageView.setImageBitmap(bitmap565);}</code></pre><p>Anyone know where I might be going wrong?</p><p>Thanks!</p><p>EDIT:  the app is crashing when the app detects no faces and I try to write the photo and some text to the imageview.</p><p>EDIT:  Here is the logcat:</p><pre><code>11-18 19:42:39.825: ERROR/AndroidRuntime(4244): FATAL EXCEPTION: main11-18 19:42:39.825: ERROR/AndroidRuntime(4244): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=100, result=-1, data=Intent { act=inline-data (has extras) }} to activity {com.project.dtf/com.project.dtf.DTF}: java.lang.NullPointerException11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3589)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3631)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at android.app.ActivityThread.access$3000(ActivityThread.java:129)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2137)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at android.os.Handler.dispatchMessage(Handler.java:99)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at android.os.Looper.loop(Looper.java:143)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at android.app.ActivityThread.main(ActivityThread.java:4701)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at java.lang.reflect.Method.invokeNative(Native Method)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at java.lang.reflect.Method.invoke(Method.java:521)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at dalvik.system.NativeStart.main(Native Method)11-18 19:42:39.825: ERROR/AndroidRuntime(4244): Caused by: java.lang.NullPointerException11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at com.project.dtf.DTF.detectFaces(DTF.java:130)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at com.project.dtf.DTF.processCameraImage(DTF.java:90)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at com.project.dtf.DTF.onActivityResult(DTF.java:57)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at android.app.Activity.dispatchActivityResult(Activity.java:3890)11-18 19:42:39.825: ERROR/AndroidRuntime(4244):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3585)</code></pre><p>EDIT:  Still having issues =/</p><pre><code>Here are both calls:            if (facesFound &lt; 1) {                setContentView(R.layout.detectfalse);                ImageView imageView = (ImageView) findViewById(R.id.false_view);                TextView textView = (TextView) findViewById(R.id.badPicText);                textView.setText(R.string.noFace);                imageView.setImageBitmap(bitmap565);</code></pre><p>AND</p><pre><code>if (facesFound &gt; 0) {                showToast(this, ""Face Detected!"");</code></pre><p>//do stuff</p><pre><code>setContentView(R.layout.detectlayout);            ImageView imageView = (ImageView) findViewById(R.id.image_view);            TextView textView = (TextView) findViewById(R.id.textViewGoodPic);            textView.setText(R.string.yesFace);            imageView.setImageBitmap(bitmap565);</code></pre><p>Keep in mind, I did setContentView in this method:</p><pre><code>public void processCameraImage(Intent intent) {    setContentView(R.layout.detectlayout); // detectlayout    ImageView imageView = (ImageView) findViewById(R.id.image_view); // image_view    cameraBitmap = (Bitmap) intent.getExtras().get(""data"");    imageView.setImageBitmap(cameraBitmap);    detectFaces();}</code></pre><p>before the facedetect class is even called, is that where I am going wrong?</p>","496686","","496686","","2010-11-19 01:29:24","2010-11-19 01:29:24","Getting Null Pointer and I have no idea why","<android><xml><class><layout><nullpointerexception>","1","5","","",""
"4221159","1","4221280","","2010-11-19 00:44:25","0","561","<p>I make login in my main activity.If the login is correct, I wanna see my profile and download some data from server, but I cannot keep the connection, if I change activity.</p><p>How can I do this?</p>","496371","","244296","","2010-11-19 00:48:01","2010-11-19 01:57:25","How to keep login throw Activities?","<android><connection>","3","0","","",""
"4221169","1","4971098","","2010-11-19 00:46:24","8","7224","<p>When I write Android apps, I love the Toast feature. Is there a way to get this kind of set and forget popup message in iPhone development using MonoTouch (C# .NET)?</p>","172861","","228755","","2013-11-02 08:50:11","2014-03-12 10:28:09","Android Toast in iPhone?","<android><ios><iphone><ipad><monotouch>","10","0","6","",""
"4221314","1","4223948","","2010-11-19 01:19:44","0","650","<p>i have id ""@+id/call"" in single_item.xml when i use findVewById it (the layout setcontextview(R.layout.main)) .the app crash .how to fix the errorcode single_items.xml used to inflate listView in class CustomSqlCursorAdapter</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;ImageView    android:src=""@drawable/icon""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:visibility=""invisible""/&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:minWidth=""30px""    &gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:minWidth=""30px""        &gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Name: ""            android:id=""@+id/name""            android:textColor=""#2E6100""            android:textStyle=""bold""        /&gt;        &lt;TextView android:id=""@+id/contact_name""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:textColor=""#2E6100""             android:textStyle=""bold""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:minWidth=""30px""&gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Phone: ""            android:clickable=""true""            android:id=""@+id/phone""            android:textColor=""#2E6100""/&gt;        &lt;TextView android:id=""@+id/phone_number""            android:layout_width=""wrap_content""           android:layout_height=""wrap_content""            android:textColor=""#2E6100""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;ImageView    android:src=""@drawable/icon""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:id=""@+id/call""    android:clickable=""true""/&gt; &lt;/LinearLayout&gt;</code></pre><p>class managecontact.java </p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mDbHelper = new database(this);    mDbHelper.open();    /* ImageView call=(ImageView)this.findViewById(R.id.call);     call.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            //TODO Auto-generated method stub            call();        }                     });*/    registerForContextMenu(getListView());}private void fillData() {    Cursor currentCursor = mDbHelper.fetchAllNotes();    startManagingCursor(currentCursor);    // Create an array to specify the fields we want to display in the list (only TITLE)    String[] from = new String[]{database.KEY_TITLE};    // and an array of the fields we want to bind those fields to (in this case just text1)    int[] to = new int[]{ R.id.contact_name};    // Now create a simple cursor adapter and set it to display    CustomSqlCursorAdapter adapter = new CustomSqlCursorAdapter(this, R.layout.single_item,currentCursor, from, to);    setListAdapter(adapter);}private void call() {    Intent callIntent = new Intent(Intent.ACTION_CALL);    callIntent.setData(Uri.parse(""tel:123456789""));    startActivity(callIntent);}</code></pre><p>i want to make a call when click the image icon .please show me how to correct this</p>","510992","","111896","","2010-11-19 02:54:32","2010-11-19 10:06:11","how to get id in different layout","<android><listview>","1","2","","",""
"4221315","1","4221446","","2010-11-19 01:19:50","1","180","<p>I have a simple app I coded  for android that I want to go on Blackberry too - How easy is it to get the code over to their SDK and run it working as intended?</p><p>I was only wondering if anyone knew from experience.  The only API's on Droid I really use are camera and face detect.</p><p>Thanks!</p>","496686","","","","","2010-11-25 15:44:17","What kind of conversion efforts are there involved in porting a complete droid app to work on Blackberry?","<android><blackberry><import>","3","0","1","",""
"4221327","1","4221395","","2010-11-19 01:23:07","2","607","<p>I'm wondering a simple way to find back the object corresponding to the clicked item..</p><p>They're tons of examples on the web on how to figure out the ListView setup with the setListAdpater, but much less on how to well handle its listener.</p><p>Is ""by position"" the only way ?? I'm wondering a possibility to associate the objects itselves to the adapter, to not have to use their position in list (or even the displayed String!) to find back the Object referred by the clicked label..</p>","474411","","73488","","2010-11-19 01:30:23","2010-11-19 01:35:50","ListView / ListAdapter find back the object out of the list","<android><listview><listadapter>","1","0","","",""
"4221383","1","","","2010-11-19 01:33:40","1","476","<p>I would like to determine which portion of the revenue generated by my application is in the form of interstitial ads vs a normal adview.</p><p>I have the following two lines of code in my manifest file, where x is my publisher ID (they are the exact same):</p><pre><code> &lt;meta-data android:value=""xxxxxxxxxxxxxxx"" android:name=""ADMOB_PUBLISHER_ID"" /&gt; &lt;meta-data android:value=""xxxxxxxxxxxxxxx"" android:name=""ADMOB_INTERSTITIAL_PUBLISHER_ID"" /&gt;</code></pre><p>First of all, did I set this up properly via the manifest file to generate the data I want, or do I need to do something different?</p><p>Second, how do I find out which ad type is doing better?</p><p>Thanks.</p>","432209","","","","","2011-10-20 03:51:02","How to properly set up admob in Android to tell the difference between ad revenue","<android><xml><admob>","1","0","1","",""
"4221398","1","","","2010-11-19 01:37:03","0","292","<p>My question is probably really simple, but I am just starting out with OpenGL ES for Android. I have some code running where I made a cube (using 12 triangles) and it moves back and forth in the z-direction.</p><p>Basically, I'm wondering if theres a way to render this cube (say) 5 times simultaneously just at different positions in space. As of now, I would have to create a new buffer for each cube, which seems wrong. Sorry if this is a stupid question.</p><p>Thanks!</p>","512960","","44729","","2010-11-19 16:18:40","2010-11-19 16:18:40","Android OpenGL newbie","<android><opengl-es>","1","0","","",""
"4221408","1","4221426","","2010-11-19 01:39:32","1","175","<p>I am a little new to android development. I know that network activity and expensive operations should not be done on the ui thread, but what about database activity?</p><p>I have an activity that, when started, I query an sqlite database and dynamically populate rows in a tablelayout with an inflator. I do this all in the oncreate() method. Should this be done in a separate thread? If so, can anyone provide me with an example?</p><p>Thanks!</p>","123891","","","","","2010-11-19 07:26:10","Question about datàbase activity in android onCreate()c","<java><android><multithreading>","2","0","1","",""
"4221420","1","4596713","","2010-11-19 01:42:37","3","7525","<p>I've written some code for my Android device to login to a web site over <code>https</code> and parse some data out of the resulting pages.  An <code>HttpGet</code> happens first to get some info needed for login, then an <code>HttpPost</code> to do the actual login process.</p><p>The code below works great in a Java project within Eclipse which has the following Jar files on the build path: <code>httpcore-4.1-beta2.jar</code>, <code>httpclient-4.1-alpha2.jar</code>, <code>httpmime-4.1-alpha2.jar</code>, <code>commons-logging-1.1.1.jar</code>.</p><pre><code>public static MyBean gatherData(String username, String password) {    MyBean myBean = new MyBean();    try {        HttpResponse response = doHttpGet(URL_PAGE_LOGIN, null, null);        System.out.println(""Got login page"");        String content = EntityUtils.toString(response.getEntity());        String token = ContentParser.getToken(content);        String cookie = getCookie(response);        System.out.println(""Performing login"");        System.out.println(""token = ""+token +"" || cookie = ""+cookie);        response = doLoginPost(username,password,cookie, token);        int respCode = response.getStatusLine().getStatusCode();        if (respCode != 302) {            System.out.println(""ERROR: not a 302 redirect!: code is \""""+ respCode+""\"""");            if (respCode == 200) {                System.out.println(getHeaders(response));                System.out.println(EntityUtils.toString(response.getEntity()).substring(0, 500));            }        } else {            System.out.println(""Logged in OK, loading account home"");            // redirect handler and rest of parse removed        }    }catch (Exception e) {        System.out.println(""ERROR in gatherdata: ""+e.toString());        e.printStackTrace();    }    return myBean;}private static HttpResponse doHttpGet(String url, String cookie, String referrer) {    try {        HttpClient client = new DefaultHttpClient();        client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);        client.getParams().setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, ""UTF-8"");        HttpGet httpGet = new HttpGet(url);        httpGet.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);        httpGet.setHeader(HEADER_USER_AGENT,HEADER_USER_AGENT_VALUE);        if (referrer != null &amp;&amp; !referrer.equals("""")) httpGet.setHeader(HEADER_REFERER,referrer);        if (cookie != null &amp;&amp; !cookie.equals("""")) httpGet.setHeader(HEADER_COOKIE,cookie);        return client.execute(httpGet);    } catch (Exception e) {        e.printStackTrace();        throw new ConnectException(""Failed to read content from response"");    }}private static HttpResponse doLoginPost(String username, String password, String cookie, String token) throws ClientProtocolException, IOException {    try {        HttpClient client = new DefaultHttpClient();        client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);        client.getParams().setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, ""UTF-8"");        HttpPost post = new HttpPost(URL_LOGIN_SUBMIT);        post.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);        post.setHeader(HEADER_USER_AGENT,HEADER_USER_AGENT_VALUE);        post.setHeader(HEADER_REFERER, URL_PAGE_LOGIN);        post.setHeader(HEADER_COOKIE, cookie);        post.setHeader(""Content-Type"",""application/x-www-form-urlencoded"");        List&lt;NameValuePair&gt; formParams = new ArrayList&lt;NameValuePair&gt;();        formParams.add(new BasicNameValuePair(""org.apache.struts.taglib.html.TOKEN"", token));        formParams.add(new BasicNameValuePair(""showLogin"", ""true""));        formParams.add(new BasicNameValuePair(""upgrade"", """"));        formParams.add(new BasicNameValuePair(""username"", username));        formParams.add(new BasicNameValuePair(""password"", password));        formParams.add(new BasicNameValuePair(""submit"", ""Secure+Log+in""));        UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formParams,HTTP.UTF_8);        post.setEntity(entity);        return client.execute(post);    } catch (Exception e) {        e.printStackTrace();        throw new ConnectException(""ERROR in doLoginPost(): ""+e.getMessage());    }}</code></pre><p>The server (which is not under my control) returns a 302 redirect when the login was successful, and 200 if it fails and re-loads the login page.  When run with the above Jar files I get the 302 redirect, however if I run the exact same code from an Android project with the 1.6 Android Jar file on the build path I get the 200 response from the server.  I get the same 200 response when running the code on my 2.2 device.</p><p>My android application has internet permissions, and the HttpGet works fine.  I'm assuming that the problem lies in the fact that HttpPost (or some other class) is different in some significant way between the Android Jar version and the newer Apache versions.</p><p>I've tried adding the Apache libraries to the build path of the Android project, but due to the duplicate classes I get messages like: <code>INFO/dalvikvm(390): DexOpt: not resolving ambiguous class 'Lorg/apache/http/impl/client/DefaultHttpClient;'</code> in the log.  I've also tried using a <code>MultipartEntity</code> instead of the <code>UrlEncodedFormEntity</code> but I get the same 200 result.</p><p>So, I have a few questions:<br>- Can I force the code running under android to use the newer Apache libraries in preference to the Android versions?<br>- If not, does anyone have any ideas how can I alter my code so that it works with the Android Jar?<br>- Are there any other, totally different approaches to doing an HttpPost in Android?<br>- Any other ideas?</p><p>I've <a href=""http://stackoverflow.com/questions/2253061/secure-http-post-in-android"">read</a> <a href=""http://stackoverflow.com/questions/3663701/cant-do-a-http-post-to-a-web-service-from-my-android-app"">a</a> <a href=""http://stackoverflow.com/questions/2935946/sending-images-using-http-post"">lot</a> <a href=""http://stackoverflow.com/questions/3522140"">of</a> <a href=""http://stackoverflow.com/questions/874227"">posts</a> and <a href=""http://code.google.com/p/and-bookworm/source/browse/trunk/src/com/totsp/bookworm/data/HttpHelper.java"" rel=""nofollow"">code</a> but I'm not getting anywhere.  I've been stuck on this for a couple of days and I'm at a loss how to get the thing to work, so I'll try anything at this point.  Thanks in advance.</p>","512958","","512958","","2011-01-04 17:51:43","2012-10-05 06:37:43","HttpPost works in Java project, not in Android","<java><android><http-post>","4","0","4","",""
"4221425","1","4224304","","2010-11-19 01:44:15","0","857","<p>I am a web developer delivering video on a webpage. When I link to a video file (.m4v), Android wants to download the video to the phone, and then you can play the video from your phone.</p><p>On an iPhone (and Palm Pre), however, the same link just opens up the video in the media player, and returns to the web page upon completion.</p><p>My website is for members only, and I would prefer them not to be able to download the videos. Obviously I know there is no way to completely protect the videos, but I would like to at least make it appear like you can't download the video for a casual user. Streaming is not really an option.</p><p>So my question is how do I deliver the iPhone experience (opening in a media player) on an Android phone?</p><p>FYI, I've been testing this out with my Evo.</p>","58795","","","","","2010-11-19 16:31:41","Prevent Android from downloading video from website","<android><video><media-player>","2","0","","",""
"4221449","1","4221747","","2010-11-19 01:51:24","0","2030","<p>I'm trying to save an image to my sdcard but running into the following error:</p><pre><code>java.io.IOException: Parent directory of file does not exist: /sdcard/skdyImages/a46e2e08-9154-4fe7-96e8-2af0a7a92867.jpg</code></pre><p>I do have the permissions in my manifest </p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""/&gt;</code></pre><p>Here is my code:</p><pre><code>String newName = UUID.randomUUID().toString();            Bitmap bmp = ImageLoader.getInstance().getBitmap(e.getUrl());            File file = new File(""/sdcard/skdyImages"", newName + "".jpg"");            file.getParentFile().mkdirs();            file.createNewFile();            BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file));            bmp.compress(CompressFormat.JPEG, 90, out);            out.flush();            out.close();</code></pre><p>Any ideas?</p>","469682","","","","","2010-11-19 03:05:07","Trying to save a file but getting ""Parent directory of file does not exist"" even after trying to create dir","<android>","1","0","","",""
"4221454","1","","","2010-11-19 01:52:25","2","955","<p>I am facing a problem about encoding.  </p><p>For example, I have a message in XML, whose format encoding is ""UTF-8"". </p><pre><code> &lt;message&gt;        &lt;product_name&gt;apple&lt;/product_name&gt;        &lt;price&gt;1.3&lt;/price&gt;        &lt;product_name&gt;orange&lt;/product_name&gt;        &lt;price&gt;1.2&lt;/price&gt;        .......    &lt;/message&gt;</code></pre><p>Now, this message is supporting multiple languages:  </p><ul><li>Traditional Chinese (big5),  </li><li>Simple Chinese (gb),  </li><li><p>English (utf-8)</p><p>And it will only change the encoding in specific fields.<br>For example (Traditional Chinese),</p><p>        ??         1.3         ?        1.2        .......    </p><p>Only ""??"" and ""?"" are using big5, <code>""&lt;product_name&gt;""</code> and <code>""&lt;/product_name&gt;""</code> are still using utf-8.<br><code>&lt;price&gt;1.3&lt;/price&gt;</code> and <code>&lt;price&gt;1.2&lt;/price&gt;</code> are using utf-8.</p></li></ul><p>How do I know which word is using different encoding?</p>","491276","","469983","","2011-12-23 08:53:06","2011-12-23 08:53:06","How to check encoding in java?","<java><android>","3","0","","",""
"4221467","1","","","2010-11-19 01:55:13","8","5648","<p>I've seen this in a few tutorials now... but how in the world can Android source code not have a main method and still run.</p><p>For example (from <a href=""http://developer.android.com/guide/tutorials/hello-world.html"">http://developer.android.com/guide/tutorials/hello-world.html</a>):</p><pre><code>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>That runs but there is no main!!!</p><p>I've also thought that using things like onCreate (or formLoad, etc.) was bad becuase a constructor should do that work and such built-in methods can be smelly sometimes.  But onCreate is an entry point?   Even without a main?</p><p>What if there is more than one activity... is there a hierarchy to these built in event handlers?  OnCreate trumps everything else?  Otherwise, how would the app know what to run or where to enter the program?</p><p>Thanks!</p>","494294","","611007","","2013-05-10 11:02:33","2014-01-15 11:40:22","How can Android source code not have a main method and still run?","<android><entry-point>","12","0","3","",""
"4221539","1","4221648","","2010-11-19 02:12:49","2","3711","<p>When compiling the following C code with ndk-build in Terminal (I'm running Ubuntu):</p><pre><code>#include &lt;jni.h&gt;#include &lt;GLES/gl.h&gt;#include &lt;GLES/glext.h&gt;#include ""org_opengldrawinjni_DrawinJNI.h""JNIEXPORT void JNICALL Java_org_opengldrawinjni_DrawinJNI_Draw  (JNIEnv *envptr, jobject jobj){ GLfloat vertices[] =  { 1.0, 0.0, 0.0,    1.0, 1.0, 0.0,    0.0, 0.0, 0.0  }; GLubyte indices[] = { 0, 1, 2 }; glVertexPointer(3, GL_FLOAT, 0, vertices); glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_BYTE, indices);}</code></pre><p>with this Android.mk file:</p><pre><code>   LOCAL_PATH := $(call my-dir)   include $(CLEAR_VARS)   LOCAL_MODULE    := OpenGLJNI   LOCAL_SRC_FILES := org_opengldrawinjni_DrawinJNI.c   LOCAL_LDLIBS := -llog -lGLESv1_CM.so   include $(BUILD_SHARED_LIBRARY)</code></pre><p>I get an error, undefined reference to glVertexPointer.  I'm wondering why because I believe I properly included the headers and linked up the libraries in the Android.mk</p><pre><code>/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/OpenGLDrawinginJNI/obj/local/armeabi/objs/OpenGLJNI/org_opengldrawinjni_DrawinJNI.o: In function `Java_org_opengldrawinjni_DrawinJNI_Draw':/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/OpenGLDrawinginJNI/jni/org_opengldrawinjni_DrawinJNI.c:33: undefined reference to `glVertexPointer'collect2: ld returned 1 exit statusmake: *** [/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/OpenGLDrawinginJNI/obj/local/armeabi/libOpenGLJNI.so] Error 1</code></pre><p>Thanks!</p>","450153","","44729","","2010-11-19 16:17:54","2010-11-19 16:17:54","NDK OpenGL undefined reference to glVertexPointer","<android><opengl-es><vertex-array>","1","0","1","",""
"4221679","1","","","2010-11-19 02:47:01","2","1241","<p>I want to do PC Sync, between pc and android mobile. So I need some USB cable Programing APIs. Like request for connection and response. And also i want to know what is dun_service.</p><p>ThanksLaxman Dodda</p>","551936","","","","","2010-11-19 04:06:21","Android USB Programing","<android><usb>","1","0","","",""
"4221680","1","4221691","","2010-11-19 02:47:02","0","925","<p>I make an app with some activities.The first is the login.If I login correctly, I pass to the second activity, and I want download a stream (like twitter), but I cannot keep the session.</p><p>I saved user &amp; pass in sharedpreferences, how can i keep the session througt all activities?</p>","496371","","","","","2011-11-15 15:35:07","SharedPreferences to keep session","<android><session><sharedpreferences>","1","0","","",""
"4221859","1","","","2010-11-19 03:33:45","1","394","<p>I am a beginner in Android programming. I was going through the official tutorial on Android developer site. When I copied the codes for the Grid View tutorial to Eclipse, many red wave underlines appeared which are not allowing me to compile. Every time I click the run button, it says ""Your project contains error(s), please fix them before running your application.""</p><p>I am using a WIN7 and followed every single step that is necessary for setting up the envrionment. I had no problem at with previous tutorials such as Hello Android, Linear Layout, Relative Layout, and Table View. </p><p>Does anyone have the same experience and have a solution for this? I have tried to clean and re-build the project, which doesn't help.</p>","513025","","","","","2010-11-19 05:24:04","Official tutorial codes appearing red wave line in Eclipse not allowing me to compile","<java><android><eclipse>","2","2","","",""
"4221910","1","4222030","","2010-11-19 03:45:31","1","1882","<p>I am trying to insert rows into my database, but nothing gets persisted. Here is my helper class:</p><pre><code>    package com.android.cancertrials;import java.util.Calendar;import java.util.GregorianCalendar;import android.content.ContentValues;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;public class DataBaseHelper extends SQLiteOpenHelper{    public DataBaseHelper(Context context, String name) {        super(context, name, null, 1);        // TODO Auto-generated constructor stub    }    @Override    public void onCreate(SQLiteDatabase db) {        System.out.println(""the database in onCreate: ""+db);    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {    }    @Override    public void onOpen(SQLiteDatabase db) {        System.out.println(""the database: ""+db);        this.db=db;        super.onOpen(db);    }    public void insertRecordBean(RecordBean recordbean){        ContentValues content=new ContentValues();        content.put(""TrialPhase"", AdvanceSearchTab2.phaseOptions.toString());        content.put(""TrialStatus"", AdvanceSearchTab2.typeOptions.toString());        content.put(""StudyType"", AdvanceSearchTab2.statusOptions.toString());        content.put(""ContactType"", AdvanceSearchTab2.contactSpinner.toString());        content.put(""MileRange"", AdvanceSearchTab2.rangeSpinner.toString());        content.put(""Location"", AdvanceSearchTab2.locationSpinner.toString());        db.insert(""tblClinicalTrial"", null, content);    }    /*public void insertRecordResult(RecordBean recordbean){        ContentValues content1=new ContentValues();        content1.put(""NCTID"", recordbean.getNctId());        content1.put(""Title"", recordbean.getTitle());        content1.put(""TrialPhase"", recordbean.getTrialPhase());        content1.put(""TrialStaus"", recordbean.getTrialStatus());        content1.put(""Summary"", recordbean.getSummary());        content1.put(""Conditions"", recordbean.getConditions());        content1.put(""Interventions"", recordbean.getIntervention());        content1.put(""Description"", recordbean.getDescription());        content1.put(""SponserName"", recordbean.getSponsor());        content1.put(""Inclusion"", recordbean.getInclusionCriteria());        content1.put(""Exclusion"", recordbean.getExclusionCriteria());        content1.put(""StudyPop"", recordbean.getStudyPop());        content1.put(""MinAge"", recordbean.getMinimumAge());        content1.put(""MaxAge"", recordbean.getMaximumAge());        content1.put(""Gender"", recordbean.getGender());        content1.put(""Hvolunteer"", recordbean.getHealthyVolunteers());        content1.put(""EnrollmentType"", recordbean.getEnrollment());        content1.put(""EnrollmentNum"", recordbean.getEnrollment());        content1.put(""VerifiedOn"", recordbean.getVerifiedOn());        db.insert(""tblResultItem"", null, content1);    }*/    public void insertRecordBookmark(RecordBean recordbean){        ContentValues content2=new ContentValues();        content2.put(""NCTID"", recordbean.getNctId());        content2.put(""Title"", recordbean.getTitle());        content2.put(""TrialPhase"", recordbean.getTrialPhase());        content2.put(""TrialStatus"", recordbean.getTrialStatus());        content2.put(""Summary"", recordbean.getSummary());        content2.put(""Conditions"", recordbean.getConditions());        content2.put(""Interventions"", recordbean.getIntervention());        content2.put(""Description"", recordbean.getDescription());        content2.put(""SponserName"", recordbean.getSponsor());        content2.put(""Inclusion"", recordbean.getInclusionCriteria());        content2.put(""Exclusion"", recordbean.getExclusionCriteria());        content2.put(""StudyPop"", recordbean.getStudyPop());        content2.put(""MinAge"", recordbean.getMinimumAge());        content2.put(""MaxAge"", recordbean.getMaximumAge());        content2.put(""Gender"", recordbean.getGender());        content2.put(""Hvolunteer"", recordbean.getHealthyVolunteers());        content2.put(""EnrollmentType"", recordbean.getEnrollment());        content2.put(""EnrollmentNum"", recordbean.getEnrollment());        content2.put(""VerifiedOn"", recordbean.getVerifiedOn());        content2.put(""UpdatedOn"", recordbean.getUpdatedOn());        content2.put(""LocationName"", recordbean.getLocationName());        content2.put(""LocationStatus"", recordbean.getLocationStatus());        content2.put(""City"", recordbean.getCity());        content2.put(""State"", recordbean.getState());        content2.put(""Country"", recordbean.getCountry());        content2.put(""Distance"", recordbean.getLocationDist());        content2.put(""Long"", recordbean.getLongitude());        content2.put(""lat"", recordbean.getLatitude());        content2.put(""Url"", recordbean.getSourceUrl());        content2.put(""Location_id"", recordbean.getLocationId());        content2.put(""Zip_code"", recordbean.getZip());        db.insert(""tblBookMarkItem"", null, content2);    }    public Cursor getBookMarks(){        String[] columns={""_id"",""Title"",""Gender"",""TrialPhase"",""Zip_code"",""Location_id"",""NCTID""};        return db.query(""tblBookMarkItem"", columns, null, null, null, null, null);    }    public Cursor getRecent(){        String[] columns={""SearchString"",""ProfileDate"",""_id"",""years"",""Gender"",""TrialPhase"",""StudyType"",""TrialStatus"",""ContactType"",""MileRange"",""LocationZip"",""UrlParameter""};        return db.query(""tblProfile"", columns, null, null, null, null, null);    }    public void insertRecordProfile(String search,String url){        ContentValues content4=new ContentValues();        GregorianCalendar c=new GregorianCalendar();        content4.put(""ProfileDate"",c.get(GregorianCalendar.DATE)+""/""+(c.get(GregorianCalendar.MONTH)+1)+""/""+ c.get(GregorianCalendar.YEAR));//      content4.put(""years"", age);        //content3.put(""ProfileType"", AdvanceSearchTab2.typeOptions.toString());        //content4.put(""months"", AdvanceSearchTab1.ageEdit.getText().toString());        content4.put(""SearchString"", search);//      content4.put(""Gender"", gender);//      content4.put(""TrialPhase"", phase);//      content4.put(""StudyType"", study);//      content4.put(""TrialStatus"", status);//      content4.put(""ContactType"", contact);//      content4.put(""MileRange"", mile);//      content4.put(""LocationZip"", zip);//      //content4.put(""searchString"", AdvanceSearchTab1.edit_se.toString());        content4.put(""UrlParameter"", url);        db.insert(""tblProfile"", null, content4);    }    public void insertRecordMedical(RecordBean recordbean){        ContentValues content3=new ContentValues();        content3.put(""years"", AdvanceSearchTab1.ageEdit.toString());        content3.put(""months"", AdvanceSearchTab1.ageEdit.toString());        content3.put(""searchString"", AdvanceSearchTab1.edit_se.toString());        content3.put(""Gender"", AdvanceSearchTab1.hubSpinner.toString());        db.insert(""tblMedicalProfile"", null, content3);    }    public void deleteRecord(int id){        //_id=1;        db.delete(""tblBookMarkItem"", ""_id=""+id, null);    }    public void deleteRecent(int id){        //_id=1;        db.delete(""tblProfile"", ""_id=""+id, null);    }    private SQLiteDatabase db;}</code></pre><p>When I display it in my ListAdapter, it appears fine. As soon as I kill my application. My changes are not persisted. Why is this?</p>","19875","","19875","","2010-11-19 03:59:54","2010-11-19 04:13:52","Problem inserting rows in SQLite database","<java><sql><android><sqlite>","1","3","","",""
"4221959","1","4826508","","2010-11-19 03:57:23","4","5061","<p><a href=""http://i.stack.imgur.com/NCwQa.png"" rel=""nofollow"">screenshot</a></p><p>Notice that little tiny gray line that runs underneath the tabs (Except selected tab)? How do I change/alter that?</p><p>Would that be part of the FrameLayout, tabHost or TabWidget? I just cannot find a way to alter or remove this little gray line.</p><p>Thanks</p>","455008","","","","","2012-03-12 19:36:31","Tabhost bottom border line android","<android><android-tabhost>","4","0","1","",""
"4222053","1","","","2010-11-19 04:19:45","0","433","<p>What is the easiest(less code) way to post status on twitter?</p>","432848","","493939","","2012-04-18 09:38:56","2012-04-18 09:38:56","Easiest way to post twitter status in android","<android><twitter>","1","3","","",""
"4222091","1","","","2010-11-19 04:29:40","1","126","<p>Hi in my application first time i am inserting some data into sqlite db through assets,first time means installation time.next time onwards i am getting the values from db.Now my question is if the user chnage the language of the device automatically  how that db values(Grocery names) are also changed? Please give me some suggestions.Thanks in advance</p>","479027","","","","","2010-11-19 05:01:43","convert the db itemsinto one language to another language","<android>","1","0","1","",""
"4222134","1","","","2010-11-19 04:40:34","0","141","<p>How to you make it so if a user does something, it asks them how they want to do it and it brings them to that application? Like if you go ""Share"" a photo or video it pops up a list with all apps that can do that for you like facebook or text or email , ect.? I am asking how to have my app use other apps, not them use mine.</p>","513064","","","","","2010-11-19 06:36:47","How to use other applications to send pictures?","<java><android><google-app-engine>","1","0","","",""
"4222230","1","4222250","","2010-11-19 05:00:52","0","985","<p>In my application I have a autocomplete in first activity and some edittext in second activity.</p><p>When I run my code in emulator it works fine and I am not seeing any virtual keyboard on screen when program is excecuted.</p><p>But when I deploy it in device when the application loads, onfocus is directly on autocomplete and a keyboard pops out, and also when I navigate from first activity to second activity onfocus is on first edittext and keyboard pops out. </p><p><strong>I want to disable this onfocus on all the page.</strong> how to do that ?</p>","430652","","539542","","2012-01-15 06:18:13","2012-10-04 18:17:52","Android default onfocus on autofocus and editview,How to remove that?","<android><activity><onfocus><oncreate>","2","0","","",""
"4222240","1","","","2010-11-19 05:01:59","0","288","<p>HelloI have parsed the xml file. now aim is to display contents using list view as dynamiclly..How it is possible?</p>","513073","","","","","2013-11-11 07:49:24","XML parsing in android","<android>","3","1","1","",""
"4222255","1","","","2010-11-19 05:06:13","0","895","<p>I have an Activity that use a ViewSwitcher. the view switches between a list view(child #1) and another view that contains 2 spinners(child #2)<br/>In activity onCreate using spinner.setSelection i set a specific position for spinner. Later if next view is requested i execute viewSwitcher.showNext and spinner selection is empty - it seems like the showNext resets the spinner position. i have tried to save the position and set again after showNext is called but dont works.<br/>Any ideas?</p>","456234","","","","","2011-04-18 17:44:28","ViewSwitcher reset spinner selected position","<android>","1","0","1","",""
"4222289","1","4282409","","2010-11-19 05:13:47","1","1632","<p>Basically I have a fully functional ogl program (2D game) in opengl es 1.1, everything works fine except for one problem: glcolor</p><p>I'm trying to set some of my texture to half transparent and I would like to do it as follows;</p><pre><code>gl.glColor4f(1f, 1f, 1f, .5f);obj.draw(gl);...gl.glColor4f(1f, 1f, 1f, 1f);</code></pre><p>I'm using VBO for my vertice, my textures and indices. (if that is relevant)</p><p>the problem is that nothing gets set to 50% transparency...</p><p>I'm don't think relevant to post all my code (mainly because it is spread out several classes with several GL options changing (blends, scissors etc etc).</p><p>What I would like is for people to tell me what state of OGL could prevent glcolor form working like I want, what functions should I check, what state should I call.</p><p>Jason  </p>","440336","","","","","2010-11-26 03:47:19","Problems Using glColor to set textures to half transparency","<android><opengl-es>","2","0","2","",""
"4222511","1","4224528","","2010-11-19 06:05:13","0","943","<p>i want to display google map in android emulator. i also follow the step described in below link.<a href=""http://developer.android.com/guide/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-mapview.html</a></p><p>when i run my application it will not display google map. just display grids like below.<img src=""http://i.stack.imgur.com/3cI4s.png"" alt=""alt text""></p><p>Please help me to show google map.</p><p>thanks in advance.</p>","489902","","","","","2013-02-25 05:24:08","android google map view problem","<android><google-maps>","4","2","","",""
"4222528","1","","","2010-11-19 06:07:49","0","4530","<p>this is my code  </p><pre><code>public class Main extends Activity {      @Override      public void onCreate(Bundle savedInstanceState)      {          super.onCreate(savedInstanceState);           LinearLayout rLinear=new LinearLayout(this);          rLinear.setId(200);          for (int c=0;c&lt;5;c++)          {              ImageView imEdit = new ImageView(this);              imEdit.setId(300+c);              imEdit.setImageResource(R.drawable.a);              imEdit.setLayoutParams(new LayoutParams(36, 36));              rLinear.addView(imEdit);        }    }  }  </code></pre><p>Okay, I have this code, I'm adding 5 ImageView to an linear layout at runtime, so far so good, but what i would like to do is, when the user slide his finger over one of them, i would like to change the image, so my question would be, how can i know what's the current imageview under the user finger.??  </p><p>Thanks.</p>","508412","","592351","","2013-05-14 16:55:59","2013-05-14 16:55:59","onTouchEvent how to get curret view under finger","<android>","4","0","","",""
"4222577","1","4222639","","2010-11-19 06:18:35","0","450","<p>VitaminTable.java:</p><pre><code>package vitaminTable.xyz.com;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.*;public class VitaminTable extends Activity {Button vitaminA,vitaminB1,vitaminB2,vitaminB3,vitaminB5,vitaminB6,vitaminB7,vitaminB9;Button vitaminB12,vitaminC,vitaminD,vitaminE,vitaminK;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    vitaminA = (Button) findViewById(R.id.vitaminA);    vitaminB1 = (Button) findViewById(R.id.vitaminB1);    vitaminB2 = (Button) findViewById(R.id.vitaminB2);    vitaminB3 = (Button) findViewById(R.id.vitaminB3);    vitaminB5 = (Button) findViewById(R.id.vitaminB5);    vitaminB6 = (Button) findViewById(R.id.vitaminB6);    vitaminB7 = (Button) findViewById(R.id.vitaminB7);    vitaminB9 = (Button) findViewById(R.id.vitaminB9);    vitaminB12 = (Button) findViewById(R.id.vitaminB12);    vitaminC = (Button) findViewById(R.id.vitaminC);    vitaminD = (Button) findViewById(R.id.vitaminD);    vitaminE = (Button) findViewById(R.id.vitaminE);    vitaminK = (Button) findViewById(R.id.vitaminK);    vitaminA.setOnClickListener((OnClickListener) this);    vitaminB1.setOnClickListener((OnClickListener) this);    vitaminB2.setOnClickListener((OnClickListener) this);    vitaminB3.setOnClickListener((OnClickListener) this);    vitaminB5.setOnClickListener((OnClickListener) this);    vitaminB6.setOnClickListener((OnClickListener) this);    vitaminB7.setOnClickListener((OnClickListener) this);    vitaminB9.setOnClickListener((OnClickListener) this);    vitaminB12.setOnClickListener((OnClickListener) this);    vitaminC.setOnClickListener((OnClickListener) this);    vitaminD.setOnClickListener((OnClickListener) this);    vitaminE.setOnClickListener((OnClickListener) this);    vitaminK.setOnClickListener((OnClickListener) this);}public void onClick(View v) {    switch (v.getId()) {    case R.id.vitaminA:     Intent va = new Intent(VitaminTable.this,vita.class);     startActivity(va);    break;   case R.id.vitaminB1:      Intent vb1 = new Intent(VitaminTable.this,vitb1.class);      startActivity(vb1);    break;   case R.id.vitaminB2:      Intent vb2 = new Intent(VitaminTable.this,vitb2.class);       startActivity(vb2);     break;   case R.id.vitaminB3:      Intent vb3 = new Intent(VitaminTable.this,vitb3.class);       startActivity(vb3);     break;   case R.id.vitaminB5:      Intent vb5 = new Intent(VitaminTable.this,vitb5.class);        startActivity(vb5);      break;   case R.id.vitaminB6:      Intent vb6 = new Intent(VitaminTable.this,vitb6.class);        startActivity(vb6);      break;   case R.id.vitaminB7:      Intent vb7 = new Intent(VitaminTable.this,vitb7.class);        startActivity(vb7);      break;   case R.id.vitaminB9:      Intent vb9 = new Intent(VitaminTable.this,vitb9.class);        startActivity(vb9);      break;   case R.id.vitaminB12:      Intent vb12 = new Intent(VitaminTable.this,vitb12.class);        startActivity(vb12);      break;   case R.id.vitaminC:      Intent vc = new Intent(VitaminTable.this,vitc.class);        startActivity(vc);      break;   case R.id.vitaminD:      Intent vd = new Intent(VitaminTable.this,vitd.class);        startActivity(vd);      break;   case R.id.vitaminE:      Intent ve = new Intent(VitaminTable.this,vite.class);        startActivity(ve);      break;   case R.id.vitaminK:      Intent vk = new Intent(VitaminTable.this,vitk.class);        startActivity(vk);      break;     } }} </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=""vitaminTable.xyz.com""    android:versionCode=""1""      android:versionName=""1.0""&gt;     &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;       &lt;activity android:name="".VitaminTable""              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="".vita""/&gt;    &lt;activity android:name="".vitb1"" /&gt;    &lt;activity android:name="".vitb2"" /&gt;    &lt;activity android:name="".vitb3"" /&gt;    &lt;activity android:name="".vitb5"" /&gt;    &lt;activity android:name="".vitb6"" /&gt;    &lt;activity android:name="".vitb7"" /&gt;    &lt;activity android:name="".vitb9"" /&gt;    &lt;activity android:name="".vitb12"" /&gt;    &lt;activity android:name="".vitc"" /&gt;    &lt;activity android:name="".vitd"" /&gt;    &lt;activity android:name="".vite"" /&gt;    &lt;activity android:name="".vitk"" /&gt;    &lt;activity android:name="".vitadailyreq"" /&gt;   &lt;/application&gt;&lt;/manifest&gt;  </code></pre><p>main.xml:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;ScrollView android:id=""@+id/Vitamintable"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""   &gt; &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:stretchColumns=""1"" android:background=""@drawable/fruit2""&gt;  &lt;TableRow&gt; &lt;Button    android:id=""@+id/vitaminA"" android:layout_width=""240px"" android:layout_height=""36px"" android:textSize=""15sp"" android:background=""#FFFFFF"" android:textColor=""#D15FEE"" android:textStyle=""bold"" android:gravity=""left"" android:text=""Vitamin A""  android:fadingEdge=""horizontal|vertical""/&gt; &lt;/TableRow&gt;    &lt;TableRow&gt;  &lt;Button    android:id=""@+id/vitaminB1"" android:layout_width=""240px""  android:layout_height=""36px"" android:textSize=""15sp"" android:background=""#FFFFFF""  android:textColor=""#D15FEE"" android:textStyle=""bold"" android:gravity=""left"" android:text=""Vitamin B1"" android:fadingEdge=""horizontal|vertical""/&gt; &lt;/TableRow&gt;    &lt;TableRow&gt; &lt;Button    android:id=""@+id/vitaminB2"" android:layout_width=""240px"" android:layout_height=""36px"" android:textSize=""15sp"" android:background=""#FFFFFF""  android:textColor=""#D15FEE"" android:textStyle=""bold""  android:gravity=""left""  android:text=""Vitamin B2""  android:fadingEdge=""horizontal|vertical""/&gt; &lt;/TableRow&gt;    &lt;TableRow&gt;  &lt;Button    android:id=""@+id/vitaminB3"" android:layout_width=""240px"" android:layout_height=""36px"" android:textSize=""15sp""  android:background=""#FFFFFF""  android:textColor=""#D15FEE""  android:textStyle=""bold""  android:gravity=""left"" android:text=""Vitamin B3"" android:fadingEdge=""horizontal|vertical""/&gt;  &lt;/TableRow&gt;    &lt;TableRow&gt; &lt;Button    android:id=""@+id/vitaminB5"" android:layout_width=""240px"" android:layout_height=""36px""  android:textSize=""15sp""  android:background=""#FFFFFF""   android:textColor=""#D15FEE"" android:textStyle=""bold"" android:gravity=""left"" android:text=""Vitamin B5"" android:fadingEdge=""horizontal|vertical""/&gt; &lt;/TableRow&gt;    &lt;TableRow&gt; &lt;Button    android:id=""@+id/vitaminB6""  android:layout_width=""240px"" android:layout_height=""36px""  android:textSize=""15sp"" android:background=""#FFFFFF"" android:textColor=""#D15FEE"" android:textStyle=""bold"" android:gravity=""left"" android:text=""Vitamin B6""  android:fadingEdge=""horizontal|vertical""/&gt; &lt;/TableRow&gt;     &lt;TableRow&gt; &lt;Button    android:id=""@+id/vitaminB7"" android:layout_width=""240px"" android:layout_height=""36px""  android:textSize=""15sp"" android:background=""#FFFFFF"" android:textColor=""#D15FEE"" android:textStyle=""bold"" android:gravity=""left"" android:text=""Vitamin B7""  android:fadingEdge=""horizontal|vertical""/&gt; &lt;/TableRow&gt;    &lt;TableRow&gt; &lt;Button   android:id=""@+id/vitaminB9"" android:layout_width=""240px"" android:layout_height=""36px"" android:textSize=""15sp"" android:background=""#FFFFFF"" android:textColor=""#D15FEE"" android:textStyle=""bold"" android:gravity=""left""  android:text=""Vitamin B9""  android:fadingEdge=""horizontal|vertical""/&gt;  &lt;/TableRow&gt;    &lt;TableRow&gt; &lt;Button    android:id=""@+id/vitaminB12"" android:layout_width=""240px"" android:layout_height=""36px"" android:textSize=""15sp"" android:background=""#FFFFFF"" android:textColor=""#D15FEE"" android:textStyle=""bold"" android:gravity=""left"" android:text=""Vitamin B12"" android:fadingEdge=""horizontal|vertical""/&gt; &lt;/TableRow&gt;    &lt;TableRow&gt; &lt;Button    android:id=""@+id/vitaminC"" android:layout_width=""240px"" android:layout_height=""36px""  android:textSize=""15sp"" android:background=""#FFFFFF"" android:textColor=""#D15FEE"" android:textStyle=""bold"" android:gravity=""left"" android:text=""Vitamin C""  android:fadingEdge=""horizontal|vertical""/&gt; &lt;/TableRow&gt;    &lt;TableRow&gt; &lt;Button    android:id=""@+id/vitaminD"" android:layout_width=""240px"" android:layout_height=""36px"" android:textSize=""15sp"" android:background=""#FFFFFF"" android:textColor=""#D15FEE"" android:textStyle=""bold"" android:gravity=""left"" android:text=""Vitamin D""  android:fadingEdge=""horizontal|vertical""/&gt;  &lt;/TableRow&gt;    &lt;TableRow&gt; &lt;Button    android:id=""@+id/vitaminE"" android:layout_width=""240px"" android:layout_height=""36px"" android:textSize=""15sp"" android:background=""#FFFFFF"" android:textColor=""#D15FEE"" android:textStyle=""bold"" android:gravity=""left"" android:text=""Vitamin E"" android:fadingEdge=""horizontal|vertical""/&gt; &lt;/TableRow&gt;    &lt;TableRow&gt; &lt;Button    android:id=""@+id/vitaminK""  android:layout_width=""240px""   android:layout_height=""36px""   android:textSize=""15sp""  android:background=""#FFFFFF""  android:textColor=""#D15FEE""  android:textStyle=""bold""  android:gravity=""left""  android:text=""Vitamin K""   android:fadingEdge=""horizontal|vertical""/&gt;  &lt;/TableRow&gt;  &lt;/TableLayout&gt;  &lt;/ScrollView&gt; i get the following error: 11-18 22:09:51.765: ERROR/AndroidRuntime(488): FATAL EXCEPTION: main 11-18 22:09:51.765: ERROR/AndroidRuntime(488): java.lang.RuntimeException: Unable to start activity ComponentInfo{vitaminTable.xyz.com/vitaminTable.xyz.com.VitaminTable}: java.lang.ClassCastException: vitaminTable.xyz.com.VitaminTable 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at android.app.ActivityThread.access$2300(ActivityThread.java:125) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at android.os.Handler.dispatchMessage(Handler.java:99) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at android.os.Looper.loop(Looper.java:123) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at android.app.ActivityThread.main(ActivityThread.java:4627) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at java.lang.reflect.Method.invokeNative(Native Method) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at java.lang.reflect.Method.invoke(Method.java:521) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at dalvik.system.NativeStart.main(Native Method) 11-18 22:09:51.765: ERROR/AndroidRuntime(488): Caused by: java.lang.ClassCastException: vitaminTable.xyz.com.VitaminTable 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at vitaminTable.xyz.com.VitaminTable.onCreate(VitaminTable.java:38) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 11-18 22:09:51.765: ERROR/AndroidRuntime(488):     ... 11 more</code></pre>","505453","","505453","","2010-11-19 06:33:32","2010-11-19 06:40:33","my app crashes at the start and gives me a force close error","<java><android><android-intent><android-manifest>","3","3","1","",""
"4222582","1","","","2010-11-19 06:19:30","0","627","<p>I'm parsing large XML files (~1-2M) in my application. Occasionally parser failswhen parsing some files. </p><p>Symptoms:</p><ol><li>Sometimes the same file is parsed successfully, sometimes - not.</li><li>If parsing of a file fails it will take some time before the file can be parsedsuccessfully again.</li><li>I use 2 types of XML parsers: SAX (XMLReader) and Pull (XMLPullParser),both of them fail near the same place in the file.</li><li>I use FileInputStream as the input source for parsers.</li><li>The same file compressed via zip and then opened via ZipFile.getInputStream (almost) always parsed successfully.</li><li>I tryed to wrap FileInputStream with BufferedInputStream - nothing changed.</li><li>If parsing fails the next attempts to parse the file fail in the same place in the file.</li></ol><p>I believe there can be two causes:</p><ol><li>FileInputStream works incorrectly.</li><li>XML parsers work incorrectly with FileInputStream's (I heard both parsersimplemented on the same base in Android).</li></ol><p>Please help to fix the problem or advise a workaround.</p><p>Thanks.</p>","513127","","","","","2011-11-01 20:36:23","XML parsers sometimes fail parsing large XML files on Android","<android><xml>","1","4","1","",""
"4222594","1","4241244","","2010-11-19 06:22:05","1","622","<p>To make development easier, I want to be able to send textual commands to my android app  (especially prior to having prior the UI completely fleshed out).  Presumably in the emulator, but it would be great if it also worked on a device connected via USB.  Of course, I could add an editText control to my app and type the commands in there, but would prefer not have deal with debug things cluttering up the UI and all the complications of that.  I also would like to be able to paste text from computer clipboard, which sorta rules out EditText controls.</p><p>Is there any way to do this, say via any of the android-sdk/tools/ stuff?  I would implement the command processor java class/method, but need some way to be able to actually feed it a string.  I suppose I could do something that talks to the emulator via the file system or something, but would prefer not have to spend a lot of time doing this if there is something already available.</p>","226507","","","","","2010-11-22 16:45:24","send debug commands to app running in emulator","<android><android-emulator>","2","0","","",""
"4222620","1","4224538","","2010-11-19 06:26:54","1","1023","<p>I admit, I'm new at this whole Android stuff. I am trying to make an app but randomly I get Force close errors and I really don't know why. My application has many activities, none of them finish() when I start a new one. I get data from the web (via web services and direct image downloading) and I use AsyncTask a lot. Most of the time it crashes on the asynctask. Here is a sample on how I do things:</p><pre><code>private BackTask backTask;Activity ctx = this;    public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.trackslist);        backTask = new BackTask();            backTask.execute();    }    protected class BackTask extends AsyncTask&lt;Context, String, myObject&gt;        {            @Override            protected myObject doInBackground(Context... params)             {                 try{                        if (hasInternet(ctx)==true)                        {                            //access the web SERVICE here                        //initialize myObject WITH result FROM the web                         return myObject                       }                       else                       {                            return null                       }                  }catch(Exception ex){                       return null;                }            }            @Override            protected void onPreExecute()            {                    super.onPreExecute();            }            @Override            protected void onProgressUpdate(String... values)             {                    super.onProgressUpdate(values);            }            @Override            protected void onCancelled()            {                    super.onCancelled();            }            @Override            protected void onPostExecute( myObject result )             {                    super.onPostExecute(result);                    if (result==null || result.isEmpty())                    {                           //no valid result, show a message                    }                    else                    {                        //result valid do something with it                    }            }        }     @Override        public void onPause()        {            if (backTask!=null &amp;&amp; ! backTask.isCancelled())            {                backTask.cancel(true);            }            super.onPause();        }    public void btnStartOnClick(View target) {          Intent intent = new Intent(this, MyNewActivity.class);       startActivity(intent); }</code></pre><p>When the activity gets onPause() the task is being canceled. I am not sure what happens during the try/catch if a error appears, from what I've did, it should return null, but I think here I miss something. As I said before, randomly I get a force close even if I am on another Activity. This is really frustrating as I can't offer a app that has this behavior. So, what am I doing wrong ? </p>","379865","","","","","2010-11-19 11:31:41","Android Why does my app Force to close?","<android><android-asynctask>","2","2","","",""
"4222713","1","","","2010-11-19 06:40:14","17","16509","<p>Anyone know how to disable/hide notification bar at the top which show battery and other things in android.Any help will be appreciated.</p>","513146","","","","","2014-02-22 16:11:54","Hide Notification bar","<android>","3","2","4","",""
"4222726","1","","","2010-11-19 06:43:22","1","20821","<p>how can I stop threads safely?</p><pre><code> downloadThread = new Thread(new Runnable() {   @Override   public void run() {  });  downloadThread.start(); }</code></pre>","414777","","643742","","2013-04-15 19:51:57","2013-04-15 19:51:57","How to stop thread safely in android?","<java><android>","3","2","0","",""
"4222763","1","","","2010-11-19 06:49:08","0","131","<p>Hi i have a problem in my android 1.6 version phone...i have an application with few images in drawable resources.. when i install it in phone memory, it works fine...but when i installed into my memory card, it does not displays images...i don't know where the problem lies...i need to know where the images will store on my memory card and how to solve it...</p>","512001","","","","","2010-11-19 06:49:08","Android Real time problem","<android>","0","2","","",""
"4222792","1","4222831","","2010-11-19 06:53:42","2","301","<p>I am using the showDialog and dismissDialog methods to show progress dialogs in my app. Moved from creating the dialog and calling show() on it to using this in order to save state when changing orientation.</p><p>But when I change the orientation from portrait->landscape->portrait, the dismissDialog no longer dismisses the dialog. The dialog stay there all the time and I need to press the back button for it to disappear.</p><p>Any reason why it would behave that way?</p><p>Thanks</p>","493193","","","","","2010-11-19 11:26:34","Why dismissDialog method not working properly?","<android>","2","2","1","",""
"4222858","1","","","2010-11-19 07:05:40","0","162","<p>Hey all - I have an app that pulls up the camera, has the user snap a pic, and detect a face.  If a face is detected, I want layoutresult to be set as the content view, if faces aren't detected I want layoutfalse to be set as the content view. </p><p>My code is this:</p><p>--I open the camera on a button click (as an intent) and in this method, the photo is displayed on an ImageView: </p><pre><code>public void processCameraImage(Intent intent) {    setContentView(R.layout.detectlayout); // detectlayout    ImageView imageView = (ImageView) findViewById(R.id.image_view); //    cameraBitmap = (Bitmap) intent.getExtras().get(""data"");    imageView.setImageBitmap(cameraBitmap);    detectFaces();}</code></pre><p>detectFaces is called and I run conditions based on faces detected:</p><pre><code>        if (facesFound &lt; 1) {            setContentView(R.layout.detectfalse);            ImageView imageView = (ImageView) findViewById(R.id.false_view);            TextView textView = (TextView) findViewById(R.id.badPicText);            textView.setText(R.string.noFace);            imageView.setImageBitmap(bitmap565);        }</code></pre><p>I also have this, if there are faces detected:</p><pre><code>if (facesFound &gt; 0) {            showToast(this, ""Face Detected!"");                    //draw a rectangle around the face and compress the bmp            setContentView(R.layout.detectlayout);            ImageView imageView = (ImageView) findViewById(R.id.image_view);            TextView textView = (TextView) findViewById(R.id.textViewGoodPic);            textView.setText(R.string.faceFound);            imageView.setImageBitmap(bitmap565);</code></pre><p>}</p><p>The issue is, the image is set to the same layout (detectlayout) regardless of faces being found or not....there is no call to my false layout xml even if there are no faces....am I just missing something simple?</p><p>Thanks for any help! </p>","496686","","","","","2010-12-09 01:45:05","Need help resolving content view issues","<android><xml><layout><view><call>","0","2","","",""
"4222870","1","4223038","","2010-11-19 07:08:06","0","389","<p>i'm writing a function to download file:</p><pre><code>URL _url = new URL(""http://kevin95800.free.fr/Music/Jay%20Sean%20-%20Down%20(ft.%20Lil%20Wayne).mp3"");        URLConnection conn = _url.openConnection();        conn.connect();        InputStream is = conn.getInputStream();        if(is == null)        {            throw new RuntimeException(""stream is null"");        }        File musicFile = new File(""/sdcard/music/"" , ""mitpig.mp3"");        FileOutputStream fos = new FileOutputStream(musicFile);        byte buf[] = new byte[128];        do        {            int numread = is.read(buf);            Log.i(""html2"" , numread+"" "");            if(numread &lt;=0)                break;            fos.write(buf , 0 , numread);        }while(true);        is.close();</code></pre><p>my question is , how do i know the total byte of the file i'm downloading??</p><p>because , i wanna display the downloading progress. could someone teach me</p>","422405","","","","","2010-11-19 07:45:49","android downloading progress","<android>","1","0","1","",""
"4222877","1","4223475","","2010-11-19 07:09:15","0","1465","<p>I have created a media player and it is working. The issue I have is that only the video names are displayed in my list view. How can I see the name and a thumbnail image of the video in my list view?</p>","486554","","3340","","2012-08-18 03:15:16","2012-08-18 03:15:16","How to get video thumbnails?","<java><android><video><thumbnails>","1","0","","",""
"4222898","1","","","2010-11-19 07:13:57","1","1023","<p>In my application I've implemented such that pressing the hardware volume keys displays a Toast with the current volume. Things go well most of the times. However long presses of the volume keys do succeed in crashing my application. The Log generated on crash is the following :</p><pre><code>....11-19 06:43:22.114 I/NotificationService( 2783): enqueueToast pkg=com.FunTime.android callback=android.app.ITransientNotification$Stub$Proxy@47b679a8 duration=011-19 06:43:22.119 V/WindowManager( 2783): Delivering key 25 to Window{47f6a930 com.FunTime.android/com.FunTime.android.map.MapActivity paused=false}11-19 06:43:22.164 I/NotificationService( 2783): enqueueToast pkg=com.FunTime.android callback=android.app.ITransientNotification$Stub$Proxy@47a980b0 duration=011-19 06:43:22.169 V/WindowManager( 2783): Delivering key 25 to Window{47f6a930 com.FunTime.android/com.FunTime.android.map.MapActivity paused=false}11-19 06:43:22.209 I/NotificationService( 2783): enqueueToast pkg=com.FunTime.android callback=android.app.ITransientNotification$Stub$Proxy@47b4d270 duration=0...many such notifications...11-19 06:43:22.244 E/SurfaceFlinger( 2783): createSurface() failed, generateId = -1211-19 06:43:22.244 W/WindowManager( 2783): OutOfResourcesException creating surface11-19 06:43:22.244 I/WindowManager( 2783): Out of memory for surface! Looking for leaks...11-19 06:43:22.244 W/WindowManager( 2783): No leaked surfaces; killing applicatons!11-19 06:43:22.244 W/ActivityManager( 2783): Killing processes for memory at adjustment 011-19 06:43:22.244 W/ActivityManager( 2783): Killing for memory: ProcessRecord{47dd75c8 3246:com.FunTime.android/10079} (adj 0)11-19 06:43:22.244 I/Process ( 2783): Sending signal. PID: 3246 SIG: 911-19 06:43:22.244 W/WindowManager( 2783): Looks like we have reclaimed some memory, clearing surface for retry.11-19 06:43:22.244 W/WindowManager( 2783): Due to memory failure, waiting a bit for next layout</code></pre><p>The approach I follow:I have a toast Object and for every key press event detected I inflate a view ,set the view elements within, set it to the toast and then show the toast.</p><p>Any idea what is going wrong ?</p><p>Lated Edited </p><p>In the base activity class from which all my activities inherit:</p><pre><code>public boolean onKeyDown(int keyCode, KeyEvent event) {     if(keyCode==KeyEvent.KEYCODE_VOLUME_DOWN)     {        myAudioManager.getInstance().onVolumeDown();               myAudioManager.getInstance().showVolumeAdjustment(myAudioManager.getInstance().getVolume());        return true;     }     else if(keyCode==KeyEvent.KEYCODE_VOLUME_UP)     {        myAudioManager.getInstance().onVolumeUp();          myAudioManager.getInstance().showVolumeAdjustment(myAudioManager.getInstance().getVolume());       return true;      }    return super.onKeyDown(keyCode, event);}</code></pre><p>In myAudioManager </p><pre><code> public void showVolumeAdjustment(final int adjustment) {         volumeToast.setDuration(Toast.LENGTH_SHORT);         volumeToast.setView(getVolumeProgressBarView(adjustment));         volumeToast.setGravity(Gravity.TOP,0,0);         volumeToast.show(); } private View getVolumeProgressBarView(int adjustment) {         LayoutInflater inflater = (LayoutInflater) myApplication.getInstance().getApplicationContext()                                       .getSystemService(Context.LAYOUT_INFLATER_SERVICE);         toastView= inflater.inflate(R.layout.volume_toast, null);         ProgressBar pb =(ProgressBar)toastView.findViewById(R.id.level);         pb.setMax(MAX_VOICE_VOLUME_ENGINE);         pb.setProgress(adjustment);         return toastView; }</code></pre>","304866","","304866","","2010-11-19 09:18:22","2010-11-19 09:20:30","Toast crashes application","<android>","1","1","","",""
"4223396","1","4223432","","2010-11-19 08:55:38","0","2225","<p>I have a list view with 2 buttons on each row.I am using a cursoradpater to populate the list.</p><p>I am also using the view holder pattern on newview() bindview().</p><p>My questions are:where do i put the clicklisteners for the buttons knowing that the action for the button is different from the action of the list item itself?Do i keep the onListItemClick ?</p>","513267","","","","","2010-11-19 09:01:40","OnClickListener in Listview populated with a CursorAdapter","<android><listactivity>","1","0","","",""
"4223468","1","6101760","","2010-11-19 09:06:50","8","956","<p>After my application has been restored, of course.</p><p>or I have to store everything at onSaveInstanceState()?</p>","487500","","501932","","2012-06-11 02:42:16","2012-06-11 02:42:16","in Android if OS kills my application, will getIntent() return the Intent with the same extras?","<android><android-intent><android-activity>","3","0","1","",""
"4223472","1","4223594","","2010-11-19 09:07:54","5","11986","<p>How can I display image in an <code>ImageView</code> in android from a URL (from the internet)?</p>","508377","","1665365","","2014-03-31 10:01:12","2014-03-31 10:01:12","How to display an image from the internet in android?","<android>","4","0","2","",""
"4223499","1","","","2010-11-19 09:11:57","3","1541","<p>I am trying to add permissions to my application manifest, so it can access other apps that the user installs at runtime. I thought the way to do this was to define a permission-tree in the manifest, and then use PackageManager.addPermission() to add permissions under that tree. However, I can't get this to work and the documentation I found wasn't conclusive. Could anybody show me how to do this by means of a simple example? Thanks!</p>","513284","","","","","2014-03-24 20:56:17","Adding permissions to app manifest programatically","<android><permissions><android-manifest>","4","1","1","",""
"4223846","1","4244941","","2010-11-19 09:54:43","3","1946","<p>now i've been tring to integrate adwhirl to my application it does not show any add from the admob provider.But it will show house ads does not seem any problem with that</p><p>I added log cat file </p><p>To verify working of admob I interated with the same application too it does n't show any problem</p><p>Any help will be appreciated</p><p>thanks in advance</p><pre><code>11-19 15:18:33.149: DEBUG/AdWhirl SDK(572): Showing ad:11-19 15:18:33.149: DEBUG/AdWhirl SDK(572):     nid: 95eb0bdbbc484f8a86e69d15e04f764411-19 15:18:33.149: DEBUG/AdWhirl SDK(572):     name: admob11-19 15:18:33.149: DEBUG/AdWhirl SDK(572):     type: 111-19 15:18:33.149: DEBUG/AdWhirl SDK(572):     key: a14ce50397c304311-19 15:18:33.149: DEBUG/AdWhirl SDK(572):     key2: 11-19 15:18:33.149: INFO/dalvikvm(572): Failed resolving Lcom/adwhirl/adapters/AdMobAdapter; interface 88 'Lcom/admob/android/ads/AdListener;'11-19 15:18:33.149: WARN/dalvikvm(572): Link of class 'Lcom/adwhirl/adapters/AdMobAdapter;' failed11-19 15:18:33.159: WARN/AdWhirl SDK(572): Caught an exception in adapter:11-19 15:18:33.159: WARN/AdWhirl SDK(572): java.lang.Exception: Invalid adapter11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at com.adwhirl.adapters.AdWhirlAdapter.handle(AdWhirlAdapter.java:141)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at com.adwhirl.AdWhirlLayout.handleAd(AdWhirlLayout.java:163)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at com.adwhirl.AdWhirlLayout.access$3(AdWhirlLayout.java:151)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at com.adwhirl.AdWhirlLayout$HandleAdRunnable.run(AdWhirlLayout.java:316)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at android.os.Handler.handleCallback(Handler.java:587)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at android.os.Handler.dispatchMessage(Handler.java:92)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at android.os.Looper.loop(Looper.java:123)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at java.lang.reflect.Method.invokeNative(Native Method)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at java.lang.reflect.Method.invoke(Method.java:521)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-19 15:18:33.159: WARN/AdWhirl SDK(572):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Code is added below</p><pre><code>private static final String COMPANY_NAME = ""soft"";private static final String APP_NAME = ""firstapplication"";private static LogindbAdapter dbAdapter;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    AdManager.setInTestMode(true);    AdView adView=(AdView)findViewById(R.id.ad);    adView.requestFreshAd();    dbAdapter=new LogindbAdapter(getBaseContext());   LinearLayout layout=(LinearLayout) findViewById(R.id.layout_ad);    try     {        AdWhirlAdapter.setGoogleAdSenseCompanyName(COMPANY_NAME);        AdWhirlAdapter.setGoogleAdSenseAppName(APP_NAME);        ;        ZestAdzAdapter.setGoogleAdSenseAppName(APP_NAME);        ZestAdzAdapter.setGoogleAdSenseCompanyName(COMPANY_NAME);        AdManager.setPublisherId(""a14ce50397c3043"");        AdWhirlLayout adWhirlLayout=new AdWhirlLayout(this,""XXXXXXXX"");        //handle(adWhirlLayout,this.Ration);        final int DIP_WIDTH = 320;        final int DIP_HEIGHT = 52;        final float DENSITY = getResources().getDisplayMetrics().density;        int scaledWidth = (int) (DENSITY * DIP_WIDTH + 0.5f);        int scaledHeight = (int) (DENSITY * DIP_HEIGHT + 0.5f);        RelativeLayout.LayoutParams adwp =        new RelativeLayout.LayoutParams(scaledWidth, scaledHeight);        layout.addView(adWhirlLayout,adwp);        layout.invalidate();    }    catch(Exception e)    {        Log.e(""ad whirl"", ""un able to create adwhirl layout"", e);    }</code></pre>","482604","","482604","","2010-11-24 05:00:19","2010-12-18 19:03:15","Adwhirl does n't show ads from ad mob and same time it show house ads","<android><admob><adwhirl>","1","1","1","",""
"4223964","1","","","2010-11-19 10:08:24","0","3479","<p>I have an issue like </p><p>o</p><pre><code>org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: no element found org.apache.harmony.xml.ExpatParser.finish(ExpatParser.java:553) Displayed activity com.logictreeit.flight1/com.logictreeit.flight.app.MainTabActivity: 1689 ms (total 1689 ms) org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:483)   org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:320)    org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:293)</code></pre><p>Some times  successfully parsing , but some times  it thrwoing above error. </p><p>My code is</p><pre><code>URL url = new URL(urlString);        SAXParserFactory saxParserFactory= SAXParserFactory.newInstance();        SAXParser saxParser = saxParserFactory.newSAXParser();        XMLReader xmlReader = saxParser.getXMLReader();        FlightGuideHandler flightGuideHandler = new FlightGuideHandler();        xmlReader.setContentHandler(flightGuideHandler);        inputStream = url.openStream();        xmlReader.parse(new InputSource(urlString)); // am getting error at this line</code></pre><p>Can any one help me to sort out this error .</p><p>Thanking yoyu ,Srinivas</p>","414777","","","","","2011-05-10 11:19:41","Android: parseexception at Line 1 , column0 no element found?","<android><xml-parsing>","3","1","","",""
"4223967","1","","","2010-11-19 10:08:54","0","1528","<p>Am developing one apps in this i have to display pie chart , Am importing achartengine lib into my apps .the demo version of achartengine work fine it show the graph .But wen i use that into my apps nothing will displaying.anybody help me to solve this problem.</p><p>This is my code:</p><p>Main Activity:</p><pre><code>public class HomeScreenPage extends Activity {    public void onCreate(Bundle savedInstanceState)    {    super.onCreate(savedInstanceState);    setContentView(R.layout.homescreenpage);   PieChart achartIntent = new PieChart();    achartIntent.execute(this);    }</code></pre><p>Piechart class :</p><pre><code>import org.achartengine.ChartFactory;import org.achartengine.model.CategorySeries;import org.achartengine.renderer.DefaultRenderer;import org.achartengine.renderer.SimpleSeriesRenderer;import android.content.Context;import android.content.Intent;import android.graphics.Color;public class PieChart {    public Intent execute(Context context) {        double[] values = new double[] {12, 14, 11, 10,2};        int[] colors = new int[] {Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN};        DefaultRenderer renderer = buildCategoryRenderer(colors);        renderer.setLabelsTextSize(10);        return ChartFactory.getPieChartIntent(context, buildCategoryDataset(""Project budget"", values), renderer);      }    protected DefaultRenderer buildCategoryRenderer(int[] colors) {        DefaultRenderer renderer = new DefaultRenderer();        for (int color : colors) {          SimpleSeriesRenderer r = new SimpleSeriesRenderer();          r.setColor(color);          renderer.addSeriesRenderer(r);        }        return renderer;      }    protected CategorySeries buildCategoryDataset(String title, double[] values) {        CategorySeries series = new CategorySeries(title);        int k = 0;        for (double value : values) {          series.add(""Project "" + ++k, value);        }        return series;      }}</code></pre>","450596","","96196","","2011-08-03 09:15:18","2011-08-03 09:15:18","pie chart not displayed in my application ,am using achartengine library for graph?","<android><achartengine>","2","0","1","",""
"4224026","1","4231462","","2010-11-19 10:16:19","1","897","<p>I am new to Android.I create a HelloAndroid Project using command-line(not Eclipse). /<em>Runs in Eclipse</em>/Then I used Ant to build my HelloAndroid Project.But while building it showed me the below output.</p><pre><code>-resource-src:     [echo] Generating R.java / Manifest.java from the resources...-aidl:     [echo] Compiling aidl files into Java classes...BUILD FAILEDjava.lang.NoSuchMethodError: org.apache.tools.ant.types.FileSet.iterator()Ljava/util/Iterator;Total time: 1 second</code></pre><p>How can I fix this?</p>","513340","","183172","","2011-07-27 13:36:19","2011-07-27 13:36:19","NoSuchMethodError using Ant","<android><ant>","1","1","","",""
"4224178","1","10777609","","2010-11-19 10:39:27","0","2397","<p>Is there any way to display contact picker that has both number and contact name?</p><p>Now I'm calling picker:</p><pre><code>startActivityForResult(                       new Intent(Intent.ACTION_PICK,Contacts.Phones.CONTENT_URI),                       1);</code></pre><p>But in a result I get only Contact names without visible numbers. To make things worse, if one contact has two numbers it occurs twice.</p>","296427","","","","","2012-05-27 22:02:44","Contact picker that shows number, contact name and possibly a contact image?","<android><android-intent><contacts><android-contacts>","3","0","1","",""
"4224189","1","5563738","","2010-11-19 10:41:20","2","936","<p>I have integrated Facebook into my Android application. It was worked fine before last week. Since a couple of days ago (before it was working fine) I now sometimes get an error when posting to wall page saying <code>An error occured with holyplanets connect. Please try again later.</code></p><p>Please help me to resolve this issue.</p><p>Thanks in advance..</p>","365203","","290028","","2011-04-05 16:23:32","2011-04-06 08:50:56","Android Facebook SDK: ""An error occured with holyplanets connect. Please try again later."" How do I fix it?","<android><facebook><connection>","2","1","0","",""
"4224196","1","4224364","","2010-11-19 10:41:47","2","1177","<p>I have an <code>EditText</code> which when some text entered the virtual keyboard appears and when I press enter I can't get focus in my second <code>EditText</code>, but some times it works.</p><p>Anybody please help.</p><pre><code>edittext.setOnKeyListener(new OnKeyListener() {    public boolean onKey(View v, int keyCode, KeyEvent event) {        if (keyCode == KeyEvent.KEYCODE_ENTER)// key code for virtual keyboard next            {                System.out.println(""Event catched&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"");                edittext.requestFocus();            }            return false;        }    });</code></pre>","487219","","119895","","2010-11-19 11:01:20","2012-11-16 12:01:03","Android Virtual KeyboardListener","<android>","2","0","","",""
"4224223","1","","","2010-11-19 10:46:47","0","2918","<p>I am currently using Java API to get accelerometer values in 5Hz, which is below my requirements. I want to achieve at least 50Hz. Is there any way to increase the sampling rate of accelerometer? </p><p>Regards</p>","2290561","","","","","2013-11-11 03:11:18","Android: How to increase Accelerometer Sampling Rate?","<android><linux-kernel><accelerometer><sampling>","3","0","","",""
"4224234","1","4224277","","2010-11-19 10:48:08","1","1125","<p>I use a <code>LinearLayout</code> and first I have a <code>MapView</code> and below the map I have a <code>TableLayout</code> with informations fields.</p><p>Now I would like to add additional information fields (e.g. a new <code>TableLayout</code>) when the user select a specific menu item on the Options Menu. I would like to have these fields either between the <code>MapView</code> and the <code>TableLayout</code>, or on top of the bottom area of the <code>MapView</code>.</p><p>How can I add this <code>TableLayout</code> with additional information fields dynamically after the user has selected a menu item? How can I show it below the <code>MapView</code> or on top of the bottom area of the <code>MapView</code>?</p>","213269","","","","","2010-11-19 10:54:57","How to add Views dynamically or on top of other components?","<android><layout><views>","1","0","","",""
"4224267","1","4227707","","2010-11-19 10:53:08","0","1714","<p>I have a custom adapter to display a list of items with section headings. I've looked at Jeff Sharkey's <a href=""http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/"" rel=""nofollow"">SeparatedListAdapter</a> and CommonsWare's <a href=""https://github.com/commonsguy/cwac-merge"" rel=""nofollow"">MergeAdapter</a> as examples of how to achieve this, and I now have a solution which works by providing a separate adapter for the content of each section.</p><p>This creates a big performance problem, though. In my case, there are potentially thousands of items in the list, each with an associated date, and I want to use the date as section heading for all the items with that date.</p><p>So, without section headings, I'd have a single Cursor which returns the items sorted by date. Nice and easy.</p><p>With section headings, I'm currently doing this:</p><ol><li>One Cursor to select all distinct dates in the dataset</li><li><strong>For each distinct date</strong>, a separate Cursor to return the items matching that date</li><li>Pour the dates (section headings) and separate SimpleCursorAdapters for each date's items, into my custom adapter.</li></ol><p>This requires many more database queries and Cursors to be generated than I want, and there's a delay of several seconds before the ListView appears.</p><p>I suspect there might be a simpler solution where <code>getView</code> does something clever and detects when the date has changed between successive items, and then sneaks in a new heading by itself, thus requiring just the one Cursor. Can anyone suggest a way of doing this?</p>","385478","","508666","","2014-01-12 03:19:15","2014-01-12 03:19:15","Android adapter with section headings: performance problems","<android><cursor><adapter>","2","0","","",""
"4224301","1","4228080","","2010-11-19 10:59:07","0","516","<p>I want to try to get nice buttons that will work similar to tabs down the bottom of my app, but I am wondering if there are buttons like this built in:</p><p><img src=""http://i.stack.imgur.com/DNv5F.png""/></p><p>It would make navigation better, and developing a lot easier &amp; faster if they are.</p>","348261","","348261","","2010-11-19 11:46:28","2010-11-19 18:13:39","Are there buttons like these built into the Android that Devs can use?","<android><button><tabs><navigation><built-in>","2","0","","",""
"4224312","1","4224896","","2010-11-19 11:00:28","0","243","<p>I have to parse the url <a href=""http://local.yahooapis.com/LocalSearchService/V3/localSearch?appid=YahooDemo&amp;query=pizza&amp;zip=94306&amp;results=2"" rel=""nofollow"">http://local.yahooapis.com/LocalSearchService/V3/localSearch?appid=YahooDemo&amp;query=pizza&amp;zip=94306&amp;results=2</a> and show the result in android simulator</p><p>I have done earlier parsing in androidI did not get problem in that Can anyone help me in this regard?</p>","475349","","75204","","2010-11-25 06:12:39","2010-11-25 06:12:39","Android XML parsing","<android>","1","4","1","",""
"4224353","1","","","2010-11-19 11:05:55","1","237","<p>I am developing an application,In my application,I am displaying lot of images from url using <code>DOM</code> xml parsing,It is working fine,but some time i got <code>org.xml.sax.SAXParseException: Unexpected end of the document</code>in my xml parsing handler.How to solve this problem,please help me.This is my xml parsing handler code</p><pre><code>public String parse_bannerlink() throws UnknownHostException{DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();String bannerlink=null;try {DocumentBuilder builder = factory.newDocumentBuilder();Document dom = builder.parse(this.getInputStream());org.w3c.dom.Element root = dom.getDocumentElement();NodeList items = root.getElementsByTagName(""partypicbanner"");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(""link"")) {bannerlink=property.getFirstChild().getNodeValue();}}}} catch (Exception e) {e.printStackTrace();throw new RuntimeException(e);}return bannerlink;}</code></pre><p>Thanks all</p>","500595","","500595","","2010-11-19 11:27:56","2010-11-19 11:43:04","How to solve SAXParseExecption in android?","<android>","2","0","","",""
"4224360","1","","","2010-11-19 11:06:30","3","769","<p>I am having following code : </p><pre><code>public void onClick(View v) {    // TODO Auto-generated method stub    if(v.getId()==R.id.btnSrch){        Intent i = new Intent(this, SearchByCode.class);        View view = SearchGroup.group.getLocalActivityManager()            .startActivity(""SearchByCode"",i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))            .getDecorView();             SearchGroup.group.replaceView(view);    }}</code></pre><p>But when I am clicking the button it shows the next screen abruptly. I want to show the slide-in animation here.</p>","513386","","418183","","2010-11-19 11:10:15","2011-01-14 23:19:57","replace view in activitygroup with slide in animation in android","<android>","1","0","","",""
"4224413","1","","","2010-11-19 11:13:59","1","12418","<p>How to use a .p12 certificate on Android?</p><p>I tried adding it at Menu / Settings / Location and security. </p><p>When i do this the certificate disappears from the SD card but when i go to the website that needs the .p12-certificate i just get a connection error.</p><p>The certificate, password and url are all good. I tripple checked them.</p><p>I am not the only one with this issue, right? My colleagues with ipad / iphone can use it easily but on Android it's a pain in the *ss. They just double click on the .p12 file, give certificate password and they are set. </p><p>How come this is not like this on Android?</p>","513390","","675129","","2012-07-04 18:26:12","2013-04-08 00:43:53","How to use .p12 certificate on Android?","<android><ssl><certificate><pkcs#12>","1","2","2","",""
"4224435","1","4224514","","2010-11-19 11:17:07","0","639","<p>I'm using this code to display severl images from the internet </p><pre><code>ImageView iv = new ImageView;URL url = new URL(address);InputStream content = (InputStream)url.getContent();Drawable d = Drawable.createFromStream(content , ""src""); iv.setImageDrawable(d)</code></pre><p>but the application became slow in running why ??does the internet connection is the reason ??? or because i input several input stream to display each image??? </p>","508377","","","","","2010-11-19 11:28:37","why my android application become slow in running?","<android><inputstream>","1","1","2","",""
"4224450","1","4227354","","2010-11-19 11:19:10","1","4523","<p>I'm trying to bring up the standard window for Bluetooth Settings(with Device name, Discoverability etc).</p><p>However, general approach with <code>startActivity(intent)</code> ends with NullPointerException pointing to<code>BluetoothSettings.java onCreate:135.</code></p><p>Checking with the Android code, I've found that at line 135 they get some extras from the intent. So I prepare the same extras (names I've found in android core BluetoothDevicePicker interface) and issue it -- the same effect with NullPointerException.</p><p>Might be the wrongs names of the extras I prepare?</p><p>So is there a way I can see those extras (with names especially) from the intent the system itself submits when I open Bluetooth Settings manually acting like a user?</p><p>Many thanks.</p><p>My code is:</p><pre><code>Intent settingsIntent = new Intent();settingsIntent.setClassName(""com.android.settings"",      com.android.settings.bluetooth.BluetoothSettings"");settingsIntent.putExtra(""android.bluetooth.devicepicker.extra.LAUNCH_PACKAGE"", ""mypackage.bttoggle"");settingsIntent.putExtra(""android.bluetooth.devicepicker.extra.DEVICE_PICKER_LAUNCH_CLASS"", ""mypackage.bttoggle.BluetoothWidget"");PendingIntent settingsPendingIntent = PendingIntent.getActivity(context, 0, settingsIntent, 0);views.setOnClickPendingIntent(R.id.btnSettings, settingsPendingIntent);</code></pre><p>It's a widget so I need to use PendingIntent.</p><p>This code get the following Exception at runtime:</p><blockquote>  <p>ERROR/AndroidRuntime(4905): Uncaught handler: thread main exiting due  to uncaught exception ERROR/AndroidRuntime(4905):  java.lang.RuntimeException: Unable to start activity  ComponentInfo{com.android.settings/com.android.settings.bluetooth.BluetoothSettings}:  java.lang.NullPointerException ERROR/AndroidRuntime(4905): at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)  ERROR/AndroidRuntime(4905): at  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)  ERROR/AndroidRuntime(4905): at  android.app.ActivityThread.access$2200(ActivityThread.java:126)  ERROR/AndroidRuntime(4905): at  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)  ERROR/AndroidRuntime(4905): at  android.os.Handler.dispatchMessage(Handler.java:99)  ERROR/AndroidRuntime(4905): at android.os.Looper.loop(Looper.java:123)  ERROR/AndroidRuntime(4905): at  android.app.ActivityThread.main(ActivityThread.java:4595)  ERROR/AndroidRuntime(4905): at  java.lang.reflect.Method.invokeNative(Native Method)  ERROR/AndroidRuntime(4905): at  java.lang.reflect.Method.invoke(Method.java:521)  ERROR/AndroidRuntime(4905): at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)  ERROR/AndroidRuntime(4905): at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  ERROR/AndroidRuntime(4905): at dalvik.system.NativeStart.main(Native  Method) ERROR/AndroidRuntime(4905): Caused by:  java.lang.NullPointerException ERROR/AndroidRuntime(4905): at  com.android.settings.bluetooth.BluetoothSettings.onCreate(BluetoothSettings.java:135)  ERROR/AndroidRuntime(4905): at  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  ERROR/AndroidRuntime(4905): at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)  ERROR/AndroidRuntime(4905): ... 11 more</p></blockquote><p>After investigating, I found that at line 135 in BluetoothSettings.java there is:</p><pre><code>public class BluetoothSettings extends PreferenceActivity{ ... 132 mNeedAuth = intent.getBooleanExtra(BluetoothDevicePicker.EXTRA_NEED_AUTH, false); 133 mFilterType = intent.getIntExtra(BluetoothDevicePicker.EXTRA_FILTER_TYPE, 134 BluetoothDevicePicker.FILTER_TYPE_ALL); 135 mLaunchPackage = intent.getStringExtra(BluetoothDevicePicker.EXTRA_LAUNCH_PACKAGE); 136 mLaunchClass = intent.getStringExtra(BluetoothDevicePicker.EXTRA_LAUNCH_CLASS); ...</code></pre><p>I looked into BluetoothDevicePicker to find the names of the extras:</p><pre><code>public interface BluetoothDevicePicker { public static final String EXTRA_NEED_AUTH = ""android.bluetooth.devicepicker.extra.NEED_AUTH"";public static final String EXTRA_FILTER_TYPE = ""android.bluetooth.devicepicker.extra.FILTER_TYPE"";public static final String EXTRA_LAUNCH_PACKAGE = ""android.bluetooth.devicepicker.extra.LAUNCH_PACKAGE"";public static final String EXTRA_LAUNCH_CLASS = ""android.bluetooth.devicepicker.extra.DEVICE_PICKER_LAUNCH_CLASS"";</code></pre><p>So, I use them in my code to prepare those particular extras.</p>","510148","","275567","","2012-10-18 03:36:58","2012-12-17 09:57:16","Android: Trying to start BluetoothSettings activity Force Close with NullPointerException","<android><bluetooth><settings>","2","0","2","",""
"4224486","1","4225036","","2010-11-19 11:24:45","0","226","<p>Why we have to setup a boundary string?What is the purpose for?any rules on it?</p>","206630","","","","","2010-11-19 12:38:47","The boundary string in HttpURLConnection?","<android>","1","1","","",""
"4224519","1","4225157","","2010-11-19 11:29:05","0","324","<p>This is my layout:</p><pre><code>&lt;ListView&gt;   &lt;TextView&gt;&lt;/TextView&gt;&lt;/ListView</code></pre><p>This xml is the main.xml with main.java.  How can i embed intro.xml with intro.java into the <code>&lt;Textview&gt;?</code></p><p>thanks for your help.</p>","513407","","21234","","2010-11-19 12:40:58","2010-11-19 12:50:31","Android: How to embed a class inside a textview of another xml?","<android><embedded-resource>","1","0","","",""
"4224535","1","4225037","","2010-11-19 11:31:30","1","512","<p>In main page of my program I have some buttons such as Help. When user clicks it an activity appears and shows some guideline. It is full text and I need to change color of some words as I like. for bold and italic I don't have problem, easily I surround my words with <b></b>. But I don't know what should I do to change color of some words.</p><p>Please tell me what should I do?</p>","513413","","","","","2010-11-19 12:38:54","Adding HTML tags into text","<html><android><text><colors><tags>","3","0","","",""
"4224632","1","","","2010-11-19 11:44:24","0","755","<p>I am New to Android My requirement is to read text File From local in android?</p><p>can anyone help me...</p>","486291","","","","","2010-11-19 12:30:04","How to Read Textfile from Local in android?","<android>","1","1","","",""
"4224693","1","","","2010-11-19 11:54:33","0","137","<p>I get want to know how to deploy a application within a another application in android.for example mms application is get deployed within the message application and QuickSearchbox within contacts.how to do this one.There is now separate icon in launcher for QuickSearchBox or mms application.How to do it.Thanks in advance.</p>","366916","","","","","2011-02-16 12:26:58","Android-Application within an another application","<android>","1","1","","",""
"4224765","1","","","2010-11-19 12:04:08","5","1292","<p>How can I block outgoing an SMS if it contains a filtered word according to a database? I can monitor that a sent message contains a filtered word but I am unable to block the SMS.</p>","450601","","869458","","2012-01-04 20:08:34","2012-01-05 09:48:01","Block Outgoing SMS","<android><sms>","1","2","","",""
"4224785","1","4224883","","2010-11-19 12:07:01","0","555","<p>My video player not working in HTC Eris </p><pre><code>    Intent tostart = new Intent(Intent.ACTION_VIEW);         tostart.setDataAndType(Uri.parse(photos_videos_uri_list.get(position)),           ""video/*"");         v.getContext().startActivity(tostart);</code></pre>","487219","","119895","","2010-11-19 12:09:11","2010-11-19 12:20:01","Android Video Player","<android>","1","1","0","",""
"4224861","1","4227618","","2010-11-19 12:16:08","2","2715","<p>I've got a TabHost with three tabs; each holding one activity.</p><p>I'd like to change the view of one tab to another view - how can I do that programatically? I don't like to use ActivityGroups, as I've experienced several problems with ActivityGroups.</p><p>It would be perfect if I could add a View on top of the current one, so the back button is working, too (or at least I could fetch the back button and remove the topmost view).</p>","27404","","114066","","2012-01-11 16:40:13","2012-01-11 16:40:13","Android: Change View of Tab","<android><tabs>","1","0","1","",""
"4224913","1","","","2010-11-19 12:23:32","16","21617","<p>Is there a specific library for Android session management? I need to manage my sessions in a normal Android app. not in <code>WebView</code>. I can set the session from my post method. But when I send another request that session is lost. Can someone help me with this matter?</p><pre><code>DefaultHttpClient httpClient = new DefaultHttpClient();HttpPost httppost = new HttpPost(""My url"");HttpResponse response = httpClient.execute(httppost);List&lt;Cookie&gt; cookies = httpClient.getCookieStore().getCookies();if (cookies.isEmpty()) {    System.out.println(""None"");} else {    for (int i = 0; i &lt; cookies.size(); i++) {        System.out.println(""- "" + cookies.get(i).toString());    }}</code></pre><p>When I try to access the same host that session is lost:</p><pre><code>HttpGet httpGet = new HttpGet(""my url 2"");HttpResponse response = httpClient.execute(httpGet);</code></pre><p>I get the login page response body.</p>","511737","","56285","","2013-10-27 08:47:30","2013-10-27 08:47:30","Android session management","<java><android><session><session-cookies><apache-commons-httpclient>","3","0","15","",""
"4224969","1","4225278","","2010-11-19 12:29:52","2","2075","<p>I have a DatabaseHelper class which extends SQLiteOpenHelper, what is a good practice to using the DBHelper to perform data extractions?</p><p>In my DatabaseHelper class, I have a method to help me retrieve the results of a query like, ""Select * FROM ....."". The results will be used by many other classes. </p><p>Example:</p><pre><code>Cursor getAllWhitelist(){     SQLite Database db=this.getWritableDatabase();     Cursor cur = db.rawQuery(""Select * from WhiteList"");     return cur;}</code></pre><p>Should I be returning a cursor at this stage? Is it recommended? Or should I be returning an ArrayList or things like that?</p><p>How are you guys doing it?</p>","188357","","","","","2011-02-04 04:51:37","What is a good practice to using a DBHelper (SQLite) on Android Applications","<java><android><database><sqlite>","2","0","","",""
"4225027","1","","","2010-11-19 12:38:08","1","814","<p>I am trying to paste clipboard content in a disabled EditText with no softkeyboard popup, with  following code</p><pre><code>clipboardBox.setInputType(InputType.TYPE_NULL);</code></pre><p>android EditText does not respect line feeds, i.e. doesnt show multiline contentand puts it in single line.</p><p>I want to disable softkeyboard from popping up in a multiline content holder disabled EditText</p>","447238","","","","","2010-11-19 12:38:08","Disable SoftKeyboard in MultiLine EditText android","<android><edittext><android-softkeyboard>","0","2","","",""
"4225115","1","","","2010-11-19 12:46:30","0","201","<p>I want to use somthing like:</p><pre><code>MyLogger.e(""MyApp"",""I have an error."");</code></pre><p>in a cross-plattform project, where MyLogger should be static to make it available in the whole project.</p><p>So I was trying something like:</p><pre><code>MyAndroidLogger implements MyLogger {   public static void e(String strApp, String strErr) {     Log.e(strApp, strErr);}MyAppletLogger implements MyLogger {   private static Logger logger = Logger.getLogger();   public static void e(String strApp, String strErr) {     logger.e(strApp, strErr);}</code></pre><p>The compiler complains about the static. How do I do this? Is it possible at all? If not, what's the right approach?</p><p>Thanks in advance...</p>","284393","","","","","2010-12-07 16:23:46","Static logger for cross-plattform, e.g. Java (Applet) and Android","<java><android><logging><cross-platform><applet>","2","2","","",""
"4225197","1","4763833","","2010-11-19 12:56:07","5","685","<p>I'm writing an android soundboard wich allow the user to create multiple desktop widgets, one for each sound. I'm using an activity for the user to choose wich sound he wants to create the widget for. For each widget created i store a  shared preference in the form of<br/> <code>key =&gt; ""WIDGET_FILENAME_""+widgetId, value=&gt; fileName</code><br/>To play the sounds, i did override the <code>onRecieve</code> method on the widgetProvider class. When the desktop widget is clicked, it triggers a broadcast to this method, wich gets the widget id from the intent and then loads the shared preference associated with the widget:<br/></p><pre><code>int appWidgetId =  intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,                                     AppWidgetManager.INVALID_APPWIDGET_ID);</code></pre><p>The problem is: The widgetId  is always the same, no mather wich widget is clicked, causing the same sound to be played.<br/>Any idea or guidance on this?</p>","181915","","356440","","2013-03-12 17:39:05","2013-03-12 17:39:05","Android - Multiple appWidgets playing different sounds","<java><android><android-widget>","2","0","2","",""
"4225205","1","","","2010-11-19 12:56:52","1","706","<p>I managed to sign in with my google account (using the Google API AVD), but any notes that I write does not sync to the jumpnote.appspot.com, and vice versa. I notice in the account settings, it says ""sync is OFF"". I click on menu and the ""sync now"" button, the sync icon shows up momentarily on top but nothing happened after that. The notes I wrote on the phone do not get reflected on the server. Did anyone manage to get the jumpnote sample to sync successfully via C2DM? Please help. Thanks.</p>","192339","","","","","2011-10-18 15:00:04","Can anyone get the sync to work on the jumpnote running under a google android emulator?","<android><android-emulator><android-c2dm>","3","0","","",""
"4225295","1","4227229","","2010-11-19 13:09:25","0","931","<p>Is there any nice to way to get notifications/intents/changes from the systemlog in Android.</p><p>Logcat only shows the latest part of the systemlog which I find very limited and I would like to stream the changes to a webserver or such from an application.</p><p>/Br Johannes</p>","185433","","","","","2010-11-19 16:41:34","Android log event","<android><notifications><logcat>","1","0","","",""
"4225305","1","4225347","","2010-11-19 13:10:30","2","6937","<p>I would like to know how to execute a system command from an android application?  </p><p>For example :   </p><p>I would like to create a directory while I am running an application, so i need to execute the command ""mkdir -p /x/y"".  </p><p>Please guide me with valuable pointers.  </p><p>Thanks,<br>Sen</p>","449378","","","","","2011-12-27 18:28:45","How to execute a system command from an android application","<android><linux>","3","0","1","",""
"4225326","1","","","2010-11-19 13:13:00","0","327","<p>I am calling my application from clicking on button in web-page. I made that activity as BROWSABLE.  It is working fine when I open that web-page in android emulator and click on button; i.e. it is opening the application. Now, I want to whether that activity is present or not in my emulator i.e. it is installed or not, by clicking on button... How can I check that??</p>","456231","","","","","2010-11-19 13:36:18","How to check whether BROWSABLE activity is present(installed ) or not?","<android>","1","0","","",""
"4225340","1","4226193","","2010-11-19 13:15:24","1","934","<p>I have an application in which there will be a service continuously running in background and on certain conditions service should call an activity or pop-up a dialog. I think this is possible.</p><p>The question is, in case device keyguard gets on say after 2 minutes of idle time then will the service continue running in background. And what will happen when the condition of opening pop-up or Activity is reached.</p><p>Does anyone have any solution to this?</p>","261566","","","","","2010-11-19 14:58:00","Pop-up dialog or Activity from Service running in Background in Android when keyguard is locked?","<android><user-interface><service>","1","0","","",""
"4225344","1","","","2010-11-19 13:16:19","3","3287","<p>I am getting this when trying to run a Android 1.5 app in the emulator from Eclipse. Any ideas what this is, the Android documentation is somewhat sparse to say the least. My web searches have proven fruitless and i am on the verge of dumping the whole thing...</p><p>Any ideasRick</p><blockquote>  <p>eclipse.buildId=unknown  java.version=1.6.0_22 java.vendor=Sun  Microsystems Inc. BootLoader  constants: OS=win32, ARCH=x86,  WS=win32, NL=en_US Framework  arguments:  -product  org.eclipse.epp.package.jee.product  Command-line arguments:  -os win32 -ws  win32 -arch x86 -product  org.eclipse.epp.package.jee.product</p>    <p>Error Fri Nov 19 08:02:15 EST 2010 No  command output when running: 'am start  -n package -a android.intent.action.MAIN -c  android.intent.category.LAUNCHER' on  device emulator-5554</p>    <p>com.android.ddmlib.ShellCommandUnresponsiveException  at  com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408)  at  com.android.ddmlib.Device.executeShellCommand(Device.java:277)  at  com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(Unknown  Source) at  com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launchApp(Unknown  Source) at  com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(Unknown  Source) at  com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:861)  at  com.android.ddmlib.Device.update(Device.java:399)  at  com.android.ddmlib.Client.update(Client.java:834)  at  com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90)  at  com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64)  at  com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)  at  com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322)  at  com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)</p></blockquote>","513516","","210916","","2010-11-27 08:20:47","2013-04-25 19:00:02","Android Exception No command output when running: 'am start <application/application>","<android><exception>","2","0","2","",""
"4225356","1","","","2010-11-19 13:18:47","0","940","<p>I want to set text in textview in my android class using a javascript which contains a same named variable as in the class for textview to which I want to assign some text. Something like this:</p><p>In js:</p><pre><code>function validClick() { fromJS.append(""vikrant""); valid.performClick(); document.getElementById(""ok"").value = ""Accepte"";}</code></pre><p>fromJS is my textview in android class.</p><p>and the code in the class looks like:</p><pre><code>    valid.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            // TODO Auto-generated method stub            Context context = getApplicationContext();            CharSequence text = fromJS.getText();            CharSequence text = clsVariable;            int duration = Toast.LENGTH_SHORT;            Toast toast = Toast.makeText(context, text, duration);            toast.show();        }    });</code></pre><p>EDIT:Also, I' writing </p><pre><code>    wbvw.addJavascriptInterface(valid, ""valid"");    wbvw.addJavascriptInterface(fromJS, ""fromJS"");</code></pre><p>in my onCreate method.</p><p>Can anybody please help?</p><p>Thanx in advance.</p>","227943","","227943","","2010-11-22 05:49:18","2012-07-18 05:08:05","How to set textview text using javascript android","<javascript><android>","1","1","","",""
"4225397","1","4225491","","2010-11-19 13:24:42","1","896","<p>how to add 2 buttons horizontally with 50% width for each ? </p>","508377","","","","","2014-01-10 11:55:03","how to add 2 buttons horizontally with 50% width for each in android?","<android>","2","0","","",""
"4225406","1","4496259","","2010-11-19 13:25:33","0","963","<p>i have set the background of an activity with a green gradient png image as</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/bg""    android:orientation=""vertical""&gt;...&lt;/LinearLayout&gt;</code></pre><p>This working fine almost always but some times during navigating to an activity its background is becoming black! i am not able to reproduce it with any specific operation, also not getting how to debug or fix it.</p>","470056","","470056","","2010-11-19 15:36:14","2010-12-21 04:21:12","Activity background becoming black!","<android><activity>","4","2","","",""
"4225422","1","","","2010-11-19 13:27:58","1","640","<p>In Reuters' RSS web services, loading rss feeds from certain countries throws <code>java.net.ProtocolException: Too many redirects</code>  on loading RSS feed on both UI and Background . (Specially in case of two countries: <code>INDIA</code> and <code>USA</code>) .</p><p>How can I solve this issue? Did anybody successfully solved this problem.</p><p>Thanks in advance.</p>","246942","","","","","2010-11-19 13:27:58","Too many redirects to reuters rss web services","<android><rss><reuters>","0","5","","",""
"4225470","1","","","2010-11-19 13:34:42","0","1202","<p>I have a layout.xml file with a surfaceview and various buttons.</p><p>This is loaded (setContentView) into two instantiations of a class. Each instance is an activity on a different tab (within another class which is a tabactiviy).</p><p>The problem: if I start the app with tab1 (setCurrentTab) as the opening tab it (tab1) can draw on the surface. If I set tab2 as the opening tab, it can draw on the surface. BUT switching between the tabs when running, only the initial tab can draw on the surface. It's as if the initial tab has a lock on the surface.</p><p>I've tried making the surfaceview invisible (setvisibility) on the inactive tab during pause and resume but this just covers (I think) the other tab's copy of the surfaceview.</p><p>The question: can two tabs share a single layout's surfaceview? How can a 'resumed' tab get control from the 'paused' tab?</p><p>PS I have rewritten, torn apart, tried reloading (rebuilt in several ways this application over 3 weeks and I get the feeling that there's something about shared layout that I'm missing.</p>","513534","","","","","2011-01-12 11:02:24","Android Reusing SurfaceViews from a single layout xml file on two tabs of a tabactivity","<android><tabs><surfaceview><tabactivity>","2","0","","",""
"4225526","1","9911888","","2010-11-19 13:41:23","4","6184","<p>I've an application that you can show and close several Dialogs with:</p><pre><code>showDialog(...)removeDialog(...)</code></pre><p>I play a little bit with the application and when there is no any Dialog on the screen, I press the menu button and I go to the main android screen.</p><p>After a while, I enter again into my application and sometimes, I get this RuntimeException:</p><pre><code>java.lang.IllegalArgumentException: Activity#onCreateDialog did not create a dialog for id 4    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)    at android.app.ActivityThread.access$2200(ActivityThread.java:126)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4595)    at java.lang.reflect.Method.invokeNative(Native Method)    at java.lang.reflect.Method.invoke(Method.java:521)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)    at dalvik.system.NativeStart.main(Native Method)Caused by: java.lang.IllegalArgumentException: Activity#onCreateDialog did not create a dialog for id 4    at android.app.Activity.createDialog(Activity.java:878)    at android.app.Activity.restoreManagedDialogs(Activity.java:867)    at android.app.Activity.performRestoreInstanceState(Activity.java:815)    at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1096)    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2565)    ... 11 more</code></pre><p>Any idea?</p><p>Thank you very much.</p><p>UPDATE, more information:</p><p>The current onCreateDialog implementation is:</p><pre><code>protected Dialog onCreateDialog(int id){ Builder b = new AlertDialog.Builder(this); if(id == 4){  b.setMessage(...);  b.setItems(items, new DialogInterface.OnClickListener(){   public void onClick(DialogInterface dialog, int which){    Intent i = new Intent(Current.this, Another.class);    startActivity(i);   }  });  return b.create(); } return null;}</code></pre><p>In order to call this function I do:</p><pre><code>removeDialog(4);showDialog(4);</code></pre>","245638","","245638","","2011-01-07 10:47:11","2012-03-28 16:31:27","Android RuntimeException onCreateDialog did not create a dialog for id","<android><runtimeexception>","5","0","3","",""
"4225616","1","4225636","","2010-11-19 13:51:47","1","222","<p>I'm trying to force the user to qualify my application. For do that I need launch the AndroidMarket for the user can access to rating web.</p><p>Can anyone tell me what is the best way?</p><p>I try this, but don't work:</p><pre><code>String urlString = ""market.android.com/details?id=com.pakagename"";              Intent intent = new Intent();intent.setAction(Intent.ACTION_VIEW);intent.setData(Uri.parse(urlString));startActivity(intent);</code></pre><p>Thanks a lot!</p>","435936","","","","","2010-11-19 13:55:47","How to launch AndroidMarket for rating my application","<android><google-play>","1","0","1","",""
"4225634","1","4225653","","2010-11-19 13:55:28","2","237","<p>I got the following code in my Android-App:</p><pre><code>Event[] events = retrieveEvents();if (events != null &amp;&amp; events.length&gt;0) {   int eventNr = getFromUserInput();   eventNr = eventNr % events.length;   Event event = events[eventNr];}</code></pre><p>retrieveEvents() gets some <code>Event</code>s from the Internet, so this can fail an though be empty or <code>null</code>. The user can select which <code>Event</code> to display, to avoid a Exception I use the modulo operation to ensure the <code>eventNr</code> is within bounds. This works fine on any devices I tested on BUT:</p><p>I get error-reports from other users where the second last line (the array-access) throws an <code>ArrayIndexOutOfBoundsException</code>. How can this happen? What condition have I left unchecked? Where is my error?</p><p>Remember: The <code>retrieveEvents()</code> and the <code>getFromUserInput()</code> function can both return invalid data, but I think I checked every case, so where is my fault?</p><p>Thanks</p>","61855","","443515","","2010-11-19 14:33:07","2010-11-19 14:33:07","Why does a ArrayIndexOutOfBoundsException happen here?","<java><android><arrays><bounds><checking>","2","3","","",""
"4225713","1","","","2010-11-19 14:04:03","1","138","<p>i have a question regarding some weird logcat outputs. </p><p>Scenario:I have a listactivity with images and textviews, etc. The images are loaded by Fedor's implementation of LazyList. I changed his cache to a LRUMap from commons.</p><p>On scrolling i got sometimes a stuttering and logcats shows me a lot of this messages:</p><pre><code>V/WindowManager( 2482): Dsptch &gt; Window{48267640 &lt;packagename to Listactivity&gt; paused=false}V/InputDevice( 2482): ID[0]=0(0) Up(1=&gt;0)</code></pre><p>Any ideas what these messages mean?</p><p>Thx in advance</p>","288324","","","","","2010-11-19 14:04:03","listactivity is stuttering caused by WindowManager","<android><list><listview><listactivity><logcat>","0","2","1","",""
"4225817","1","4226444","","2010-11-19 14:14:46","7","7056","<p>I am using following example to display internet images in my activity.</p><p><a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-gridview.html</a></p><p>In custom image adapter I'm directly loading images from internet and assigning it to imageview.</p><p>Which shows images in gridview and every thing works fine but it is not efficient way.</p><p>When ever i scroll gridview it again and again loads images and thats why gridview scrolls very slow</p><p>Is there caching or some useful technique available to make it faster?</p>","249991","","168868","","2012-01-21 19:06:45","2013-08-22 17:13:48","how to load internet images in gridview efficiently?","<android><gridview>","3","0","12","",""
"4225847","1","4226246","","2010-11-19 14:18:44","4","2963","<p>I wrote an android program that: has a main activity for UI, and it starts a service. The service timely callbacks the UI activity to update views. It works fine except: if the activity is closed (with BACK) and start again, the service will also be started again (The service plays audio file, so there are two overlapped sounds).I use bindService with BIND_AUTO_CREATE flag to start and connect to service. According to the document, it should create service only if it doesn't exist, but obviously it starts another instance when opened second time.All I want is when the activity is closed, the service goes on running, and when the activity opens again, it can reconnect to the service. Is that possible? Or I just misunderstand the usage of service?</p><p>Tried more:Use ICountService (described in .aidl) instead of CountService in bindService Intent. It's onDestroyed is called when the activity is closed.</p><p>Below is code of service creating if it helps.</p><pre><code>    ServiceConnection conn = new ServiceConnection(){    @Override    public void onServiceConnected(ComponentName c, IBinder b) {        Log.d(""TK"",""Connected"");        //binder = (ICountService.Stub) b;        service = ICountService.Stub.asInterface(b);        try {            service.setCallback(new ICountCallback.Stub(){                @Override                public void alert() {                    Log.d(""TK"",""alert!"");                }                @Override                public void updateTime(final int sec) {                    handler.post(new Runnable(){                        @Override                        public void run() {                                                            indicator.setText(toText(sec));                        }                    });                }                           });        } catch (RemoteException e) {            e.printStackTrace();        }    }    @Override    public void onServiceDisconnected(ComponentName c) {        Log.d(""TK"",""Disconnected"");    }           };private void startCountService(){    Intent i = new Intent(ICountService.class.getName());    boolean ok = context.bindService(i, conn, Context.BIND_AUTO_CREATE);    Log.d(""TK"", ""bindService=""+ok);}</code></pre>","513080","","513080","","2010-11-20 08:14:10","2012-06-30 15:17:34","Why remote service is destroyed when main activity is closed?","<android><service>","2","0","","",""
"4225862","1","4714417","","2010-11-19 14:20:22","1","356","<p>I managed to record audio by sending intent with action MediaStore.Audio.Media.RECORD_SOUND_ACTION. But is there a way to tell MediaStore application to automatically start recording without the need for user to press record button?I don't see relevant parameters nor <a href=""http://developer.android.com/reference/android/provider/MediaStore.Audio.Media.html"" rel=""nofollow"">MediaStore.Audio.Media</a> nor in MediaStore.</p><p>And same question for video...</p>","490114","","","","","2011-01-17 16:30:12","Autostart recording in MediaStore","<android><activity><android-intent><mediastore>","1","0","0","",""
"4225877","1","4225980","","2010-11-19 14:21:37","5","6406","<pre><code>The type Enum is not generic; it cannot be parameterized with arguments &lt;RestClient.RequestMethod&gt;</code></pre><p>I've this error in the following code ..</p><pre><code>package ayanoo.utility;    import java.io.BufferedReader;    import java.io.IOException;    import java.io.InputStream;    import java.io.InputStreamReader;    import java.net.HttpURLConnection;    import java.net.URL;    import java.util.Vector;    import org.apache.http.HttpEntity;    import org.apache.http.HttpResponse;    import org.apache.http.NameValuePair;    import org.apache.http.client.ClientProtocolException;    import org.apache.http.client.HttpClient;    import org.apache.http.client.entity.UrlEncodedFormEntity;    import org.apache.http.client.methods.HttpPost;    import org.apache.http.client.methods.HttpUriRequest;    import org.apache.http.impl.client.DefaultHttpClient;    import org.apache.http.message.BasicNameValuePair;    import org.apache.http.protocol.HTTP;    import android.util.Log;    public class  RestClient {     public enum RequestMethod     {     GET,     POST     }        private Vector &lt;NameValuePair&gt; params;        private String url;        private int responseCode;        private String message;        private String response;        public String getResponse() {            return response;        }        public String getErrorMessage() {            return message;        }        public int getResponseCode() {            return responseCode;        }        public RestClient(String url)        {            this.url = url;            params = new Vector&lt;NameValuePair&gt;();        }        public void AddParam(String name, String value)        {            params.add(new BasicNameValuePair(name, value));        }        public void Execute(RequestMethod method) throws IOException        {            switch(method) {                case GET:                {                    //add parameters                    String combinedParams = """";                    if(!params.isEmpty()){                        combinedParams += ""/"";                        for(NameValuePair p : params)                        {                            //String paramString = p.getName() + ""="" + p.getValue();                         String paramString = p.getValue();                            if(combinedParams.length() &gt; 1)                            {                                combinedParams  +=  ""&amp;"" + paramString;                            }                            else                            {                                combinedParams += paramString;                            }                        }                    }                    Log.d(""URL See:"",url + combinedParams);                    URL urlObject = new URL(url + combinedParams);                    //URL urlObject = new URL(""http://www.aydeena.com/Services/Search.svc/JSON/SearchByText/1"");                    executeRequest(urlObject);                    break;                }                case POST:                {                    HttpPost request = new HttpPost(url);                    //add headers                    if(!params.isEmpty()){                        request.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));                    }                    executeRequest(request, url);                    break;                }            }        }        private void executeRequest(URL urlObject) throws IOException{         HttpURLConnection con = null;         con = (HttpURLConnection) urlObject.openConnection();            con.setReadTimeout(10000 /* milliseconds */);            con.setConnectTimeout(15000 /* milliseconds */);            con.setRequestMethod(""GET"");            //con.addRequestProperty(""Referer"",              //    ""http://www.pragprog.com/titles/eband/hello-android"");            con.setDoInput(true);            // Start the query            con.connect();            response = convertStreamToString(con.getInputStream());            Log.d(""Response:"", response);        }        private void executeRequest(HttpUriRequest request, String url)        {            HttpClient client = new DefaultHttpClient();            Log.d(""Test URL:"", url);            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 = convertStreamToString(instream);                    // Closing the input stream will trigger connection release                    instream.close();                }            } catch (ClientProtocolException e)  {                client.getConnectionManager().shutdown();                e.printStackTrace();            } catch (IOException e) {                client.getConnectionManager().shutdown();                e.printStackTrace();            }        }        private static String convertStreamToString(InputStream is) {            BufferedReader reader = new BufferedReader(new InputStreamReader(is));            StringBuilder sb = new StringBuilder();            String line = null;            try {                while ((line = reader.readLine()) != null) {                    sb.append(line + ""\n"");                }            } catch (IOException e) {                e.printStackTrace();            } finally {                try {                    is.close();                } catch (IOException e) {                    e.printStackTrace();                }            }            return sb.toString();        }    }</code></pre><p>what's the problem ??? !</p>","508377","","","","","2014-03-27 15:28:38","The type Enum is not generic; it cannot be parameterized with arguments <RestClient.RequestMethod>","<java><android><enums>","5","0","","",""
"4225881","1","4227126","","2010-11-19 14:21:58","1","434","<p>could you tell me where to down the Page Turner widget in old early sdk.i want to use it. can you give me a link?  and if  give me have been modified code,i feel more happy.thank you?</p>","233618","","","","","2011-04-23 17:39:45","about Page Turner widget","<android><android-widget>","2","0","","",""
"4225909","1","4225953","","2010-11-19 14:25:48","3","2151","<p>I'm testing some functions with Android, JNI and NDK.</p><p>I have the following JAVA class:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.TextView;public class JNITest extends Activity {    private int contador;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        contador = 0;        TextView label = (TextView)findViewById(R.id.Text);        label.setText(Integer.toString(contador));    }    public void addClick(View addButton) {        nativeAdd(1);        TextView label = (TextView)findViewById(R.id.Text);        label.setText(Integer.toString(contador));    }    private static native void nativeAdd(int value);    static {        System.loadLibrary(""JNITest01"");    }}</code></pre><p>I have used <code>javah -jni</code> to generate header file:</p><pre><code>#include &lt;jni.h&gt;/* Header for class es_xxxxx_pruebas_JNITest */#ifndef _JNITestNative#define _JNITestNative#ifdef __cplusplusextern ""C"" {#endif/* * Class:     com_xxxxx_tests_JNITest * Method:    nativeAdd * Signature: (I)V */JNIEXPORT void JNICALL Java_com_xxxxx_tests_JNITest_nativeAdd(JNIEnv *, jclass, jint);#ifdef __cplusplus}#endif#endif</code></pre><p>As you can see, second paramter is <strong>jclass</strong> type.</p><p>I'm wondering how I can change <strong>jclass</strong> for a <strong>jobject</strong> parameter.</p><p>I need a jobject paramter to obtain a value from a field of the class is calling this native function.</p><p>How can I change method signature? or how can I obtain jobject from jclass paremeter?</p><p>Thanks.</p>","68571","","68571","","2010-11-19 15:33:15","2010-11-19 15:33:15","JNI CALL change jclass parameter or how to obtain a jobject from a jclass parameter","<java><android><jni>","1","0","1","",""
"4226132","1","","","2010-11-19 14:52:21","60","127934","<p>I have a program working in the Android Emulator. Every now and again I have been creating a signed .apk and exporting it to my HTC Desire to test. It has all been fine.</p><p>On my latest exported .apk I get the error message 'Application not installed' when I try to install the .apk. It runs fine on the emulators.</p><p>As I have mainly been testing on the emulators and only every now and again exporting to a real phone I am not sure when this happened. What is the likely cause of it not installing on a physical phone but running fine in the emulators?</p><p>I have tried rebooting the phone &amp; removing the existing .apk, does not fix fault</p><p>Many thanks</p>","497517","","","","","2014-02-13 16:11:46","'Application not Installed' Error on Android","<android><android-emulator>","27","9","12","2014-03-22 20:50:49",""
"4226276","1","4226332","","2010-11-19 15:07:55","1","4340","<p>I am working through a facebook-sdk example and trying to utilize the collection of classes as provided as a .JAR.  I am relatively new to java and eclipse so I expect I am making some obvious blunder.</p><p>The issue is that everything seems to compile fine, but when I run the project (using the android emulator) dalvik vm is unable to find the first class I reference from this facebook sdk.  ( com/facebook/android/Facebook.class )</p><p>As an aside, if I copy the source directly into my project as an additional package everything works fine.  </p><p>Step 1: I exported the com_facebook_android project as a .JAR file. ( right click project, export, java / jar file ) I choose c:\data\jag\jar as my location to save facebooksdk.jar.</p><p>Step 2: I hit properties on the project HelloGoogleMaps, Selected Java Build Path, Libraries, Add External JARS...  I the directly selected the c:\data\jag\jar\facebooksdk.jar file.</p><p>At this point my project seems to be building just fine ( no errors ).<img src=""http://i.stack.imgur.com/4zowf.png"" alt=""alt text""></p><p>Step 3: Debug the project and receive the error:</p><p>[2010-11-19 09:05:08 - Example] ActivityManager: Error: Activity class {com.facebook.android/com.facebook.android.Example} does not exist.[2010-11-19 09:05:11 - Example] Starting activity com.facebook.android.Example on device [2010-11-19 09:05:12 - Example] New package not yet registered with the system. Waiting 3 seconds before next attempt.</p><p>[2010-11-19 09:05:15 - Example] Starting activity com.facebook.android.Example on device </p><p>[2010-11-19 09:05:17 - Example] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.facebook.android/.Example }</p><p>[2010-11-19 09:05:17 - Example] New package not yet registered with the system. Waiting 3 seconds before next attempt.</p><p>[2010-11-19 09:05:20 - Example] Starting activity com.facebook.android.Example on device </p><p>[2010-11-19 09:05:21 - Example] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.facebook.android/.Example }</p><p>[2010-11-19 09:05:21 - Example] ActivityManager: Error type 3</p><p>[2010-11-19 09:05:21 - Example] ActivityManager: Error: Activity class {com.facebook.android/com.facebook.android.Example} does not exist.</p><p>SHAWN -- Here are the Android properties for my project. </p><p><img src=""http://i.stack.imgur.com/KEkww.png"" alt=""alt text""></p>","104975","","104975","","2010-11-21 15:40:51","2010-11-22 01:50:51","Android:Java Unable to find class at runtime from JAR I created","<java><android><eclipse><jar>","3","1","1","",""
"4226470","1","","","2010-11-19 15:29:37","0","673","<p>I would like to set checkbox that allows user to select many contact names. Besides that, The selected item will be display in an Edit text.Can someone show me how?Thanks.This is my codes for getting into the contact page:-</p><pre><code>      package com.droidnova.android.samples;      public class SelectContact extends Activity {       private static final int PICK_CONTACT = 0;       private EditText  contact_name;      private Button btnPick;        @Override       public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.button);     btnPick = (Button)findViewById(R.id.button);     btnPick.setOnClickListener(new MyOnClickListener());     }     @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {     if (requestCode == PICK_CONTACT) {         if (resultCode == RESULT_OK) {             Cursor contact = getContentResolver().query(data.getData(), null, null, null, null);             contact.moveToFirst();             String name = contact.getString(contact.getColumnIndexOrThrow(People.NAME));            contact_name = (EditText)findViewById(R.id.contact_name);            contact_name.setText(name);     } } }         private class MyOnClickListener implements View.OnClickListener {  @Override    public void onClick(View v) {   startActivityForResult(new Intent(Intent.ACTION_PICK),PICK_CONTACT);  }  }}</code></pre><p>This codes for selecting the contacts</p><pre><code>  public class Contacts extends ListActivity {  private CheckBox checkBox;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Cursor cursor = getContentResolver().query(People.CONTENT_URI,       new String[]{People._ID,People.NAME,People.NUMBER}, null, null, null);    startManagingCursor(cursor);    // start mappings    String[] columns = new String[] {People.NAME, People.NUMBER};    int[] names = new int[] {R.id.contact_name, R.id.phone_number};    SimpleCursorAdapter myAdapter = new SimpleCursorAdapter(this, R.layout.contact, cursor, columns, names);    setListAdapter(myAdapter);    this.setListAdapter(myAdapter);}</code></pre><p>This is my codes for selecting the contacts:-</p><pre><code>     public class Contacts extends ListActivity {     private CheckBox checkBox;     @Override     public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Cursor cursor = getContentResolver().query(People.CONTENT_URI,       new String[]{People._ID,People.NAME,People.NUMBER}, null, null, null);    startManagingCursor(cursor);    // start mappings    String[] columns = new String[] {People.NAME, People.NUMBER};    int[] names = new int[] {R.id.contact_name, R.id.phone_number};    SimpleCursorAdapter myAdapter = new SimpleCursorAdapter(this, R.layout.contact, cursor, columns, names);    setListAdapter(myAdapter);    this.setListAdapter(myAdapter);}    @Override     public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.firstmenu,menu); return true;        }      public boolean onOptionsItemSelected(MenuItem item){   switch(item.getItemId()){   case R.id.mark:   return true;  case R.id.select:   return true;   case R.id.back:   final Intent i = new Intent(this,SelectContact.class);   startActivity(i);    return true;    } return false;   }</code></pre>","513658","","244296","","2010-11-19 15:35:25","2010-11-19 15:35:25","Get the selected Item and display in Edit Text","<android><text><checkbox><edit>","0","2","","",""
"4226604","1","4226632","","2010-11-19 15:44:15","19","18963","<p>I want to hide the linear layout so i used </p><pre><code>LinearLayout mainLayout=(LinearLayout)this.findViewById(R.id.mainLayout);mainLayout.setVisibility(2);</code></pre><p>but why is doesn't hide ??!!!</p>","508377","","","","","2013-02-05 08:51:18","how to hide linearlayout from java code?","<android>","5","2","4","2013-02-05 12:02:01",""
"4226650","1","","","2010-11-19 15:49:27","1","628","<p>I can't delete a symlink on Android. Can't with <code>File.delete()</code> and neither with<code>exec(""rm "" + verFile.getPath())</code></p><p>I have a symlink</p><p><code>com.example.app/mydata/12345.ver --&gt; com.example.app/lib/library.so</code></p><p>which was created by</p><pre><code>Runtime.getRuntime().exec(String.format(""ln -s %s %s"", target, link));</code></pre><p>After upgrade (download different build.apk from web) I want to delete this link by</p><pre><code>File verFile = new File(dataDir, verFile);Log.w(""MyApp"", ""Deleting file "" + verFile.getPath());if (verFile.exists()) Log.w(""MyApp"", ""File exists!"");try {    Runtime.getRuntime().exec(""rm "" + verFile.getPath());} catch( IOException ioex ) { Log.w(""MyApp"", ""Failed to delete""); }</code></pre><p>I can replace </p><pre><code>Runtime.getRuntime().exec(""rm "" + verFile.getPath());</code></pre><p>with</p><pre><code>verFile.delete()</code></pre><p>but it has no effect (the file still won't be deleted).</p><p>From the <strong>adb logcat</strong> I can see</p><pre><code>W/MyApp   (13298): Deleting file /data/data/com.example.app/mydata/12345.verW/MyApp   (13298): File exists!</code></pre><p>But the file 12345.ver is still there! It has the same user/group permissions as the rest of the application (except <code>lib</code> directory which is owned by the <code>system</code> user).</p><p>Any clue?</p>","513691","","","","","2011-05-05 06:45:49","File.delete() does not delete symlink on Android?","<android>","1","1","","",""
"4226660","1","6070193","","2010-11-19 15:50:19","7","3657","<p>I have created a Custom preference which has the following constructor</p><pre><code>public CoordinatesPreference(Context context, AttributeSet attrs){    super(context, attrs);    setLayoutResource(R.layout.coordinates_preference);}</code></pre><p>And I have Overriden <code>onCreateView()</code> so it writes to the log like this:</p><pre><code>@Overrideprotected View onCreateView(ViewGroup parent){    Log.d(""test"", ""Creating Preference view"");    return super.onCreateView(parent);}</code></pre><p>and my log is full of <code>""Creating Preference view""</code> messages, this creates a laggy feel to scrolling and I believe convert view is supposed to solve this, I had  a look at the preference source code and if convert view is null then <code>onCreateView()</code> is called.</p><p>for testing purposes I added this method:</p><pre><code>@Overridepublic View getView(View convertView, ViewGroup parent){    if (convertView == null)    {        return super.getView(convertView, parent);    }    return super.getView(convertView, parent);}</code></pre><p>and set a break point. I have found that almost always my convert view is null. and therefore it must create a new view, why is this? and how can I improve this to avoid a laggy preference screen?</p><p>EDIT: Changed the way the onCreate is called, now its all android I just use <code>setLayoutResource</code>. but this does not solve the problem...</p><p>EDIT2: I have used <code>Debug.StartMethodTracing()</code> and have found as I suspected that 55% of the time spend (when I'm just scrolling up and down) is spend on the Inflation of the preference from the method <code>onCreateView()</code> which is called from <code>getView()</code> when <code>convertView</code> is null.</p><p>Thanks, Jason</p>","407133","","407133","","2010-11-26 08:36:38","2011-05-20 09:51:15","onCreateView() being called too often in custom preference","<android>","4","3","4","",""
"4226782","1","","","2010-11-19 16:01:30","1","1148","<p>I have a number of EditTexts inside a scrollview. In the background these fields are linked to a number of other fields and regularly (once a second or so) the layout has it's textfields updated depending on the values in the EditText.</p><p>The problem is if one EditText has focus at the top of the ScrollView and the user scrolls the view done (i.e. so the focused EditText is off screen), but if the update is made to the views, the scroll view moves up to focus on the EditText at the top of the view.</p><p>The closest I have got to remedying this is to make the scroll view change focus when scrolling however this is still has the same behaviour but at a reduced scale.</p><p>Does anyone have an idea of how I can stop this from happening?</p><p>Cheers,Matt</p>","295996","","","","","2010-11-19 17:08:40","When do Android EditText's requestFocus()","<android><focus><edittext>","1","0","","",""
"4226813","1","4227268","","2010-11-19 16:03:39","0","472","<p>I would like to re-design my application into components, so it is more modular and easier to re-use in the future, but I've never really designed applications, so I don't really know how I should do this.</p><p>Here is a brief description of the application:</p><ul><li><p>The purpose of the Application is to allow the User to create ""Events"" that are going to be stored locally on the Device and sent over the network.</p></li><li><p>The User can interact with the application through 2 Activities: A ""NewEventActivity"" that allows him to create the new Events and a ""LogbookActivity"" that allows him to browse previously created Events.</p></li><li><p>The local storage should be handled by a SQLite Database</p></li><li><p>The Event should be sent in a specific Binary format.</p></li><li><p>Other applications should be able to Use the Sending component to Format and send other type of messages in the same format.</p></li></ul><p>This drawing represents how I was thinking of organizing the components. Boxes represent components, and arrows represent interactions without those components.<img src=""http://i.stack.imgur.com/GW9BV.png"" alt=""alt text""></p><p>Here are my questions:</p><ul><li>Does this model look OK? Can you see something that could be improved?</li><li>Should my SQLiteHelper be a ContentProvider or a ContentResolver?</li><li>Should I create one BroadcastReceiver class per type of Signal, or should I create one big BroadcastReceiver that handles all the kind of Signals my application can handle?</li></ul><p>Thank you!</p>","488054","","","","","2010-11-19 16:45:42","Android components-based application design: How should I represent this model?","<android><design><components>","1","0","","",""
"4226898","1","11302611","","2010-11-19 16:10:39","2","1626","<p>I have a MapActivity as one of four tabs in a TabActivity.  This MapActivity can launch a PopupWindow that is a legend.  The PopupWindow remains on the screen, on top of the map, until the ""Show Legend"" button is clicked again (back and forth, etc.).</p><p>The problem is that, when a user switches to another tab, the PopupWindow remains persistent over the view.</p><p>I've tried implementing the onPause() method in the MapActivity class, and dismissing it from there.  The application force closes with this method in place.</p><p>Any help?  Thanks!</p><p>EDIT: Here's some of my code:</p><p>In the MainActivity, which establishes the four tabs:</p><pre><code>    Resources res = getResources(); // Resource object to get Drawables    TabHost tabHost = getTabHost();  // The activity TabHost    TabHost.TabSpec spec;  // Reusable 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, FirstActivity.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""game"").setIndicator(""First"",                      res.getDrawable(R.drawable.ic_tab_game))                  .setContent(intent);    tabHost.addTab(spec);    // Do the same for the other tabs    intent = new Intent().setClass(this, SecondActivity.class);    spec = tabHost.newTabSpec(""alerts"").setIndicator(""Second"",                      res.getDrawable(R.drawable.ic_tab_alert))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, MapActivity.class);    spec = tabHost.newTabSpec(""map"").setIndicator(""Map"",                      res.getDrawable(R.drawable.ic_tab_map))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, LastActivity.class);    spec = tabHost.newTabSpec(""experience"").setIndicator(""Last"",                      res.getDrawable(R.drawable.ic_tab_experience))                  .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTab(0);</code></pre><p>Now in my MapActivity class (which extends MapActivity):</p><pre><code>    // Declare the Legend PopupWindow    mapLegendInflater = (LayoutInflater) MapActivity.this            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);    mapLegendPopupLayout = mapLegendInflater.inflate(            R.layout.maptablegendpopuplayout, null, false);    mapLegendPopup = new PopupWindow(mapLegendPopupLayout,            (int) (0.45 * getApplicationContext().getResources()                    .getDisplayMetrics().widthPixels),            (int) (0.33 * getApplicationContext().getResources()                    .getDisplayMetrics().heightPixels), true);    mapLegendPopup.setFocusable(false);    mapLegendPopup.setOutsideTouchable(true);            Boolean legendIsShown = false;    mapLegendButton = (Button) findViewById(R.id.buttonMapLegend);    mapLegendButton.setOnClickListener(mapLegendListener);private OnClickListener mapLegendListener = new OnClickListener() {    public void onClick(View v) {        // Launch or dismiss the map legend popup        if (legendIsShown) {            mapLegendPopup.dismiss();            mapLegendButton.getBackground().clearColorFilter();            legendIsShown = false;        } else {            mapLegendPopup.showAtLocation(                    findViewById(R.id.buttonMapLegend), Gravity.TOP                            | Gravity.LEFT, 8,                    (int) (0.23 * getApplicationContext().getResources()                            .getDisplayMetrics().heightPixels));            mapLegendButton.getBackground().setColorFilter(                    new LightingColorFilter(0xFFFFFFFF, 0xFFAA0000));            // mapLegendButton.getBackground().setColorFilter(0xFFFFFF00,            // PorterDuff.Mode.MULTIPLY);            legendIsShown = true;        }    }};</code></pre><p>I hope this provides an idea of where I'm at.  Everything works perfectly well on the Map tab.  It's only when you have the Legend shown and switch tabs that it is still displayed on other views.</p>","255394","","255394","","2010-11-19 16:27:01","2012-07-02 23:35:13","Dismiss Android PopupWindow when switching to a new Tab in TabActivity?","<android><popupwindow><dismiss><tabactivity>","3","2","1","",""
"4226924","1","4227915","","2010-11-19 16:13:25","1","811","<p>I frequently get an app crash while the ListView is calling on the Adapter to provide backing data.  Device is a Sony Experia X10 with Android 1.6. This is just a Seg fault violation, however I dont know how i can fix it?? I do not have any native components - its a pure java app.</p><pre><code>I/DEBUG   ( 1955): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***I/DEBUG   ( 1955): Build fingerprint: 'SEMC/X10_1232-9897/SonyEricssonX10i/es209ra:1.6/R1FA016/1268206111:user/rel-keys'I/DEBUG   ( 1955): pid: 2226, tid: 2486  &gt;&gt;&gt; com.xxx.yyy &lt;&lt;&lt;I/DEBUG   ( 1955): signal 11 (SIGSEGV), fault addr 00000000I/DEBUG   ( 1955):  r0 00000007  r1 2c4a14e8  r2 2c4a14e8  r3 00000000I/DEBUG   ( 1955):  r4 2c4a14e8  r5 00902f10  r6 00000000  r7 34828cacI/DEBUG   ( 1955):  r8 34828da0  r9 2d3dbe48  10 2d3dbe34  fp 00000001I/DEBUG   ( 1955):  ip 6fbc30c8  sp 34828c70  lr 6d044889  pc 6d03d806  cpsr 00000030I/DEBUG   ( 1955):          #00  pc 0003d806  /system/lib/libdvm.soI/DEBUG   ( 1955):          #01  pc 001f3362  /system/lib/libwebcore.soI/DEBUG   ( 1955):          #02  pc 00260296  /system/lib/libwebcore.soI/DEBUG   ( 1955):          #03  pc 000da460  /system/lib/libwebcore.soI/DEBUG   ( 1955):          #04  pc 000ec454  /system/lib/libwebcore.soI/DEBUG   ( 1955):          #05  pc 000df0ec  /system/lib/libwebcore.soI/DEBUG   ( 1955):          #06  pc 00187d60  /system/lib/libwebcore.soI/DEBUG   ( 1955):          #07  pc 00187edc  /system/lib/libwebcore.soI/DEBUG   ( 1955):          #08  pc 00187f08  /system/lib/libwebcore.soI/DEBUG   ( 1955):          #09  pc 00258162  /system/lib/libwebcore.soI/DEBUG   ( 1955):          #10  pc 0000e474  /system/lib/libdvm.soI/DEBUG   ( 1955):          #11  pc 0003e68e  /system/lib/libdvm.soI/DEBUG   ( 1955):          #12  pc 000131d8  /system/lib/libdvm.soI/DEBUG   ( 1955):          #13  pc 00017a84  /system/lib/libdvm.soI/DEBUG   ( 1955):          #14  pc 000174cc  /system/lib/libdvm.soI/DEBUG   ( 1955):          #15  pc 0004f6c8  /system/lib/libdvm.soI/DEBUG   ( 1955):          #16  pc 0004f6e6  /system/lib/libdvm.soI/DEBUG   ( 1955):          #17  pc 00044d28  /system/lib/libdvm.soI/DEBUG   ( 1955):          #18  pc 0000f984  /system/lib/libc.soI/DEBUG   ( 1955):          #19  pc 0000f4f8  /system/lib/libc.soI/DEBUG   ( 1955): stack:I/DEBUG   ( 1955):     34828c30  2c99510e  /system/framework/core.odexI/DEBUG   ( 1955):     34828c34  2c99510f  /system/framework/core.odexI/DEBUG   ( 1955):     34828c38  00902f10  [heap]I/DEBUG   ( 1955):     34828c3c  00000001  I/DEBUG   ( 1955):     34828c40  00000007  I/DEBUG   ( 1955):     34828c44  2c352fe0  /dev/ashmem/dalvik-LinearAlloc (deleted)I/DEBUG   ( 1955):     34828c48  2c352fe0  /dev/ashmem/dalvik-LinearAlloc (deleted)I/DEBUG   ( 1955):     34828c4c  00902f10  [heap]I/DEBUG   ( 1955):     34828c50  00902f10  [heap]I/DEBUG   ( 1955):     34828c54  00000001  I/DEBUG   ( 1955):     34828c58  00000007  I/DEBUG   ( 1955):     34828c5c  6d044889  /system/lib/libdvm.soI/DEBUG   ( 1955):     34828c60  2c4a14e8  /dev/ashmem/dalvik-LinearAlloc (deleted)I/DEBUG   ( 1955):     34828c64  00902f10  [heap]I/DEBUG   ( 1955):     34828c68  df002777  I/DEBUG   ( 1955):     34828c6c  e3a070ad  I/DEBUG   ( 1955): #00 34828c70  34828cb8  I/DEBUG   ( 1955):     34828c74  70f537a8  I/DEBUG   ( 1955):     34828c78  009130e8  [heap]I/DEBUG   ( 1955):     34828c7c  6a3dc5d0  /system/lib/libwebcore.soI/DEBUG   ( 1955):     34828c80  34828cb8  I/DEBUG   ( 1955):     34828c84  6d03d7f1  /system/lib/libdvm.soI/DEBUG   ( 1955):     34828c88  6a1f334d  /system/lib/libwebcore.soI/DEBUG   ( 1955):     34828c8c  009130e8  [heap]I/DEBUG   ( 1955):     34828c90  00000000  I/DEBUG   ( 1955):     34828c94  6a1f3365  /system/lib/libwebcore.soI/DEBUG   ( 1955): #01 34828c98  6a3dc5d0  /system/lib/libwebcore.soI/DEBUG   ( 1955):     34828c9c  34828cac  I/DEBUG   ( 1955):     34828ca0  ffe16d7d  I/DEBUG   ( 1955):     34828ca4  6a260299  /system/lib/libwebcore.soI/DEBUG   ( 1955):     34828ca8  2c4a14e8  /dev/ashmem/dalvik-LinearAlloc (deleted)I/DEBUG   ( 1955):     34828cac  00000000  </code></pre>","450741","","","","","2010-11-19 17:54:52","Android app crash in the OS layer","<android><crash><sigsegv>","1","1","","",""
"4226978","1","4227755","","2010-11-19 16:19:16","7","2407","<p>I want to have the second line (and third, fourth, etc.) of my TextView indented, is that possible? I don't know the exact TextView's text in advance. The text will be without newline (""\n"") characters - it will be wrapped to lines automatically by the TextView.</p>","243225","","192801","","2010-11-19 16:29:59","2010-11-19 17:35:46","TextView - how to make second line indented","<android><textview><textwrapping>","2","2","1","",""
"4227027","1","","","2010-11-19 16:23:21","0","871","<p>Here's what I would like to do:</p><ul><li>I have an existing webview with a link to ""www.youtube.com/existingchannel""</li><li>I know how to override (shouldOverrideUrlLoading) and detect when that link is clicked</li><li>I would like for the webview to open up the Youtube application to that specific Youtube channel</li></ul><p>Does anyone know how to do this??</p><p>Again, I am not wanting to open a specific video, but want the Youtube app to open to a specific youtube channel.</p><p>thanks in advance!</p>","513738","","","","","2011-11-29 16:11:06","Opening the Youtube Application from a Webview","<java><android><webview>","1","0","","",""
"4227107","1","","","2010-11-19 16:30:21","-2","3650","<p>I am New To android, My Requirement is to choose one Radio Button and going to that corresponding activity in Android?Can anyone help me?Thanks in advance.......</p>","513745","","","","","2010-11-19 17:21:39","How to select one Radio Button and Going to that activity in android?","<android>","2","1","","",""
"4227411","1","4227811","","2010-11-19 16:58:06","0","3215","<p>I have an Android activity that, onCreate(), will query a database and display the query results in textviews on the UI.</p><p>The problem that I am having is at some point, users can open another activity and update the database. When they go back to the original activity, I would like for the text views to update with the new database information (so, I will re query the database and display the info).</p><p>Another thing that I am willing to do is to take the new input from the user (in the new activity) and directly update the textview in the existing activity (without having the existing activity re-query the database). But I'm not sure how to do something like that either.</p><p>Can someone please inform me on the best way to go about doing this? The only solution that I have found so far has to do with broadcast receivers, but I'm not sure if that is best suited for what I have to do.</p><p>I'd appreciate any advice.  Thanks!</p>","123891","","","","","2011-02-17 15:45:50","android update activity textview after changes from another activity","<java><android><user-interface><activity><textview>","3","0","","",""
"4227424","1","4227701","","2010-11-19 16:58:57","4","6089","<p>I've been trawling the internet looking for an answer for several hours, but I can't seem to find anyone who has been able to solve this.</p><p>I've got a listview which uses <code>enter code here</code>a custom adapter. A row looks like this </p><p><img src=""http://i.stack.imgur.com/ugvGc.png"" alt=""alt text""></p><p>The list is filled by an array. Everything works great.</p><p>Now, I want the ImageView and the ToggleButton to react to clicks, so I implement the OnClickListener in my adapter, put the items position in each view's tag, and then I set their onclicklistener to this. </p><p>Works great, except now I can't use the onListItemClick for starting an activity for the item! OK, I say, I just make the relativelayout holding the text in the middle there use the same onclicklistener. Works great. Everything is clickable, and life is good. </p><p>EXCEPT! Now, when I scroll the list, I cannot ""continue"" the scroll by just flinging again. This causes the scrolling to stop, and I have to fling once more to get it going again. It seems the onclick-thingy causes the fling-motion to be interpreted as a tap or something (it does not trigger the logic within onClick).</p><p>I know that this is possible by just going to the phone list on my HTC Hero, which has exactly the kind of layout and behaviour I want from my app. This app even seems to have the onItemClickListener working.</p><p>So how can I make sure the list keeps scrolling, and still be able to click the togglebutton, listitem and the imageview? I've been stuck on this all day, and it's giving me a headache :(</p>","397060","","","","","2014-04-16 12:52:50","Android ListView with clickable items in it's rows causes problems continuing scrolling","<android><listview><scrolling><onclick><listadapter>","1","0","2","",""
"4227451","1","","","2010-11-19 17:01:16","23","40354","<p>I am currently developing for Android (my first app) an application which lets users see the subway map and be able to pinch zoom and drag around.</p><p>I am currently modifying the code found in Hello Android, 3rd Edition and got the pinch zooming and dragging to work. I'm using Matrix as my layout scale.</p><p>However I now have 3 problems:</p><ol><li><p>I tried many things to limit the drag parameters but I can't seem to stop it being dragged off the parent view (and can actually disappear from view). I've tried setting layout parameters in the XML file and it just doesn't work.</p></li><li><p>I can pinch zoom fine but I have trouble, again, limiting the amount of zoom. I'm trying to play around with setting a max_zoom and min_zoom to limit the scaling value (i will post my code after)</p></li><li><p>I also have trouble trying to map a coordinate on my image so that people can click on certain parts (the whole point of this is to let users click a station on the map and view information about it)</p></li></ol><p>I have a feeling i'm having trouble because I'm using the matrix scale.</p><p>Here is my current code:</p><p><strong>Touch.java</strong></p><pre><code>package org.example.touch;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.Matrix;import android.graphics.PointF;import android.os.Bundle;import android.util.FloatMath;import android.util.Log;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.widget.GridView;import android.widget.ImageView;public class Touch extends Activity implements OnTouchListener {private static final String TAG = ""Touch"";private static final float MIN_ZOOM = 1.0f;private static final float MAX_ZOOM = 5.0f;// These matrices will be used to move and zoom imageMatrix matrix = new Matrix();Matrix savedMatrix = new Matrix();// We can be in one of these 3 statesstatic final int NONE = 0;static final int DRAG = 1;static final int ZOOM = 2;int mode = NONE;// Remember some things for zoomingPointF start = new PointF();PointF mid = new PointF();float oldDist = 1f;@Overridepublic void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   setContentView(R.layout.main);   ImageView view = (ImageView) findViewById(R.id.imageView);   //view.setLayoutParams(new GridView.LayoutParams(85, 85));   view.setScaleType(ImageView.ScaleType.FIT_CENTER);   view.setOnTouchListener(this);   }public boolean onTouch(View v, MotionEvent event) {   ImageView view = (ImageView) v;   view.setScaleType(ImageView.ScaleType.MATRIX);   float scale;   // Dump touch event to log   dumpEvent(event);   // Handle touch events here...   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(TAG, ""mode=DRAG"" );      mode = DRAG;      break;   case MotionEvent.ACTION_UP: //first finger lifted   case MotionEvent.ACTION_POINTER_UP: //second finger lifted      mode = NONE;      Log.d(TAG, ""mode=NONE"" );      break;   case MotionEvent.ACTION_POINTER_DOWN: //second finger down      oldDist = spacing(event);      Log.d(TAG, ""oldDist="" + oldDist);      if (oldDist &gt; 5f) {         savedMatrix.set(matrix);         midPoint(mid, event);         mode = ZOOM;         Log.d(TAG, ""mode=ZOOM"" );      }      break;   case MotionEvent.ACTION_MOVE:       if (mode == DRAG) { //movement of first finger         matrix.set(savedMatrix);         if (view.getLeft() &gt;= -392){            matrix.postTranslate(event.getX() - start.x, event.getY() - start.y);         }      }      else if (mode == ZOOM) { //pinch zooming         float newDist = spacing(event);         Log.d(TAG, ""newDist="" + newDist);         if (newDist &gt; 5f) {            matrix.set(savedMatrix);            scale = newDist / oldDist; **//thinking i need to play around with this value to limit it**            matrix.postScale(scale, scale, mid.x, mid.y);         }      }      break;   }   // Perform the transformation   view.setImageMatrix(matrix);   return true; // indicate event was handled}private float spacing(MotionEvent event) {   float x = event.getX(0) - event.getX(1);   float y = event.getY(0) - event.getY(1);   return FloatMath.sqrt(x * x + y * y);}private void midPoint(PointF point, MotionEvent event) {   float x = event.getX(0) + event.getX(1);   float y = event.getY(0) + event.getY(1);   point.set(x / 2, y / 2);}/** Show an event in the LogCat view, for debugging */private void dumpEvent(MotionEvent event) {   String names[] = { ""DOWN"" , ""UP"" , ""MOVE"" , ""CANCEL"" , ""OUTSIDE"" ,      ""POINTER_DOWN"" , ""POINTER_UP"" , ""7?"" , ""8?"" , ""9?"" };   StringBuilder sb = new StringBuilder();   int action = event.getAction();   int actionCode = action &amp; MotionEvent.ACTION_MASK;   sb.append(""event ACTION_"" ).append(names[actionCode]);   if (actionCode == MotionEvent.ACTION_POINTER_DOWN         || actionCode == MotionEvent.ACTION_POINTER_UP) {      sb.append(""(pid "" ).append(      action &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT);      sb.append("")"" );   }   sb.append(""["" );   for (int i = 0; i &lt; event.getPointerCount(); i++) {      sb.append(""#"" ).append(i);      sb.append(""(pid "" ).append(event.getPointerId(i));      sb.append("")="" ).append((int) event.getX(i));      sb.append("","" ).append((int) event.getY(i));      if (i + 1 &lt; event.getPointerCount())         sb.append("";"" );   }   sb.append(""]"" );   Log.d(TAG, sb.toString());}}</code></pre><p><strong>main.xml (rather simple nothing really complicated):</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" &gt;&lt;ImageView android:id=""@+id/imageView""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:src=""@drawable/map""     android:scaleType=""matrix"" &gt;&lt;/ImageView&gt;&lt;/FrameLayout&gt;</code></pre><p><strong>AndroidManifest.xml (only added the theme so there is no title bar and is full screen)</strong></p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""org.example.touch""  android:versionCode=""7""  android:versionName=""1.0"" &gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:theme=""@android:style/Theme.NoTitleBar.Fullscreen"" &gt;  &lt;activity android:name="".Touch""        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"" android:targetSdkVersion=""7"" /&gt;&lt;/manifest&gt;</code></pre>","513757","","321731","","2014-03-24 20:07:44","2014-03-24 20:07:44","android imageView: setting drag and pinch zoom parameters","<android><drag-and-drop><imageview><zoom><pinch>","6","0","15","",""
"4227501","1","4227565","","2010-11-19 17:07:26","0","5310","<p>Is it possible to get the width of a linear/relative layout, if the layout_width is set to fill_parent in the layout xml? For example, I have the following layout xml. Is it possible to find the width of the cameraSourceScreen? Thanks in advance :)</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:id=""@+id/CameraSourcesScreen""&gt;&lt;LinearLayout android:id=""@+id/button_bar""android:layout_height=""wrap_content""android:layout_width=""fill_parent""android:layout_alignParentTop=""true""android:layout_alignParentLeft=""true""android:background=""@drawable/topbar""android:orientation=""horizontal""android:gravity=""center""&gt;&lt;LinearLayout android:layout_height=""wrap_content""  android:layout_width=""fill_parent""  android:orientation=""horizontal"" android:paddingLeft=""20dp""&gt;        &lt;common.view.ToggleButton android:id=""@+id/Near_Toggle""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:layout_marginRight=""2dp""          android:layout_alignParentLeft=""true""          android:layout_centerVertical=""true"" android:text=""@string/NEAR_STR""          android:textSize=""18px"" android:width=""130dp""/&gt;  &lt;common.view.ToggleButton android:id=""@+id/Far_Toggle""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:layout_marginRight=""2dp""          android:layout_alignParentLeft=""true""          android:layout_centerVertical=""true"" android:text=""@string/FAR_STR""            android:textSize=""18px"" android:width=""130dp""/&gt;&lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt;</code></pre>","388025","","","","","2010-11-19 17:14:53","Get width of linear/relative layout?","<android>","1","0","","",""
"4227539","1","4227815","","2010-11-19 17:11:33","2","23692","<pre><code>public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {    AlertDialog.Builder adb = new AlertDialog.Builder(CategoriesTab.this);    adb.setTitle(""Selected Category"");    adb.setMessage(""Selected Item is = ""+lv1.getItemAtPosition(position));    adb.setPositiveButton(""Ok"", null);    adb.show();}</code></pre><p>This at the moment displays an alertbox when an item from listview is clicked.  I want to convert the alertbox to load a specific xml for each choices clicked.  How can i do this?thanks for your help.</p>","513407","","139010","","2010-11-19 17:12:39","2012-04-28 21:37:47","Android: how to create Switch case from this?","<java><android>","3","2","1","",""
"4227612","1","4227892","","2010-11-19 17:20:47","2","1070","<p>I having problem in my application.. I am pressing back button in my third activity but its running in running in background(i noticed by used Log statement). If again load application its starts from first activity instead of third activity. please suggest some idea to do this..This is my back button coding</p><pre><code>public boolean onKeyDown(int keyCode, KeyEvent event)</code></pre><p>{</p><pre><code> if (keyCode == KeyEvent.KEYCODE_BACK){   moveTaskToBack(true);}  return true; }</code></pre><p>Thanks in advance..</p>","405640","","","","","2010-11-20 09:01:46","Running android application in background?","<android>","2","1","","",""
"4227665","1","4227753","","2010-11-19 17:26:31","0","1287","<p>Where to find complete tutorial for posting twitter status from android?</p><p>Thanks </p>","432848","","41981","","2010-11-19 17:28:56","2010-11-19 17:35:41","Android twitter post","<android>","2","0","","",""
"4227667","1","4231846","","2010-11-19 17:26:42","2","1356","<p>I'm developing client/server software for Android.</p><p>While connected to the phone via USB debugging, I'd like to access the webserver I'm running on my developement PC - using the USB connection.</p><p>Is that possible and if so, how ?</p>","466771","","","","","2010-11-20 08:23:35","TCP connection from phone to debugging host","<android>","3","0","1","",""
"4227759","1","4257208","","2010-11-19 17:36:25","54","42027","<p>There is a library called cocos-2d for iphone. There are number of games developed with that nowadays. Also, there is cocos-2d library available for Android too. I just wanted to know if that is also as stable as iphone one or its still not stable to be used in development.</p><p>Also, is there any other game engine available for Android? The ones that I know is AndEngine. Which one is better for development? If not both then will it better to develop using core Android API rather than using any game engine.</p>","445541","","321731","","2013-11-25 18:04:18","2014-01-28 06:08:17","Android game engine for 2d and 3d games?","<android>","12","0","47","2012-09-12 22:40:22",""
"4227874","1","","","2010-11-19 17:49:11","1","652","<p>I am developing an Android app and using Google Maps and Directions API. I was able to successfully get directions in XML for all supported modes. However, they all come back with HTML markup. Does anyone know if there is a way to omit the markup when making a request, so that I don't have to remove it locally in the app?(Example: 1. ""Turn right on <b>Broad St.</b>"" and so on, is what I currently receive. But of course, the word is not bold, but you can actually see the tags).Thank you.</p>","492407","","492407","","2010-11-19 18:14:25","2014-04-16 09:46:12","Google Directions API -- get XML response without HTML markup","<html><android><google-maps-api-3>","1","0","1","",""
"4227919","1","4227940","","2010-11-19 17:55:38","0","2311","<p>i want to start a new activity from ab activity that (extends from Linearlayout) .. but this code is not right</p><pre><code>Intent i = new Intent(SearchResultForm.this, MainActivity.class);startActivity(i);</code></pre><p>......</p><pre><code>public class SearchResultForm extends LinearLayout{ ...</code></pre><p>and i get this error ..</p><blockquote>  <blockquote>    <p>No enclosing instance of the type SearchResultForm is accessible in scope</p>  </blockquote></blockquote><p>how can i do it ?</p>","508377","","548526","","2013-04-29 10:30:51","2013-04-29 10:30:51","how to start a new activity from anther activity ... in android?","<android><android-intent>","4","0","1","",""
"4227927","1","6526179","","2010-11-19 17:57:26","4","1554","<p>I am having an Android Phone (<strong>Motorola Quench XT3</strong>) running version <strong>2.1</strong>.I have installed android <code>SDK</code> (including the USB driver) in my Windows XP OS. </p><p>I enabled <code>USB</code> debugging in my phone and connected it to the computer.The phone is recognized and the SD card gets mounted in my computer.</p><p>When I launch the <code>DDMS</code> tool from my computer, it is not listing my device.</p><p>Am I missing any steps here or the <code>USB</code> debugging works only with specific phones.</p>","513826","","7565","","2011-06-20 13:54:05","2011-07-04 05:26:18","USB Debugging in Android","<android><android-emulator>","6","4","0","",""
"4227973","1","4228108","","2010-11-19 18:02:11","0","69","<p>I am modifying an existing app.And there is an issue trying to run ADT</p><p><strong>environment</strong></p><ul><li>Eclipse-galilo</li><li>jdk 6</li><li>ADT android sdk    lattest editon.</li></ul><p><strong>error bellow</strong></p><pre><code>[2010-11-19 11:01:12 - iDonatedIt] Android Launch![2010-11-19 11:01:12 - iDonatedIt] adb is running normally.[2010-11-19 11:01:12 - iDonatedIt] Could not find iDonatedIt.apk!</code></pre><p>I have loaded/reloaded the project. My other projects load just fine but this one will not at all. Any help on fixing the situation would be greatly appreciated</p>","","george9170","","","","2010-11-19 18:17:06","android emulator issue","<android><eclipse>","2","0","","",""
"4228011","1","4228099","","2010-11-19 18:06:22","0","273","<p>I want to call a bitmap from a method in my main class and am unsure how to do it - </p><p>I have a method:</p><pre><code>private void detectFaces() {Bitmap bitmap565 = Bitmap.createBitmap(width, height,                Config.RGB_565);    if (facesFound &lt; 1) {                Intent k = new Intent(main.this, False.class);                startActivity(k);</code></pre><p>and in my False.class I have:</p><pre><code>super.onCreate(savedInstanceState);        setContentView(R.layout.detectfalse);        ImageView imageView = (ImageView) findViewById(R.id.false_view);        TextView textView = (TextView) findViewById(R.id.badPicText);        textView.setText(R.string.noFace);        imageView.setImageBitmap(bitmap565);</code></pre><p>So basically, how can I place the bitmap in my detectFaces method in my main class and pass it as a bitmap on my imageview in my false class?</p><p>Thanks!</p>","496686","","","","","2010-11-19 23:05:30","How can I call a bitmap defined in a method of another class?","<android><variables><methods><public><calling>","1","1","","",""
"4228248","1","4228500","","2010-11-19 18:37:54","0","344","<p>I have a ListView that is being populated. I have checked the contents of the datasource and it contains valid data. Unfortunately, the number of rows is correct, but the text I want to display is not appearing.</p><p>Here is how I am setting up the ListView:</p><pre><code>private void setupUI() {        setContentView(R.layout.streamactivity);        this.streamListView = (ListView) findViewById(R.id.streamListView);        this.streamAdapter = new StreamAdapter(this, R.layout.streamactivityrow, messages);        streamListView.setAdapter(this.streamAdapter);    }</code></pre><p>Here is my Adapter:</p><pre><code>private class StreamAdapter extends ArrayAdapter&lt;STMessage&gt; {        private ArrayList&lt;STMessage&gt; messages;        public StreamAdapter(Context context, int textViewResourceId, ArrayList&lt;STMessage&gt; messages) {            super(context, textViewResourceId, messages);            this.messages = messages;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            if (v == null) {                LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.streamactivityrow, null);            }            STMessage aMessage = messages.get(position);            if (aMessage != null) {                TextView titleText = (TextView) v.findViewById(R.id.toptext);                TextView descriptionText = (TextView) v.findViewById(R.id.bottomtext);                if (titleText != null) {                    titleText.setText(aMessage.getBody());                }                if (descriptionText != null) {                    descriptionText.setText(aMessage.getFor_user_login());                }            }            return v;        }    }</code></pre><p>Here is the XML for each row in the list:</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=""?android:attr/listPreferredItemHeight""    android:padding=""6dip""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""0dip""        android:layout_weight=""1""        android:layout_height=""fill_parent""&gt;        &lt;TextView            android:id=""@+id/toptext""            android:layout_width=""fill_parent""            android:layout_weight=""1""            android:gravity=""center_vertical"" android:layout_height=""0dip"" android:singleLine=""true"" android:textSize=""15sp"" android:textStyle=""bold"" android:ellipsize=""end"" android:shadowColor=""#000000"" android:shadowDy=""1.0"" android:shadowRadius=""1.0"" android:textColor=""#FFFFFF""/&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""             android:id=""@+id/bottomtext""            android:singleLine=""true""            android:ellipsize=""marquee""        android:textSize=""15sp"" android:shadowColor=""#000000"" android:shadowDy=""1.0"" android:shadowRadius=""1.0"" android:textColor=""#FFFFFF""/&gt;&lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/dateText"" android:shadowColor=""#000000"" android:shadowDy=""1.0"" android:shadowRadius=""1.0"" android:textColor=""#E2E2E2""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is the XML for the StreamActivity with the ListView:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;ListView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/streamListView""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","19875","","19875","","2010-11-19 18:43:52","2010-11-19 19:11:12","Text not appearing in my ListView","<java><android><xml><listview><android-arrayadapter>","2","1","","",""
"4228251","1","","","2010-11-19 18:38:31","0","3159","<p>Can anybody help get me past this error when I hit ""Finish"" when I'm in ""Install new software"" with Android DDMS and Development Tools in Eclipse 3.5.2? What's it trying to uninstall?</p>","427167","","","","","2012-07-15 13:08:41","Can't install Android ADT plugin in Eclipse - ""error occurred while uninstalling""","<android><eclipse><adt>","2","2","","",""
"4228333","1","5032335","","2010-11-19 18:51:11","1","1942","<p>I am having one web service and I have call that from the Android application by passing double value along with other values like String, int and float. When i call the web service I am getting Runtime exception saying cannot serialize the double value. Please some one help me to do call the web service if you know the solution.</p><p>Thanks and Regards,Rajapandian.K</p>","131062","","","","","2011-03-15 09:34:01","How to serialize double value when calling soap service in android?","<android>","1","0","","",""
"4228384","1","4228972","","2010-11-19 18:57:00","1","1409","<p>i just signed my paid app and now i want to sign a lite version of it with the same private key. my problem now is that, am receiving this error: </p><p>jarsigner: unable to open jar file. </p><p>do i have to create another keystore for it? or is the problem coming from the fact that i am saving it as a different file name? what can i do? Thank you</p>","479908","","","","","2010-11-19 20:10:27","can't sign android app lite version with same private key","<android>","1","4","","",""
"4228489","1","4228614","","2010-11-19 19:10:07","1","682","<p>I want to use <a href=""https://github.com/brione/Brion-Learns-OAuth"" rel=""nofollow"">https://github.com/brione/Brion-Learns-OAuth</a> for posting twitter status from android</p><p>But I have problem with filling this constants. Where to find </p><pre><code>public static final String USER_TOKEN public static final String USER_SECRET public static final String REQUEST_TOKENpublic static final String REQUEST_SECRETprivate static final Uri CALLBACK_URI</code></pre><p>I create app in twitter , I guess USER_SECRET  is Consumer secret. But I don't know other values.</p><p>Thanks</p>","432848","","","","","2010-11-19 19:26:03","Help with OAUTH twitter post from Android","<android>","1","0","","",""
"4228563","1","4228623","","2010-11-19 19:18:05","1","194","<p>I would like to create a dialog that contains a link for my site (on android), and would want the phone's browser to open when the user clicks on the link. I currently have: </p><pre><code>@Override protected Dialog onCreateDialog (int id){Dialog dialog = new Dialog(MyActivity.this);                                                dialog.setContentView(R.layout.custom_dialog);dialog.setTitle(""MyTittle"");ImageView image = (ImageView)dialog.findViewById(R.id.image); image.setImageResource(R.drawable.launcher_icon);TextView lblClickable = (TextView)findViewById(R.id.text); String htmlText = ""Link to my &lt;a HREF='http://www.rainbowbreeze.it'&gt;site&lt;/a&gt;"";  lblClickable.setText(Html.fromHtml(htmlText));//needed to enable click on the link     lblClickable.setMovementMethod(LinkMovementMethod.getInstance());return dialog; }</code></pre><p>the above code fires NullPointerException in the line that contains <code>lblClickable.setText(Html.fromHtml(htmlText));</code> any suggestions? whats wrong with the code? regards maxsap</p>","234898","","418183","","2010-11-19 19:21:42","2010-11-19 19:27:18","how to textview and android","<android>","1","0","0","",""
"4228588","1","","","2010-11-19 19:23:07","0","264","<p>All,</p><p>I'm developing an Android application that connects to other hardware on start up via TCP (over WiFi) .  I'm pretty happy with the software that handles the connection -- it does a good job of establishing the socket connection as well as handling things when the connection is unexpectedly lost.</p><p>Unfortunately, my application currently just displays a blank, empty screen until the connection is established, and I expect that this sort of thing may produce unwarranted worry on the part of my users.</p><p>I can't figure out how to put up a start-up message informing the user that I have a towel and that there's no need to panic.  Can anybody point me to a method for accomplishing this?  I'll be happy with just about anything that's legible, whether graphical or textual.</p><p>Thanks,R.</p>","453989","","","","","2010-11-19 21:53:31","What's good way to display a start up message in an Android app?","<android><user-interface><splash-screen>","3","1","","",""
"4228641","1","4228815","","2010-11-19 19:28:58","53","59869","<p>I'm a total noob at Android programming, and wanted to learn how to debug my apps.  I can't seem to have my Log.i|d|v calls displayed in the LogCat.  </p><p>Here's the code that I'm using.  As you can see I have defined a LOG_TAG constant, but can't seem to find it in the LogCat.  I have also imported android.util.Log AND I have made sure that in my AndroidManifest I have ""debuggable"" set to TRUE.</p><p>I have also checked <a href=""http://developer.android.com/reference/android/util/Log.html"">http://developer.android.com/reference/android/util/Log.html</a> w/o any luck resolving this issue.  </p><p>What am I doing wrong?  Am I even looking in the right place?  I've tried using the DDMS and Debug perspective as well w/o any luck.  Any help to this noob would be greatly appreciated.  Thanks.</p><p>My environment:Windows XPIDE = Eclipse Version: 3.6.1, Build id: M20100909-0800Emulator = having it point to android sdk 2.1 api 7</p><p>//very basic HELLO World code with a couple of Log.i calls</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.util.Log;public class debugger extends Activity {    private static final String LOG_TAG = ""debugger"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        Log.i(LOG_TAG, ""line 13"");        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Log.i(LOG_TAG, ""CREATING NOW"");    }}</code></pre>","473737","","234039","","2010-11-19 19:38:01","2014-01-09 10:45:26","Logcat not displaying my log calls","<android><debugging><logging><android-logcat>","15","4","12","",""
"4228663","1","","","2010-11-19 19:31:15","0","533","<p>I have a few buttons in a tab layout for which the OnClickListener works fine. The purpose of these buttons is to start a new activity when clicked upon. I want my code to work for the touch mode of the phone as well. In other words I wanted to know how to implement the OnTouchListener for the code. Currently I have something like </p><pre><code>public boolean onTouch(View v, MotionEvent event) {  startActivity(new Intent().setClass(this, OtherActivity.class));  return true;}</code></pre><p>I am just thinking about it the same way as I would think about the onClick() method but apparently I am wrong. </p><p>Any help in this matter would be appreciated. Thanks! </p>","513901","","82118","","2010-11-19 19:42:52","2010-11-19 19:51:27","OnTouchListener not working","<java><android>","1","4","","",""
"4228697","1","4228985","","2010-11-19 19:35:17","1","1070","<p>Were looking into Android for writing a tablet based system.  Part of the design is for the system to be as modular as possible.  One aspect of this is to display any ""STATUS"" activities in a side view on the screen.  It looks like I can use PackageManager queryIntentActivities() to find the activities that show status information.  But, can I display these in a single view all at the same time (via a linear layout)?  The activities would be installed in separate apk's (features).</p><p>Can this be accomplished using ActivityGroup?  Is this even allowed in Android?  Everything I've read implies that Activities take the whole screen or float on top.  This implies only one activity can be active at a time where as the design I'm thinking of uses the activities more like widgets. </p>","512309","","","","","2010-11-19 20:12:48","How to: Multiple activities in a single view?","<android>","1","2","","",""
"4228699","1","4228934","","2010-11-19 19:35:34","9","20608","<p>I see a lot of examples how to write String objects like that:</p><pre><code>String FILENAME = ""hello_file"";String string = ""hello world!"";FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);fos.write(string.getBytes());fos.close();</code></pre><p>but not how to read them back from internal application file. Most of examples assume specific string length to calculate byte buffer but I do not know what the length will be. Is there an easy way to do so? My app will write up to 50-100 strings to the file</p>","473725","","473725","","2010-11-19 19:42:15","2010-11-19 21:57:00","write and read strings to/from internal file","<android><string><file>","1","0","4","",""
"4228802","1","4228830","","2010-11-19 19:50:00","3","1715","<p>Here are some HTML ASCII Codes:</p><p><a href=""http://www.ascii.cl/htmlcodes.htm"" rel=""nofollow"">http://www.ascii.cl/htmlcodes.htm</a></p><p>I have a string that may look like <code>""All in a hard day &amp;#39;s work""</code></p><p>What is the best way to replace that ascii code, with an apostrophe?</p>","19875","","","","","2011-09-12 11:05:14","Is there a quick way to recognize HTML ASCII codes in a String or TextView?","<java><android><regex><string><ascii>","2","0","","",""
"4228855","1","4651915","","2010-11-19 19:56:16","2","1335","<p>The Twitter application for Android has a nice way of refreshing the listview by pulling down and automatically refreshing the data source.</p><p>Are there any good examples of this?</p>","19875","","","","","2012-04-02 19:34:10","Are there any good examples of a pull to refresh feature for ListViews?","<java><android><listview><twitter><datasource>","1","0","5","",""
"4228914","1","4247623","","2010-11-19 20:04:36","0","4638","<p>I'm trying to add rows to a <code>TableLayout</code> in Android and the orientation property doesn't seem to work.  Basically I need to create a <code>TableRow</code>, add multiple <code>TextView</code>s to it, and the add to the <code>TableLayout</code> and have the <code>TextView</code>s stacked vertically instead of horizontally.  </p><p>The XML looks like this:</p><pre><code>&lt;TableLayout android:id=""@+id/mylayout""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;    &lt;TableRow  android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;            &lt;TextView android:text=""Test1""&gt;&lt;/TextView&gt;            &lt;TextView android:text=""Test2""&gt;&lt;/TextView&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>This seems like it should work, but the TextViews end up stacked left to right.  Any thoughts?</p>","477231","","477231","","2010-11-22 16:23:30","2012-09-27 05:59:45","Inserting vertical rows in TableLayout","<android>","3","0","","",""
"4228922","1","4283908","","2010-11-19 20:05:24","1","1977","<p>i want to programmatically clear the history of the android maps (and navigation) application.</p><p>I know there is a way to clear the browser history via</p><pre><code>Browser.clearSearches(getContentResolver());</code></pre><p>and the corresponding permission: <code>com.android.browser.permission.WRITE_HISTORY_BOOKMARKS</code>and this works fine (2.2.).</p><p>I couldn't find any way to clear the Maps-History though.Clearing the google/history online doesn't help either.</p><p>There are some apps in the market that promote to do that, so there must be an API for it, but i really couldn't find it yet.</p><p>I also messed around a bit with CLEAR_APP_CACHE and CLEAR_APP_USER_DATA but seems like they are signed/root-only permissions and delte too much anyways.</p>","314089","","","","","2011-04-15 19:38:58","Clear Android Maps history programmatically","<android><navigation><maps><history><clear>","2","0","","",""
"4228956","1","4228967","","2010-11-19 20:08:02","1","742","<p>I am building a twitter-like client. Assume I have a string:</p><p><code>""$AAPL rocks!""</code></p><p>I want to be able to click on ""$AAPL"" and do something.</p><p>How can I go about making $ clickable in a TextView?</p>","19875","","","","","2014-04-01 12:57:53","How can I make certain words clickable in a TextView?","<java><android><regex><string><textview>","1","0","2","",""
"4228997","1","4229557","","2010-11-19 20:14:00","1","1385","<p>lets us assume that i am using service or database path in my application,so whenever i change the location path, i don't want to edit in all the ton times in coding. so is it possible to store the value in some xmlfile or manifest file and read it directly to a variable? or i have to use xml parser? any idea?</p>","430652","","","","","2010-11-19 21:32:16","how to read a particular value in android manifest file or xml in android?","<android><xml><manifest>","2","0","1","",""
"4229014","1","4229247","","2010-11-19 20:16:12","1","1369","<p>I have a query that is making use of GROUP BY so that the results are grouped by a date column.  My question is this:</p><p>When I move through the cursor to get the results of the query, how can I get the multiple items associated with each group into my vector?  For example, I want to get BOTH ""Item X"" and ""Item Y"" for October 16, 2010.  Currently, I get them each separately.  Here is my code:</p><pre><code>Vector&lt;Event&gt; v = new Vector&lt;Event&gt;();Event e; detailCursor.moveToFirst(); while (detailCursor.isAfterLast() == false) {      e = new Event();      e.setEventDate(detailCursor.getString(detailCursor                .getColumnIndex(""eventDate"")));      e.setItem(detailCursor.getString(detailCursor                .getColumnIndex(""Item"")));      v.add(e);      detailCursor.moveToNext(); }detailCursor.close();</code></pre><p>So, when I get the results from my Vector, I will get:</p><p>October 12, 2010- Item X</p><p>October 12, 2010- Item Y</p><p>and I want:</p><p>October 12, 2010 - Item X, Item Y</p><p>Yes, I do have to change my Vector to support multiple items, but hopefully you get what issue I'm facing...</p><p>Thanks!</p>","123891","","123891","","2010-11-19 20:51:15","2010-11-19 20:51:15","Android question about SQL Cursor and GROUP BY","<java><sql><android><sqlite><cursor>","1","1","","",""
"4229032","1","4229663","","2010-11-19 20:18:43","0","571","<p>Is there a way to 'preload' a user interfaces but to not display it until I am ready?  </p><p>I have a service which has a receiver to listen for action_screen_on to occur.  When that occurs, I would like to load an activity.  However, as it is now, it takes about 1 second to load.  I would like to preload the layout in advance so that when the screen is turned on the layout loads as soon as possible.</p>","513939","","","","","2010-11-19 21:44:31","activity in background","<android>","2","0","","",""
"4229040","1","4229143","","2010-11-19 20:20:29","0","188","<p>I'm trying to write a program that is just a little beyond my abilities.The program is supposed to retrieve GPS data and display it on a nice page of graphics.  I can access the GPS data fine, by implementing the necessary listener interfaces.  I can display nice graphics using a sophisticated program structure employing a SurfaceView.  But when I try to pull these two functionalites (incoming data and graphics) together things fall apart.</p><p>The graphics structure of the program is, in schematic form:</p><p>Activity implements several gpsStatus/Location interfaces</p><pre><code>Anonymous inner class Panel extends SurfaceView  implements SurfaceHolder.Callback        onDraw() which does the drawing        inner (instance) class Thread            run() which does the canvas locking and calls onDraw()</code></pre><p>I hope that makes sense. I got this structure from the Droidnova site, the 2D graphics tutorial.  The graphics are drawn in the separate thread.  I've been able to get very nice smooth graphics out of this.</p><p>The class ""Panel,"" the one which extends SurfaceView is created in the onCreate of the Activity, like this: setContentView(new Panel(this));  The inner class is created as an instance, i.e. Thread thread=new Thread() by the Panel's constructor.</p><p>My data from the GPS chip comes in via methods in the Activity.  The problem is, how do I get these objects inside the ""Panel"" and into the onDraw()?  From within the onDraw() the objects in the Activity (my GPS data) are inaccessible.</p><p>I've tried creating the SurfaceView as an instance, I've tried moving the SurfaceView out so it's a separate class (with the thread still inside).  I've tried implementing the interfaces in the Panel  These always crash, with debug data I can't fathom. </p><p>Any help much appreciated.</p>","485548","","485548","","2010-11-20 19:04:18","2010-11-20 19:04:18","Trouble getting data into an inner class","<android><graphics><2d>","2","1","","",""
"4229140","1","4240237","","2010-11-19 20:32:36","0","1483","<p>I have kept a list of videos in vector {http://a/video1.mp4, <a href=""http://a/video2.mp4"">http://a/video2.mp4</a>, <a href=""http://a/video3.mp4"">http://a/video3.mp4</a>, <a href=""http://a/video4.mp4"">http://a/video4.mp4</a>, <a href=""http://a/video5.mp4"">http://a/video5.mp4</a>, <a href=""http://a/video6.mp4"">http://a/video6.mp4</a>}I want to play all the videos one after the another using the Android native player VideoView.Kindly provide me the sample code to implement the same.</p><p>Warm Regards,</p><p>CB</p>","443141","","29407","","2010-11-19 20:33:47","2010-11-21 20:40:09","Playing multiple videos using VideoView","<android>","1","2","","",""
"4229163","1","","","2010-11-19 20:37:01","4","2592","<p>A view flipper has 4 list views. When i flip the view flipper using gesture listener implemented on view flipper, it works fine. But I am not able to scroll the list view since the touch event is not able to trickle down from view flipper to list view. Please provide solutions.</p><pre><code>private class MyViewFlipper extends ViewFlipper implements OnGestureListener {    GestureDetector gestureScanner = new GestureDetector(this);    Context context;    public MyViewFlipper(Context context) {        super(context);        this.context=context;    }    @Override    public boolean onInterceptTouchEvent(MotionEvent event) {         return gestureScanner.onTouchEvent(event);    }    @Override    public boolean onTouchEvent(MotionEvent event) {          return gestureScanner.onTouchEvent(event);    }    @Override    public boolean onDown(MotionEvent arg0) {        return true;    }    @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) {                this.setOutAnimation(AnimationUtils.loadAnimation(context,R.anim.push_left_out));                this.setInAnimation(AnimationUtils.loadAnimation(context,R.anim.push_left_in));                this.showNext();                return true;            } else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp;                       Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                this.setOutAnimation(AnimationUtils.loadAnimation(context,R.anim.push_right_out));                this.setInAnimation(AnimationUtils.loadAnimation(context,R.anim.push_right_in));                this.showPrevious();                return true;            } else if (e1.getY() - e2.getY() &gt; SWIPE_MIN_DISTANCE &amp;&amp;                       Math.abs(velocityY) &gt; SWIPE_THRESHOLD_VELOCITY) {                return true;            } else if (e2.getY() - e1.getY() &gt; SWIPE_MIN_DISTANCE &amp;&amp;                       Math.abs(velocityY) &gt; SWIPE_THRESHOLD_VELOCITY) {                return true;            }       } catch (Exception e) {            e.printStackTrace();            //Toast.makeText(context, ""Error Occurred"", Toast.LENGTH_LONG);       }       return false;    }    @Override    public void onLongPress(MotionEvent e) {    }    @Override    public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {        //I want this event to be handled by list view        this.getCurrentView().findViewWithTag(""hierarchy_list"").dispatchTouchEvent(e1);        Log.i(LOG_TAG, ""Scroll"");        return false;    }    @Override    public void onShowPress(MotionEvent e) {    }    @Override    public boolean onSingleTapUp(MotionEvent e) {        //DO something          return false;    }}</code></pre>","304695","","620360","","2011-11-23 10:24:43","2011-11-23 10:24:43","Listview not scrolling inside view flipper in android","<android><listview><listener><gesture>","2","2","2","",""
"4229177","1","4229387","","2010-11-19 20:40:10","9","8555","<p>I have a webview control that needs to support the fling gesture in Android in order to bring up a new record (load new data). This is occuring in a class that extends Activity. All the examples I've seen show how to implement gesture support for a textview, but nothing for webview.</p><p>I need to execute different actions for both left and right flings. Any code help would be appreciated as this totally has me stumped.</p><p>Here's my basic onCreate and my class</p><pre><code>import android.app.Activity;import android.content.Intent;import android.database.Cursor;import android.database.SQLException;import android.os.Bundle;import android.text.Html;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.view.Window;import android.webkit.WebView;public class ArticleActivity extends Activity   {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Window  w = getWindow();     w.requestFeature(Window.FEATURE_LEFT_ICON);     WebView webview = new WebView(this);     setContentView(webview);      w.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,     R.drawable.gq);    setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);    populateFields();    webview.loadData(question + answer, ""text/html"", ""utf-8"");  //   }private void populateFields() {....}}</code></pre>","513964","","418183","","2010-11-19 20:41:29","2012-06-05 07:30:16","Fling Gesture and Webview in Android","<android><sdk><webview><gesture>","3","0","3","",""
"4229205","1","","","2010-11-19 20:45:09","0","1316","<p>I am developing Checkers application for Android and I have some questions for more experienced users. </p><p>I successfully drew gameboard, but I am stuck in adding pieces. When I am drawing black fields of a gameboard (or chessboard, as you wish), I am saving all locations of black fields into field called <code>location[i][j]</code> in 2 for loops:</p><pre><code>location[i][j]=new RectF(i*width, j*height,(i+1)*width, (j+1)*height);</code></pre><p>and then I am drawing it on Canvas:</p><pre><code>canvas.drawRect(location[i][j],black);</code></pre><p>When I am trying to draw pieces, I tried to use method:</p><pre><code>canvas.drawBitmap(bitmap, src, dst, paint);</code></pre><p>But still no success, application everytime call Force close. Does anyone knows how to do it efectively? There must be some simple way.</p><p>edited: With this code I am drawing tiles on chessboard</p><hr><pre><code>        for(int i=0;i&lt;9;i++){            if (i%2==0)                continue;                for (int j=0;j&lt;8;j++){                    if (j%2!=0)                        continue;                        pole[i][j]=new RectF(i*width, j*height,(i+1)*width, (j+1)*height);                        canvas.drawRect(location[i][j],brown);                }        }        for(int i=0;i&lt;9;i++){            if (i%2!=0)                continue;                for (int j=0;j&lt;8;j++){                    if (j%2==0)                        continue;                        pole[i][j]=new RectF(i*width, j*height,(i+1)*width, (j+1)*height);                        canvas.drawRect(location[i][j],brown);                }        }</code></pre><h3>Update:</h3><p>With this code I am trying to draw bitmap on a screen as a game pieces</p><hr><pre><code>Bitmap a = BitmapFactory.decodeResource(getResources(), R.drawable.ch);        for(int i=0;i&lt;8;i++){            for (int j=0;j&lt;8;j++){                if (pole[i][j].isEmpty()){                }else{                    canvas.drawBitmap(a, null, pole[i][j], cerna);                }            }    }</code></pre><hr><p>Actual problem - When I select new Game, screen just got black and returns to menu. Loc cat insn't writing something unusual. Just ""Process Terminated by Signal (11)"". Maybe I have bad approach, do you have any idea how to add game pieces into game plan?</p><p>Thanks  </p>","513956","","3043","","2012-04-30 13:34:37","2012-04-30 13:34:37","Checkers for Android - drawing pieces","<android>","0","10","","",""
"4229219","1","4231216","","2010-11-19 20:46:34","7","3820","<p>So I'm developing an application that must handle multitouch.  Basically I want single touch for rotating ( this is no problem ).  And multitouch for scrolling.</p><p>I have the basic code in, but I'm having problems when the shift from single to multitouch, and vice verca, occur.  Basically the movement will jolt because the median position of the multitouch ( two fingers ) and the absolute position of the single finger are at a distance.  So if I have two fingers on the screen, they make up a median position, and then lift one finger, it would be like a quick movement from that median position to the absolute single finger position.  This will be the movement that I don't want.</p><p>This is my code:</p><pre><code>@Overridepublic boolean onTouchEvent( MotionEvent event ) {    float xEvent[] = new float[ 2 ];    float yEvent[] = new float[ 2 ];    switch( event.getPointerCount() ) {        case 1:            xEvent[ 0 ] = event.getX( 0 );            yEvent[ 0 ] = event.getY( 0 );            switch( event.getAction() ) {                case MotionEvent.ACTION_DOWN:                    camera.onTouchDown( xEvent[ 0 ], yEvent[ 0 ] );                    return true;                case MotionEvent.ACTION_MOVE:                    camera.onTouchRotate( xEvent[ 0 ], yEvent[ 0 ] );                    return true;                default: return super.onTouchEvent( event );            }        case 2:            xEvent[ 0 ] = event.getX( 0 );            yEvent[ 0 ] = event.getY( 0 );            xEvent[ 1 ] = event.getX( 1 );            yEvent[ 1 ] = event.getY( 1 );            switch( event.getAction() ) {                case MotionEvent.ACTION_DOWN:                    camera.onTouchDown( ( ( xEvent[ 0 ] + xEvent[ 1 ] ) / 2 ), ( ( yEvent[ 0 ] + yEvent[ 1 ] ) / 2 ) );                    return true;                case MotionEvent.ACTION_MOVE:                    camera.onTouchSlide( ( ( xEvent[ 0 ] + xEvent[ 1 ] ) / 2 ), ( ( yEvent[ 0 ] + yEvent[ 1 ] ) / 2 ) );                    return true;                case MotionEvent.ACTION_POINTER_1_UP:                    camera.onTouchDown( xEvent[ 1 ], yEvent[ 1 ] );                    return true;                case MotionEvent.ACTION_POINTER_2_UP:                    camera.onTouchDown( xEvent[ 0 ], yEvent[ 0 ] );                    return true;                default: return super.onTouchEvent( event );            }        default: return false;    }}</code></pre><p>The onTouchDown function of the camera just sets the first value of the touch move.  That's why I also use it in the up movement to set a new begin value for the single touch movement when coming from a multitouch.</p><p>I hope someone knows what my problem is and can help me further.</p>","324943","","822005","","2013-02-28 23:56:12","2013-02-28 23:56:12","How to code for multitouch","<android><touch><multi-touch>","2","0","6","",""
"4229462","1","","","2010-11-19 21:19:20","0","1090","<p>I have a webview control that needs to support the fling gesture in Android in order to bring up a new record (load new data). This is occuring in a class that extends Activity. All the examples I've seen show how to implement gesture support for a textview, but nothing for webview. From what I've read Webview is another animal and it is ""complicated"".</p><p>I need to execute different actions for both left and right flings. Any code help would be appreciated as this totally has me stumped.</p><p>Here's my basic onCreate and my class</p><pre><code>import android.app.Activity;import android.content.Intent;import android.database.Cursor;import android.database.SQLException;import android.os.Bundle;import android.text.Html;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.view.Window;import android.webkit.WebView;public class ArticleActivity extends Activity   {public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  Window  w = getWindow();   w.requestFeature(Window.FEATURE_LEFT_ICON);   WebView webview = new WebView(this);  setContentView(webview);    w.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,   R.drawable.gq);  setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);  populateFields();webview.loadData(question + answer, ""text/html"", ""utf-8"");//   }    private void populateFields() {....}}</code></pre>","513964","","","","","2010-11-24 21:22:44","Fling Gesture, Webview and Android","<android><sdk><webview><gesture>","1","0","","",""
"4229479","1","","","2010-11-19 21:21:30","2","2434","<p>i have created a TabWidget </p><pre><code>TabWidget tabWidget = new TabWidget(this);        tabWidget.setId(android.R.id.tabs);</code></pre><p>and a FrameLayout</p><pre><code>FrameLayout frameLayout = new FrameLayout(this);        frameLayout.setId(android.R.id.tabcontent);</code></pre><p>how make framelayout above tabs?</p><pre><code>**what is the equivalent code to ""android:layout_above=""@android:id/tabs""**</code></pre><p><strong>EDIT</strong></p><p>i am doing with this code, is it correct?</p><pre><code>TabHost tabHost = new TabHost(this);tabHost.setLayoutParams(                new RelativeLayout.LayoutParams(                        LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT,1)); TabWidget tabWidget = new TabWidget(this);        tabWidget.setId(android.R.id.tabs);RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(width, height);lp.addRule(RelativeLayout.ABOVE, R.id.tabcontent);tabWidget.setLayoutParams(lp);tabHost.addView(tabWidget);FrameLayout frameLayout = new FrameLayout(this);        frameLayout.setId(android.R.id.tabcontent);        frameLayout.setPadding(0, 55, 0, 0);tabHost.addView(frameLayout, new RelativeLayout.LayoutParams(                  LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); tabHost.setup();</code></pre>","430652","","430652","","2010-11-21 09:11:16","2010-11-23 12:21:48","what is the equivalent code for android:layout_above=""@android:id/tabs""?","<android><layout><tabs><frame>","1","0","","",""
"4229481","1","4229531","","2010-11-19 21:21:41","0","145","<p>i have a editText, so how do i check if the editText contain like ""http://www.""?</p><p>Is this possible to see if a component contain a specific string?</p><p>Thank-you</p><p>PS. is it also possible to change android:theme(like no title) at runtime?</p>","502419","","","","","2010-11-19 21:48:58","Android Development: Text contain","<android>","2","0","","",""
"4229494","1","","","2010-11-19 21:23:12","22","19288","<p>Right now I have an app that loads a webview and all the clicks are kept within the app. What I would like to do is when a certain link, for example, <a href=""http://www.google.com"">http://www.google.com</a> is clicked within the app it opens the default browser. If anyone has some ideas please let me know!</p>","407774","","703019","","2012-03-08 14:33:48","2013-10-04 05:12:56","WebView link click open default browser","<android>","4","0","7","",""
"4229515","1","","","2010-11-19 21:26:16","0","221","<p>from my last question i know how to tint a complete image with a color (by applying SetColorFilter). Now i would like to tint only parts of my icon. I have a class derived from ImageView and could use the overridden onDraw method.</p><p>Does anyone has an idea how to only tint a part of my icon? I've tried to figure out the solution within the canvas explanation, but i unfortunately i still have no idea...</p>","512769","","","","","2010-11-19 21:26:16","Android: Coloring (tint) parts of an icon (like microphone in google voice search)","<android>","0","3","1","",""
"4229653","1","4229883","","2010-11-19 21:43:33","1","601","<p>Just wondering what would be the best way to grab the following data and parse it.</p><p>Here's an example of some the data I want to pull. </p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8"" ?&gt; &lt;eveapi version=""2""&gt;&lt;currentTime&gt;2010-11-19 19:23:44&lt;/currentTime&gt; &lt;result&gt;&lt;rowset name=""characters"" key=""characterID"" columns=""name,characterID,corporationName,corporationID""&gt;  &lt;row name=""jennyhills"" characterID=""90052591"" corporationName=""Imperial Academy"" corporationID=""1000166"" /&gt; &lt;/rowset&gt;&lt;/result&gt;&lt;cachedUntil&gt;2010-11-19 20:20:44&lt;/cachedUntil&gt; &lt;/eveapi&gt;</code></pre><p>I've seen some examples on how to parse XML data but they are all based on if statements and that's a lot of hard coding is there a more genertic way to do this?</p>","508902","","","","","2010-11-19 22:18:12","Grabbing XML File Data from a Website","<android><xml><parsing><data><website>","2","1","","",""
"4229710","1","4229739","","2010-11-19 21:50:10","5","15069","<p>I have an EditText for which will be using for a float number.  So I'm trying to read the text from the EditText and put it into a float variable.  But I seem to have a text to float problem.  This is the line I have:</p><pre><code>float Number = ( ( EditText )findViewById( R.id.edit_float ) ).getText();</code></pre><p>I've tried using Float.parseFloat(string) and just general casting, but nothing seem to do it.  What can I do here?  Also, is there a way to check for a valid float number before writing it to a variable?</p>","324943","","","","","2012-12-16 11:18:37","String from EditText to float","<java><android>","1","2","6","",""
"4229811","1","4230405","","2010-11-19 22:04:47","0","1284","<p>I am pondering the idea of a Wine-ish compatibility layer on Android.The idea is to run Symbian apps on it as both OSes share ARM hardware.</p><p>I have no knowledge of Symbian but I think that given the hardware capabilities of Android devices this could be done with less effort than Wine's windows emulation. </p><p>What would be the most significant difference to overcome in this emulator? (threading, storage, ...) </p>","400026","","400026","","2010-11-19 22:15:20","2012-08-04 07:42:21","Wine like for Android","<android><symbian>","4","2","","",""
"4229827","1","","","2010-11-19 22:07:32","1","202","<p>I'm new to android development. Is it possible for a view (with a particular layout) to ""appear"" at the location where the user ""touches""? If so, how?Like the idea of right-clicking on your computer - a menu pops down wherever you right-click.and when you navigate away, it disappears.</p><p>I hope what I said made sense :PThanks!</p>","514022","","","","","2010-11-20 00:03:05","Can a view appear at the location where the user touches the screen, and disappear?","<android><layout><view><popup><touch>","1","1","","",""
"4229894","1","4230105","","2010-11-19 22:19:29","1","539","<p>I'm currently developing an application for Android which needs to use a custom made Tabs. I have encountered two problems:</p><p>I will start from my first problem:</p><pre><code>java.lang.NullPointerExceptionat android.widget.TabWidget.initTabWidget(TabWidget.java:115)at android.widget.TabWidget.&lt;init&gt;(TabWidget.java:86)at android.widget.TabWidget.&lt;init&gt;(TabWidget.java:69)...</code></pre><p>I'm getting this exception when i want to switch from a text mode to wyswig mode in Eclipse.This is the actual xml code that gives me that error:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;       &lt;FrameLayout android:id=""@android:id/tabcontent""           android:layout_width=""fill_parent""           android:layout_height=""0dip""           android:layout_weight=""1""           android:padding=""20dip""           android:background=""#fff"" /&gt;       &lt;RadioGroup android:layout_width=""fill_parent""           android:layout_height=""wrap_content""           android:orientation=""horizontal""           android:checkedButton=""@+id/first""           android:id=""@+id/states""&gt;           &lt;RadioButton android:id=""@+id/first""               android:background=""#FF00FF""               android:width=""80dip""               android:height=""70dip"" /&gt;           &lt;RadioButton android:id=""@+id/second""               android:background=""#FFFFFF""               android:width=""80dip""               android:height=""70dip"" /&gt;           &lt;RadioButton android:id=""@+id/third""               android:background=""#00FFFF""               android:width=""80dip""               android:height=""70dip"" /&gt;           &lt;RadioButton android:id=""@+id/fourth""               android:background=""#0000FF""               android:width=""80dip""               android:height=""70dip"" /&gt;       &lt;/RadioGroup&gt;      &lt;TabWidget android:id=""@android:id/tabs""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:layout_weight=""0""          android:visibility=""gone"" /&gt;      &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Now the second problem is an Graphic-Artifact:<img src=""http://i.stack.imgur.com/lJcmQ.png"" alt=""http://img529.imageshack.us/img529/8216/99725485.png""></p><p>How can i resolve my problems?</p>","514006","","418183","","2010-11-19 22:21:36","2010-11-19 22:52:01","nullpointerexception in wyswig xml layout in eclipse for android and visual-artifacts","<android><nullpointerexception><tabwidget><visual-artifacts>","2","0","","",""
"4229943","1","4229962","","2010-11-19 22:29:16","1","1096","<p>I'm trying to save and then load the files that I've just saved but I can't find it. </p><p>I know it is being saved because I can look at the cache size under the Manage Application screen for the app and see that the size goes up when I save the image.</p><p>This is the error I'm getting: <code>java.io.FileNotFoundException: /data/data/com.xxxxx/files/5ec2d71d-8a99-4258-a33a-91f6f99b8f0e.jpg</code></p><p>Here is my code:</p><pre><code>imageDir = new File(context.getCacheDir().getAbsolutePath());            String newName = UUID.randomUUID().toString() + "".jpg"";            Bitmap bmp = ImageLoader.getInstance().getBitmap(e.getUrl());            Boolean r = imageDir.exists();            Boolean c = imageDir.canWrite();            String[] d = imageDir.list();            BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(imageDir + ""/"" + newName));            bmp.compress(CompressFormat.JPEG, 90, out);            out.flush();            out.close();            d = imageDir.list();            FileInputStream fis = new FileInputStream(imageDir + ""/"" + newName);            ObjectInputStream ois = new ObjectInputStream(fis);            Bitmap b = (Bitmap) ois.readObject();</code></pre><p>Ideas?</p>","469682","","469682","","2010-11-19 23:24:46","2010-11-19 23:24:46","java.io.FileNotFoundException When trying to load a file I just saved","<android>","1","0","","",""
"4229958","1","","","2010-11-19 22:30:59","1","830","<p>I have a TabActivity that hosts many tabs. Each tab refers to the same activity, however logic is performed inside the activity that determines what to load. I would like this to be done by passing a boolean to the respective tab. How can I do this?</p><pre><code>package com.stocktwits.activity;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class StockTwitsTabActivity extends TabActivity{    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.stocktwits_tab_activity);        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, StreamActivity.class);        // Initialize a TabSpec for each tab and add it to the TabHost        intent.putExtra(""reloadAll"", true);        spec = tabHost.newTabSpec(""all"").setIndicator(""All"",res.getDrawable(R.drawable.icon)).setContent(intent);        tabHost.addTab(spec);        // Do the same for the other tabs        intent = new Intent().setClass(this, StreamActivity.class);        spec = tabHost.newTabSpec(""home"").setIndicator(""Home"",res.getDrawable(R.drawable.icon)).setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, StreamActivity.class);        spec = tabHost.newTabSpec(""mentions"").setIndicator(""Mentions"",res.getDrawable(R.drawable.icon)).setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, StreamActivity.class);        spec = tabHost.newTabSpec(""directs"").setIndicator(""Directs"",res.getDrawable(R.drawable.icon)).setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, StreamActivity.class);        spec = tabHost.newTabSpec(""more"").setIndicator(""More"",res.getDrawable(R.drawable.icon)).setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(0);    }}</code></pre>","19875","","","","","2010-11-20 11:56:38","How can I pass extras to an intent inside of a TabActivity?","<java><android><android-intent><android-tabhost><tabactivity>","2","2","","",""
"4230075","1","","","2010-11-19 22:48:54","0","2606","<p>First of all I'd like to mention I am very new to Java programming.  This Android project is my first experience with Java.  So for one task I need to strip HTML tags from a string.  I was thinking about using this answer <a href=""http://stackoverflow.com/questions/240546/removing-html-from-a-java-string"">Removing HTML from a Java String</a> to do this task.  In order to do this I need to be able to import javax.swing.text.html.* and javax.swing.text.html.parser.*.  </p><p>I went to the properties of my project and attempted to add this library to my project.  I read that this was included in the rt.jar file which was located at /usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar</p><p>I was able to use the imports but it seems like it added a million libraries I am not using.  Will this negatively effect my application?  What is the correct way to add just the one extension?</p>","147862","","","","","2010-11-19 23:38:51","How do I add the javax.swing.* packages to my libs for my android project?","<android><javax.swing.text>","1","0","","",""
"4230149","1","","","2010-11-19 22:58:43","2","426","<p>I've got a small Android app that I am developing and I have an <code>EditText</code> element which does not like to display it's contents while the keyboard is on the screeen.</p><p>For example I touch the editTextbox and it brings up the keyboard, pressing a letter, say <code>a</code> displays <code>a</code> in the textbox, but after that no new text shows up so the user is essentially typing blind from that point on.</p><p>This only happens on the device and not in the emulator. Vodafone 845 if it makes any difference.</p><p>The code I am using for the EditText is this. </p><pre><code> &lt;EditText  android:id=""@+id/EditAddress"" android:layout_width=""200px"" android:singleLine=""True"" android:hint=""Address or Landmark""/&gt; </code></pre><p>I did have a OnKeyListener and an OnClickListener, but removing them from the code makes no changes to the behaviour. The EditText is also inside of a TableLayout which is inside of another TableLayout. This is the only EditText that is behaving badly on the device. (I have not coded any others in the application. But might add some just to find out whats wrong.</p><p>EDIT: Ok, it seems to be caused if the keyboard obscures the location of the original editbox such that the view has to scroll down so the editbox will not be covered by the software keyboard. For now I can rearrange my page so the edit box is at the top. But this is a bit of a hacky solution. Anyone know what causes this and/or how to fix it.</p>","54794","","54794","","2010-11-21 07:29:40","2012-12-04 02:54:30","Android Phone EditText not updating the display on the device","<android><android-emulator><edittext>","1","3","","",""
"4230212","1","4230255","","2010-11-19 23:08:32","0","334","<p>Here is my code. I'd like to pass a boolean to the activity i want to start.</p><pre><code>private void setupUI() {        setContentView(R.layout.more_tab_activity);        listView = (ListView) findViewById(R.id.streamListView);        listView.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1 , streams));        listView.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {                //start the streamactivity            }        });    }</code></pre>","19875","","","","","2010-11-19 23:17:43","How can I start an activity when the user clicks on a ListItem?","<java><android><listview><android-intent><listviewitem>","1","0","","",""
"4230294","1","","","2010-11-19 23:26:21","1","1061","<p>There seems to be a lot of controversy about how to stop applications in Android, so I'll explain what I'm trying to do and why in hopes that I can receive some guidance on how to properly implement the functionality I'm looking for.</p><p>I got tired of plugging my phone into power when I get into the car, connecting the headphones, turning BT on, turning WiFi off, and then launching ""Car Home"" because my dock doesn't do so automatically - it's just a piece of plastic mounted to the dash.</p><p>So my application automatically does these things when I connect power - and when I disconnect power, it turns BT off and WiFi back on, but unfortunately, Car Home is still running.</p><p>I want to automate the entire process, so I never have to launch (or shut down) Car Home, and make getting in and out of the car a little less frustrating.</p><p>I know Froyo introduces ActivityManager's killBackgroundProcesses method, but this doesn't seem to work for me. It does seem to be focused around <em>background</em> processes, but what I've read online seems people want to use it to stop foreground applications.</p><p>I've also tried restartPackage from Eclair unsuccessfully, so I'm looking for advice.</p><p>What is the best way for me to tell the ""Car Home"" application to stop specifically because power is disconnected and I'm getting out of the car, without me having to navigate to it's home page and click ""Exit""?</p>","514095","","995926","","2012-05-22 07:59:38","2012-05-22 07:59:38","How to properly kill an Android activity, that isn't a background process","<android><android-2.2-froyo><android-2.0-eclair>","1","2","","",""
"4230534","1","","","2010-11-20 00:21:09","0","194","<p><code>playTune</code> is called whenever a user selects a button. The problem is the line <code>myButton.setPressed(true);</code> is only called after the tune is played. This defies logic, so I'm wondering whether Android lines up events in an queue? I would like the line <code>myButton.setPressed(true);</code> to be called as it appears in the code. i.e. before a note is played.</p><pre><code>private void playTune() {  isTunePlaying = true;  //Get no of notes user selected  String selectedValue = noteCountValues[noteCountIdx];  Log.v(LOG_TAG, ""selectedValue:""+selectedValue+"" noteCountIdx:""+noteCountIdx);  int noOfNotes;  if (""ALL"".equals(selectedValue)){   noOfNotes = 50;  }  else{   noOfNotes = Integer.parseInt(selectedValue);  }  TuneManager tuneManager = TuneManager.getInstance(this);  Log.v(LOG_TAG, ""tuneNamesIdx:""+tuneNamesIdx);     Tune tune = tuneManager.getTune(tuneNamesIdx+1);  Log.v(LOG_TAG, "" tuneTitle:""+tune.getTitle()+"" tuneNoOfNotes:""+tune.getNotes().size());  //Initialise expectedNotes  expectedNotes = new StringBuffer();  //Get notes and play  List&lt;Note&gt; notes = tune.getNotes();    //for (Note note:tune.getNotes()){  for (int i=1; i&lt;=notes.size() &amp;&amp; i&lt;=noOfNotes; i++){   Log.v(LOG_TAG, ""i:""+i+"" notesSize:""+notes.size()+"" noOfNotes:""+noOfNotes);      //Highlight note   if (isHighlightNotesOn){        final View myButton = (ImageButton) findViewById(R.id.middle_c);        myButton.setPressed(true);          }       Note note = notes.get(i-1);   int notePos = soundManager.getNotePosition(note);   Log.v(LOG_TAG, ""current note:""+note.getName()+"" playing notePos:""+notePos+"" setting duration:""+note.getDurationMS());      soundManager.playSound(notePos);   //Add to expectedNotes   expectedNotes.append("" ""+note.getName()+"","");      //Sleep for the duration   try{    Thread.currentThread().sleep(note.getDurationMS());//sleep for 1000 ms   }   catch(InterruptedException ie){   }  }  isTunePlaying = false;    //Initialise actualNotesPlayed i.e. start from after the tine has finished  actualNotesPlayed = new StringBuffer();     } </code></pre>","514129","","139010","","2010-11-20 00:52:28","2010-11-20 00:52:28","Programmatically pressing a imageButton doesn't execute immediately","<android>","1","0","","",""
"4230620","1","","","2010-11-20 00:50:17","2","4919","<p>I'd like to programmatically create a button with a custom drawn shape as the image. In my activity's onCreate, I have:</p><pre><code>final FrameLayout contentContainer = new FrameLayout(this);final FrameLayout.LayoutParams contentLayoutParams = new FrameLayout.LayoutParams(        FrameLayout.LayoutParams.FILL_PARENT,        FrameLayout.LayoutParams.FILL_PARENT);contentContainer.setLayoutParams(contentLayoutParams);contentContainer.setBackgroundColor(Color.BLUE);int size = 50;final ShapeDrawable drawable = new ShapeDrawable(new OvalShape());drawable.getPaint().setColor(Color.RED);drawable.setBounds(0, 0, size, size);final ImageButton leftArrow = new ImageButton(this);leftArrow.setImageDrawable(drawable);final FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(size, size);leftArrow.setLayoutParams(lp);contentContainer.addView(leftArrow);</code></pre><p>When I run the app, I see a blue screen with a plain white button. I has hoping to see a red oval on the button, but it seems I'm not understanding the setImageDrawable call.</p><p>Any suggestions how to achieve this? Thanks!</p>","514132","","","","","2010-11-20 00:50:17","Android: create image button with programmatically drawn shape as its image","<android>","0","2","","",""
"4230740","1","4232308","","2010-11-20 01:24:02","1","1789","<p>When trying to add an object to the JS environment using Rhino 1.7 r2 on Android 2.2 I always get a NullPointerException. I have boiled the class down to the bare minimum to get this exception, and I can't figure out why. Here's the code that always produces the exception:</p><pre><code>public class StartActivity extends Activity{    /** Rhino context object */    private Context mCX;    /** Rhino script scope object */    private Scriptable mScope;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        // Create our context and turn off compilation        mCX = Context.enter();        mCX.setOptimizationLevel( -1 );        // Initialize the scope        mScope = mCX.initStandardObjects();        Object insertObj;        // This line always throws the exception.        insertObj = Context.javaToJS( this, mScope );        // We never get here        ScriptableObject.putProperty( mScope, ""platform"", insertObj );        setContentView(R.layout.main);    }}</code></pre><p>Changing the troublesome line to some else like <code>insertObj = Context.javaToJS( null, mScope );</code> or really anything but <code>this</code> and the problem doesn't occur. </p><p>Here is the stacktrace:</p><pre><code>E/AndroidRuntime(  308): FATAL EXCEPTION: mainE/AndroidRuntime(  308): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.me/com.me.StartActivity}: java.lang.NullPointerExceptionE/AndroidRuntime(  308):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)E/AndroidRuntime(  308):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)E/AndroidRuntime(  308):    at android.app.ActivityThread.access$2300(ActivityThread.java:125)E/AndroidRuntime(  308):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)E/AndroidRuntime(  308):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  308):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  308):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(  308):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  308):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  308):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(  308):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(  308):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  308): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime(  308):    at org.mozilla.javascript.net.sf.retrotranslator.runtime.impl.MethodDescriptor.getInstance(MethodDescriptor.java:137)E/AndroidRuntime(  308):    at org.mozilla.javascript.net.sf.retrotranslator.runtime.java.lang.reflect._Constructor.isVarArgs(_Constructor.java:83)E/AndroidRuntime(  308):    at org.mozilla.javascript.jdk15.VMBridge_jdk15.isVarArgs(VMBridge_jdk15.java:66)E/AndroidRuntime(  308):    at org.mozilla.javascript.MemberBox.init(MemberBox.java:86)E/AndroidRuntime(  308):    at org.mozilla.javascript.MemberBox.&lt;init&gt;(MemberBox.java:72)E/AndroidRuntime(  308):    at org.mozilla.javascript.JavaMembers.reflect(JavaMembers.java:667)E/AndroidRuntime(  308):    at org.mozilla.javascript.JavaMembers.&lt;init&gt;(JavaMembers.java:76)E/AndroidRuntime(  308):    at org.mozilla.javascript.JavaMembers.lookupClass(JavaMembers.java:838)E/AndroidRuntime(  308):    at org.mozilla.javascript.NativeJavaObject.initMembers(NativeJavaObject.java:90)E/AndroidRuntime(  308):    at org.mozilla.javascript.NativeJavaObject.&lt;init&gt;(NativeJavaObject.java:80)E/AndroidRuntime(  308):    at org.mozilla.javascript.NativeJavaObject.&lt;init&gt;(NativeJavaObject.java:70)E/AndroidRuntime(  308):    at org.mozilla.javascript.WrapFactory.wrapAsJavaObject(WrapFactory.java:149)E/AndroidRuntime(  308):    at org.mozilla.javascript.WrapFactory.wrap(WrapFactory.java:105)E/AndroidRuntime(  308):    at org.mozilla.javascript.Context.javaToJS(Context.java:1698)E/AndroidRuntime(  308):    at com.me.android.StartActivity.onCreate(StartActivity.java:34)E/AndroidRuntime(  308):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)E/AndroidRuntime(  308):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)E/AndroidRuntime(  308):    ... 11 more</code></pre><p>Any insight as to why this is happening would be greatly appreciated.</p><p><strong>[EDIT]</strong> After some serious googling and head smashing I discovered the <code>ScriptableObject.defineClass</code> method and tried using that instead, following the examples in the Rhino documentation, however now I get a RuntimeException ""ReferenceError: 'DeviceInterface' is not defined."" I know this is possible, as Rhino is what the <a href=""http://code.google.com/p/android-scripting/"" rel=""nofollow"">ASE</a> uses for its JavaScript support.</p><p>Here is the new code which throws the RuntimeException:</p><pre><code>public class StartActivity extends Activity{    /** Rhino context object */    private Context mCX;    /** Rhino script scope object */    private Scriptable mScope;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        // Create our context and turn off compilation        mCX = Context.enter();        mCX.setOptimizationLevel( -1 );        // Initialize the scope        mScope = mCX.initStandardObjects();        try{            ScriptableObject.defineClass( mScope, DeviceInterface.class );        } catch( Exception e ) {            Log.e(""StartActivity"", e.toString());        }        // This is the line that throws the exception        mCX.evaluateString(mScope,                ""var p = new DeviceInterface();"", """",                1, null);        setContentView(R.layout.main);    }}</code></pre><p>And the DeviceInterface class:</p><pre><code>public class DeviceInterface extends ScriptableObject{    static private final long serialVersionUID = 1L;    static public void init ( Scriptable scope )    {        Log.i( ""JSInterface"", ""Init called"" );    }    public DeviceInterface()    {        logger( ""Created new JSInterface Object"" );    }    @Override    public String getClassName()    {        return ""DeviceInterface"";    }    public void jsFunction_logger( String message )    {        logger( message );    }    private void logger( String message )    {        if( message.contains(""[alrt]"") )            Log.e( ""JSInterface"", message );        else if( message.contains(""[info]"") )            Log.i( ""JSInterface"", message );        else            Log.d( ""JSInterface"", message );    }}</code></pre>","321937","","321937","","2010-11-20 07:25:57","2012-01-28 23:06:33","Embedding Rhino on Android Problems","<java><android><nullpointerexception><rhino>","1","0","2","",""
"4230772","1","","","2010-11-20 01:36:47","0","1209","<p>I Know this question has been asked and answered but i have a different problem. I have a app out right now that wont load images that are higher than 5mp but loads smaller ones. Im not sure if its 5mp or over 1mb, Im pretty sure its mp though, I have tested. How can I load pictures that are all sizes? My code is below, Please help, please post code not links, of must to links then links to code that can help. Thanks! </p><p><strong>Downloading The Image</strong>  @Override            protected Bitmap doInBackground(Object... objects) {              InputStream is = null;                      BufferedInputStream bis = null;</p><pre><code>                   Bitmap bmp = null;                   try {                    URL url = new URL(Pictureurl);                       URLConnection conn = url.openConnection();                     conn.connect();                     is = conn.getInputStream();                      bis = new BufferedInputStream(is);                      bmp = BitmapFactory.decodeStream(bis);                      return bmp;                 } catch (MalformedURLException e) {                  return null;                 } catch (IOException e) {                  return null;                   }    }        @Override        protected void onPostExecute(Object resizedBitmap) {   MainPicture.setImageBitmap((Bitmap) resizedBitmap);   connectionProgressDialog.dismiss();         }</code></pre><p><strong>Uploading the image</strong></p><p>public boolean SaveNewPicture(String SelectedFile, String UpdatedPhotoPath){</p><pre><code> HttpURLConnection conn = null; DataOutputStream dos = null; DataInputStream inStream = null; @SuppressWarnings(""unused"")</code></pre><p>String Message = null;     // The full path of filename which is to be uploaded to server     String exsistingFileName = SelectedFile;</p><pre><code> String lineEnd = ""\r\n""; String twoHyphens = ""--""; String boundary = ""*****""; int bytesRead, bytesAvailable, bufferSize; byte[] buffer; int maxBufferSize = 1*1024*1024; @SuppressWarnings(""unused"")</code></pre><p>String responseFromServer = """";</p><pre><code> //Server path to the upload.php String urlString = ""http://www.thelinkhookup.com/upload.php""; try { //------------------ CLIENT REQUEST 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); System.out.println(""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); // close streams System.out.println(""File is written""); fileInputStream.close(); dos.flush(); dos.close(); } catch (MalformedURLException ex) { return false; } catch (IOException ioe) { Message = ioe.toString(); return false; } //------------------ read the SERVER RESPONSE try { inStream = new DataInputStream ( conn.getInputStream() ); String str; while (( str = inStream.readLine()) != null) { //the str contains the server response System.out.println(""Server Response""+str); } inStream.close(); //Message = ""Should Have Worked""; } catch (IOException ioex){ return false; } try{    HttpClient client = new DefaultHttpClient();      HttpPost request = new HttpPost(""http://thelinkhookup.com/UpdatePhotoName.php"");       List&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;();       postParameters.add(new BasicNameValuePair(""Username"", MyGlobalInfomation.getUsername()));       postParameters.add(new BasicNameValuePair(""Photopath"", UpdatedPhotoPath));       postParameters.add(new BasicNameValuePair(""localphotopath"",SelectedFile ));       UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(postParameters);       request.setEntity(formEntity);       @SuppressWarnings(""unused"")</code></pre><p>HttpResponse response = client.execute(request);           if(SelectedFile != null || SelectedFile != """"){           MyGlobalInfomation.setLocalPhotoPath(SelectedFile);           }      }           catch(Exception e){            return false;}     return true;     }</p>","514162","","","","","2010-11-20 02:49:41","android development loading Images from URL","<android><loading><image>","1","0","","",""
"4231092","1","","","2010-11-20 03:35:40","0","583","<p>I'm a noob when it comes to basically <em>all</em> forms of storage aside from SharedPreferences and some SQLite. I did some searching and found that JSON+GSON was a fast way to parse Objects and their fields into storable Strings.</p><p>So, in my game, I have a <code>Player</code> object which has fields that are also my own classes:</p><pre><code>public class Player {    private int something_game_related = 1;    private Skill equipped_skill;    private Item equipped_weapon;    public Player () {}}</code></pre><p>I suspect those classes are the problem, because when I try to run a simple save method:</p><pre><code>private class ItemSerializer implements JsonSerializer&lt;Item&gt; {    public JsonElement serialize( Item src, Type typeOfSrc, JsonSerializationContext context ) {        return new JsonPrimitive(src.toString());    }}private class SkillSerializer implements JsonSerializer&lt;Skill&gt; {    public JsonElement serialize( Skill src, Type typeOfSrc, JsonSerializationContext context ) {        return new JsonPrimitive(src.toString());    }}public void doSave() {    GsonBuilder gson = new GsonBuilder();    //Both custom classes have zero-arg constructors so we don't need to register those    gson.registerTypeAdapter( Item.class, new ItemSerializer() );    gson.registerTypeAdapter( Skill.class, new SkillSerializer() );    Gson g = gson.create();    String mPlayer = """";    Type player = new TypeToken&lt;Player&gt;(){}.getType();    try{        mPlayer = g.toJson( GameView.mPlayer, player );       } catch (Exception e) {e.printStackTrace();} }</code></pre><p>I get this Exception: <code>java.lang.IllegalStateException: How can the type variable not be present in the class declaration!</code><br><br></p><h1><strong>My Question is..</strong></h1><p>How do I get these custom serializers to work? Like I said, I'm a noob.. but it <em>looks</em> like I did it right..</p>","408178","","408178","","2010-11-20 23:02:47","2011-02-11 09:55:30","Gson IllegalStateException","<android><json><gson>","1","1","","",""
"4231099","1","4231922","","2010-11-20 03:39:56","0","526","<p>i am trying to develop this app in android that has 3-4 buttons and a list being displayed below them. each button when clicked must reload the list with new contents based on which button was clicked.each row in the list has a picture and two lines of text.could some one please suggest me how do I perform the reloading part.</p>","377337","","","","","2010-11-20 08:54:00","reload list contents on click of a button","<android><activity><listactivity>","2","0","","",""
"4231158","1","","","2010-11-20 04:07:28","-1","358","<p>Im doing a program where u can draw your signature on the phone. Right now it saves one image but I would like to save more than one image since there are more than one customer that needs to sign their package. very thankful for any kind of help. </p><pre><code>public void save() {            File sdImageMainDirectory = new File(""/sdcard/mySignatures"");            sdImageMainDirectory.mkdirs();            String nameFile = ""newpic"";FileOutputStream out = null;            try {            out = new FileOutputStream(sdImageMainDirectory.toString() +""/"" + nameFile + "".jpg"");            mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);            } catch (Exception e) {            e.printStackTrace();            } finally {            try {                out.flush();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            try {                out.close();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            out=null;            }</code></pre>","511895","","","","","2010-11-20 04:18:48","save more than one pic with different names in sdcard","<android>","1","0","","",""
"4231172","1","4231176","","2010-11-20 04:13:01","5","230","<p>in most IDEs and editors there's no consensus as to how to ident the @Override. and it's not covered in the coding style for java <a href=""http://www.oracle.com/technetwork/java/codeconvtoc-136057.html"" rel=""nofollow"">http://www.oracle.com/technetwork/java/codeconvtoc-136057.html</a></p><p>i use exclusively vim and it creates a new indentation level. So i'm inclined to think that the correct is</p><pre><code>@Override public boolean onTouch(View v, MotionEvent event) {</code></pre><p>But every documentation shows</p><pre><code>@Overridepublic boolean onTouch(View v, MotionEvent event) {</code></pre><p>But most of the time, the editor autoidents that to</p><pre><code>   @Override      public boolean onTouch(View v, MotionEvent event) {</code></pre><p>So, is there a 'correct' way? should i fix my java.vim syntax rules?</p>","183132","","65977","","2010-11-20 16:48:52","2010-11-20 16:48:52","Where to type @Override?","<java><android><vim><syntax><coding-style>","2","1","","",""
"4231186","1","","","2010-11-20 04:17:51","0","1369","<p>Hi I am using expandable list view in my layout which contain list of fitness activities i have done on that particular day. I can see all the list of activities when i initially open my Activity. But when i add new activities, i can not see new activities in my expandable list view. How can i see my new activities when i come back from other screens? Please suggest me some solutions.</p><p>Thanks in advance.</p>","503795","","366904","","2010-11-20 05:49:36","2012-08-17 16:54:33","How to update expandable list view values","<android><expandablelistview><updating>","1","1","","",""
"4231222","1","","","2010-11-20 04:28:30","1","547","<p>When I run video on my android emulator, it's volume is slow.</p><p>So anybody have ans for that. So please give me hint.</p><p>Thanks in advance,Prashant</p>","487253","","","","","2010-11-20 10:07:15","how to increase video volume in android emulator?","<android><volume><voice>","1","0","","",""
"4231227","1","","","2010-11-20 04:30:15","1","121","<p>I would like to know how to capture data(media) from an infinite input stream(eg. internet radio) and play it on the android device.Most of the tutorials i have gone through, tell me to use the MediaPlayer class. But the problem is that i want to capture that raw data in a byte array and then play it from that byte array itself.Does anyone know how to do this?</p>","505453","","","","","2011-04-01 21:49:28","using raw-data from an infinite input and playing it on the device","<java><android><bytearray>","1","0","","",""
"4231375","1","4231528","","2010-11-20 05:29:52","14","7251","<p>I tried enough to find in google &amp; android this question. Also did several trials &amp; errors, but couldn't get this question.I was learning Android's ""Draw Nine Patch"" images. One basic I know is that, whatever image you process must be in .png format (if it's already in .9.png then it will be ignored by tool). However, </p><ol><li>I couldn't understand what it literally means by ""stretchable patches"" ? </li><li>What exactly happens when you draw black dots outside the .png image ? (preview pane shows changes happening, but I am unclear on how it makes those)</li><li>When I draw black dots in left/top sides of image it shows some changes in preview; but why isn't there any effect when you do the same on right/bottom side of the image ?</li><li>Why this tool is used primarily for background, when we try to process on the image itself ?</li><li>I am trying to modify a simple button.png (given in android sdk). Whenever I use this tool &amp; draw black lines, it reduces the size of the image instead of 'stretching' it! Why ?</li><li>What is the significance of options given below like, ""show lock"", ""show content"", ""Patch scale"" and so on ?</li></ol><p>I apologize for asking so many questions, but in Android online docs they haven't explained well for novice. If someone can answer these, it will become ready reference for all the begineers who search this forum.</p>","514235","","","","","2010-11-20 06:39:39","Android Draw 9-patch tool: What is the meaning of black lines outside the figure","<android><drawing2d>","1","1","6","",""
"4231531","1","4231671","","2010-11-20 06:40:44","0","285","<p>i am using SharedPreferences in my code that will store last state of my check box. when i focefuly stop my application through setting>> application it dosn't save it's previous state. what is the problem ...   </p>","304961","","","","","2010-11-20 08:19:09","SharedPreferences Problem","<android>","2","0","","",""
"4231763","1","4232368","","2010-11-20 07:51:02","1","400","<p>Can I test Android smartphones applications on Samsung Galaxy Tab ?</p><p>Let's say I want to develop Android applications for HTC,and I only have Galaxy.</p><p>Can I simulate smaller resolutions on Galaxy to see how it would work on HTC ? </p><p>thanks</p>","257022","","","","","2010-11-20 10:58:38","Can I test Android smartphones applications on Samsung Galaxy Tab?","<android>","2","0","","",""
"4231793","1","4231925","","2010-11-20 08:03:17","4","6560","<p>I have two simple programmes, server and client, both at localhost. What I want to do is to streaming the video from the server to the client through socket and the client can play it by using filediscriptor of the socket. First I try to send some message and the client can receive it. After that I send a few bytes of the video from the server'sd card to the client. The client can receive those bytes but cannot play it. Anyone know how to solve the problem?</p><p>Here is my server and client code snippets:</p><p>Server:</p><pre><code>        //Receive request from client.     Socket client=serversocket.accept();     System.out.println(""accept"");     //Receive client message.     BufferedReader in=new BufferedReader(new InputStreamReader(client.getInputStream()));     String str=in.readLine();     System.out.println(""read:""+str);     //Send message to client.     //PrintWriter out=new PrintWriter(new BufferedWriter(new OutputStreamWriter(client.getOutputStream())),true);     //out.println(""server message"");     FileInputStream fis=new FileInputStream(""/sdcard/toystory3.3gp"");     byte buffer[]=new byte[2000];     fis.read(buffer,0,20);     DataOutputStream out=new DataOutputStream(client.getOutputStream());     out.write(buffer,0,20);     in.close();     out.close();     client.close();     System.out.println(""close"");</code></pre><p>Client:</p><pre><code> Socket socket=new Socket(""127.0.0.1"",4444); String message=""Initial""+""\r\n""; //Send message to server. PrintWriter out=new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true); out.println(message); //Receive message from server. BufferedReader br=new BufferedReader(new InputStreamReader(socket.getInputStream())); String msg=br.readLine(); //ParcelFileDescriptor pfd=ParcelFileDescriptor.fromSocket(socket); //MediaPlayer m=new MediaPlayer(); //m.setDataSource(pfd.getFileDescriptor()); //m.prepare(); //m.start(); if(msg!=null) {  System.out.println(""Data received."");  System.out.println(msg); } else {  System.out.println(""Data not received.""); } out.close(); br.close(); socket.close();</code></pre>","513374","","","","","2012-02-05 03:47:49","Video streaming through socket and playing from client","<android>","2","1","6","",""
"4231797","1","4231927","","2010-11-20 08:05:14","0","1763","<p>My application requires 2 screens and for this I have created two different <code>XML</code> layout files using <code>RelativeLayout</code>. One layout file loads whenever I run my Activity. Now I want to load the second layout on to the same <code>Activity</code> , when user click on a button in <code>OptionsMenu</code> and also when user press Back button the first screen loads instead of exiting the application. So that i don't need to create another <code>Intent</code> in my application.</p>","457982","","457982","","2011-01-10 11:25:07","2011-01-10 11:25:07","Dynamically load layout in Android","<android><activity><android-intent><relativelayout>","3","0","1","",""
"4231817","1","4250279","","2010-11-20 08:11:37","15","14965","<p>I have a image file on the disk and I am resizing the file and saving it back to disk as a new image file.  For the sake of this question, I am not bringing them into memory in order to display them on the screen, only to resize them and resave them.  This all works just fine.  However, the scaled images have artifacts on them like shown here: <a href=""http://stackoverflow.com/questions/2041207/android-quality-of-the-images-resized-in-runtime"">android: quality of the images resized in runtime</a></p><p>They are saved with this distortion, as I can pull them off the disk and look at them on my computer and they still have the same issue.</p><p>I am using code similar to this <a href=""http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue/823966#823966"">Android: Strange out of memory issue</a> to decode the bitmap into memory:</p><pre><code>BitmapFactory.Options options = new BitmapFactory.Options();options.inJustDecodeBounds = true;BitmapFactory.decodeFile(imageFilePathString, options);int srcWidth = options.outWidth;int srcHeight = options.outHeight;int scale = 1;while(srcWidth / 2 &gt; desiredWidth){   srcWidth /= 2;   srcHeight /= 2;   scale *= 2;}options.inJustDecodeBounds = false;options.inDither = false;options.inSampleSize = scale;Bitmap sampledSrcBitmap = BitmapFactory.decodeFile(imageFilePathString, options);</code></pre><p>Then I am doing the actual scaling with:</p><pre><code>Bitmap scaledBitmap = Bitmap.createScaledBitmap(sampledSrcBitmap, desiredWidth, desiredHeight, false);</code></pre><p>Lastly, the new resized image is saved to disk with:</p><pre><code>FileOutputStream out = new FileOutputStream(newFilePathString);scaledBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);</code></pre><p>Then, as I mentioned, if I pull that file off the disk and look at it, it has that quality issue linked above and looks terrible.  If I skip the createScaledBitmap and just save the sampledSrcBitmap right back to disk there is no problem, it seems to only happen if the size changes.</p><p>I have tried, as you can see in the code, setting inDither to false as mentioned here <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/8b1abdbe881f9f71"">http://groups.google.com/group/android-developers/browse_thread/thread/8b1abdbe881f9f71</a> and as mentioned in the very first linked post above.  That didn't change anything.  Also, in the first post I linked, Romain Guy said: </p><blockquote>  <p>Instead of resizing at drawing time  (which is going to be very costly),  try to resize in an offscreen bitmap  and make sure that Bitmap is 32 bits  (ARGB888).</p></blockquote><p>However, I have no idea how to make sure the Bitmap stays as 32 bits through the whole process.</p><p>I have also read a couple other articles such as this <a href=""http://android.nakatome.net/2010/04/bitmap-basics.html"">http://android.nakatome.net/2010/04/bitmap-basics.html</a> but they all seemed to be addressing drawing and displaying the Bitmap, I just want to resize it and save it back to disk without this quality problem.</p><p>Thanks much</p>","445348","","1228","","2013-11-14 21:30:13","2013-11-14 21:30:13","Quality problems when resizing an image at runtime","<android><image><bitmap><resize>","6","2","29","",""
"4232058","1","4232245","","2010-11-20 09:35:47","2","2929","<p>I have a main activity.  It's main purpose is to handle Tab menu.  If a user click a tab it'll load another activity as a sub-activity, still showing the tab menu. I am using Intent to do this:</p><pre><code>setContent(new Intent(this,B.class))</code></pre><p>This sub-activity has an onclick function as well. If the user clicks one of the links it'll load xml layout file using setContentView command:</p><pre><code>setContentView(R.layout.B1);</code></pre><p>Now, when the back button is pressed while xml file is loaded, it'll close the entire application.  Is there a way to prevent this, say, return to the sub-activity or the main activity?</p><p>thanks for all your help.</p>","513407","","21234","","2010-11-20 09:42:04","2011-06-12 20:50:49","Help prevent Back button from closing sub-activity","<android><back-button>","3","0","3","",""
"4232140","1","","","2010-11-20 09:56:18","1","1003","<p>I am trying to build an Android project with Scala sources in IntelliJ IDEA (Community Edition). I am using Scala sources from Java files: auto-complete works correctly, but build cannot resolve Scala classes in Java: <code>cannot find symbol class MyScalaClass</code>.</p><p>(I managed that in Eclipse, but Scala support in Eclipse is poor.)</p><p>Any hints or tutorials?</p><p><strong>Update:</strong> I have added Scala module in addition to Android module. Now, build fails during generating <code>classes.dex</code> with message:</p><pre><code>Error: trouble writing output: format == null</code></pre><p>I found that it is a limitation of Dalvik: <a href=""http://code.google.com/p/android/issues/detail?id=7147"" rel=""nofollow"">issue 7147</a>.</p><p>How can I strip unused methods/classes in IDEA without using Ant script? (I was using ProGuard in Ant script, but I was unable make IDEA to parse Scala error messages from Ant results.)</p>","121968","","121968","","2010-11-22 23:11:51","2011-05-09 10:12:03","How to build Android project with Scala sources in IntelliJ IDEA (Community Edition)?","<android><scala><build><intellij-idea><dalvik>","1","0","1","",""
"4232147","1","","","2010-11-20 09:57:47","2","1552","<p>I am developing an application in which Android device will be connected to a device via bluetooth and they will be exchanging certain packets. Now, the packet communication should be running in background and user can navigate through the screens of the app. So, for this purpose using bluetooth communication running as service is proper solution or not? If not, then can someone let me know of alternative to it.</p><p>One more thing that I wanted to know is whether its a good idea to have the service as ""Remote"" and communicate over IPC or the Service should be running in the same process as Application.</p>","261566","","261566","","2010-11-22 07:06:13","2010-11-22 07:06:13","Bluetooth connection in Background as a Service in Android?","<android><service><bluetooth>","1","1","","",""
"4232177","1","4665934","","2010-11-20 10:03:49","1","3825","<p>I have some code for displaying an alert dialog from one of my activities in Android.</p><pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setMessage(""Message"");    builder.setCancelable(false)            .setPositiveButton(""Ok"",                    new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog, int id) {                        }                    });    AlertDialog alert = builder.create();    alert.setTitle(""Title"");    alert.setIcon(R.drawable.your_image);          alert.show();  </code></pre><p>Now I would like to change the size of the dialog.  How can I do that?</p>","254790","","103167","","2011-01-31 14:08:31","2011-01-31 14:08:31","control size of alert dialog box in android","<android>","1","0","2","",""
"4232210","1","4232282","","2010-11-20 10:12:43","0","411","<p>I have a class which holds strings.  I declared them like this:</p><p>private String pper[]={"""" + ""Juan"", ""Manuel"",........};</p><p>This is then displayed as a listview, and that is fine.  Now, i want to add an icon/image on its item.  How can i do that?  </p><p>thanks for your help.</p>","513407","","366904","","2010-11-20 10:28:31","2010-11-20 10:32:38","Android: Help add image to Private string","<android><string>","1","0","","",""
"4232301","1","","","2010-11-20 10:37:13","3","581","<p>I am using ""content://mms"" Content resolver and getting mms database. How to get number,sent/received, body and attachment details from that?</p>","411893","","","","","2014-01-31 02:47:12","I want mms number,sent/received, body and attachment details from MMS db in android... How to do that?","<android><mms><android-contentresolver>","1","3","","",""
"4232352","1","4232373","","2010-11-20 10:54:04","2","1403","<p>hello and hi everyone, can anyone suggest me how to use device independent pixels(dip),sip and convert px to dip with a sample code..</p>","505580","","","","","2011-06-08 11:42:45","how to use dip and sip in android","<java><android><eclipse>","1","1","1","",""
"4232360","1","4232617","","2010-11-20 10:56:11","0","784","<p>i am developing app.its having post message on facebook and twitter.i searched on net and got many example but i confused with twitter.</p><p>if i am using oath authentication how should i provide login screens for clients.many example </p><p>what i found just they are using consumer and secret key where i need to pass uname,pword</p><p>can you pl suggest me its very urgent to me</p><p>Thanks in advance</p><p>Aswan </p>","1746300","","","","","2013-05-27 10:21:02","twitter oath authentication android","<android>","3","0","","",""
"4232386","1","4232446","","2010-11-20 11:04:08","1","5716","<p>In my application i have three activity. In my third activity if i click home button it comes to the android home screen(application still run in background i noticed by using Log statement). If i relaunch application then it start from first activity. How can i load it from third activity? Anyone can give me your suggestion....</p><p>Thanks in advance....</p>","405640","","","","","2012-04-19 18:18:27","Home button in android?","<android>","3","0","2","",""
"4232523","1","","","2010-11-20 11:43:28","0","1028","<p>Hey I am completely new to programming for android and for university I have been asked to create an app to buy sell and advertise a product. I have chosen dvd's to keep it simple. Using the tutorials on the android developer site I have created 3 tabs one for PG films one for 15 and one for 18. Now in these tabs I want to have a button that then changes the content of the tab but keeps the tabs. </p><p>I have tried so many things and the only thing I have been able to do is start a new activity but that gets rid of the tabs :( and I have tried many other things been up all night trying to work this out. If someone could just point me in the right direction to how to go about this would be great. Is it even possible? </p><p>Thanks  </p>","514417","","","","","2011-01-31 13:04:14","Android - content in a tab how to change it with out losing parent tabs","<java><android><tabs><content>","1","0","","",""
"4232722","1","","","2010-11-20 12:31:52","0","448","<p>I'm trying to toggle cell network on Android Emulator running on MacOSX. It works great on Windows with F8 (as documented), but it seems not to be the same shortcut on Mac. Does anyone know how to toggle cell network on MacOSX?</p>","459888","","","","","2011-05-16 22:47:08","Android Emulator Toggle Cell Networking on MacOSX","<android><osx><emulator><shortcuts>","3","0","2","",""
"4232790","1","4233586","","2010-11-20 12:50:07","2","288","<p>I'm writing an application and I have a feedback screen. When the user presses submit button, it takes him to the default email client and prefills the email address, subject etc. (""mailto:"")</p><p>When the user presses Send, my application appears and I thank the user for giving feedback.</p><p>However, how can I tell if the user has pressed the Discard button and did not send the email?</p>","292263","","","","","2010-11-20 15:55:57","Detect if user discarded message","<android><email>","1","0","","",""
"4232792","1","4233144","","2010-11-20 12:50:14","4","1763","<p>I have created a activity and set a the title bar to contain a progress bar like this:</p><pre><code>this.requestWindowFeature(Window.FEATURE_PROGRESS);getWindow().setFeatureInt(Window.FEATURE_PROGRESS, 500);</code></pre><p>But it turns out to be a horizontal bar, how can I make this a spin bar? (without creating a custom title bar)</p><p>Thanks, Jason</p>","407133","","","","","2010-11-20 14:16:27","How to make title bar progress bar a spin progress bar istead of horizontal bar?","<android>","1","0","4","",""
"4232917","1","4233224","","2010-11-20 13:21:02","0","426","<p>Typically, for a WinForm or a Web App, I create the database and tables through the RDBMS or through a separate install process. However, I haven't seen anything of the sort in Android. All the examples I've seen have the database creation scripts embedded in an activity like <a href=""http://sarangasl.blogspot.com/2009/09/create-android-database.html"" rel=""nofollow"">this</a>.</p><p>The best thing I can come up with now is to call a method from the data access constructor to check whether the database is installed - if not - install it. However, this seems like a lot of overhead to me.</p><p>What's the cleanest way to execute a android database install and then forget about it?</p>","462307","","462307","","2010-11-20 14:25:35","2010-11-20 14:37:49","Getting an Android Database Setup?","<android><database><installation>","1","0","","",""
"4232968","1","","","2010-11-20 13:33:20","1","5197","<p>I need to add a scroll for linear layout.I use the following code to create the linear layout.But it's not working</p><pre><code>LinearLayout llay=new LinearLayout(context);    llay.setVerticalScrollBarEnabled(true);</code></pre><p>If i use the following lines i will get the Scrollbar.</p><pre><code>ScrollView sc=new ScrollView(context);sc.addView(llay);</code></pre><p>But I need to add scroll for the Linear layout without using ScrollView.Thanks in advance !!!</p>","512192","","","","","2011-07-06 13:38:21","Add scroll bar for linear layout?","<android>","2","2","","",""
"4233088","1","4238130","","2010-11-20 14:03:39","1","365","<p>I stumbled about a strange problem with ListViews.</p><p>In the emulator the ListView shows no feedback, when an item is pressed for selection. I think I have seen that in the real thing, but I am not sure. I would expect that the list item gets selected (darker background) when it is pressed, so that the user can see, which item he pressed.</p><p>Do I have to code that?</p><p>RG</p><p>After seeing the comments, I tried the following:</p><p>I created a file res/color/backgroundstate.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_selected=""true""          android:color=""#888""/&gt;    &lt;item android:state_pressed=""true""          android:color=""#888""/&gt;    &lt;item android:color=""#eee""/&gt;&lt;/selector&gt;</code></pre><p>Then I use this in listitem.xml as a background color</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:textColor=""@color/helptextcolor""    android:background=""@color/backgroundstate""    android:padding=""10dp""    android:textSize=""16sp"" &gt;&lt;/TextView&gt;</code></pre><p>When I display the ListView with</p><pre><code>    ArrayAdapter adapter=new ArrayAdapter&lt;String&gt;(this,R.layout.listitem,names);    LV.setAdapter(adapter);    LV.invalidate();</code></pre><p>the program crashes.</p><p>There are three exceptions connected with this. But the problem seems to be the last one XMLPullParserException: </p><pre><code>&lt;item&gt; tag needs a drawable.</code></pre><p>Now?</p>","447111","","447111","","2010-11-21 12:52:48","2011-02-11 11:26:18","ListView shows no Feedback","<android><android-sdk-2.1>","3","0","","",""
"4233152","1","4248886","","2010-11-20 14:18:45","3","2233","<p>I'm parsing an OBJ-file in Android and my goal is to render &amp; display the object.  Everything works fine except the correct texture mapping (importing the resource/image into opengl etc works fine).</p><p>I don't know how to populate the texture related data from the obj-file into an texturebuffer-object.</p><p>In the OBJ-file I've vt-lines:</p><pre><code>vt 0.495011 0.389417 vt 0.500686 0.561346</code></pre><p>and face-lines:</p><pre><code>f 127/73/62 98/72/62 125/75/62</code></pre><p>My draw-routine looks like (only relevant parts):</p><pre><code>gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);gl.glNormalPointer(GL10.GL_FLOAT, 0, normalsBuffer);gl.glTexCoordPointer(2, GL10.GL_SHORT, 0, t.getvtBuffer());gl.glDrawElements(GL10.GL_TRIANGLES, t.getFacesCount(), GL10.GL_UNSIGNED_SHORT, t.getFaceBuffer());</code></pre><p>Output of the counts of the OBJ-file: </p><pre><code>Vertex-count: 1023Vns-count: 1752Vts-count: 524/////////////////////////Part 0Material name:defaultNumber of faces:2037Number of vnPointers:2037Number of vtPointers:2037</code></pre><p>Any advise is welcome. </p>","470517","","998299","","2011-12-03 00:23:02","2011-12-03 00:23:02","How to setup/calculate texturebuffer in glTexCoordPointer when importing from OBJ-file","<android><opengl-es><3d><.obj>","1","0","2","",""
"4233200","1","","","2010-11-20 14:32:12","1","1162","<p>I have an app that sends SMS via Internet, and I'd like to know how to:</p><p>1)Launch my own ""SmsSender"" activity when user have <strong>already</strong> typed an sms in <strong>default</strong> android sms application, and presses <strong>Send</strong> button.I would like to get recipient number and message text.</p><p>2)or Launch my app when user tries to send sms from his adress book-I'll provide him interface for typing message.</p><p>I don't wish launching it when user selects a contact in default sms application if he won't see the conversation; I'd like to keep default messaging application working.</p><p>I've tried such code but nothing :-(</p><pre><code>&lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.SENDTO"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;            &lt;data android:scheme=""sms"" /&gt;            &lt;data android:scheme=""smsto"" /&gt;&lt;/intent-filter&gt;</code></pre><p>Also I'd like to know if I can integrate my app with Handset SMS.</p><hr><p>P.S. Sorry for my english, I'm Russian.Thanks.</p>","514506","","","","","2011-03-16 09:23:06","Making alternative SMS sender default in Android","<android><sms><android-intent>","1","0","","",""
"4233216","1","7761695","","2010-11-20 14:36:03","0","620","<p>I added the application into Android market, but some phones(i think with android lower than Froyo(2.2)) does not find it!</p><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""    android:installLocation=""preferExternal""    package=""com.skkap.utimetable""    android:versionCode=""2""    android:versionName=""1.1""&gt;&lt;application android:icon=""@drawable/icon"" android:theme=""@android:style/Theme.NoTitleBar"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".timetable""                  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:label=""Preferences"" android:name=""Preferences"" android:configChanges=""keyboardHidden|orientation""&gt;&lt;/activity&gt;        &lt;activity android:name="".edit_dialog"" android:label=""@string/app_name"" android:configChanges=""keyboardHidden|orientation""&gt;&lt;/activity&gt;        &lt;activity android:name="".add_dialog"" android:label=""@string/app_name"" android:configChanges=""keyboardHidden|orientation""&gt;&lt;/activity&gt;        &lt;activity android:name="".move_dialog"" android:label=""@string/app_name"" android:configChanges=""keyboardHidden|orientation""&gt;&lt;/activity&gt;         &lt;activity android:name="".copy_dialog"" android:label=""@string/app_name"" android:configChanges=""keyboardHidden|orientation""&gt;&lt;/activity&gt;         &lt;activity android:name="".export_to_calendar_dialog"" android:label=""@string/app_name"" android:configChanges=""keyboardHidden|orientation""&gt;&lt;/activity&gt;        &lt;activity android:name="".export_to_csv_dialog"" android:label=""@string/app_name"" android:configChanges=""keyboardHidden|orientation""&gt;&lt;/activity&gt;        &lt;activity android:name="".import_from_tpu_dialog"" android:label=""@string/app_name"" android:configChanges=""keyboardHidden|orientation""&gt;&lt;/activity&gt;                &lt;activity android:name="".import_from_csv_dialog"" android:label=""@string/app_name"" android:configChanges=""keyboardHidden|orientation""&gt;&lt;/activity&gt;    &lt;/application&gt;&lt;uses-permission android:name=""android.permission.READ_CALENDAR""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.WRITE_CALENDAR""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""&gt;&lt;/uses-permission&gt;&lt;uses-sdk android:minSdkVersion=""4"" android:targetSdkVersion=""8""&gt;&lt;/uses-sdk&gt;&lt;supports-screens          android:normalScreens=""true""          android:smallScreens=""true""          android:largeScreens=""true""          android:anyDensity=""true"" /&gt;&lt;/manifest&gt; </code></pre><p>If you can try in on your android - app.name: uTimetable</p><p>What I have to do for fix it?</p>","499393","","124538","","2010-11-20 19:51:38","2011-10-13 23:45:29","Android market does not find application on some devices","<android><android-manifest><google-play>","2","2","","",""
"4233232","1","4233256","","2010-11-20 14:38:45","0","1379","<p>I have written a simple database driven app in C# which uses a 2 table MySQL database. This is all a learning curve for me (except c#, which I am now comfortable with)</p><p>The app is small, has a couple of datagridviews, uses a few sql select/inserts statments to populate the datagridviews and also update records.</p><p>I want to port this app to Android. All of the internet sources I can find recommend  a middle php sript which accepts http requests in order to fetch the data from MySQL and then return the results back to the android device where it is parsed with JSON etc etc.</p><p>This method is a little out of my reach since I dont have php experience, all of my attempts to implement the php layer have failed, speciially the android app was not receiving any data back, I'm assuming I messed up somewhere inside the php file.</p><p>Is there an easier (more noobproof) way to interact with the MySQL database from within android which doesnt require the need for php + JSON? Any ideas are appreciated, thank you in advance.</p>","377613","","","","","2011-06-25 10:37:13","Android MySQL php+JSON alternative","<sql><mysql><android><database>","4","0","","",""
"4233331","1","","","2010-11-20 15:01:56","0","902","<pre><code>public class CustomDialog extends Dialog {    public  int result = -1;        public CustomDialog(Context context, int theme) {        super(context, theme);        RadioGroup radioGroup = (RadioGroup) findViewById(R.id.rdbGp1);        radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener()         {            public void onCheckedChanged(RadioGroup arg0, int arg1)             {                result = arg1;                Log.i(""Dialog"", ""Result=""+result);                cancel();            }        });    }    public CustomDialog(Context context) {        super(context);    }    /**     * Helper class for creating a custom dialog     */    public static class Builder {        private Context context;        private String title;        private String message;        private String positiveButtonText;        private String negativeButtonText;        private View contentView;        private DialogInterface.OnClickListener                         positiveButtonClickListener,                        negativeButtonClickListener;        public Builder(Context context) {            this.context = context;        }        /**         * Set the Dialog message from String         * @param title         * @return         */        public Builder setMessage(String message) {            this.message = message;            return this;        }        /**         * Set the Dialog message from resource         * @param title         * @return         */        public Builder setMessage(int message) {            this.message = (String) context.getText(message);            return this;        }        /**         * Set the Dialog title from resource         * @param title         * @return         */        public Builder setTitle(int title) {            this.title = (String) context.getText(title);            return this;        }        /**         * Set the Dialog title from String         * @param title         * @return         */        public Builder setTitle(String title) {            this.title = title;            return this;        }        /**         * Set a custom content view for the Dialog.         * If a message is set, the contentView is not         * added to the Dialog...         * @param v         * @return         */        public Builder setContentView(View v) {            this.contentView = v;            return this;        }        /**         * Set the positive button resource and it's listener         * @param positiveButtonText         * @param listener         * @return         */        public Builder setPositiveButton(int positiveButtonText,                DialogInterface.OnClickListener listener) {            this.positiveButtonText = (String) context                    .getText(positiveButtonText);            this.positiveButtonClickListener = listener;            return this;        }        /**         * Set the positive button text and it's listener         * @param positiveButtonText         * @param listener         * @return         */        public Builder setPositiveButton(String positiveButtonText,                DialogInterface.OnClickListener listener) {            this.positiveButtonText = positiveButtonText;            this.positiveButtonClickListener = listener;            return this;        }        /**         * Set the negative button resource and it's listener         * @param negativeButtonText         * @param listener         * @return         */        public Builder setNegativeButton(int negativeButtonText,                DialogInterface.OnClickListener listener) {            this.negativeButtonText = (String) context                    .getText(negativeButtonText);            this.negativeButtonClickListener = listener;            return this;        }        /**         * Set the negative button text and it's listener         * @param negativeButtonText         * @param listener         * @return         */        public Builder setNegativeButton(String negativeButtonText,                DialogInterface.OnClickListener listener) {            this.negativeButtonText = negativeButtonText;            this.negativeButtonClickListener = listener;            return this;        }        /**         * Create the custom dialog         */        public CustomDialog create() {            LayoutInflater inflater = (LayoutInflater) context                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);            // instantiate the dialog with the custom Theme            final CustomDialog dialog = new CustomDialog(context,                     R.style.Dialog);            dialog.setOnCancelListener(new OnCancelListener()         {        public void onCancel(DialogInterface arg0)         {            Log.i(""FooDialog"", ""Result=""+dialog.result);        }        });            View layout = inflater.inflate(R.layout.credits, null);            dialog.addContentView(layout, new LayoutParams(                    LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));            // set the dialog title            ((TextView) layout.findViewById(R.id.title)).setText(title);            // set the confirm button            if (positiveButtonText != null) {                ((Button) layout.findViewById(R.id.positiveButton))                        .setText(positiveButtonText);                if (positiveButtonClickListener != null) {                    ((Button) layout.findViewById(R.id.positiveButton))                            .setOnClickListener(new View.OnClickListener() {                                public void onClick(View v) {                                    positiveButtonClickListener.onClick(                                            dialog,                                             DialogInterface.BUTTON_POSITIVE);                                }                            });                }            } else {                // if no confirm button just set the visibility to GONE                layout.findViewById(R.id.positiveButton).setVisibility(                        View.GONE);            }            // set the cancel button            if (negativeButtonText != null) {                ((Button) layout.findViewById(R.id.negativeButton))                        .setText(negativeButtonText);                if (negativeButtonClickListener != null) {                    ((Button) layout.findViewById(R.id.negativeButton))                            .setOnClickListener(new View.OnClickListener() {                                public void onClick(View v) {                                    negativeButtonClickListener.onClick(                                            dialog,                                             DialogInterface.BUTTON_NEGATIVE);                                }                            });                }            } else {                // if no confirm button just set the visibility to GONE                layout.findViewById(R.id.negativeButton).setVisibility(                        View.GONE);            }            // set the content message            if (contentView != null) {                // if no message set                // add the contentView to the dialog body                ((LinearLayout) layout.findViewById(R.id.content))                        .removeAllViews();                ((LinearLayout) layout.findViewById(R.id.content))                        .addView(contentView,                                 new LayoutParams(                                        LayoutParams.WRAP_CONTENT,                                         LayoutParams.WRAP_CONTENT));            }            dialog.setContentView(layout);            return dialog;        }    }}</code></pre><p>Hello i am building android app and i am trying to return selected <code>RadioButton</code> id from the custom dialog to the main acivity but the app force closes on this line <code>radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener()</code></p><p>Can somebody give some hints thank you</p>","514521","","418183","","2010-11-20 16:27:06","2010-11-20 18:26:44","Pass value from CustomDialog to the main Activity","<android>","1","0","","",""
"4233339","1","4266560","","2010-11-20 15:04:46","1","2075","<p>In short I am unable to access all the pixels of a bitmap image.</p><p>I have used an intent to fire the native Camera app and returned a Bitmap image to my application activity. The data is definitely a bitmap object and I am able to display, get the height/width etc and access some pixels using getPixel(). However when I use the values of getHeight() and getWidth() I get an array out of bounds error. By trail and error I have found I can only access a reduced number of pixels of the image, for example with one image which returned a height and width value of 420,380, I could also access 200,100. I then do some image processing and used setPixel() on the original image. When I display the image it shows the, say 200,100, processing pixels and the rest normal, therefore the pixels are obviously there and accessible by android but not by me. I have to spoken to other people who have also had this problem with images. </p><p>Does anyone know anything more about this, reasons? or a work around?</p><p>Many thanks in advance.</p><p>It seems that there's no way around this, does anyone think it would be better/possible to access the image directly in memory maybe using the NDK?</p>","514531","","514531","","2010-12-19 15:26:02","2014-03-14 13:32:56","SOLVED. How to access pixels of a Bitmap image on Android?","<android><image><pixel>","2","0","1","",""
"4233350","1","4259691","","2010-11-20 15:06:24","6","20419","<p>Greetings,</p><p>I'm developing an Android app and need to open a url (with POST parameters) over https and get the response.</p><p>There's the added complication that I have a self-signed certificate. I also need to accept cookies.</p><p>Anyone have any ideas about where to get started?</p><p>Many thanks in advance,</p>","395974","","395974","","2010-11-20 15:35:57","2010-11-23 18:58:07","Android: Get response from a https url","<android><post><https>","3","0","0","",""
"4233404","1","","","2010-11-20 15:14:56","0","217","<p>I jave a list of item (linearlayout inside a scrollview where i add buttons vertically to linearlayout dynamically from the java code  ) ? i need when i click on one button the item moves up (scroll up) , to make the item at the first of the screen ??!</p>","508377","","508377","","2010-11-20 15:32:51","2010-11-20 15:41:22","how to scroll up when choose some item at item list in android?","<android><scroll>","1","2","","",""
"4233451","1","4233559","","2010-11-20 15:25:08","1","1796","<p>I am in a desperate situation.  </p><p>I am developing an Android application using the ADT in Eclipse on Ubuntu 10.04 on a netbook.</p><p>Unfortunately the netbook is not powerful enough to run the Device Emulator (when I try there are always issues). Then, I tried to debug on-device, but unfortunately my phone (Pulse) seems to have some problem.</p><p>It seems I can't debug. I have already spent hours trying to get that working. And I can't afford to upgrade my netbook/mobile now.</p><p>The only thing I can do is developing on Eclipse and run the application on the phone.<br>Is there any way I can debug while the application is running on my phone? Can I create somewhere a log with errors/warnings and even some custom messages I put in the code?</p><p>What a situation.</p><p>Any help would be appreciated.</p><p>Thanks,<br>Dan</p>","354742","","","","","2012-01-31 06:00:23","Debug Android application on device without debugger","<android><debugging>","4","2","","",""
"4233461","1","4306183","","2010-11-20 15:28:31","6","5595","<p>Basically I have a working application that sends an SMS after receiving an SMS.</p><p><strong>Everything works fine</strong>, except when the SMS text <strong>to send</strong> has ""special chars"", ie ""é,à,í,ç"", etc.</p><p>I've tried many things including charset conversion but I simply can't make it work... the msgText always comes back with charset encoding problems.</p><p>Here's the part where the message is sent:</p><pre><code>if (msgText.length() > 160) {    ArrayList msgTexts = sm.divideMessage(msgText);    sm.sendMultipartTextMessage(PhoneNumber, null, msgTexts, null, null);} else {    try {        sm.sendTextMessage(PhoneNumber, null, msgText, null, null);    } catch (IllegalArgumentException e) {        e.printStackTrace();    }}</code></pre><p>Here's the charset conversion function I tried (but didn't help), that I applied on msgText:</p><pre><code>public static String formatCharset(String txtInicial) {    //-- Please notice this is just for reference, I tried every charset from/to conversion possibility. Even stupid ones and nothing helped.    /*try {//-- Seems simpler, it should do the same as below, but didn't help        msgText = new String(msgText.getBytes(""UTF-8""), ""ISO-8859-1"");        } catch (UnsupportedEncodingException e) {            e.printStackTrace();    }*/    Charset charsetOrigem = Charset.forName(""UTF-8"");    CharsetEncoder encoderOrigem = charsetOrigem.newEncoder();    Charset charsetDestino = Charset.forName(""ISO-8859-1"");    CharsetDecoder decoderDestino = charsetDestino.newDecoder();    String txtFinal = """";    try {        ByteBuffer bbuf = encoderOrigem.encode(CharBuffer.wrap( txtInicial ));        CharBuffer cbuf = decoderDestino.decode(bbuf);        txtFinal = cbuf.toString();    } catch (CharacterCodingException e) {        e.printStackTrace();    }    if (txtFinal.length() == 0) txtFinal = txtInicial;    return txtFinal;}</code></pre><p>Near desperation I even tried the solution for unicode messaging in here (didn't help as well):</p><p><a href=""http://since2006.com/blog/android-send-unicode-message/"">http://since2006.com/blog/android-send-unicode-message/</a></p><p>Anyway, here's the (cleaned up - package is com.THE.APPLICATION, main activity is MAINACT) LogCat for when it crashes (when trying to send the message, after receiving one):</p><pre>WARN/dalvikvm(28218): threadid=1: thread exiting with uncaught exception (group=0x4001d7f0)ERROR/AndroidRuntime(28218): FATAL EXCEPTION: mainERROR/AndroidRuntime(28218): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.provider.Telephony.SMS_RECEIVED (has extras) } in com.THE.APPLICATION.SMSReceiver@44acd880ERROR/AndroidRuntime(28218):     at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:905)ERROR/AndroidRuntime(28218):     at android.os.Handler.handleCallback(Handler.java:587)ERROR/AndroidRuntime(28218):     at android.os.Handler.dispatchMessage(Handler.java:92)ERROR/AndroidRuntime(28218):     at android.os.Looper.loop(Looper.java:123)ERROR/AndroidRuntime(28218):     at android.app.ActivityThread.main(ActivityThread.java:4627)ERROR/AndroidRuntime(28218):     at java.lang.reflect.Method.invokeNative(Native Method)ERROR/AndroidRuntime(28218):     at java.lang.reflect.Method.invoke(Method.java:521)ERROR/AndroidRuntime(28218):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)ERROR/AndroidRuntime(28218):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)ERROR/AndroidRuntime(28218):     at dalvik.system.NativeStart.main(Native Method)ERROR/AndroidRuntime(28218): Caused by: java.lang.NullPointerExceptionERROR/AndroidRuntime(28218):     at android.os.Parcel.readException(Parcel.java:1253)ERROR/AndroidRuntime(28218):     at android.os.Parcel.readException(Parcel.java:1235)ERROR/AndroidRuntime(28218):     at com.android.internal.telephony.ISms$Stub$Proxy.sendText(ISms.java:369)ERROR/AndroidRuntime(28218):     at android.telephony.SmsManager.sendTextMessage(SmsManager.java:87)ERROR/AndroidRuntime(28218):     at com.THE.APPLICATION.MAINACT.sendMessage(MAINACT.java:214)ERROR/AndroidRuntime(28218):     at com.THE.APPLICATION.SMSReceiver.onReceive(SMSReceiver.java:24)ERROR/AndroidRuntime(28218):     at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:892)ERROR/AndroidRuntime(28218):     ... 9 more</pre><p>Sample of message text to send with issues:</p><pre>VERBOSE/debug_tag(28218): msgText is: possÃ­vel.</pre><p>So, it <em>reads</em> <strong>possÃ­vel</strong> when it should <em>be</em> <strong>possível</strong></p><p>Please some enlightened soul help me out. He/She'll have a special place in my heart! :)</p><p>Edit: If the special place in my heart doesn't cut it, I'm willing to pay a few bucks for a working solution...</p>","404541","","404541","","2010-11-23 16:52:52","2011-03-01 16:06:35","Android: Unicode/Charset problems when sending an SMS (sendTextMessage)","<android><sms><special-characters><character-encoding>","3","0","5","",""
"4233480","1","4233583","","2010-11-20 15:31:50","1","696","<p>Flush with success on getting ""hello Android"" to run, I'm working on the tutorial at <a href=""http://developer.android.com/resources/tutorials/views/hello-formstuff.html#CustomButton"" rel=""nofollow"">link text</a> using Eclipse. When I create the android_button.xml file in res/drawable/, I get errors for each of the  in </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>The errors (repeated for each item) are:</p><pre><code>Description Resource    Location    Type    Patherror: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/android_focused'). android_button.xml  line 5  Android AAPT Problem    /HelloFormStuff/res/drawableerror: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/android_focused'). android_button.xml  line 5  Android AAPT Problem    /HelloFormStuff/res/drawable</code></pre><p>I'm afraid I don't know which resource should match the names or if I have overlooked something or misnamed something. Help resolving this is greatly appreciated!</p>","79178","","418183","","2010-11-20 16:35:02","2010-11-20 16:35:02","Hello Views/Form Stuff/Custon Button tutorial error","<android>","2","0","","",""
"4233518","1","4233580","","2010-11-20 15:39:08","-1","192","<p>the app crash if enable <code>text =cursor.getString(cursor.getColumnIndexOrThrow(KEY_BODY));</code></p><pre><code>public String getPhone(long rowId){        SQLiteDatabase cb = mDbHelper.getReadableDatabase();        String text = null ;        Cursor cursor=cb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE,                KEY_BODY,KEY_EMAIL},KEY_ROWID + "" = ?""+rowId, null, null, null,null);    //text = cursor.getString(cursor.getColumnIndexOrThrow(KEY_BODY));                return text;}</code></pre>","510992","","418183","","2010-11-20 16:36:09","2010-11-20 16:36:09","query in android","<android><sqlite>","1","2","","",""
"4233612","1","","","2010-11-20 16:00:57","9","5668","<p>I'm currently creating a side-scroller style game for my final year project for my degree.</p><p>I'm just wondering how you make the menu designed for when the phone is in horizontal orientation display, even when the phone is held in it's vertical orientation?</p><p>i.e. I want the user to know that the game has to be played with the phone in it's horizontal orientation and want the menu's to only display in the horizontal orientation.</p><p>Many thanks in advance.</p>","514568","","","","","2010-11-20 16:11:58","How do you create an app that only allows horizontal orientation?","<android><android-layout><tablelayout>","2","0","1","",""
"4233617","1","4244743","","2010-11-20 16:02:52","0","344","<p>i got a kind of weird issue with my HTC desire.</p><p>I currently test some opengl things using the accelerometer and geomagnetic sensors.</p><p>it seem that the two of them return sometimes (quite a few) the exact same values .</p><p>i got this on my onSensorChanged()</p><pre><code>    if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {        gravity = event.values;    }     if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {        geomagnetic = event.values;    }</code></pre><p>and i don't know why but when i unplug the usb (to computer) it's gettin worse , (i use thoses values to rotate a camera around an object like sky map, and when i unplug , it's look like the values are correct about 1 one time per 2 seconds ~).</p><p>and sometimes (with usb plugged in AND looking at the logcat) it work juste fine and never get the same values from the two sensors.</p><p>it's not my device , other program like sky map runs fine , but i don't get what i'm doing wrong.i never mixed up the two arrays gravity and geomagnetic , they juste global and used with SensorManager.getRotationMatrix(R,gravity,geomagnetic).</p><p>i'm wondering if i just don't get values too fast , but even if i define SENSOR_DELAY_UI in the listener , it's the same story.</p>","2556147","","2556147","","2010-11-22 09:13:57","2010-11-22 11:04:18","Android sensor issues when unplug usb","<android><accelerometer><sensor>","1","0","","",""
"4233626","1","4233683","","2010-11-20 16:03:37","64","48173","<p>How to allow multi-line in Android's <code>EditText</code> view?</p>","508377","","2390083","","2013-11-04 13:59:51","2014-02-05 15:46:11","Allow multi-line in EditText view in Android?","<android><text><multiline>","6","1","14","",""
"4233727","1","4233799","","2010-11-20 16:30:47","2","5947","<p>I am trying to get a Spinner to work in Android. It displays fine and I can select any one of the options in the list. But how do I transfer that to a string?I would have thought in the code below that 'selected' would hold the selected string, but I get an 'Illegal modifier for the local class YourItemSelectedListener; only abstract or final is permitted' error on the 'YourItemSelectedListener'.What am I doing wrong?Many thanks for any help.</p><pre><code>Spinner spinnerFPS = (Spinner) findViewById(R.id.sp_FPS);        ArrayAdapter adapter = ArrayAdapter.createFromResource(                this, R.array.framesps, android.R.layout.simple_spinner_item);        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        spinnerFPS.setAdapter(adapter);        spinnerFPS.setOnItemSelectedListener(new YourItemSelectedListener());        public class YourItemSelectedListener implements OnItemSelectedListener {            public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {                String selected = parent.getItemAtPosition(pos).toString();            }            public void onNothingSelected(AdapterView parent) {                // Do nothing.            }        }</code></pre>","497517","","","","","2012-04-16 12:32:37","Using Spinner selection as a value in Android","<android><spinner>","2","0","","",""
"4233873","1","4233898","","2010-11-20 16:59:59","183","167458","<p>How can I send data from one activity (intent) to another?</p><p>I use this code to send data:</p><pre><code>Intent i=new Intent(context,SendMessage.class);i.putExtra(""id"", user.getUserAccountId()+"""");i.putExtra(""name"", user.getUserFullName());context.startActivity(i);</code></pre>","508377","","177634","","2011-08-08 10:10:28","2013-07-29 02:58:55","How to get extra data from intent in android?","<android><android-intent>","6","1","38","",""
"4233907","1","","","2010-11-20 17:05:46","0","438","<p>I need to block (no input, no go on) the execution of an Activity until I have the GPS coordinate. How can I do?Thanks.</p>","514482","","21234","","2010-11-20 17:12:51","2010-11-21 19:18:39","Android: How block execution of activity until locationupdate()?","<android><activity><gps>","1","0","","",""
"4233961","1","4234000","","2010-11-20 17:15:56","0","362","<p>How to display the text of a textfield in a url section in android?Here is the code</p><pre><code>final Text q = (Text) findViewById(R.id.q);   Intent i = new Intent(""android.intent.action.VIEW"", Uri.parse(""http://www.google.com/search?q=""));   startActivity(i);</code></pre><p>i want to use as query this <code>(Text) findViewById(R.id.q);</code> . How??</p>","514611","","418183","","2010-11-20 17:25:51","2010-11-20 17:25:51","How to display the text of an EditText in a url section in android?","<java><android><android-intent>","2","0","","",""
"4233978","1","4233994","","2010-11-20 17:20:25","1","233","<p>i am developing checkers application for Android. I have drawn on Canvas gameboard and tiles for each side, also I have made selection of tiles by D-Pad. But what about, Android phone doesn't have D-Pad? There must be a way how to do that in touch (I touch a tile - it is selected now). Do you have any ideas?</p><p>Thanks</p><p>image of my Gameboard can be found here - <a href=""http://img171.imageshack.us/img171/7814/checkers.gif"" rel=""nofollow"">http://img171.imageshack.us/img171/7814/checkers.gif</a></p>","513956","","3043","","2012-04-30 13:34:30","2012-04-30 13:34:30","Android - selecting tile in gameboard by touch?","<android><selection>","2","0","","",""
"4234021","1","4234169","","2010-11-20 17:29:35","0","200","<p>As a part of our CS grad project, we are developing an android application that receives push recommendations from our server based on geolocation logic &amp; social-networking APIs.We still have lots to learn &amp; following are the choices we have made:</p><ol><li>Poll for recommendations as normal HTTP requests</li><li>Push the data in XML formatting</li><li>Serve using Java Servlets in Tomcat</li><li>Keep the application logic separate from the servicing layer for adding other kinds of client access later. Maybe by calling separate Java classes from the Servlet Classes.</li><li>MySQL</li><li>Our java code shall also interact with the Facebook API to start with and some Map APIs<br>(All this sounds scary as of now!)</li></ol><p>Could you please comment/differ on our choices? We would love to give back to the community as we learn ahead.</p>","446940","","418183","","2010-11-20 17:54:13","2010-11-20 18:09:37","Help with back-end choices for a mobile application","<java><android><web-services><servlets><push>","1","0","","",""
"4234030","1","4234804","","2010-11-20 17:31:35","9","4340","<p>My app uses two databases (separate files). To handle these databases I have created two Helper classes which extend SQLiteOpenHelper, one for each database.</p><p>I am now going to add a third database and wonder whether I need to create yet another Helper class (and if I used a 4th and a 5th database would I need even more Helper classes), or can I use the same Helper class for multiple databases?</p><p>The problem that I see with trying to use just one Helper class is that I can't see how to pass the name of the individual database files to the Helper. At present the name of the database is hard-coded as a Static field of each of the Helper classes, but if I had only one Helper class I would need to be able to pass the different names in to the Constructor when creating the separate Helper objects; the problem is that the SQLiteOpenHelper Constructor seems to be called by Android with just one parameter: the Context.</p>","250845","","","","","2010-11-20 20:16:23","Android: can I use one SQLiteOpenHelper class for multiple database files?","<android><database><sqlite><class-design>","2","1","4","",""
"4234051","1","4234219","","2010-11-20 17:36:59","0","293","<p>I am monitoring every 20 minutes my AdMob account (user AdMob API).It appears that there is (roughly speaking) the same number of ad requests every day. But my app is business oriented and mostly used on week days. Connections to the ""business"" server drops on week-ends by 80%.</p><p>So, I am wondering if the AdMob manager isn't sending requests even if the app (Android) is in background mode. By background mode I mean when the user press ""Home"" or ""Back"" button on his Android phone and then gets back to the ""desktop"".</p><p>I haven't find any information on background mode and AdMob integration (what we should do in such case).</p><p>Have you ever noticed such behavior? Do you know if (and how) the app needs to disable AdMob when going to background mode?</p>","446576","","","","","2010-11-20 18:15:05","AdMob: background requests?","<android><background><admob>","1","0","","",""
"4234156","1","4256825","","2010-11-20 18:01:29","4","13857","<p>How can I disable the keyguard when a broadcast receiver is activated by screen_on, so that when it occurs the user sees an activity that I have started behind it?  (The activity is running already...) </p><p>I have been trying the following code from a broadcast receiver triggered by screen off...</p><pre><code>KeyguardManager  myKeyGuard = (KeyguardManager)getSystemService(Context.KEYGUARD_SERVICE);myLock = myKeyGuard.newKeyguardLock();myLock.disableKeyguard();</code></pre><p>It doesn't seem to be working though as it is.  When I turn the screen on, I still have to manually unlock the keyguard on the phone to reveal the activity behind it.</p>","513939","","12223","","2012-03-23 05:57:07","2014-03-28 00:31:33","How to Disable Keyguard and display an activity to the user when receiver of SCREEN_ON is triggered?","<android><keyguard>","3","2","6","",""
"4234185","1","4234236","","2010-11-20 18:06:55","1","344","<p>I want my row items to look like this:<img src=""http://i.stack.imgur.com/2rwEQ.png"" alt=""alt text""></p><p>I want to have an image on the left, top and bottom text and a date. I have started to lay it out, but am not sure how to proceed with the rest of the XML:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout01"" xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""wrap_content""      android:layout_height=""wrap_content""&gt;     &lt;ImageView         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_alignParentTop=""true""        android:layout_alignParentLeft=""true""        android:id=""@+id/avatarImageView""&gt;     &lt;/ImageView&gt;    &lt;TextView         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:id=""@+id/usernameTextView""         android:text=""username""         android:layout_toRightOf=""@+id/avatarImageView""        android:layout_alignParentTop=""true""&gt;    &lt;/TextView&gt;    &lt;TextView         android:id=""@+id/bodyTextView""         android:layout_below=""@+id/usernameTextView""         android:layout_toRightOf=""@+id/avatarImageView""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:text=""body""&gt;    &lt;/TextView&gt;    &lt;TextView         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_toRightOf=""@+id/usernameTextView""         android:id=""@+id/dateTextView""         android:text=""date""&gt;    &lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre>","19875","","19875","","2010-11-20 19:53:06","2010-11-20 19:53:06","How can I make my ListViewItem look like the Twitter app?","<java><android><listview><twitter><android-layout>","1","0","1","",""
"4234187","1","4234708","","2010-11-20 18:06:58","0","369","<p>Well.. what I'm trying to do here is implement something like a peer-to-peer client. Being that, it will start a client thread and a server thread.</p><p>I know Services themselves run in the main GUI thread, so I'll have to start a couple of independent threads (or Asynctasks?) for each server and client. The only thing I'm not so sure about is if I'll better have 1 Service starting 2 threads, or maybe 2 services, each one of them starting their own thread.</p><p>What do you think? which way is better perfomance-wise? or is it irrelevant?</p><p>ThanksNelson</p>","274434","","","","","2010-11-20 19:59:10","Two threads and 1 service, or a service per thread?","<android><performance><service><android-asynctask>","2","0","","",""
"4234190","1","","","2010-11-20 18:08:44","1","2710","<p>Some of my apps do not appear in the Android Market when viewed from the Samsung Galaxy Tab.</p><p>I've noticed this is happening to many other apps from other devs as well. If I compare the ""Just in"" for a category in the Market on a Nexus One to the Galaxy Tab, there are a lot more apps appearing on the Nexus One. So I don't think this is an issue specific to my apps.</p><p>What's strange is that I can't figure out what is different between my apps that do, and do not, appear. For instance, in my Android manifest for an app that does appear, I have this:</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;!-- Prevent shoeboxing on Tab --&gt;&lt;supports-screens android:largeScreens=""true"" /&gt;</code></pre><p>which shows the app in the Android Market, and the app displays full-screen on the Tab.</p><p>But for several of my other apps, with the same settings, I can't browse or search to find the apps listed in the Market. It's as if they simply are not in the Market.</p><p>FYI, I can run the apps fine on the Galaxy Tab AVD emulator. I've also tried min SDK of 4.</p><p>Thanks!!</p>","514632","","","","","2011-12-13 23:08:58","Apps not appearing in the Android Market on the Samsung Galaxy Tab","<android><google-play><galaxy>","3","3","","",""
"4234267","1","4234296","","2010-11-20 18:24:45","3","888","<p>I am relatively new to Java (well, might as well be new, it's been about 10 years) and Android programming.  I have built an app with a main activity and two ""sub"" activities that are activated using two buttons on the main activity window.</p><p>Everything is working fine.  However, when I install the application on my phone, there are icons for the main activity/class and each of the two ""sub"" activities/classes in the applications list on the phone.</p><p>This, I believe is a failing of my Java knowledge but do I hide activities that are called via the user interface and have them reside under only the main application icon so that it is the sole entry point into the app?</p><p>The classes are all designated like:</p><p>public class  extends Activity {</p><p>Is there a ""private class  extends Activity {"" or something like it that will allow use by the main activity but not show it for app users?</p>","514647","","","","","2012-08-27 15:40:55","Why Do All Activities/Classes Show Up in the Application List When I Install?","<android>","1","1","","",""
"4234333","1","4238013","","2010-11-20 18:39:12","0","371","<p>How do i do a if statement but i want like: </p><pre><code>else if not edittext.getText.toString.contains(""hello"") then doCode.</code></pre><p>and how do i setfocus on a component and remove the focus can not really figure that out.</p>","502419","","114066","","2010-11-21 16:30:09","2010-11-21 22:43:06","Android Development: if not and focus","<android>","2","1","","",""
"4234334","1","","","2010-11-20 18:39:25","0","13620","<p>I've got a menu activity and a game activity which is launched from the menu.Some (most) of the times I launch the game activity; all input hangs for a few (up to 10-ish) seconds and then plays out in hyperspeed while i get this in logcat:</p><pre><code>11-20 18:24:27.873: WARN/WindowManager(2473): Key dispatching timed out sending to southgrove.game/southgrove.game.Game11-20 18:24:27.873: WARN/WindowManager(2473): Previous dispatch state: {{KeyEvent{action=1 code=4 repeat=0 meta=0 scancode=28 mFlags=8} to Window{4866c7a0 southgrove.game/southgrove.game.Game paused=false} @ 1290273811209 lw=Window{4866c7a0 southgrove.game/southgrove.game.Game paused=false} lb=android.os.BinderProxy@484e8a58 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4866c7a0 southgrove.game/southgrove.game.Game paused=false}}}11-20 18:24:27.873: WARN/WindowManager(2473): Current dispatch state: {{null to Window{4833d500 southgrove.game/southgrove.game.Game paused=false} @ 1290273867876 lw=Window{4833d500 southgrove.game/southgrove.game.Game paused=false} lb=android.os.BinderProxy@485487b0 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4833d500 southgrove.game/southgrove.game.Game paused=false}}}</code></pre><p>The menu activity:</p><pre><code>package southgrove.game;import southgrove.game.R;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.KeyEvent;import android.view.View;import android.view.View.OnClickListener;public class Menu extends Activity{@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.menu);    View playButton = findViewById(R.id.play);    playButton.setOnClickListener(new OnClickListener()    {        public void onClick(View view)        {            startActivityForResult(new Intent(Menu.this, Game.class), 0);        }    });    View testButton = findViewById(R.id.test);    testButton.setOnClickListener(new OnClickListener()    {        public void onClick(View view)        {            startActivityForResult(new Intent(Menu.this, Test.class), 0);        }    });    View closeButton = findViewById(R.id.close);    closeButton.setOnClickListener(new OnClickListener()    {        public void onClick(View view)        {            showDialog(QUIT_DIALOG);        }    });}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event){    if (keyCode == KeyEvent.KEYCODE_BACK)    {        showDialog(QUIT_DIALOG);    }    return super.onKeyDown(keyCode, event);}@Overrideprotected Dialog onCreateDialog(int id){    Dialog dialog;    switch (id)    {        case QUIT_DIALOG:            AlertDialog.Builder quitDialogBuilder = new AlertDialog.Builder(this);            quitDialogBuilder.setMessage(""Exit the game?"")                    .setCancelable(false)                    .setPositiveButton(""Yes"", new DialogInterface.OnClickListener()                    {                        public void onClick(DialogInterface dialog, int id)                        {                            Menu.this.finish();                        }                    })                    .setNegativeButton(""No"", new DialogInterface.OnClickListener()                    {                        public void onClick(DialogInterface dialog, int id)                        {                            dialog.cancel();                        }                    });            dialog = quitDialogBuilder.create();        break;        default:            dialog = null;    }    return dialog;}private final int   QUIT_DIALOG = 0;}</code></pre><p>The game activity:</p><pre><code>package southgrove.game;import southgrove.droidgl.DroidGL;import southgrove.droidgl.core.Camera;import southgrove.droidgl.core.Node;import southgrove.droidgl.core.RootNode;import southgrove.game.R;import southgrove.game.board.BoardBase;import southgrove.game.board.core.*;import southgrove.game.cameras.StupidCamera;import southgrove.input.OnTouchFilter;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.content.Context;import android.content.DialogInterface;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.os.Vibrator;import android.widget.TextView;public class Game extends Activity{@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.game);    // Get fpsTextView reference    fpsTextView = (TextView) findViewById(R.id.fpsTextView);    // Build meshes    TetrominoMesh.buildMeshes();    // Setup the DroidGL surface    droidgl = (DroidGL) findViewById(R.id.droidGL);    droidgl.setLongClickable(true);    droidgl.setOnTouchListener(new GameSurfaceOnTouchFilter(false));    // Create and add camera    final Camera camera = new StupidCamera();    camera.move(0, 0, 14);    droidgl.registerCamera(camera);    DroidGL.setActiveCamera(camera);    // Create and add root node    final Node rootNode = new RootNode();    droidgl.setRootNode(rootNode);    // Create and add game board    gameBoard = new GameBoard(droidgl, 32, 32, 8);    rootNode.addChild(gameBoard);    // start up updateHandler    updateHandler = new UpdateHandler();    updateHandler.sleep(1);    // get vibrator service    vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);}@Overridepublic void onBackPressed(){    showDialog(QUIT_DIALOG);}@Overrideprotected Dialog onCreateDialog(int id){    Dialog dialog;    switch (id)    {        case QUIT_DIALOG:            AlertDialog.Builder quitDialogBuilder = new AlertDialog.Builder(this);            quitDialogBuilder.setMessage(""Really quit?"")                    .setCancelable(false)                    .setPositiveButton(""Yup!"", new DialogInterface.OnClickListener()                    {                        public void onClick(DialogInterface dialog, int id)                        {                            Game.this.finish();                        }                    })                    .setNegativeButton(""Nope!"", new DialogInterface.OnClickListener()                    {                        public void onClick(DialogInterface dialog, int id)                        {                            dialog.cancel();                        }                    });            dialog = quitDialogBuilder.create();        break;        default:            dialog = null;    }    return dialog;}@Overrideprotected void onPause(){    super.onPause();    droidgl.onPause();}protected void onUpdate(){    fpsTextView.setText(""fps: "" + String.valueOf(droidgl.getFps()));    updateHandler.sleep(500);}@Overrideprotected void onResume(){    super.onResume();    droidgl.onResume();}private DroidGL         droidgl;private GameBoard       gameBoard;private TextView        fpsTextView;private Vibrator        vibrator;private UpdateHandler   updateHandler;private final int       QUIT_DIALOG = 0;private class UpdateHandler extends Handler{    @Override    public void handleMessage(Message msg)    {        Game.this.onUpdate();    }    public void sleep(long delayMillis)    {        this.removeMessages(0);        if (!Game.this.isFinishing())            sendMessageDelayed(obtainMessage(0), delayMillis);    }}private class GameSurfaceOnTouchFilter extends OnTouchFilter{    public GameSurfaceOnTouchFilter(Boolean consumeEvent)    {        super(consumeEvent);    }    private float   flipDeltaX;    private float   flipDeltaY;    protected void doubleTap(float x, float y)    {        super.doubleTap(x, y);        synchronized (gameBoard)        {            if (gameBoard.dropCursorTetromino())            {                gameBoard.resetReactorTimer();                gameBoard.setCursorTetromino((int) (Tetromino.NUM_TYPES * Math.random() - 1), 0);                if (gameBoard.removeConnectedTetrominoes(3))                {                    gameBoard.startShockWave(0, 0, 10f, 0.35f);                    vibrator.vibrate(300);                } else                {                    vibrator.vibrate(50);                }            }        }    }    protected void down(int pointer, float x, float y)    {        super.down(pointer, x, y);        if (pointer == 0)        {        }        if (pointer == 1)        {            flipDeltaX = 0;            flipDeltaY = 0;        }    }    protected void up(int pointer, float x, float y)    {        super.up(pointer, x, y);        synchronized (gameBoard)        {        }    }    protected void move(int pointer, float x, float y, float dx, float dy)    {        super.move(pointer, x, y, dx, dy);        synchronized (gameBoard)        {            if (pointer == 0)            {                gameBoard.addInertia(-dx * 0.0045f, dy * 0.0045f);            }            if (pointer == 1)            {                flipDeltaX -= dx;                flipDeltaY += dy;                if (Math.abs(flipDeltaX) &gt; 45 || Math.abs(flipDeltaY) &gt; 45)                {                    vibrator.vibrate(50);                    if (Math.abs(flipDeltaX) &gt; Math.abs(flipDeltaY))                    {                        if (flipDeltaX &gt; 0)                        {                            gameBoard.rotateCursorTetromino(1);                        } else                        {                            gameBoard.rotateCursorTetromino(-1);                        }                    } else                    {                        if (flipDeltaY &gt; 0)                        {                            gameBoard.rotateCursorTetromino(1);                        } else                        {                            gameBoard.rotateCursorTetromino(-1);                        }                    }                    flipDeltaX = 0;                    flipDeltaY = 0;                }            }        }    }}private class GameBoard extends BoardBase{    public GameBoard(DroidGL droidGL, int width, int height, int depth)    {        super(droidGL, width, height, depth);    }    public void resetReactorTimer()    {        synchronized (this)        {            reactorTimer = 0;        }    }    public void startShockWave(int gridPosX, int gridPosY, float length, float magnitude)    {        synchronized (this)        {            for (int i = 0; i &lt; tetrominoes.size(); i++)            {                tetrominoes.get(i).bounce(                        (float) (Math.random() * 0.12f),                        (float) (Math.random() * magnitude)                        );            }        }    }    @Override    protected void onSetup()    {        synchronized (this)        {            setCursorTetromino((int) (Tetromino.NUM_TYPES * Math.random()), 0);            for (int i = 0; i &lt; 1024; i++)            {                addTetromino(                        (int) (Math.random() * Tetromino.NUM_TYPES),                        (int) (Math.random() * width / 2) * 2,                        (int) (Math.random() * height / 2) * 2,                        (int) (Math.random() * 2),                        (int) (Math.random() * 4));            }            removeConnectedTetrominoes(3);        }    }    @Override    protected void onLogic(float timeFactor)    {        synchronized (this)        {            if (shiftTimer &gt; shiftTime || tetrominoes.size() &lt; 15)            {                shiftTimer = 0;                shiftTime -= shiftTime / 5;                shiftUp();                for (int i = 0; i &lt; 256; i++)                {                    addTetromino(                            (int) (Math.random() * Tetromino.NUM_TYPES),                            (int) (Math.random() * width / 2) * 2,                            (int) (Math.random() * height / 2) * 2,                            0,// (int) (Math.random() * (depth - 1)),                            (int) (Math.random() * 4));                }            }            if (reactorTimer &gt; 1f)            {                reactorTimer = 0;                drop();                removeConnectedTetrominoes(3);            }            reactorTimer += timeFactor;            shiftTimer += timeFactor;        }    }    private float   shiftTime   = 60 * 5;    private float   reactorTimer;    private float   shiftTimer;}}</code></pre><p>What could be causing this? Any ideas/speculations are welcome. And yes, I know that's a pretty massive wall of code to sift through.</p>","514651","","","","","2011-07-27 22:40:44","Android; ""Key dispatching timed out ...""","<android><time><input><out>","2","1","1","",""
"4234343","1","","","2010-11-20 18:41:48","0","541","<p>I'm developing an Android application that has a list of items. What options do I have to make a background service to update that list from a webservice from time to time, asking first for the user permission?Can you provide code samples?</p><p>Thanks in advance!</p>","478025","","","","","2010-11-20 19:23:09","Android background service","<android><background-service>","1","1","","",""
"4234359","1","4234437","","2010-11-20 18:48:07","0","78","<p>I have the following code:</p><pre><code>FileOutputStream out = null;try {out = new FileOutputStream(""/sdcard/tmp/i.jpg"");b.compress(Bitmap.CompressFormat.JPEG, 90, out);Toast.makeText(getApplicationContext(), ""Succeded"", Toast.LENGTH_LONG).show();} catch (Exception e) { Toast.makeText(getApplicationContext(), ""Failed"", Toast.LENGTH_LONG).show();}Intent share = new Intent(Intent.ACTION_SEND);share.setType(""image/jpeg"");    share.putExtra(Intent.EXTRA_STREAM, Uri.parse(""/sdcard/tmp/i.jpg""));startActivity(Intent.createChooser(share, ""Share image""));</code></pre><p>When it is called it all works correctly. The file is saved and it pops up the chooser. but once you get to the activity you choose, they all pop up a message saying that I can't add that image. Except GMail, it works fine. So what on earth do I do to fix this?</p>","513064","","418183","","2010-11-20 18:54:57","2010-11-20 19:20:00","Image doesn't get recognized","<java><android><activity><jpeg><android-sdcard>","1","1","","",""
"4234393","1","4234500","","2010-11-20 18:55:52","0","2679","<p>I have a realtively complicated listview in my application, with data fetched from the internet and so on. What is the best practice to do to preload as much as possible of the ListView, such that it appears immediately on the screen?</p><p>For example, the standard SMS/MMS app of android shows a white screen with a spinning loader and ""Loading..."" before a conversation is shown. I can't really find this in the Android source code, but I guess this is an extra loading Activity doing some caching and handing over to the conversation Activity using finish(), so that no screen change animation is shown.</p><p>How can I preload or cache ListView items? Is it even possible to do that?</p><p>Thanks! Best regards, Jan Oliver</p>","169748","","","","","2010-11-20 19:20:12","Android: preloading list activity","<android><listview>","1","0","1","",""
"4234596","1","4234799","","2010-11-20 19:39:21","0","3735","<p>I've that in my Adapter :</p><pre><code>public View getView(int position, View convertView, ViewGroup parent)    {        ViewHolder holder;        if(convertView==null)           {            convertView = myInflater.inflate(R.layout.list, null);                      holder = new ViewHolder();            holder.text01 = (TextView) convertView.findViewById(R.id.Text01);             ((Button)convertView.findViewById(R.id.ListButonPlus)).setOnClickListener(this);            convertView.setTag(holder);        }else        {            holder = (ViewHolder) convertView.getTag();                 }               return convertView;        }</code></pre><p>And  that :</p><pre><code>public void onClick(View v) {    Toast.makeText(v.getContext(), ""pouette"",1000).show();}</code></pre><p>And I try t get the position of the item who contains my button.</p><p>How Can I pass the position variable present in the getView method to my onClick Method?I will have several button In my View (Item view)    </p><p>Thank you</p>","454998","","","","","2010-11-20 20:15:56","Get the position after click on button in a list view","<android>","1","0","1","",""
"4234632","1","4234667","","2010-11-20 19:46:54","0","81","<p>I going through a simple tutorial to create a very small android app in eclipse. The tutorial is here: <a href=""http://mobile.tutsplus.com/tutorials/android/android-sdk-development/"" rel=""nofollow"">http://mobile.tutsplus.com/tutorials/android/android-sdk-development/</a>.</p><p>Now that I have it compiling, what should I do to get it on my phone? Do I need to export the app to some sort of exe? can i just copy and paste that exe into some ""app"" folder on my phone?</p>","336384","","","","","2010-11-21 00:41:58","I have my android app compiling in an emulator, now what?","<java><android><eclipse>","2","0","","",""
"4234660","1","","","2010-11-20 19:50:56","1","905","<p>I have a linearlayout A containing a imageview and scrollview. The scrollview contains a second linearlayout BThe idea is to have a fixed header while the linearLayout B contains multiple views that match exactly the height of the scrollview. See it as a tabview where all tabs are after each other in a scrollview.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/main_view""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#000000""    android:orientation=""vertical""&gt;&lt;ImageView android:id=""@+id/logoImg""    android:layout_width=""fill_parent""    android:gravity=""center""    android:src=""@drawable/logo""    android:layout_height=""wrap_content""/&gt;&lt;ScrollView  android:id=""@+id/scrollView""  android:layout_weight=""1""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt; &lt;LinearLayout android:id=""@+id/scrollLinear""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;&lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p>I tried to achieve this by calling getHeight on the scrollView and then set this height to each view in the linearLayout B but getHeight always returns 0.Anyone an idea what's the easiest way to achieve this?</p>","503659","","","","","2012-11-25 01:31:42","ScrollView height 0 even when fill_parent","<android><scrollview><android-linearlayout>","1","2","","",""
"4234668","1","4234766","","2010-11-20 19:51:29","0","853","<p>When I change the orientation of my screen in Android, an OnItemSelectedListener from a Spinner is called.</p><p>It's not just the emulator, it also happens on a physical phone.</p><p>How can I stop this from occurring?</p><p>Cheers.</p>","497517","","","","","2010-11-20 20:09:07","OnItemSelectedListener called on screen rotation","<android><spinner><screen-orientation>","1","1","","",""
"4234689","1","4235419","","2010-11-20 19:55:34","2","846","<p>I created a map app that uses a very large image as my map. It shows high resolution tiles when the user zooms in to a certain degree and a lower-res bitmap of the whole image when zoomed out past 50%. It works OK, on my origional droid sometimes I can see a very slight lag due to the new tiles being drawn into and from the garbage collector.</p><p>Im now thinking about how OpenGL ES would be a better way to render. Ive never touched it before, but from what ive been reading in different turoials, it seems i could create a quad that has 8 faces or so, and enable culling so it only draws the images that are currently visible on the screen.</p><p>Would this eliminate the lag completely? In my test app now I have tiles being loaded on app startup but i can tell the lag is due to those tiles being drawn for the first time. Thanks.</p>","385051","","","","","2010-11-20 22:50:30","handling large bitmaps in OpenGL ES and Android","<android><opengl-es><bitmap><culling>","1","0","2","",""
"4234793","1","","","2010-11-20 20:14:40","-3","402","<p>I want to set Image background for linearlyout in android ? can i ? if yes. how ?</p>","508377","","","","","2011-12-14 15:58:54","how can I set image background for linearlyout?","<android><background>","3","0","","2012-11-17 10:32:24",""
"4234910","1","4234998","","2010-11-20 20:42:18","0","1099","<p>I'm noticing that there are double icons for an application I recently built. Is this being caused by an issue in my manifest? Or is this an artifact from a previously deleted rev of the apk?</p>","154146","","","","","2010-11-20 21:01:24","Double icons in Applications list","<android>","1","2","","",""
"4234952","1","","","2010-11-20 20:50:45","0","141","<p>Can anyone see why the following xml file should throw NullPointer exception?If I remove all reference to the array hrs_to_wait_values it is ok.ThanksRon</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;string-array name=""hrs_to_wait_options""&gt;&lt;item&gt;1 hour&lt;/item&gt;&lt;item&gt;2 hours&lt;/item&gt;&lt;item&gt;3 hours&lt;/item&gt;&lt;item&gt;4 hours&lt;/item&gt;&lt;item&gt;5 hours&lt;/item&gt;&lt;item&gt;6 hours&lt;/item&gt;&lt;item&gt;7 hours&lt;/item&gt;&lt;item&gt;8 hours&lt;/item&gt;&lt;item&gt;9 hours&lt;/item&gt;&lt;item&gt;10 hours&lt;/item&gt;&lt;item&gt;11 hours&lt;/item&gt;&lt;item&gt;12 hours&lt;/item&gt;&lt;item&gt;13 hours&lt;/item&gt;&lt;item&gt;14 hours&lt;/item&gt;&lt;item&gt;15 hours&lt;/item&gt;&lt;item&gt;16 hours&lt;/item&gt;&lt;item&gt;17 hours&lt;/item&gt;&lt;item&gt;18 hours&lt;/item&gt;&lt;item&gt;19 hours&lt;/item&gt;&lt;item&gt;20 hours&lt;/item&gt;&lt;/string-array&gt;&lt;array name=""hrs_to_wait_values""&gt;&lt;item&gt;1&lt;/item&gt;&lt;item&gt;2&lt;/item&gt;&lt;item&gt;3&lt;/item&gt;&lt;item&gt;4&lt;/item&gt;&lt;item&gt;5&lt;/item&gt;&lt;item&gt;6&lt;/item&gt;&lt;item&gt;7&lt;/item&gt;&lt;item&gt;8&lt;/item&gt;&lt;item&gt;9&lt;/item&gt;&lt;item&gt;10&lt;/item&gt;&lt;item&gt;11&lt;/item&gt;&lt;item&gt;12&lt;/item&gt;&lt;item&gt;13&lt;/item&gt;&lt;item&gt;14&lt;/item&gt;&lt;item&gt;15&lt;/item&gt;&lt;item&gt;16&lt;/item&gt;&lt;item&gt;17&lt;/item&gt;&lt;item&gt;18&lt;/item&gt;&lt;item&gt;19&lt;/item&gt;&lt;item&gt;20&lt;/item&gt;&lt;/array&gt;&lt;/resources&gt;</code></pre>","479505","","418183","","2010-11-20 20:54:52","2010-11-20 21:26:35","xml throwing NullPointer exception","<android>","1","5","","",""
"4234995","1","4235298","","2010-11-20 21:01:13","0","352","<p>Is it possible to determine programatically whether any background applications/services are using the sattelite GPS functionality?I realise from searching SO that it isn't possible to disable it in code, but that I have to use a button shortcut which does:</p><pre><code>Intent myIntent = new Intent(Settings.ACTION_SECURITY_SETTINGS);startActivity(myIntent);</code></pre><p>and click the relevant settings button.</p><p>I've written a maps application but have no access to a real phone at present and notice that the little satellite icon in the emulator's status bar doesn't reflect the state of the system setting. I'd like to try and conserve battery charge and am wondering whether the GPS stays on, draining the battery, if nothing requires its functionality.</p><p>I realise that disabling satellite GPS at system level may impact other apps, hence my question.</p>","440010","","","","","2010-11-20 22:18:26","Determining programatically whether satellite GPS functionality is needed","<android>","1","0","","",""
"4235001","1","4235134","","2010-11-20 21:02:09","0","913","<p>I have a date that has the format:</p><pre><code>""yyyy-MM-dd'T'HH:mm:ss'Z'""</code></pre><p>I'd like to convert it to something similar to:</p><p>""3 minutes ago""</p><p>How can I go about doing this?</p>","19875","","","","","2011-10-07 13:38:06","How can I format this date?","<java><android><datetime><time><simpledateformat>","3","1","","",""
"4235018","1","4298638","","2010-11-20 21:08:49","2","2914","<p>Is there a way to add a default value in a RingtonePreference, via XML?  For example, here's what my preference.xml looks like.</p><pre><code>&lt;RingtonePreference android:key=""alarm""android:title=""Alarm"" android:name=""Alarm""android:summary=""Select an alarm""android:ringtoneType=""alarm"" android:showDefault=""true"" /&gt;</code></pre><p>If possible, I'd like to set the RingtonePreference to the default ringtone, like this:</p><pre><code>&lt;RingtonePreference android:key=""alarm""android:title=""Alarm"" android:name=""Alarm""android:summary=""Select an alarm""android:ringtoneType=""alarm"" android:showDefault=""true""android:defaultValue=""defaultRingtone"" /&gt;</code></pre>","434414","","434414","","2010-11-22 20:30:28","2011-07-05 09:52:09","Can I insert a android:defaultValue trait for RingtonePreference, via XML?","<android><xml><default><preferences><ringtone>","2","2","1","",""
"4235064","1","","","2010-11-20 21:19:25","0","134","<p>i have the following text area named ""results"", that holds my result.</p><p>Default from xml is: ""0""</p><p>After calculation from class file shown below, returns ie: ""1.0""</p><p>I do not want the ""."" or the ""0"" just whole numbers, ie ""1"" ""2"" ""3"" etc...</p><pre><code>protected void addone() {    double val = Double.parseDouble(results.getText().toString());     results.setText(Double.toString(val+1));}protected void minusone() {    double val = Double.parseDouble(results.getText().toString());    if (val &gt; 0 ){    results.setText(Double.toString(val-1));    }}protected void resetit() {AlertDialog.Builder ab=new AlertDialog.Builder(actcountonit.this);ab.setMessage(Html.fromHtml(""&lt;b&gt;&lt;font color=#ff0000&gt; Warning.! "" +""&lt;/font&gt;&lt;/b&gt;&lt;br&gt;Are you sure you want to reset the counter..?""));            ab.setPositiveButton(""Reset"", new android.content.DialogInterface.OnClickListener() {                      public void onClick(DialogInterface dialog, int which) {                        results.setText(Double.toString(0));                    }                    });            ab.setNegativeButton(""Cancel"", null);    ab.show();}</code></pre><p>I have tried to amend this to get the value from the text area as an int, then return it to text area as an int.Every combination i have tried, i get error's in these lines.</p><pre><code>protected void addone() {    double val = Double.parseDouble(results.getText().toString());     results.setText(Double.toString(val+1));}</code></pre><p>An example of a function like this, where your taking the numeric value of a text box as an int, do the calcs then return it as an int ""whole number"" would be great..!</p><p>This amendment of mine shows errors in eclipse at both capitalized ""Int""s.</p><pre><code>protected void addone() {    int val = Int.parseInt(results.getText().toString());     results.setText(Int.toString(val+1));}</code></pre><p>Finally worked it out:</p><pre><code>protected void addone() {    int val = Integer.parseInt(results.getText().toString());     results.setText(Integer.toString(val+1));}</code></pre>","503314","","503314","","2010-11-21 02:03:24","2010-11-21 02:03:24","Unwanted decimal in text area","<android>","1","0","","",""
"4235065","1","4235133","","2010-11-20 21:19:31","2","2309","<p>I write Android apps, distributed via the Market. A user has written asking whether they can have the raw .apk of one app (they're in a country where the Market isn't available).</p><p>Is it safe to do this, or do I risk getting ripped off in some way - having my app copied and redistributed, for example?</p><p>Thanks for your help. </p>","267831","","","","","2010-11-20 21:45:59","Is it safe to share .apk files?","<android>","1","0","","",""
"4235070","1","4235340","","2010-11-20 21:20:49","9","14410","<p>I have a EditText control.If I tap it the softkeyboard will popup however when I press ""enter/ok/return"" then the EditText control  it still has focus and the keyboard up.<br>How do I close the softkeyboard and remove focus from it?</p>","502419","","184046","","2010-11-20 21:54:28","2011-05-23 10:02:54","How to clear focus and remove keyboard on Android?","<android>","3","0","4","",""
"4235071","1","","","2010-11-20 21:21:37","2","316","<p>I use SQLite DB in my app. Is SQLLite bases will erased if i turn on copy protection in market? (I mean bases in phones of my costumers)I found both side comments. How it works now?</p>","499393","","","","","2011-08-08 00:58:51","What will happen if I turn off copy protection?","<android><google-play>","0","3","1","",""
"4235117","1","","","2010-11-20 21:34:25","1","445","<p>Here is the scenario:</p><p>User opens app, they press a button and some activity launches.  After the button is pressed and the activity is executed, I want to disable the button until the week starts over. Even if they close the app and come back, it should still be disabled unless it has reset.</p><p>For example, if they press the button on Monday, they should not be able to do it again until Sunday at 12:00 AM.</p><p>No matter what day they initially press the button, they should not be able to press again until the week starts over.</p><p>What would be the simplest way to do this in android?  Should I have the program store the date and time they initially press, and then calculate the time until reset every time they open the app?</p>","514718","","","","","2010-11-20 21:47:26","Locking a Button After Press for a period of time","<android><button><timer>","1","2","","",""
"4235223","1","","","2010-11-20 21:58:07","1","8031","<p>I am getting a parsing error and I do not know why (I am new to programing). Because of this error, R.java disappears and I end up having more errors. Hopefully someone can help me out. Here is where the error comes from: 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:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""    &gt;  &lt;ListView android:id=""@+id/ListView01"" android:layout_height=""wrap_content""  android:layout_width=""fill_parent""&gt;  &lt;TextView android:text=""@+id/TextView01"" android:id=""@+id/TextView01""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:layout_marginLeft=""10px"" android:textColor=""#0099CC""&gt;&lt;/TextView&gt; &lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>and here is where the xml file is called: list.java</p><pre><code>package com.aha;import java.util.HashMap;import android.app.ListActivity;import android.content.Intent;import android.os.Bundle;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.AdapterView.OnItemClickListener;import android.widget.SimpleAdapter;import android.widget.SimpleAdapter.ViewBinder; import android.widget.Adapter; import android.widget.BaseAdapter; public class list extends ListActivity {  private HashMap&lt;String, Class&lt;?&gt;&gt; yourMap;  @Override  public void onCreate(Bundle b) {   yourMap = new HashMap&lt;String, Class&lt;?&gt;&gt;();   yourMap.put(""Matches"", matches.class);   yourMap.put(""Economy"", finances.class);  }  public void onCreate1(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    String[] menu = getResources().getStringArray(R.array.menu_array);    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list, menu));    ListView lv = getListView();    lv.setTextFilterEnabled(true);    lv.setOnItemClickListener(new OnItemClickListener() {      public &lt;View&gt; void onItemClick(AdapterView&lt;?&gt; parent, View view,          int position, long id) {        // When clicked, show a toast with the TextView text             Object o = this.getListAdapter().getItem(position);             String keyword = o.toString();             Intent intent = new Intent(this, yourMap.get(keyword));             startActivity(intent);      }    });  } }</code></pre><p>also at this line I am getting an error saying I must implement an abstract method :</p><pre><code>    lv.setOnItemClickListener(new OnItemClickListener() {</code></pre><p>I am just wondering what this means, not necessarily a solution. Hopefully I can figure that one out on my own. The parsing error I have had for a day or two and can't figure it out alone.</p><p>Thanks for any help</p>","514728","","220834","","2010-11-20 22:52:08","2012-11-11 16:31:10","error parsing XML: No element found. and it won't generate R.java because of it","<android><xml>","5","0","","",""
"4235245","1","4235280","","2010-11-20 22:03:06","0","635","<p>I am following the steps listed here: <a href=""http://developer.android.com/guide/developing/device.html"" rel=""nofollow"">http://developer.android.com/guide/developing/device.html</a>. </p><p>I'm using eclipse 3.6 (It was the only download i could find... couldn't find 3.5). When i run SDK Manager.exe I see that I have USB Driver Packer, Revision 3 installed.</p><p>I Set my phone to enable USB Debugging and I plug in my phone to my computer's USB jack.</p><p>At this point, I do not see the device in eclipse debug configuration. Should I? Am I missing something? </p>","336384","","","","","2010-11-20 22:13:28","How to use my Samsung Captivate as a device for debugging?","<android><mobile-phones><mobile-devices>","1","3","","",""
"4235330","1","8527759","","2010-11-20 22:26:05","4","3069","<p>Greetings!</p><p>The android auto complete only starts after two letters, how can I make it so the list appears when the field is just selected?</p><p>Thanks</p>","445342","","","","","2013-02-26 12:41:07","Android Immediate Auto Complete","<android><autocomplete><letter><immediate>","4","0","","",""
"4235516","1","","","2010-11-20 23:10:19","1","1511","<p>I'm trying to use Android SDK's SQLiteQueryBuilder to join two tables, let's call them t1 and t2, and query that table based on an attribute from each table, say t1.att1 and t2.att2, equaling a certain value. I'm a little confused on the syntax when it comes to the selection. Help is appreciated. Thanks!</p>","365491","","","","","2010-11-20 23:20:59","Using SQLiteQueryBuilder to join two tables","<android><sqlite3>","1","0","1","",""
"4235547","1","4235833","","2010-11-20 23:17:56","0","2505","<p>Within my android application, I'm wanting to update an ImageView, with an image specified from a URL. This URL has been fetched via an API as part of an AsyncTask.</p><p>I have defined the ImageView as follows:</p><pre><code>&lt;ImageView    android:adjustViewBounds=""true""    android:scaleType=""fitCenter""    android:layout_height=""wrap_content""     android:id=""@+id/product_image""    android:src=""@drawable/no_product_image""     android:layout_marginRight=""6dip""    android:layout_width=""wrap_content""    /&gt;</code></pre><p>That way, whilst the data is loading, there is a blank image present behind a ProgressDialog.</p><p>As part of the doInBackground of the AsyncTask, after fetching the product details, I call:</p><pre><code>private void createProductScreen(Product product){        Log.i(TAG, ""Updating product screen"");        //Set the product image        ImageView imgView =(ImageView)findViewById(R.id.product_image);        Drawable drawable = loadImageFromWeb(product.getImageUrl());        imgView.setImageDrawable(drawable);        Log.i(TAG, ""Set image"");}</code></pre><p>The image is loading from the web as follows:</p><pre><code>private Drawable loadImageFromWeb(String url){        Log.i(TAG, ""Fetching image"");        try{            InputStream is = (InputStream) new URL(url).getContent();            Drawable d = Drawable.createFromStream(is, ""src"");            Log.i(TAG, ""Created image from stream"");            return d;        }catch (Exception e) {            //TODO handle error            Log.i(TAG, ""Error fetching image"");            System.out.println(""Exc=""+e);            return null;        }    }</code></pre><p>When this runs I see <em>""Created image from stream""</em> in the log, but don't see <em>""Set image""</em> and the onPostExecute of the AsyncTask is never called.</p><p>Does anyone have any ideas on the issue or a better way of updating the image from the blank image to the product image?</p>","185697","","","","","2012-12-08 23:00:19","Updating an ImageView with an image from a URL","<java><android>","2","1","1","",""
"4235577","1","4498344","","2010-11-20 23:26:10","1","1410","<p>Dear Android hackers, I am attaching a gestureListener recognizing flings to a ListView. The rows of the ListView consist of a LinearView and some TextViews. Unfortunately, the fling is not detected, when it starts on one of the 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:background=""#000000"" &gt;        &lt;TextView            android:id=""@+id/author""            android:textSize=""14sp""            android:textColor=""#ffffff""            android:textStyle=""bold""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""/&gt;        &lt;TextView            android:id=""@+id/date""            android:textSize=""11sp""            android:textColor=""#eeeeee""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:gravity=""right""/&gt;    &lt;/LinearLayout&gt;    &lt;TextView        android:id=""@+id/text""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:paddingTop=""5dp""        android:paddingRight=""5dp""        android:paddingLeft=""5dp""        android:textColor=""#333333""        android:paddingBottom=""5dp""        android:textSize=""14sp""        android:layout_weight=""2""/&gt;&lt;/LinearLayout&gt;</code></pre><p>So, when I start the fling on the horizontal LinearLayout, everything works fine, but when I start it on the TextView at the bottom, nothing happens. It containts editable text, if that could be the problem... As is said, the Listener is attached to the ListView itself. </p><p>I'd be glad if somebody could help!</p><p>Jan Oliver</p>","169748","","","","","2010-12-21 10:34:35","Android: fling detection on ListView with complex rows","<android><listview><ontouchlistener>","1","0","","",""
"4235756","1","4235777","","2010-11-21 00:20:47","2","1319","<p>I would like to deploy an Android application internally in an organization.</p><p>For the moment while developing the application, I have used e-mail to spread my application. Then the user has to install the Android SDK, install a driver for his phone and finally run the <code>adb install MyApplication.apk</code> to install the application.</p><p>Is there any better ways to deploy Android applications internally? Is it even possible to manage updates?</p><p>I read on a <a href=""http://forums.t-mobile.com/t5/ARCHIVED-Market-Downloads-Games/Non-Market-applications-How-to-install/m-p/9935#M629"" rel=""nofollow"">forum</a> that applications can be deployed on a webserver. Then the user only has to download the application for installing. But when I tried to simply upload an <code>.apk</code> file to my webserver and visit the URL using the browser on my phone I got this message: </p><pre><code>&lt;Uknown&gt;mydomain.comCannot download. The content is not supported on the phone.</code></pre><p>So how can I fix this? Is there any kind of MIME-type I have to set on the webserver? Doing the same thing as described in the link above on <a href=""http://slideme.org/sam2.apk"" rel=""nofollow"">http://slideme.org/sam2.apk</a> works fine, and the installation starts.</p><p>The only thing I can find about this on <em>Android Developers</em> <a href=""http://developer.android.com/guide/publishing/publishing.html"" rel=""nofollow"">Publishing Your Applications</a> is:</p><blockquote>  <p>You can publish your application using a hosted service such as Android Market or through a web server.</p></blockquote>","213269","","213269","","2010-11-21 00:45:43","2010-11-21 00:45:43","How can I deploy an Android application internally in an organization?","<android><deployment><webserver><mime-types>","1","0","3","",""
"4235823","1","4236683","","2010-11-21 00:40:12","1","2037","<p>Trying to code a simple Live wallpaper for android. I'm having trouble finding out how to capture the screen size at initialization.</p><p>Any thoughts on how I might can accomplish this?</p><p>Thanks.</p>","455637","","19750","","2011-03-31 15:43:03","2011-03-31 15:43:03","How do I get the screen width and height when initializing an Android Live Wallpaper?","<android><screen><live-wallpaper>","2","0","1","",""
"4235890","1","4235912","","2010-11-21 01:04:00","7","1975","<p>I am developing an application that will provide instructions to making a product.  The text will have bullets and/or numbered steps as well regular text paragraphs.  I may have headings for various sections.  The text will be placed into a scrollable TexView.</p><p>I was originally planning on loading the text from a resource text file and then applying formatting via xml.  However, I just learned about WebView and the ability to load local html files.  I could easily format the text in html and load it into a WebView for the various activities.</p><p>My question is, is there a performance issue with using WebView vs. TextView?  Are there other ways to easily format text for a TextView?</p><p>Thanks,</p>","514815","","","","","2010-11-21 01:13:25","Recommended approach for presenting formatted text in Android?","<html><android><webview><textview>","1","0","1","",""
"4235947","1","4236320","","2010-11-21 01:25:09","0","1439","<p>I have an image view in my app. when I try to make it show a jpg file exported from 3ds max, it works. But if it comes from Photoshop, it just does nothing. Why is that? If it is at all important my app gets the image from my server with the following code:</p><pre><code>public static Bitmap getWebImage(String URL){    URL myImageURL = null;    Bitmap bitmap = null;    try {        myImageURL = new URL(URL);        } catch (MalformedURLException error) {        error.printStackTrace();        }        try {            HttpURLConnection connection = (HttpURLConnection)myImageURL .openConnection();            connection.setDoInput(true);            connection.connect();            InputStream input = connection.getInputStream();            bitmap = BitmapFactory.decodeStream(input);            } catch (IOException e) {            e.printStackTrace();            }            return bitmap;}</code></pre>","513064","","","","","2014-04-04 09:30:29","Android imageview only accepts some jpg's","<android><jpeg><imageview>","3","2","","",""
"4235996","1","4236009","","2010-11-21 01:42:38","13","3880","<p>Would anyone know how I can view what a cursor has in it during debugging so that I can determine the functionality of my database helper?</p><p>It keeps acting like it's returning data, but then when I attempt to use the cursor.isNull(0) method, I keep getting nullPointerExceptions thrown and not being able to see what the cursor has in it while stepping through the execution is really frustrating me.</p><p>Any help would be extremely appreciated.</p><p>Thanks.</p>","485710","","","","","2012-10-28 03:57:22","Viewing an Android database cursor","<android><debugging><cursor>","2","0","1","",""
"4236210","1","4237427","","2010-11-21 03:03:05","0","1167","<p>i'm currently setting the alarm via the following..</p><pre><code>//set the alarmalarm.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pendingintent);</code></pre><p>i don't seem to see an <code>AlarmManager</code> method that allows me to <code>get</code> the time of that set alarm... Is there a way to do it from somewhere else in my app?</p>","502630","","","","","2010-11-21 10:41:24","How can i programatically get the next time a specific set alarm is set to go off?","<android><alarmmanager>","1","0","1","",""
"4236282","1","7671892","","2010-11-21 03:26:48","1","609","<p>i have a listview and button on the list how can i use both button.setonclicklistener and onListItemClick in listview </p>","510992","","","","","2011-10-06 09:14:06","handle listview with button","<android><listview>","2","0","","",""
"4236352","1","4254849","","2010-11-21 03:53:29","0","918","<p>I'm running Ubuntu 10.10 and installed Eclipse 3.5 (Galileo) for Java Developers along with the Android SDK.  When I add the following URL into the <code>work With</code> field under Eclipse's <kbd>Install New Software</kbd> menu:</p><p><a href=""https://dl-ssl.google.com/android/eclipse"" rel=""nofollow"">https://dl-ssl.google.com/android/eclipse</a></p><p>No plugins appear between the ""Work With"" and <kbd>Options</kbd> sections. I understand I'm supposed to be able to select <kbd>Developer Tools</kbd>. I get nothing. I've tried linking to http vice https. Also, downloading the zip from the android dev site itself yields the same result.  When I run <kbd>Check for Updates</kbd>, it comes back saying nothing to update. I also ran ""Test Connection"" for the above URL and it comes back positive.</p><p>Any advice?</p>","514880","","944657","","2012-12-28 08:01:14","2012-12-28 08:01:14","No ADT plugin options available","<android><eclipse><eclipse-plugin><adt>","2","3","","",""
"4236386","1","","","2010-11-21 04:07:50","1","2367","<p>I have an image setup inside an absolute panel.I am trying to set it's position via code.But I do not see any applicable method/property to set its position.</p><p>Here is my layout.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""    &gt;&lt;ImageView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/marker"" android:src=""@drawable/marker"" android:layout_y=""106dp"" android:layout_x=""290dp""&gt;&lt;/ImageView&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>Here is my code to set its position</p><pre><code>marker = (ImageView)findViewById(R.id.marker);        marker.//Can't find a method or property</code></pre>","514780","","345717","","2010-11-21 04:16:55","2013-10-23 04:53:57","Set images position in absolute layout","<android><android-layout>","1","0","","",""
"4236476","1","","","2010-11-21 04:42:07","0","999","<p>I have a need where i must pass some values from an Activity toanother file which extends View class (instead of Activity) .... Itsnot the normal passing of values from one activity to another...</p><p>In my Activity,i will pass some co-ordinate values to the class thatextends View... In this class,i will draw an image and place pointsover the image on the co-ordinates that were passed from the activity... But , the problem is ,i cant send values using Intent ...</p><p>Is there any way to do this??</p>","507715","","244296","","2010-11-21 05:14:53","2010-11-21 05:39:07","Passing values from one activity to a class that extends View class","<android>","1","0","","",""
"4236491","1","4236519","","2010-11-21 04:48:12","0","338","<p>I need to create some global android variables. Some posts here suggested me to do something like this:</p><pre><code>public class MyAppName extends Application {     String foo;      //then, to create setters and getters...}</code></pre><p>and, to add android:name="".MyAppName"" to manifest.</p><p>But now I am struggling with some basics that I missed along the way while trying to learn android.</p><p>My starting activity was named MyAppName. Now, of course I had to rename it, for example: MyStartingActivity.</p><p><strong>The question is how do I start my MyStartingActivity. Where do I specify this activity as starting activity? Can I set some other activity to be the starting one?</strong></p><p>I tried to StartActivity in OnCreate method of my application, but my app would force close every time. </p>","507153","","1288","","2013-07-06 14:04:20","2013-07-06 14:04:20","Global Variables to specify a starting Activity","<android><global-variables><android-application>","1","0","1","",""
"4236553","1","4240840","","2010-11-21 05:16:41","5","2226","<p>I am developing an Android project on Eclipse, and I'm trying to switch from running tests on the emulator/device (which is <em>very</em> slow) to <a href=""http://pivotal.github.com/robolectric/index.html"">Robolectric</a>.</p><p>I replaced the Android libs with Robolectric's, added JUnit to the path, changed the test case back to a regular <code>TestCase</code> and added the suggested <code>@RunWith(RobolectricTestRunner.class)</code> from the <a href=""http://pivotal.github.com/robolectric/quick-start.html"">Quick Start guide</a> (making the needed changes to instantiate my Activity instead of relying on Android's activity testing to do it for me).</p><p>However, when I run the test, I get:</p><pre><code>java.lang.NullPointerException at com.xtremelabs.robolectric.RobolectricTestRunner.isInstrumented(RobolectricTestRunner.java:123) at com.xtremelabs.robolectric.RobolectricTestRunner.&lt;init&gt;(RobolectricTestRunner.java:72) at com.xtremelabs.robolectric.RobolectricTestRunner.&lt;init&gt;(RobolectricTestRunner.java:57) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:532) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.&lt;init&gt;(JUnit4TestReference.java:29) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.&lt;init&gt;(JUnit4TestClassReference.java:25) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)</code></pre><p>This seems to be related to this code (<a href=""https://github.com/pivotal/robolectric/blob/Robolectric0_9/src/com/xtremelabs/robolectric/RobolectricTestRunner.java"">from 0.9 tag</a>, since 0.9.1 tag doesn't have it) in <code>RobolectricTestRunner.java</code>:</p><pre><code>private static boolean isInstrumented() {    return RobolectricTestRunner.class.getClassLoader().getClass().getName().contains(RobolectricClassLoader.class.getName());}</code></pre><p>but I can't understand how, since this reflection should work from the class itself.</p><p>Also, I could swear that it ran once before failing repeatedly - I've deleted the robolectric cache (as suggested <a href=""http://digitaldumptruck.jotabout.com/?p=773"">here</a>) and replaced Eclipse's JUnit with the latest (4.8.2), but nothing changed.</p><p>Any hints?</p><p><strong>UPDATE:</strong> I tried to create a new, Java (i.e., plain, non-Android) test project, just as described on the quick start guide. However, now the test run complains about not having AndroidManifest.xml:</p><pre><code>java.lang.RuntimeException: java.io.FileNotFoundException: /Users/chester/Documents/workspace/minitruco-android/minitruco-android-robolectric-test/AndroidManifest.xml (No such file or directory)    at com.xtremelabs.robolectric.RobolectricTestRunner.createResourceLoader(RobolectricTestRunner.java:245)    at com.xtremelabs.robolectric.RobolectricTestRunner.setupApplicationState(RobolectricTestRunner.java:215)    at com.xtremelabs.robolectric.RobolectricTestRunner.internalBeforeTest(RobolectricTestRunner.java:163)    at com.xtremelabs.robolectric.RobolectricTestRunner.methodBlock(RobolectricTestRunner.java:143)    at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)Caused by: java.io.FileNotFoundException: /Users/chester/Documents/workspace/minitruco-android/minitruco-android-robolectric-test/AndroidManifest.xml (No such file or directory)    at java.io.FileInputStream.open(Native Method)    at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:137)    at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:96)    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:87)    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:178)    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)    at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)    at com.xtremelabs.robolectric.RobolectricTestRunner.findResourcePackageName(RobolectricTestRunner.java:255)    at com.xtremelabs.robolectric.RobolectricTestRunner.createResourceLoader(RobolectricTestRunner.java:236)    ... 18 more</code></pre><p>I guess the test should load the files from the original project (minitruco-android), which shows up in both the test project's build path and on the Run/Debug build configuration on Eclipse (under the test project's classpath entry). Anyway, I've copied the file from my original test project (just for the sake of testing), but then it complains about R.java (and <em>that</em> should really have been imported from the original project):</p><pre><code>java.lang.RuntimeException: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for me.chester.minitruco.test.R    at com.xtremelabs.robolectric.RobolectricTestRunner.createResourceLoader(RobolectricTestRunner.java:245)    at com.xtremelabs.robolectric.RobolectricTestRunner.setupApplicationState(RobolectricTestRunner.java:215)    at com.xtremelabs.robolectric.RobolectricTestRunner.internalBeforeTest(RobolectricTestRunner.java:163)    at com.xtremelabs.robolectric.RobolectricTestRunner.methodBlock(RobolectricTestRunner.java:143)    at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)Caused by: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for me.chester.minitruco.test.R    at javassist.Loader.findClass(Loader.java:359)    at com.xtremelabs.robolectric.RobolectricClassLoader.findClass(RobolectricClassLoader.java:60)    at javassist.Loader.loadClass(Loader.java:311)    at java.lang.ClassLoader.loadClass(ClassLoader.java:268)    at com.xtremelabs.robolectric.RobolectricClassLoader.loadClass(RobolectricClassLoader.java:37)    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)    at java.lang.Class.forName0(Native Method)    at java.lang.Class.forName(Class.java:186)    at com.xtremelabs.robolectric.RobolectricTestRunner.createResourceLoader(RobolectricTestRunner.java:237)    ... 18 moreCaused by: javassist.NotFoundException: me.chester.minitruco.test.R    at javassist.ClassPool.get(ClassPool.java:436)    at com.xtremelabs.robolectric.AndroidTranslator.onLoad(AndroidTranslator.java:68)    at javassist.Loader.findClass(Loader.java:340)    ... 26 more</code></pre><p>The only different thing between my setup and the quick start is that I'm keeping test sources on the test project and regular sources on the regular project (since the first builds, I'd assume the test project sees the regular sources - which, of course, it depends heavily upon).</p><p>I'm using <a href=""http://landonf.bikemonkey.org/static/soylatte/"">SoyLatte</a>, but tried also Mac OS's default 1.6 JVM, with the same results.</p><p>Thank you.</p>","64635","","64635","","2010-11-21 12:55:51","2012-02-18 16:13:55","NullPointerException on reflection during Robolectric startup - any hints?","<java><android><junit><nullpointerexception>","2","0","2","",""
"4236560","1","4236612","","2010-11-21 05:20:48","0","101","<p>Newbie: <strong>Which Skill Level of Java</strong> is required, in order to write ""Android Applications with Java""</p><p>Hello Geeks here,</p><p>I am just a newbie with No programming background of any kind and want to <strong>Learn ""Android Application programming"" with Java</strong>.   </p><p>Please suggest that <strong>which Java E-books (including online resources), I should learn?</strong> And on <strong>which Java Topics, I should stress upon?</strong>, which can Later help me to <strong>Grasp the ""Android Application programming""</strong> easily.<br>Regards</p>","514892","","","","","2010-11-21 05:41:38","Newbie: In Which Particular Aspects of Java, one should be a Pro, in order to write ""Android Applications"" with Java","<android>","2","3","","2013-03-03 14:51:38",""
"4236568","1","4255690","","2010-11-21 05:23:14","11","5573","<p>I have a problem with rendering a ScrollView. Essentially, the layout is fixed header and footer with a scrollview in the middle. The idea is that when the screen keyboard is activated for the content EditText the image can be scrolled if the height of the image is longer than the middle view.</p><p>In testing the layout, I've found that on my Android phone (Xperia X10 Android 1.6) there is a whole heap of padding added to the top and bottom of the ImageView.</p><p>I'd appreciate any suggestions as to how I can prevent this from happening.</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;!-- Header --&gt;    &lt;RelativeLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""#FFFFFF""&gt;        &lt;TextView            android:text=""Share your photo""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:gravity=""left""/&gt;        &lt;Button            android:id=""@+id/btnStack""            android:text=""Stacks""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentRight=""true""/&gt;    &lt;/RelativeLayout&gt;    &lt;!-- End Header --&gt;    &lt;!-- Body --&gt;    &lt;ScrollView        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:padding=""5px""        android:background=""#CCCCCC""&gt;        &lt;ImageView            android:id=""@+id/imgPreview""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;    &lt;/ScrollView&gt;    &lt;!-- End Body --&gt;    &lt;!-- Footer --&gt;    &lt;RelativeLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""#FFFFFF""        android:layout_alignParentBottom=""true""&gt;        &lt;EditText            android:id=""@+id/caption""            android:text=""Type your caption""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;        &lt;LinearLayout            android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_below=""@+id/caption""            android:background=""#CCCCCC""&gt;            &lt;Button                android:id=""@+id/btnUpload""                android:text=""Share""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:layout_weight=""1""/&gt;            &lt;Button                android:id=""@+id/btnCancel""                android:text=""Cancel""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:layout_weight=""1""/&gt;        &lt;/LinearLayout&gt;    &lt;/RelativeLayout&gt;    &lt;!-- End Footer --&gt;&lt;/LinearLayout&gt;</code></pre>","414344","","213269","","2010-12-21 15:54:28","2011-04-21 15:22:20","Android ScrollView adds extra padding on top and bottom of child imageview","<android><emulator><imageview><scrollview>","3","0","5","",""
"4236642","1","4236664","","2010-11-21 05:50:56","1","2202","<p>I have the following in my main.xml the image marker does not fill the width of the device?</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:screenOrientation=""portrait""&gt;&lt;ImageView     android:id=""@+id/ImageView01""     android:layout_height=""wrap_content""     android:layout_width=""fill_parent""            android:src=""@drawable/marker""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre>","514780","","726547","","2013-02-26 04:48:02","2013-02-26 04:48:02","Why image don't fill width","<android><imageview><android-layout>","2","0","","",""
"4236685","1","","","2010-11-21 06:12:16","0","1240","<p>I'd like to access (and change) settings of the stock android browser via code. Is it possible, and if so - how?</p><p>YES, it's programming question - i'd like to change it by code, not by manual clicking.</p><p>What about doing it for rooted device?</p>","19868","","19868","","2010-11-21 18:30:49","2013-09-08 18:06:58","access android stock browser settings","<android><browser>","1","2","","",""
"4236874","1","","","2010-11-21 07:29:58","0","4375","<p>After searching the API and no luck, mybe anyone know how  could I retrieve the SIM ID of the device?</p><p>thanks,</p><p>ray.</p>","260511","","","","","2012-11-26 10:42:31","Retrieving SIM ID","<android>","3","0","1","",""
"4236902","1","","","2010-11-21 07:41:43","8","3303","<p>I'd like my app to run on both Android versions 2.1 and 2.2. In one area of my app, there is a portrait-style camera - the process for producing a portrait camera preview is different (as far as I know) on the two OS versions.  Here is how:</p><h2>2.1:</h2><pre><code>Camera.Parameters parameters = camera.getParameters();parameters.set(""orientation"", ""portrait"");camera.setParameters(parameters);</code></pre><h2>2.2:</h2><pre><code>camera.setDisplayOrientation(90);</code></pre><p>the setDisplayOrientation(int) method became available in API Level 8 (2.2) and, so, cannot be used on 2.1; however, using the 2.1 (Camera.Parameters) method does not rotate the preview and image correctly on 2.2.</p><p>It seems odd that this incompatibility exists - is there a more correct way to do this that will allow me to target both platforms?</p>","348010","","241776","","2011-01-21 15:25:23","2012-07-20 21:06:37","Android API Version Compatibility","<android><camera><rotation><compatibility>","3","0","1","",""
"4236915","1","","","2010-11-21 07:45:13","1","222","<p>I have a both <code>onKeyDown</code> and <code>onMotionEvent</code> overriden in my application. Both of these work, but the <code>onKeyDown</code> has strange behavior. I can always interact with the screen on the device, but after I have interacted with the screen, the buttons do not work. In order to make them work again, I have to push other buttons (ones that I don't use) in order for them to work again. And if I interact with the screen again, the buttons will not work again.</p><p>The application I am writing is a game, so the button calls are made to the surface and then passed to the thread running the game.</p><p>I am debugging on an HTC Aria, but the problem persists in my emulators as well. </p><p>EDIT</p><p>The basic code I have is the same as is detailed <a href=""http://www.droidnova.com/playing-with-graphics-in-android-part-ii,160.html"" rel=""nofollow"">here</a>.</p><p>The code for the buttons are as follows:</p><pre><code>    @Override    public boolean onKeyDown(int keyCode, KeyEvent msg) {     return thread.doKeyDown(keyCode, msg);    }    @Override    public boolean onTouchEvent(MotionEvent event) {     return thread.doTouchEvent(event);    }    public boolean doKeyDown(int keyCode, KeyEvent msg) {     synchronized (mSurfaceHolder) {      if (keyCode == KeyEvent.KEYCODE_MENU) {       showDialog(DIALOG_PAUSED_ID);                            return true;      }      return false;     }    }    public boolean doTouchEvent(MotionEvent event) {     synchronized (mSurfaceHolder) {      if (mState == STATE_PLAYING) {       if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_MOVE){              if (event.getX() &gt; 2 * (mWallX / 3)) {               //shoot arrow               shoot(event.getX(), event.getY());               //turn player               mPlayer.rotate(event.getX(), event.getY());            return true;        } else if (event.getAction() != MotionEvent.ACTION_MOVE &amp;&amp; event.getX() &lt; 2 * (mWallX / 3)) {         //temp button on left for stress test               stressTest = !stressTest;               return true;        }       }      }   return false;     }    }</code></pre>","514957","","418183","","2010-11-21 19:59:06","2010-11-21 19:59:06","Android: Interacting with the screen locks out the buttons","<java><android><key>","1","4","","",""
"4237213","1","","","2010-11-21 09:35:16","0","1164","<p>HI...</p><p>I am New To Android, My requirement is to display Total SDcard files in Listview , in that i want to read only TextFiles. Can anyone HelpMe....Thanks in advance...</p>","513745","","","","","2010-11-21 19:06:48","How to read only text file from sdcard in android?","<android>","1","0","","",""
"4237347","1","4238150","","2010-11-21 10:14:27","2","1854","<p>I think the following scenario is common, but I can't figure the way to implement it:</p><p>We have three Activities, and one database. We ask the user for an input to search in the database. The query should get none, one or may results.</p><ul><li>If you get none you simple inform the user.</li><li>If you get only one, you show it in a new activity with the right view.</li><li>If you get many you show them in a list to let the user to chose the right one and then you pass that to the activity which with show the data in the case of one result only.</li></ul><p>The problem is that, in order to know the number of results, you need to do the query (and get the cursor) in the first activity. And in the case you get more than one result you need to send the data (<strong>pass the cursor?</strong>)to the list acitivty. Doing the query again in the list activity can't be right, right?</p><p>I'm aware that you can share cursors by using a content provider, but as the activities are from the same application and the data is private (useless outside), don't see the point of making it avaliable to anyone else.</p><p>I read here around that you can crate a parcelable cursor and send it in bundle, but I'm not sure if that is the right use.</p><p>Any idea on how to address this?</p><p>Thanks in advance.</p>","505646","","","","","2010-11-21 13:46:47","Sharing cursor between Activities","<android><activity><cursor>","1","0","2","",""
"4237449","1","","","2010-11-21 10:48:27","3","1993","<p>I would like to know is there any way to access to Android menu with help of Robotium framework? (http://code.google.com/p/robotium/) I want to programmatically select GPS activation line from menu. Is it possible with Robotium?</p>","515026","","436641","","2011-10-11 17:39:12","2012-02-02 22:22:16","Access to Android device menu in Robotium framework","<android><robotium>","3","0","","",""
"4237469","1","4237476","","2010-11-21 10:54:19","47","12018","<p>Looking at the Android tutorials such as <a href=""http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html"">the Notepad tutorial</a>, I noticed that almost all variables are named starting with the letter 'm'. What convention is this, and where does it originate from?</p><p>Thank you for your answers!</p>","515029","","308661","","2010-11-21 10:56:53","2014-01-16 22:01:28","Why do variable names often start with the letter 'm'?","<java><android><variable-naming>","7","0","10","",""
"4237731","1","","","2010-11-21 12:09:48","3","2331","<p>Please help to find a lib which can provide url parsing/building functionality which can be used with Android platform. Character escaping is desired.</p><p>Thanks</p>","218783","","","","","2010-11-21 12:30:19","Url builder/utility for android","<android><url>","1","0","","",""
"4237742","1","","","2010-11-21 12:12:50","0","475","<p>Dear all, I'm making a simple file decoder for Android 2.2 that needs to find the filename of the encoded file from a header. This filename should then be used as the filename for the decoded file (as you would expect).</p><p>The filename is identified by the substring <code>name=</code>, so the actual name starts 5 places after that. The line is read by a BufferedReader and temporarily stored in <code>currLine</code>.</p><p>For some reason I can't understand nor find on the web, Strings do not always seem to be Strings...</p><p>When I give the filename as  </p><p><code>String fileOutName = ""testfile.txt"";<br>System.out.println(""fileOutName contains: ""+ fileOutName);<br>  System.out.println(""fileOutName type: ""+ fileOutName.getClass());</code>  </p><p>It works like it should. However reading it from the file does not work:</p><p><code>String fileOutName = currLine.substring((currLine.indexOf(""name="")+5));</code></p><p>Gives no output file, nor an IO exception. The string is parsed properly though: from the System.out debugging lines I find for both cases:  </p><p><code>fileOutName contains: testfile.txt<br>fileOutName type: class java.lang.String</code></p><p>Anyone have any clue as to why this would not work? :S</p><p>Thanks</p>","515070","","","","","2010-11-21 12:18:43","Java: Strings generated by substring not treated as hard coded strings","<java><android><string>","1","2","","",""
"4237770","1","","","2010-11-21 12:17:48","0","2811","<p>I am creating a group android SMS. Therefore, i need checkbox. But,my problem is i cant figure out how to get the selected contacts?</p><p>This my 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:id=""@+id/topLayout""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:layout_centerHorizontal=""true""&gt;&lt;ListView  android:id=""@+id/list""  android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:choiceMode=""multipleChoice""&gt;&lt;/ListView&gt;&lt;ImageView android:id=""@+id/contact_image""    android:src=""@drawable/icon""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;&lt;TextView     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""Name: ""     android:id=""@+id/contact_name""     android:textSize=""18dip""     android:layout_below=""@id/contact_image""              /&gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Phone: ""           android:id=""@+id/phone_number""            android:textSize=""28dip""            android:layout_below=""@id/contact_name""           /&gt;         &lt;CheckBox android:id=""@+id/checkBox""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:checked=""false"" android:layout_alignParentRight=""true""     android:focusable=""false""&gt;   &lt;/CheckBox&gt;  &lt;/RelativeLayout&gt;</code></pre><p>This my codes:-</p><pre><code>  package com.droidnova.android.samples;   import android.app.ListActivity;   import android.content.Intent;   import android.database.Cursor;   import android.os.Bundle;  import android.provider.Contacts.People;  import android.util.SparseBooleanArray;  import android.view.Menu; import android.view.MenuItem; import android.view.MenuInflater; import android.widget.ArrayAdapter;import android.widget.CheckBox;import android.widget.ListView; import android.widget.SimpleCursorAdapter;   public class Contacts extends ListActivity {private CheckBox checkBox;private ListView listView;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    listView=(ListView)findViewById (R.id.list);    final ListView listView = getListView();    listView.setItemsCanFocus(false);    listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);    listView.setAdapter(new ArrayAdapter&lt;String&gt;(this,       android.R.layout.simple_list_item_multiple_choice, lv_items));      Cursor cursor = getContentResolver().query(People.CONTENT_URI,             new String[]{People._ID,People.NAME,People.NUMBER}, null, null, null);    startManagingCursor(cursor);    // start mappings    String[] columns = new String[] {People.NAME, People.NUMBER};    int[] names = new int[] {R.id.contact_name, R.id.phone_number};    SimpleCursorAdapter myAdapter = new SimpleCursorAdapter(this, R.layout.contact,   cursor, columns, names);    setListAdapter(myAdapter);    this.setListAdapter(myAdapter);}     public boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.firstmenu,menu);    return true;    }      public boolean onOptionsItemSelected(MenuItem item){  switch(item.getItemId()){  case R.id.next:      next();    break;  case R.id.select:     return true;  case R.id.back:      final Intent i = new Intent(this,SelectContact.class);      startActivity(i);      break;  }return false;  }</code></pre>","513658","","513658","","2010-11-21 12:34:45","2010-11-24 08:31:47","How to get the selected contacts from Check box (Android)","<android><list><checkbox><view>","2","0","","",""
"4237813","1","4237905","","2010-11-21 12:30:15","0","72","<p>I have done some significant re-coding on one of my Android programs and now I am unsure if certain xml strings are used anymore.  In addition I have a few translations which makes the task even more difficult. Is there a tool to test this?  This would be useful for drawables also.</p><p>I am using the eclipse plugin.</p>","248521","","","","","2010-11-21 16:49:09","determining if resources such as those in strings.xml are no longer used","<android>","3","0","","",""
"4237829","1","","","2010-11-21 12:34:29","1","1350","<p>I've got a custom ListCursorAdapter extending from SimpleCursorAdapter. In the list's rows, there are two TextFields and one CheckBox.</p><p>When scrolling fast, the behaviour of the checkboxes is weird; the selected ones ""hop"" from on row to another, e.g. if the third row contains a selected checkbox and I'm scrolling fast, suddenly another row is selected.</p><p>I found out that sometimes, the findViewById in my bindView-method returns null:</p><pre><code>    @Overridepublic final View newView(final Context context, final Cursor cursor, final ViewGroup parent) {    final LayoutInflater inflater = LayoutInflater.from(context);    final View v = inflater.inflate(mLayout, null);    return v;}@Overridepublic final void bindView(final View v, final Context context, final Cursor cursor) {    int haltestelleCol = cursor.getColumnIndex(""haltestelle"");    int nameCol = cursor.getColumnIndex(""name"");    int linieCol = cursor.getColumnIndex(""linie"");    int startseiteCol = cursor.getColumnIndex(""startseite"");    int idCol = cursor.getColumnIndex(""_id"");    final String haltestelleString = cursor.getString(haltestelleCol);    final String nameString = cursor.getString(nameCol);    // Next set the haltestelle of the entry.    final TextView haltestelle = (TextView) v.findViewById(R.id.favorite_haltestelle);    if (haltestelle != null) {        if (nameString != null &amp;&amp; !nameString.equals("""")) {           haltestelle.setText(nameString);        } else {            haltestelle.setText(haltestelleString);        }    }    // next set the linie    final TextView linie = (TextView) v.findViewById(R.id.favorite_linie);    if (linie != null) {        linie.setText(cursor.getString(linieCol));    }    // set startseite-flag or not    final int startseite = cursor.getInt(startseiteCol);    final CheckBox startseiteCheckbox = (CheckBox) v.findViewById(R.id.favorite_startseite);    final int id = cursor.getInt(idCol);    if (startseiteCheckbox != null) {        if (startseite &gt; 0) {          startseiteCheckbox.setChecked(true);        }        checkboxes.add(startseiteCheckbox);        startseiteCheckbox.setId(id);        startseiteCheckbox.setOnClickListener(new StartseiteClickListener(cursor.getPosition()));    } else {      System.out.println();    }}</code></pre><p>i.e. I'm at the ""System.out.println()""-part. Can someone tell my why I've got this behaviour? And is it correct that the bindView-method is called often? Shouldn't it be called only once per row?</p><p>Thanks a lot!</p><p>Update:There are two different StackTraces:When the returned CheckBox is not null (= when it's working), the StackTrace is the following:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (breakpoint at line 110 in FavoriteListCursorAdapter)) FavoriteListCursorAdapter.bindView(View, Context, Cursor) line: 110 FavoriteListCursorAdapter(CursorAdapter).getView(int, View, ViewGroup) line: 186    ListView(AbsListView).obtainView(int) line: 1274    ListView.makeAndAddView(int, int, boolean, int, boolean) line: 1668 ListView.fillUp(int, int) line: 667 ListView.fillGap(boolean) line: 613 ListView(AbsListView).trackMotionScroll(int, int) line: 2531    ListView(AbsListView).onTouchEvent(MotionEvent) line: 2001  ListView.onTouchEvent(MotionEvent) line: 3234   ListView(View).dispatchTouchEvent(MotionEvent) line: 3709   ListView(ViewGroup).dispatchTouchEvent(MotionEvent) line: 852   LinearLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884   ViewFlipper(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884    LinearLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884   FrameLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884    PhoneWindow$DecorView(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884  PhoneWindow$DecorView.superDispatchTouchEvent(MotionEvent) line: 1659   PhoneWindow.superDispatchTouchEvent(MotionEvent) line: 1107 FavoritenActivity(Activity).dispatchTouchEvent(MotionEvent) line: 2061  PhoneWindow$DecorView.dispatchTouchEvent(MotionEvent) line: 1643    FrameLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884    LinearLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884   TabHost(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884    FrameLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884    LinearLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884   PhoneWindow$DecorView(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884  PhoneWindow$DecorView.superDispatchTouchEvent(MotionEvent) line: 1659   PhoneWindow.superDispatchTouchEvent(MotionEvent) line: 1107 Scout(Activity).dispatchTouchEvent(MotionEvent) line: 2061  PhoneWindow$DecorView.dispatchTouchEvent(MotionEvent) line: 1643    ViewRoot.handleMessage(Message) line: 1691  ViewRoot(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 123 ActivityThread.main(String[]) line: 4363    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  ZygoteInit$MethodAndArgsCaller.run() line: 860  ZygoteInit.main(String[]) line: 618 NativeStart.main(String[]) line: not available [native method]</code></pre><p>And when the returned object is null, the StackTrace is the following:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (breakpoint at line 123 in FavoriteListCursorAdapter)) FavoriteListCursorAdapter.bindView(View, Context, Cursor) line: 123 FavoriteListCursorAdapter(CursorAdapter).getView(int, View, ViewGroup) line: 186    ListView(AbsListView).obtainView(int) line: 1256    ListView.makeAndAddView(int, int, boolean, int, boolean) line: 1668 ListView.fillUp(int, int) line: 667 ListView.correctTooHigh(int) line: 1289 ListView.fillGap(boolean) line: 609 ListView(AbsListView).trackMotionScroll(int, int) line: 2531    ListView(AbsListView).onTouchEvent(MotionEvent) line: 2001  ListView.onTouchEvent(MotionEvent) line: 3234   ListView(View).dispatchTouchEvent(MotionEvent) line: 3709   ListView(ViewGroup).dispatchTouchEvent(MotionEvent) line: 852   LinearLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884   ViewFlipper(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884    LinearLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884   FrameLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884    PhoneWindow$DecorView(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884  PhoneWindow$DecorView.superDispatchTouchEvent(MotionEvent) line: 1659   PhoneWindow.superDispatchTouchEvent(MotionEvent) line: 1107 FavoritenActivity(Activity).dispatchTouchEvent(MotionEvent) line: 2061  PhoneWindow$DecorView.dispatchTouchEvent(MotionEvent) line: 1643    FrameLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884    LinearLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884   TabHost(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884    FrameLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884    LinearLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884   PhoneWindow$DecorView(ViewGroup).dispatchTouchEvent(MotionEvent) line: 884  PhoneWindow$DecorView.superDispatchTouchEvent(MotionEvent) line: 1659   PhoneWindow.superDispatchTouchEvent(MotionEvent) line: 1107 Scout(Activity).dispatchTouchEvent(MotionEvent) line: 2061  PhoneWindow$DecorView.dispatchTouchEvent(MotionEvent) line: 1643    ViewRoot.handleMessage(Message) line: 1691  ViewRoot(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 123 ActivityThread.main(String[]) line: 4363    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  ZygoteInit$MethodAndArgsCaller.run() line: 860  ZygoteInit.main(String[]) line: 618 NativeStart.main(String[]) line: not available [native method]  </code></pre>","27404","","27404","","2010-11-23 07:25:52","2011-10-14 20:54:24","Android: SimpleCursorAdapter.bindView sometimes delivers null for findViewById","<android><listview>","1","1","","",""
"4237982","1","4238186","","2010-11-21 13:08:02","11","15504","<p>I'm trying to get a list of valid Android permissions. I know the 'official' ones at <a href=""http://developer.android.com/reference/android/Manifest.permission.html"">http://developer.android.com/reference/android/Manifest.permission.html</a> but it seems there are more out there.</p><p>For example</p><pre><code>android.permission.READ_SETTINGSandroid.permission.ACCESS_LOCATIONandroid.permission.ACCESS_GPScom.android.vending.CHECK_LICENSEcom.android.browser.permission.READ_HISTORY_BOOKMARKScom.android.browser.permission.WRITE_HISTORY_BOOKMARKScom.google.android.googleapps.permission.GOOGLE_AUTHcom.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICEScom.google.android.c2dm.permission.RECEIVE</code></pre><p>Where can I get such a list? Where do I get a description for these permissions?</p>","460542","","","","","2013-05-17 18:44:47","Where can I get a list of Android permissions","<android><android-manifest>","5","3","5","",""
"4238012","1","4568236","","2010-11-21 13:16:06","1","1359","<p>I am creating a Quiz application. Questions are added thru web form. I am using Mysql and ruby on rails for doing so..... I would like to display the questions and its options in android application with next and previous options. I am very new to android. Can somebody please tell me how do i do this.</p>","396543","","","","","2010-12-31 05:15:11","How to get values from database and display in android application","<android>","2","1","2","",""
"4238045","1","4238554","","2010-11-21 13:25:44","-1","1391","<p>i have a button in listview .now i want to use button.setonclicklistener and onListItemClick what i need to do</p>","510992","","","","","2010-11-21 15:11:55","Button on listView","<android><listview>","2","0","1","",""
"4238128","1","4238228","","2010-11-21 13:41:05","0","1162","<p>My app uses a simple <code>SQLite</code> database. Everything works fine I can now present a <code>Toast</code> with a chosen row from the return query using:</p><pre><code>{    //etc etc etc...    c.movetofirst();    DisplayTitle(c);}public void DisplayTitle(Cursor c){    Toast.makeText(main.this,             ""id: "" + c.getString(0) + ""\n"" +            ""reg: "" + c.getString(1) + ""\n"" +            ""type: "" + c.getString(2) + ""\n"",            Toast.LENGTH_LONG).show();        }</code></pre><p>I want to prsent all the data in the cursor to the screen using a view but I am not sure how to go about this. Which view should I use? I just wnt a simple looking grid representation which allows me to scroll through each row in the cursor</p><p>Thanks in advance.</p>","377613","","377613","","2010-11-21 14:49:47","2010-11-21 14:49:47","Android populate listview with cursor","<java><android>","1","0","","",""
"4238142","1","4238170","","2010-11-21 13:44:46","2","262","<p>I’m trying to create a roll over affect for my <code>ImageButton</code>s in my application I’ve been following the guide on the android developer’s site here’s the <a href=""http://developer.android.com/reference/android/widget/ImageButton.html"" rel=""nofollow"">link</a>  </p><p>I’ve been trying to create the required XML drawable file which will change the image if it’s clicked but I’m unsure what type of xml file to create, whether it be animation, layout, value etc. When I go to create the file it forces you to select the type of file which stops you creating the xml in the drawable folder.  </p><p>Does anyone know what typesof xml file I need to create?</p>","515031","","114066","","2010-11-21 16:28:24","2010-11-21 16:28:24","Problem with creating XML drawable","<android><xml-drawable>","1","0","","",""
"4238166","1","4238262","","2010-11-21 13:49:25","2","4270","<p>I have a problem with a <code>RelativeLayout</code> containing two <code>TextView</code>s and a <code>ImageView</code>, that I use for displaying items in a <code>ListView</code>. The items are correctly displayed on Android 1.6, but on Android 2.2 the <code>TextView</code>s are overlapping.</p><p>Here is an image that shows the correct and incorrect behavior side-by-side:</p><p><img src=""http://i.stack.imgur.com/TaAcq.png"" alt=""alt text""></p><p>And here is the source code of my RelativeLayout:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""?android:attr/listPreferredItemHeight""android:padding=""6dip""&gt;&lt;ImageView    android:id=""@+id/icon""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""    android:layout_alignParentBottom=""true""    android:layout_marginRight=""6dip""    /&gt;&lt;TextView    android:id=""@+id/secondLine""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:ellipsize=""marquee""    android:singleLine=""true""    android:layout_below=""@+id/firstLine""    android:layout_toRightOf=""@id/icon""    android:layout_alignParentBottom=""true""    android:layout_alignParentRight=""true""/&gt;&lt;TextView    android:id=""@+id/firstLine""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textStyle=""bold""    android:ellipsize=""marquee""    android:singleLine=""true""    android:layout_toRightOf=""@id/icon""    android:layout_alignParentBottom=""true""    android:layout_alignParentRight=""true""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>Any idea what I am doing wrong?</p><p>Thanks a lot,</p><p>Philipp</p>","400334","","400334","","2010-11-21 14:14:41","2010-11-21 14:14:41","Overlapping TextView items in RelativeLayout in 2.2; no problem in 1.6","<android><overlap><relativelayout>","2","0","2","",""
"4238277","1","4242513","","2010-11-21 14:14:20","0","1708","<p><br>I am currently trying to call another activity via a <code>OptionsMenuItem</code> using <code>Intent</code>. I have 2 layouts. The 1st layout has a <code>EditText</code> with a string that is retrieved from a database. The 2nd layout also have a <code>EditText</code> which is empty. The <code>OptionsMenuItem</code> is in the 1st layout. Whenever I click on the <code>MenuItem</code>, it is supposed to call up the 2nd layout and extract the text from the 1st layout into the <code>EditText</code> in the 2nd layout, but instead it crashes. I tried using the ActivityResult way but I still can't get it to work. Hope you guys can help me out.</p><p>This is my java code where the intent is for the main activity with the 1st layout:</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    // Build the menus that are shown when editing.    if (mState == STATE_EDIT) {        menu.add(0, REVERT_ID, 0, R.string.menu_revert)                .setIcon(android.R.drawable.ic_menu_revert);        if (!mNoteOnly) {            menu.add(0, DELETE_ID, 0, R.string.menu_delete)                    .setIcon(android.R.drawable.ic_menu_delete);            menu.add(1, ADD_ID, 1, R.string.add_namespace);            menu.add(2, MENU_ITEM_ADD, 2, R.string.menu_add);        }    // Build the menus that are shown when inserting.    } else {        menu.add(0, DISCARD_ID, 0, R.string.menu_discard)                .setIcon(android.R.drawable.ic_menu_delete);            menu.add(1, ADD_ID, 1, R.string.add_namespace);    }    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    // Handle all of the possible menu actions.    switch (item.getItemId()) {    case DELETE_ID:        deleteNote();        finish();        break;    case DISCARD_ID:        cancelNote();        break;    case REVERT_ID:        cancelNote();        break;    case ADD_ID:     addNamespace();     break;    case MENU_ITEM_ADD:     testActivity();         break;    }    return super.onOptionsItemSelected(item);}private final void testActivity(){ Intent i = new Intent(this, TitleEditor.class); startActivityForResult(i, STATIC_INTEGER_VALUE);}@Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data){ super.onActivityResult(requestCode, resultCode, data); switch(requestCode) {  case(STATIC_INTEGER_VALUE):  {   if(resultCode == Activity.RESULT_OK)   {    newTextTemplate = (EditText) findViewById(R.id.smsTemplate);String newTemplate = data.getStringExtra(TitleEditor.PUBLIC_STATIC_STRING_IDENTIFIER);    newTextTemplate.setText(newTemplate);   }   break;  } }}</code></pre><p>This is my java code with the 2nd layout:</p><pre><code>public class TitleEditor extends Activity implements View.OnClickListener {    private static final String[] PROJECTION = new String[] {            NotePad.Notes._ID, // 0            NotePad.Notes.TITLE, // 1            NotePad.Notes.TEMPLATE, // 2    };    private static final int COLUMN_INDEX_TITLE = 1;    private static final int COLUMN_INDEX_TEMPLATE = 2;    private Cursor mCursor;    private EditText mToContacts;    private EditText mFromTemplate; public static final String PUBLIC_STATIC_STRING_IDENTIFIER = null;    private Uri mUri;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.title_editor);        mUri = getIntent().getData();        mCursor = managedQuery(mUri, PROJECTION, null, null, null);        mFromTemplate = (EditText) this.findViewById(R.id.smsTemplate);        mFromTemplate.setOnClickListener(this);        Button b = (Button) findViewById(R.id.ok);        b.setOnClickListener(this);    }    public void onClick(View v) {     Intent resultIntent = new Intent();  resultIntent.putExtra(PUBLIC_STATIC_STRING_IDENTIFIER, NoteEditor.smsTemplate);  setResult(Activity.RESULT_OK, resultIntent);        finish();    }}</code></pre><p>My logcat requested by srinathhs:11-22 04:39:12.635: ERROR/AndroidRuntime(456): Uncaught handler: thread main exiting due to uncaught exception11-22 04:39:12.815: ERROR/AndroidRuntime(456): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.notepad/com.example.android.notepad.TitleEditor}: java.lang.NullPointerException11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.os.Handler.dispatchMessage(Handler.java:99)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.os.Looper.loop(Looper.java:123)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.app.ActivityThread.main(ActivityThread.java:4203)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at java.lang.reflect.Method.invokeNative(Native Method)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at java.lang.reflect.Method.invoke(Method.java:521)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at dalvik.system.NativeStart.main(Native Method)11-22 04:39:12.815: ERROR/AndroidRuntime(456): Caused by: java.lang.NullPointerException11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.content.ContentResolver.acquireProvider(ContentResolver.java:574)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.content.ContentResolver.query(ContentResolver.java:147)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.app.Activity.managedQuery(Activity.java:1493)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at com.example.android.notepad.TitleEditor.onCreate(TitleEditor.java:84)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)11-22 04:39:12.815: ERROR/AndroidRuntime(456):     ... 11 more</p>","504864","","504864","","2010-11-22 04:46:30","2010-11-22 05:20:26","Intent crashes my app","<android>","2","5","","",""
"4238303","1","4238372","","2010-11-21 14:21:41","1","222","<p>I read a lot about handling rotation in android applications, but I still have so many questions and need to much to understand.</p><p>Let me explain my problem or implementation, that I'm using now in my application.</p><p>If an activity will be opened, a get request will be sent to server. This request will be executed in a Thread (new Thread(...)) and if request was completed, activity's ui will be refreshed.</p><p>But what should I do, if the user rotate his device? </p><p>By default, the activity will be destroyed and request will be started again and start a new thread, but the thread of destroyed activity may be still running.</p><p>I guess, it's a quite wrong way, I have now. </p><p>But what is the best approach, to handle this?</p><p>Probably is the best way to forbid rotation, but what If I don't want that?!</p><p>May be it's the second part of my question:</p><p>I saw a <a href=""http://www.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html"" rel=""nofollow"">video form Google IO</a>. Mr. Dobjanschi suggested to use services and to store retrieved data in content provider. So, probably I can use a service for executing my requests. But should data be replaced every time the get request was completed?!</p>","408780","","114066","","2010-11-22 11:18:27","2010-11-22 11:18:27","Handling of server requests and device rotations","<android><rest><rotation>","3","0","1","",""
"4238377","1","4246812","","2010-11-21 14:34:50","1","885","<p>I have heard of people who have successfully run mapreduce on a google nexus one. There is no more info on the performance of running a full clustered mapreduce on android.</p><p>I would really like to run mapreduce on my phone on a relatively small amount of data non clustered mode, is it really worth it to use the hadoop completely ? is there a stripped version available anywhere? any alternatives?</p>","383677","","","","","2012-05-27 08:24:15","Running mapreduce on portable devices","<android><hadoop><mapreduce>","1","0","3","",""
"4238408","1","4238914","","2010-11-21 14:41:39","1","125","<p>I am developing an Android application using Eclipse and APT.</p><p>Now I need to use the package com.plancake.api.client that uses the org.json.simple package.</p><p>I have downloaded them on my developer machine (they are on my Desktop for now):</p><pre><code>|-- com|   `-- plancake|       `-- api|           `-- client|               |-- PlancakeApiClient.java|               |-- PlancakeApiException.java|               |-- PlancakeListForApi.java|               |-- PlancakeRepetitionForApi.java|               |-- PlancakeSettingsForApi.java|               |-- PlancakeTagForApi.java|               |-- PlancakeTaskForApi.java|               |-- PlancakeTasksFilterOptions.java|               `-- Utils.java`-- org    `-- json        `-- simple            |-- ItemList.java            |-- JSONArray.java            |-- JSONAware.java            |-- JSONObject.java            |-- JSONStreamAware.java            |-- JSONValue.java            `-- parser                |-- ContainerFactory.java                |-- ContentHandler.java                |-- JSONParser.java                |-- ParseException.java                |-- Yylex.java                `-- Yytoken.java</code></pre><p>What's the best way to add them to my Android project in Eclipse?</p><p>What I would prefer is a command-line simple solution just to understand what happens under the hood.</p><p>Thanks,<br>Dan</p>","354742","","","","","2010-11-21 16:33:40","Best way for adding packages I have the source code of to Android project with Eclipse","<android><packages>","1","0","","",""
"4238530","1","4238559","","2010-11-21 15:06:18","3","5525","<p>I would like to create a draggable marker in Android MapView (com.google.android.maps.MapView), exactly like this: <a href=""http://koti.mbnet.fi/ojalesa/exam/draggable.html"" rel=""nofollow"">http://koti.mbnet.fi/ojalesa/exam/draggable.html</a>.</p><p>I've already got an overlay pointing to the location I want, but I'd like the marker icon to be draggable like in the above example. Is there something ready to use for this or is it necessary to implement the dragging logic myself?</p>","24094","","","","","2012-05-24 18:06:46","Android MapView draggable marker","<android><google-maps><android-mapview>","1","1","5","",""
"4238782","1","4239307","","2010-11-21 16:04:18","1","1104","<p>i am writing java code to create a tabs.i have done that.but now i want the tab widget to be in the lower part of the screen.i hope this will be achived by adding this code. <code>android:layout_alignParentBottom=""true""</code> let me know how to add this coding.i want similar look like this <a href=""http://android-pro.blogspot.com/2010/08/iphone-like-tab-bar-in-android.html"" rel=""nofollow"">http://android-pro.blogspot.com/2010/08/iphone-like-tab-bar-in-android.html</a></p><p>TabHost tabHost = new TabHost(this);</p><pre><code>    tabHost.setLayoutParams(            new LinearLayout.LayoutParams(                    LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    RelativeLayout rl=new RelativeLayout(ContactManager.this);    RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);   rlp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, android.R.id.tabs);    rl.setLayoutParams(rlp);    tabHost.addView(rl);    TabWidget tabWidget = new TabWidget(this);    tabWidget.setId(android.R.id.tabs);    rl.addView(tabWidget, new LinearLayout.LayoutParams(              LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    FrameLayout frameLayout = new FrameLayout(this);    frameLayout.setId(android.R.id.tabcontent);    frameLayout.setPadding(0, 55, 0, 0);    rl.addView(frameLayout, new LinearLayout.LayoutParams(              LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));     tabHost.setup();</code></pre>","430652","","430652","","2010-11-21 18:12:52","2010-11-21 18:12:52","how to add parent align for tab TabWidget?","<android><tabs><android-tabhost><tabwidget>","1","0","","",""
"4238908","1","4238940","","2010-11-21 16:32:39","0","2302","<p>I have a list view that can display items based on internal state (ithas items, and 'viewed' items). i need to be able to toggle between thetwo states, i do that using a simple button that change the adapter'sstate and the adapter then called notifyDatasetChanged().My data DOES gets updated, however i was facing two problems:</p><ol><li>if in the previous mode the list was partially scrolled, it stayedin that state after i changed the data set (if i was half the way downi'll be half way down in the new data set as well, this is not thebehavior i want, but i cols not find a way to scroll the list manuallyto position 0. any ideas ? (setSelected is not exactly a solution since i DON'T want any selection i want to stay in touch mode)</li><li>In my list View each item has an image that is fetched from thenet, as so it's being brought using my networking manager and i sendthe image request ONLY if i'm in this screen for the first time OR ifscroll state is idlle, i didn't want to start loading images from thegetView method since if i fling the screen it may load a lot ofunnecessary images. However when calling notifyDatasetChanged() thescroll listener methods are not called. i solved this one by usingnotifyDatasetInvalidated even though my data is not empty, is there abetter way to solve this issue ? </li></ol>","312288","","","","","2010-11-21 16:39:10","reseting a ListView after the adapter's data was changed","<android><listview><reset>","1","0","","",""
"4238921","1","4239019","","2010-11-21 16:35:05","196","132288","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1560788/how-to-check-internet-access-on-android-inetaddress-never-timeouts"">How to check internet access on Android? InetAddress never timeouts</a>  </p></blockquote><p>I need to detect whether the Android device is connected to the Internet.</p><p>Now, the <code>NetworkInfo</code> class provides a non-static method <code>isAvailable()</code> that sounds perfect.</p><p>Problem is that:</p><pre><code>NetworkInfo ni = new NetworkInfo();if (! ni.isAvailable()){    // do something} </code></pre><p>throws this error:</p><pre><code>The constructor NetworkInfo is not visible.</code></pre><p>Safe bet is there is another class that returns a <code>NetworkInfo</code> object. But I don't know which.</p><p>3 questions:    </p><ul><li>do you know how to get the snippet of code above to work?    </li><li>how could I have found myself the information I needed in the online documentation?   </li><li>can you suggest a better way for this type of detection?</li></ul>","354742","","598500","","2013-10-24 08:39:24","2014-01-12 00:32:58","Android - detect whether there is an Internet connection available","<android><internet>","6","3","115","2012-01-10 02:02:37",""
"4238959","1","","","2010-11-21 16:43:19","1","1111","<p>I'm a new to software development on Android.</p><p>I want to make an application like <a href=""http://androinica.com/2010/03/04/make-your-rooted-android-phone-even-faster-with-setcpu-app-reviews/"" rel=""nofollow"">SetCPU</a> that can manipulate CPU frequency in Android.</p><p>But I couldn't find some related APIs or materials.</p><p><strong>I want to know following two things sincerely.</strong></p><ol><li>Are there APIs to change the CPU frequency in Android?</li><li>If not, are there some APIs in Linux?</li></ol>","515211","","63550","","2010-11-30 09:46:59","2010-11-30 09:46:59","How to change clock frequency in Android?","<android><linux><cpu><frequency>","2","1","","",""
"4239152","1","","","2010-11-21 17:22:10","1","489","<p>I am implementing checkers as a game for Android. I am able to move with my pieces and with ""computer"" pieces. I am going to add AI for computer somehow, but now I am stuck with Threading. This is my game activity for checkers (Game.java):</p><pre><code>private SachovniceView sachovniceView;    @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    chessboardView = new chessboardView(this);    setContentView(chessboardView);    chessboardView.requestFocus();}</code></pre><p>in chessboardView I draw in Canvas chessboard and I have here method for drawing mine and my opponent's game pieces and method (both in @Override protected void onDraw(Canvas canvas) method) for moving my pieces. I am storing position of gamepieces in [][] field, when I move with my stone, I invalidate() chesssboard for redrawing. And Here is the thing - how to implement Threads in my game? I am absolutely lost. I think I have to give away method for moving stones and make it alone as a class with name human_turn, then I have to make the same with computer (like computer_turn) and somehow implement Thread logic. My turn, opponent thread is stopped, I finish my move, opponent thread is going to alive, my thread is stopping and so on. I have spent whole day on the internet, but I didn't get the Thread thing in my head :-( Help would be appreciated. Thanks</p><p>Hmyzak</p>","513956","","3043","","2012-04-30 13:34:23","2012-04-30 13:34:23","Thread in Android game - how to implement?","<android><multithreading>","0","3","","",""
"4239236","1","4239334","","2010-11-21 17:40:39","0","623","<p>I am new to Java programming / Android development - but I have been working through a few examples and have been trying to build a ""mix-and-match"" app with 3 scrolling galley views.</p><p>I have created the relative layout with 3 gallery views, and have defined 3 arrays to contain a list of images.</p><p>My problem is that I can't seem to get the ImageAdapter to set the correct image resource for each gallery view (it duplicates the same images across all 3 galleries).</p><p>If I can just post the relevant sections of code:</p><pre><code>    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);    setContentView(R.layout.main);    Gallery gTop = (Gallery) findViewById(R.id.gallery_top);    Gallery gMid = (Gallery) findViewById(R.id.gallery_mid);    Gallery gEnd = (Gallery) findViewById(R.id.gallery_end);    gTop.setAdapter(new ImageAdapter(this));    gMid.setAdapter(new ImageAdapter(this));    gEnd.setAdapter(new ImageAdapter(this));}</code></pre><p>Then another class sets the resources (hardcoded):</p><pre><code> public View getView(int position, View convertView, ViewGroup parent) {        ImageView i = new ImageView(mContext);        i.setImageResource(mEndThumbIds[position]);        i.setAdjustViewBounds(true);        i.setLayoutParams(new Gallery.LayoutParams(                LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)        );        return i;    }</code></pre><p>How can I remove this hardcoded link and check to see what object is calling getView and set the image resources accordingly?</p><p>Thanks, Alex</p>","519924","","","","","2010-11-21 17:59:22","Android Gallery View - How to set resource?","<android><interface><views>","1","0","","",""
"4239294","1","4239901","","2010-11-21 17:51:09","0","462","<p>Quick question, when I try to assign a variable to the id of a flipperview in an xml file, I get an issue that doesn't allow me to find the id of the flipper.</p><p>mFlipper = (ViewFlipper) findViewById(R.id.your_flipper); contains an error that the id of the flipper view is not there.</p><p>The flipper view won't take the id assigned in the xml file and place it in the R.java class for some reason.</p><p>Any ideas why or is the id of a flipper not supposed to be accessible in the class? </p>","496686","","","","","2010-11-21 19:37:43","issues with FlipperView","<android><xml><layout><viewflipper>","1","1","","",""
"4239322","1","","","2010-11-21 17:57:02","2","795","<p>I'm still not sure what the issue is...  it runs but nothing is displayed. Ideas?</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.androidpeople.com/wp-content/uploads/2010/06/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>","515267","","","","","2011-07-29 04:52:21","Android XML Parser not working but runs","<android><xml><parsing><dom>","1","1","1","",""
"4239361","1","4239758","","2010-11-21 18:04:58","6","6570","<p>I'm getting a ""SAXParseException: Unexpected end of document"" error when trying to parse an xml document on android. </p><p>The document in question is from the google weather api, but it seems to throw the same error regardless of the xml file in question (as long as the xml is valid) so I suspect it's a problem with my approach, rather than the xml.</p><p>This is being done as a learning exercise, so I've probably (hopefully) overlooked something obvious =)</p><p>I've run the xml through an online validator, and it comes back as being well formed. (Can't tell me if it's valid as I don't have a DTD, but I dont think I need the DTD to parse the xml). </p><p>This is the code that I'm using to try and parse the file:</p><pre><code>private void refreshForecast()         URL url;        try {                       url = new URL( ""http://192.168.1.66:8000/google4.xml"");                URLConnection connection = url.openConnection();                HttpURLConnection httpConnection = (HttpURLConnection)connection;                 int responseCode = httpConnection.getResponseCode();                 if (responseCode == HttpURLConnection.HTTP_OK) {                         InputStream in = httpConnection.getInputStream();                                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();                        DocumentBuilder db = dbf.newDocumentBuilder();                        // falls over here parsing the xml.                        Document dom = db.parse(in);                    }        } catch (ManyExceptions e) {        .... } </code></pre><p>A cutdown version of the xml that produces the error is:</p><pre><code>&lt;?xml version=""1.0""?&gt;&lt;xml_api_reply version=""1""&gt;      &lt;weather&gt;            &lt;forecast_information&gt;                    &lt;city&gt;Hamilton&lt;/city&gt;            &lt;/forecast_information&gt;      &lt;/weather&gt;&lt;/xml_api_reply&gt;</code></pre><p>The stacktrace is:</p><pre><code>11-20 06:17:24.416: WARN/System.err(406): org.xml.sax.SAXParseException: Unexpected end of document11-20 06:17:24.416: WARN/System.err(406):     at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:131)11-20 06:17:24.416: WARN/System.err(406):     at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:110)11-20 06:17:24.426: WARN/System.err(406):     at com.dave.nzweather.WeatherApp.refreshForecast(WeatherApp.java:159)11-20 06:17:24.426: WARN/System.err(406):     at com.dave.nzweather.WeatherApp.onCreate(WeatherApp.java:100)11-20 06:17:24.426: WARN/System.err(406):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)11-20 06:17:24.438: WARN/System.err(406):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)11-20 06:17:24.438: WARN/System.err(406):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)11-20 06:17:24.446: WARN/System.err(406):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)11-20 06:17:24.446: WARN/System.err(406):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)11-20 06:17:24.456: WARN/System.err(406):     at android.os.Handler.dispatchMessage(Handler.java:99)11-20 06:17:24.456: WARN/System.err(406):     at android.os.Looper.loop(Looper.java:123)11-20 06:17:24.456: WARN/System.err(406):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-20 06:17:24.466: WARN/System.err(406):     at java.lang.reflect.Method.invokeNative(Native Method)11-20 06:17:24.466: WARN/System.err(406):     at java.lang.reflect.Method.invoke(Method.java:521)11-20 06:17:24.466: WARN/System.err(406):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-20 06:17:24.476: WARN/System.err(406):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-20 06:17:24.476: WARN/System.err(406):     at dalvik.system.NativeStart.main(Native Method)11-20 06:17:24.486: WARN/ROGER(406): org.xml.sax.SAXParseException: Unexpected end of document</code></pre><p>In the interest of brevity, I've not included the original xml, but it's just the standard weather xml from googles feed. </p><p>I've also tried a few completely different xml files, (including the sample from <a href=""http://www.ibm.com/developerworks/xml/library/x-android/"">http://www.ibm.com/developerworks/xml/library/x-android/</a>) and they all give the same error. (They also all validate as well formed when I run them through an online xml validator).</p><p>This makes me think that it's not a problem with the xml, but rather with how I'm trying to feed it into the parser.</p><p>Cheers</p><p>Dave Smylie</p>","1505600","","","","","2011-04-26 07:08:46","SaxParser on Android: Unexpected End Of Document Exception","<android><xml><saxparser><saxparseexception>","3","2","","",""
"4239420","1","4259004","","2010-11-21 18:14:41","1","908","<p>i am trying to do the folowing: set up a large image (larger than the screen or zoomed in at some point) and by swiping left or right to be able to focus the users view to a specific part on the image(pan and zoom to that point). similar to the map view when you center on some location (or zoom to). any pointers for how i can achieve this?</p><p>i saw the zoom and swipe examples JohnNick has provided and went to search further and i found these 2 tutorials for creating scroll and zoom on an image</p><p><a href=""http://www.anddev.org/viewtopic.php?p=36764"" rel=""nofollow"">link Long-press and Scroll Large Images Using Low Level Events</a></p><p><a href=""http://www.anddev.org/large_image_scrolling_using_low_level_touch_events-t11182.html"" rel=""nofollow"">link Large Image Scrolling Using Low Level Touch Events</a></p><p>but i still need a way to swipe to a specific part of an image. but now i have a dillema. as i read on there seem to be some issues with outOfMemoryException when working with large bitmaps, so my problem is: is it better to make the swipes as changing small bitmaps like the view transition example or is there a way to maybe only render the visible part of the image or something like that or maybe a map-like functionality ( dividing the image in ex. 8 parts and showing only the ones visible)?</p>","448192","","448192","","2010-11-24 11:59:59","2010-11-24 11:59:59","pan to a specific part of an image","<java><android><image>","1","0","3","",""
"4239427","1","4239494","","2010-11-21 18:16:53","0","205","<p>I have two spinners in an activity, A and B.  Each spinner uses an arrayAdapter linked to one or more string-arrays from an XML file.  I need multiple because B's values are populated depending on what is selected in A.</p><p>A reference to some arrays that B uses:</p><pre><code>&lt;!-- Used in spinner mCcColor --&gt;&lt;string-array name=""component0_color""&gt;    &lt;item&gt;Chocolate&lt;/item&gt;    &lt;item&gt;Yellow&lt;/item&gt;    &lt;item&gt;Strawberry&lt;/item&gt;&lt;/string-array&gt;&lt;!-- Used in spinner mCcColor --&gt;&lt;string-array name=""component1_color""&gt;    &lt;item&gt;Blueberry&lt;/item&gt;    &lt;item&gt;Chocolate&lt;/item&gt;    &lt;item&gt;Dark Chocolate&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>Next, I created a custom view class that is basically a canvas that I draw bitmaps (png) to.  Spinner A is the bitmap, and spinner B is color.  So, in order to determine what to draw in this view, I need to know what the user selected in spinner A and B.</p><p>It's fairly easy to pass the position that was selected in both spinner A and spinner B.  Here is an example.</p><pre><code>ArrayAdapter&lt;CharSequence&gt; adapter1 = ArrayAdapter.createFromResource(this, R.array.cc_components, android.R.layout.simple_spinner_item);adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);mCcComponent.setAdapter(adapter1);mCcComponent.setOnItemSelectedListener(new OnItemSelectedListener() {    public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {     //Call the method of the custom view that draws to the canvas     mSelectedComponent = position;     myCustomView.foo(mSelectedComponent, mSelectedCompColor);     myCustomView.postInvalidate();});</code></pre><p>The problem I have is tying the index numbers of the spinners I pass into the custom view.  I could do a bunch of switch case crap based on the position values I pass in, but this seems unnecessary because each case is just a few static values that correlate to the spinner.  Plus then I would be tightly coupling my view class to the caller activity.</p><p>It seems like it would be much easier and cleaner to set-up a more complex array in XML and have it contain strings and 3 integer values for each string.</p><p>Is there a way I can use a complex array without causing headaches for my spinner, the image, or the colors inside the custom view?  Is there a better way to approach this? Can anyone point me to some topics or links or post a few lines of code?</p><p>Thanks everyone!</p><p>Here is a visual representation of what I'm trying to explain, which seems like a cleaner way to solve this:</p><pre><code>&lt;!-- Used in spinner mCcColor --&gt;&lt;array name=""component1_color""&gt;    &lt;item&gt;Blueberry&lt;/item&gt;     &lt;red&gt;81&lt;/red&gt;     &lt;green&gt;27&lt;/green&gt;     &lt;blue&gt;21&lt;/blue&gt;    &lt;item&gt;Chocolate&lt;/item&gt;     &lt;red&gt;45&lt;/red&gt;     &lt;green&gt;21&lt;/green&gt;     &lt;blue&gt;6&lt;/blue&gt;&lt;/array&gt;</code></pre>","432209","","432209","","2010-11-21 18:29:56","2010-11-21 18:29:56","How to maintain loose coupling between classes when each class is referencing the same data","<java><android><xml>","1","0","","",""
"4239463","1","","","2010-11-21 18:25:35","0","2210","<p>I am writing an Android Application which outputs some  array of buttons dynamically.My question is how to implement onClickListener() functionality for Array Of Buttons.I mean how to recognize the button that is clicked in public void onClick() method ?I need to display a toast based  on the button that is clicked.</p>","429501","","","","","2010-11-21 18:58:13","OnClickListener() implementation of Array Of Buttons in Android","<android>","2","0","","",""
"4239614","1","4242464","","2010-11-21 18:52:00","1","4248","<p>this is the same question as ""how can I retrieve data from the new one to the old one"".</p><p>But in my first Activity, I called <code>setContentView(R.layout.main);</code>. There is a surfaceview drawing on canvas.</p><p>The only method I know is to call <code>getContext()</code> to get the context, then call <code>startActivity()</code>. But I can't call <code>startActivityForResult()</code> from the context I get, it seems that it doesn't support, I need to call it only in my activity class.</p><p>Can anyone give me any opinion?</p><p>EDIT:</p><p>Here is my code :</p><pre><code>public class gameView extends SurfaceView implements SurfaceHolder.Callback{    public gameView(Context context, AttributeSet attrs)    {        //This is how I do :         Intent intent = new Intent();        intent.setClass(getContext(), inputCharactorName.class);        getContext().startActivity(intent);        //This what I WANT to , but I don't know how        //Activity.startActivityForResult(null,FPS);        //I want to start the activity here;    }}</code></pre>","408278","","408278","","2010-11-22 05:04:50","2012-12-07 16:14:31","How to call startActivityForResult in class initialed from layout : main.xml","<android><activity>","2","3","","",""
"4239693","1","","","2010-11-21 19:05:27","1","214","<p>I'm about to start developing an app for Android. I am totally familiar with java, linux, etc. I read almost all the site <a href=""http://developer.android.com/index.html"" rel=""nofollow"">http://developer.android.com/index.html</a> (actually it is in the docs section when you download the SDK which is very comfortable). I passed tutorials from this documentation and feel myself completely ready for Android development. Now I think that I want to develop the same application in parallel for iPhone. I understand that there is objective-C but that's not a problem since I know not one programming languages (this is for those of guys that can tell me I should quit it 'cause ""I have no idea"" ;)) Anyway my question is: is there the same resource for iPhone development like for Android which I can read and get a good understanding of the platform with good practices, practical examples and tutorials? I wish I could spend two-three weeks reading and trying and then start developing.</p><p>As usual, I know I can google and try to find out this myself but advices from real developing people is always better.</p><p>Thank you!</p>","135749","","179850","","2011-02-21 19:13:09","2011-02-21 19:13:09","Developer's Android-like kickstart documentation for iPhone app development?","<iphone><android><documentation>","3","1","","",""
"4239880","1","","","2010-11-21 19:33:40","24","21276","<p>I am trying to detect when the physical Menu button on my Android phone has been pressed. I though the code below would work but it does not. Where am I going wrong please?</p><p>The error returned is 'Illegal modifier for parameter onKeyDown; only final is permitted'</p><pre><code>public boolean onKeyDown(int keyCode, KeyEvent event) {    if (keyCode == KeyEvent.KEYCODE_MENU) {        // Do Stuff    } else {        return super.onKeyDown(keyCode, event);    }}</code></pre>","497517","","","","","2013-10-24 09:49:48","Detecting physical Menu key press in Android","<android><button><physical>","4","1","3","",""
"4239891","1","4240102","","2010-11-21 19:35:25","0","343","<p>I'm developing an application for android with eclipse, and it has some logos (.jpg image files) that I reference from my code.</p><p>The problem is that, when I export with eclipse the .apk file to install the app, the logos aren't exported...</p><p>How can I export the package to have the logos when I install the application?</p><p>Thanks!!!</p>","506712","","","","","2010-11-21 20:15:22","How can I export images with my apk file in android?","<java><android>","1","4","","",""
"4239967","1","4239997","","2010-11-21 19:49:47","3","1939","<p>I know that it's possible to determine the data connection type (WIFI/or cellular) through Android, but is it possible to determine the cellular connection type and strength?</p><p>I have an app that downloads some images and I have found that on GPRS or on 3G with weak signal that this download process slows up the app unacceptably. What I want to do is say that if you have either WIFI or a strong and fast data connection then download; otherwise display a default placeholder image.</p><p>Any clues on how to do this?</p>","398293","","","","","2011-04-20 19:17:22","Determine data signal strength","<android>","2","0","2","",""
"4240077","1","4240316","","2010-11-21 20:10:45","5","1718","<p>I know I have seen a way of calling an Intent, and if it doesn't exist the function will redirect to market for download the application that has the intent. </p><p>Right now I check if the Intent exists but I don't know how to point the user to the resource to download.</p><p>Thanks in advance</p>","435267","","","","","2010-11-21 20:57:46","Download app if intent not installed","<android><download><android-intent>","2","0","4","",""
"4240117","1","","","2010-11-21 20:19:01","5","3365","<p>All of a sudden, it seems the database that my application is using has gone corrupt.I didn't change the structure of the database, but I did re-deploy the app several times on my device today.</p><p>It is throwing the following exception.</p><pre><code>E/Database(14281): CREATE TABLE android_metadata failed err=26 ..E/Database(14281): Failed to setLocale() when constructing, closing the databaseE/Database(14281): android.database.sqlite.SQLiteException: file is encrypted or is not  a databaseE/Database(14281):  at android.database.sqlite.SQLiteDatabase.native_setLocale(Native  Method)E/Database(14281):  at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1848)E/Database(14281):  at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1798)E/Database(14281):  at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:798)E/Database(14281):  at   android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:857)E/Database(14281):  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:850)E/Database(14281):  at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:539)E/Database(14281):  at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)E/Database(14281):  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)E/Database(14281):  at com.ecs.android.gps.storage.DBAdapter.open(DBAdapter.java:75)</code></pre><p>The database is initialized using the SQLLiteOpenHelper class.</p><pre><code>public DBAdapter(Context ctx) {    this.context = ctx;    DBHelper = new DatabaseHelper(context);}private static class DatabaseHelper extends SQLiteOpenHelper {    DatabaseHelper(Context context)     {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db)     {        db.execSQL(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 location_history"");        onCreate(db);    }}  </code></pre><ul><li>I'm basically opening/closing boththe database and cursors on eachoperation. </li><li>Some articles indicatethis being the way to go, but for anandroid app, wouldn't make more senseto keep the database connection openall the time ? </li><li>I can imagine ittaking a lot more resources toopen/close it each time. </li><li>There are multiple Activities and Services thataccess the database.  (potentially at the same time)</li><li>I never saw an exception in the logs</li></ul><p>Any idea what could have caused this, how to restore from it, and how to prevent this in the future ?I have the impression the exception is coming due to some concurrency issues (multiple threads trying to open/close or read/write to the database). I don't know to what degree an SQLite database is as robust as a normal database (mysql - oracle) when it comes to multi-threaded access, locking, .....</p>","492410","","492410","","2010-12-10 21:12:06","2013-01-29 03:02:36","Why has my Android SQLite DB gone corrupt all of a sudden?","<android><database><sqlite>","2","4","0","",""
"4240171","1","","","2010-11-21 20:27:33","1","1050","<p>I am trying to send an email to a specific address by using my own email.So far, I know that I can use <code>android.content.Intent.ACTION_SEND</code> to send an email. For istance:</p><pre><code>final Intent emailIntent = newIntent(android.content.Intent.ACTION_SEND);emailIntent.setType(""plain/text"");emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,    new String[]{""blabla@gmail.com""});emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,    ""Log-in Sucessful"");emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""Hi"");Activity context = null;context.startActivity(Intent.createChooser(emailIntent, ""Send mail...""));</code></pre><p>However, I do not know whether <code>ACTION_SEND</code> can accept username and password as well. This username and password basically will be used to authenticate the email sender. It's just like when you need to log-in into your gmail account before you can compose and send an email to someone.</p><p>Do you guys by any chance know any solution/guide to do this?</p><p>Thank you guys in advance</p>","448732","","418183","","2010-11-21 20:30:55","2010-11-21 21:44:57","Android Send Email (w/ Username and Password authentication) with android.content.Intent.ACTION_SEND","<android><email><android-intent>","2","0","","",""
"4240177","1","4241253","","2010-11-21 20:28:45","2","8476","<p>I need to resize several images inside ImageView to screen size.Currently I use scaleType=""centerInside"", it works good for bigger images to scale them down to screen size but doesn't expand small images.</p><p>All other suggested options crop or deform image. Is there any way to expand images (keeping ratio) via XML or do I have to do it manually in code?</p>","475861","","","","","2014-03-11 07:30:05","Android: scaleType expand to screen","<android><image><scale>","3","0","1","",""
"4240184","1","","","2010-11-21 20:30:08","0","5468","<p>I've got a little problem, and i don't see it.</p><p>I retrieve Json data (the <code>JSONArray</code>) and i wanted to make a <code>List</code> of all the names in the <code>JSONArray</code>, something like this.</p><pre><code>List list = new ArrayList&lt;String&gt;();for(int i=0;i &lt; data.length();i++){     list.add(data.getJSONObject(i).getString(""names"").toString());}</code></pre><p>And i wanted to take this list in an `ListView' so i did this : </p><pre><code>ArrayList&lt;String&gt; test = history_share.list;names_list = (String[]) test.toArray();ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter(this,     android.R.layout.simple_list_item_1, names_list);setListAdapter(adapter);</code></pre><p>(history_share is one of the method i created to take json data from an api .Eclipse doesn't see any error, and me neither. </p><p>Can somebody help me please ?</p>","439058","","418183","","2010-11-21 20:40:27","2014-04-01 07:43:18","JSonarray to Arraylist and Arraylist in ListAdapter doesn't work. (In Android)","<android><json><listview><arraylist><android-arrayadapter>","3","4","","",""
"4240239","1","4240351","","2010-11-21 20:41:34","3","2123","<p>I am trying to write some xml generated by my Android app to a file and I'm trying to use javax.xml.transform to do this. Only problem is that javax.xml.transform is not being found by eclipse.</p><p>The only options that come up are javax.xml and javax.xml.parsers. Does anyone know what could be going on?</p><p>Edit: Just an fyi I have Java JDK 6 update 22 installed.</p>","515377","","","","","2011-04-05 23:52:14","import javax.xml.transform cannot be resolved","<java><android><eclipse>","3","0","1","",""
"4240332","1","4240387","","2010-11-21 21:01:40","0","790","<p>I am trying to generate a tourist application for my final year project, which is a tourist application for the Olympic Games in London. the thing which is very confusing for me is that , I really dont know if I have to generate it in Android as a standalone application or should I generate it in Spring+HTML5 as Mobile Web Application???please let me know your ideas.the requirements are:</p><ol><li>having the games Venues</li><li>games schedules</li><li>lots of google maps as how to get to the games and venues</li><li>uplodading pictures</li><li>checking the undergrounds and transportation in london</li></ol><p>please let me know if you have any idea,</p>","261002","","75642","","2012-08-30 11:54:02","2012-08-30 11:54:02","Android Application or Mobile Web Application","<android><html5>","2","0","","",""
"4240338","1","4240613","","2010-11-21 21:02:27","2","5686","<p>I have implemented a Customised <code>ListView</code> using <code>BaseAdapter</code> and Lazy loading concept to load the images for the list items.I am working with the RESTFul services . The webservice method defines the no of items in each page(20 items per page) &amp; the total no of pages present(5 pages). Now , I am able to load the first page accordingly . I need to call the webservice method again to download the next page contents accordingly &amp; display it in the similar way as the first page.Kindly provide the logic/sample source code on how to implement the pagination if anyone has already implemented.</p><p>Also , I have seen in few of the Android applications in the Android market , that the progress dialogue is displayed at the end of the list while loading the items , maybe the second page contents. Kindly provide hints if someone has already implemented so.</p><p>Warm Regards,</p><p>CB</p>","443141","","418183","","2010-11-21 21:07:10","2011-08-23 04:39:24","Implement Pagination in ListView in Android","<android><listview><pagination>","1","0","2","",""
"4240457","1","","","2010-11-21 21:26:35","0","798","<p>I have a small piece of code that just won't write a file to the SD card on Android.</p><pre><code>InputStream in = thumbnailUrl.openStream();File outputFile = new File(CACHE_DIR, photo.getId());if (!outputFile.canWrite()) {    throw new IOException(""Can't write to this file"");}FileOutputStream fos = new FileOutputStream(outputFile);BufferedOutputStream bos = new BufferedOutputStream(fos, 1024);byte[] data = new byte[1024];int datapart;while ((datapart = in.read(data, 0, 1024)) &gt;= 0) {    bos.write(data, 0, datapart);}bos.close();fos.close();in.close();</code></pre><p>I made sure I created the folder <code>CACHE_DIR</code> before. It exists on the SD card, but <code>canWrite()</code> always returns <code>false</code>. This is the path: <code>/mnt/sdcard/Android/data/org.my.app/files/thumbnailcache</code></p><p>I can browse the directory <code>/mnt/sdcard/Android/data/org.my.app/files/thumbnailcache</code>.</p><p><strong>Here comes the interesting part</strong>: When I try to write to <code>/mnt/sdcard/Test/</code>, it succeeds.</p><p>How is that possible?</p>","435093","","435093","","2010-11-21 21:45:14","2010-11-21 21:45:14","Android does not create File in one directory, but does in an other","<android><file>","1","0","","",""
"4240503","1","4240519","","2010-11-21 21:33:53","2","575","<p>In my app I have a TextView that I use setText on after a certain action.But when the orientation changes the TextView's text is changed back to normal.</p><p>I have a similar problem with my app's file browser, for some reason it goes back to /sdcard/ when the orientation changes :/</p><p>Is there anything I can do to prevent loosing the TextView's text?</p>","427234","","372239","","2014-01-04 15:59:26","2014-01-04 15:59:26","Android Development: How To Keep Text When Orientation Changes?","<android><text><orientation><textview>","1","1","","",""
"4240562","1","4240601","","2010-11-21 21:46:18","0","945","<p>I wish to provide the users of my application the ability to keep the screen on using a <code>WakeLock</code>. In my main activity I have created the following function:</p><pre><code>protected void processWakeLock(int pauseResume) {   switch (pauseResume) {   case STATE_RESUME:      if (mKeepScreenOn) {         wakeLock.acquire();      }      break;   case STATE_PAUSE:      if (wakeLock.isHeld()) {         wakeLock.release();      }      break;   }}</code></pre><p>I am currently calling it from my <code>onPause</code> and <code>onResume</code> overrides, as I wish to make certain I do not cause a lock on the user's phone when they are not actively using my application. My application has 3 other full screen views. What is the best way to ensure that their <code>WakeLock</code> carries over to all portions of my application while still being safe to the rest of their phone.</p><p>My first thought is to duplicate the same code snippet in each of my activities though that seems like a lot of boiler plate. I can't use <code>onStart</code> and <code>onStop</code> either because visibility is lost when I switch to another full screen activity. Though perhaps it would be better to</p><p>Based on the diagram and information found here ( <a href=""http://developer.android.com/guide/topics/fundamentals.html"" rel=""nofollow"">http://developer.android.com/guide/topics/fundamentals.html</a> ) I don't see a better way to apply the lock.</p>","216345","","","","","2010-11-21 21:52:52","How do you safely implement WakeLock across multiple activites","<android><android-wake-lock>","1","0","","",""
"4240586","1","4240921","","2010-11-21 21:48:52","2","3974","<p>Is there a way to use Google Image Search API from Android application?</p><p>Official page (http://code.google.com/apis/imagesearch/) talks about using the API from a website. I'd like to use it from android application. I'd like to get URL of a first image for the specified keyword which will user enter in my applicaton. Thanks!</p>","515420","","21234","","2010-11-21 22:20:50","2010-11-21 22:58:45","Is there A Way To Use Google Image Search API From Android?","<android><image>","1","0","2","",""
"4240622","1","4241116","","2010-11-21 21:58:33","2","696","<p>Hey all - I am using a flipper in my main xml file to view multiple layouts in my app.</p><p>For instance, if something = 1, the user is shown one version of the flipper, where if something = 2 the user sees a different version.</p><p>Is there a way I can view the layout of the xml file for the other flippers I have rather than the main one?  Ie, is there a way to switch views of each state of the flipper in eclipse?</p><p>Thanks!</p>","496686","","","","","2010-11-21 23:45:56","How do I view a different flipper in Layout view of an xml?","<android><xml><layout><viewflipper>","1","0","","",""
"4240650","1","4240913","","2010-11-21 22:03:32","-1","555","<p>I am trying to write an XML file to a url e.g. <a href=""http://myIPAddress/myFolder/myFile.xml"" rel=""nofollow"">http://myIPAddress/myFolder/myFile.xml</a> <br/>I am using an Apache2 server for my tests on Ubuntu 10.10</p><p>Output line example (ignore apostrophe): <br/>&lt;'myEntity id=""1"" name=""me"" /></p><p>Also, i want to able to reopen the connection anytime and add lines to the end of the file. <br/></p><p>I'd post my attempt here for correction but it's a sad one. <br/>I am trying OutputStreamWriter with URLConnection, please correct me if i should be using a different approach.</p>","512974","","512974","","2010-11-24 02:41:25","2010-11-24 02:41:25","How to Write XML to a URL?","<android><xml><apache2>","1","0","","",""
"4240682","1","4240831","","2010-11-21 22:10:30","1","241","<p>I am trying to reproduce the account chooser widget that the GMail app has on top right.<br>I know already how to put things in the title but i have several problems:  </p><ul><li>I've tried putting a normal button in the title but it doesn't fit</li><li>It looks like the size of the title is bigger than what it is, for example if I put a normal button there, there is no way of making it the proper height, in fact goes below the app like if half of the title space was hidden below</li><li>I thought it might be a clickable label with a rectangular shape, but I tried it and no way to make it work.</li></ul><p>Any hint?</p>","78667","","","","","2010-11-21 22:40:34","Android title buttons","<android><android-widget><title>","1","0","","",""
"4240750","1","4240923","","2010-11-21 22:24:57","3","3957","<p>I am trying a lot but it is not wroking. Here's my code:</p><pre><code>public class SchofferStr extends Activity {    String summary = ""&lt;html&gt;&lt;body&gt;You scored &lt;b&gt;192&lt;/b&gt; points.&lt;/body&gt;&lt;/html&gt;"";    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.menu);        WebView webview = new WebView(this);        setContentView(webview);        webview.loadData(summary, ""text/html"", ""utf-8"");    }}</code></pre><p>the summary string i have is a lengthy htmlformatted table. But problem is this code is not even working for this simple html formated string. What is it that im doing wrong?Please help, im stuck.</p>","515442","","263521","","2010-11-21 22:40:14","2011-03-05 10:38:47","Display html formated table using webview in Android","<android>","1","2","1","",""
"4240755","1","4240906","","2010-11-21 22:25:57","0","451","<p>My ImageView for some odd reason is always displaying a picture in the middle, left of my screen despite the xml code insisting it to be in the center.</p><p>I force portrait orientation in my app and here is my xml code for my layout:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:gravity=""center""&gt;    &lt;ImageView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:id=""@+id/image_view""    android:layout_weight=""1.0""/&gt;&lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@+id/message""    android:gravity=""center_horizontal""    android:padding=""10dip""/&gt;    &lt;Button            android:layout_gravity=""center_horizontal""    android:layout_width=""fill_parent""    android:textStyle=""bold"" android:id=""@+id/action_button"" android:selectAllOnFocus=""false"" android:layout_height=""100dip"" android:text=""Click here to preform actions""/&gt;&lt;/LinearLayout&gt;</code></pre><p>So, the page should display as Picture in the middle, extending the width of the screen, the text below that and the button below that.  But for some reason, the picture is displayed as a small, box thumbnail in the middle left of the screen - any ideas on a workaround?</p>","496686","","","","","2010-11-21 22:54:18","Need help with an ImageView always displaying incorrectly","<android><xml><layout><orientation><centering>","1","0","","",""
"4240803","1","","","2010-11-21 22:35:43","0","753","<p>How i can do that? Id like to ban the zooming of the webview in multitouch. </p>","472537","","","","","2011-04-20 04:10:25","Android webview ban zoom on multitouch","<android><webview>","1","0","","",""
"4240819","1","4240834","","2010-11-21 22:38:13","4","1451","<p>I'm an old developer (Active since the Z80 days) starting fresh with Android.  </p><ol><li>The Android Developers page recommends installing Eclipse before installing the Android SDK.</li><li>It also states ""There are known issues with the ADT plugin running with Eclipse 3.6. Please stay on 3.5 until further notice.""  </li><li>The Eclipse download page seems to offer 11 different flavors of the package. None mention Android and all seem to be the Version 3.6 that the Android Developers pages recommends avoiding. - What does one do?</li></ol><p>Comments welcomeJoe Cullity</p>","515453","","418183","","2010-11-21 22:44:41","2010-11-22 14:36:49","Which version of Eclipse to use with Android","<android><eclipse><version>","3","1","1","",""
"4240880","1","","","2010-11-21 22:48:28","0","189","<p>I'm  a new Android developer and I have been trying to get the HelloMapView example to work properly.I got the API Key for debug following:<a href=""http://code.google.com/intl/es-ES/android/add-ons/google-apis/mapkey.html"" rel=""nofollow"">http://code.google.com/intl/es-ES/android/add-ons/google-apis/mapkey.html</a></p><p>I get the application running both in the emulator and on a mobile phone, but in  both cases, I only see the overlay item of the example but I can't see the map.I have already done this twice and the result is the same.I have declared the use of the library and the use of internet permisson in the manifest.</p><p>Do you have any idea for solving my problem?</p>","515459","","180538","","2010-11-22 09:02:02","2010-11-22 10:46:26","HelloMapView problem","<android><google-maps-api-3>","1","5","","",""
"4241031","1","","","2010-11-21 23:22:57","0","448","<p>I have a situation which  I will try to explain clearly. I have two services, Service A and Service B.Activity C connects to service A using onBind(). Service A connectes to Service B using a callback object. I want Service A's onbind to not be executed until Service B is connected to Service A. What will be a good way to achieve this?</p>","476415","","","","","2010-11-22 02:12:33","Android Service connecting to another service","<android>","2","1","","",""
"4241037","1","4241086","","2010-11-21 23:24:12","0","174","<p>I have a null pointer on a button that I need to take me to a new layout when pushed.  I have the code set as:</p><pre><code>((Button) findViewById(R.id.analyzee)).setOnClickListener(btnClick);</code></pre><p>inside a method that uses conditional statements.  </p><p>It is a basic face detect app.  If faces are not found, I do this:</p><pre><code>if (facesFound &lt; 1) {                mFlipper.setDisplayedChild(2);                mTheMessage = (TextView) findViewById(R.id.falsemessage);                mThePicture = (ImageView) findViewById(R.id.false_view);                mTheMessage.setText(R.string.noFaceOne);                mThePicture.setImageBitmap(bitmap565);                return; </code></pre><p>if faces are found, I draw a box on the face, and do this:</p><pre><code>mFlipper.setDisplayedChild(1);            mTheMessage.setText(R.string.noFaceFive);            mThePicture.setImageBitmap(bitmap565);</code></pre><p>My issue lies here though, I use this method to run when buttons are clocked:</p><pre><code>private final View.OnClickListener btnClick = new View.OnClickListener() {        @Override        public void onClick(View v) {            switch (v.getId()) {            case R.id.scan_box:                openCamera();                break;            case R.id.crop_face:                final ProgressDialog dialog = ProgressDialog.show(Main.this, """",                        ""Cropping photo"", true);                dialog.show();                Handler handler = new Handler();                handler.postDelayed(new Runnable() {                    @Override                    public void run() {                        dialog.dismiss();                    }                }, 3000);                cropFace();                break;</code></pre><p>So, my issue lies in this:</p><p>In one of my layouts in the flipper, the button that rests on the layout will need to give the user the option to snap a new picture if there are no faces found.  The other layout will need the button (upon click) to have the faces cropped and the results to be sent to another layout.</p><p>The issue I am facing is where the code: </p><pre><code>((Button) findViewById(R.id.crop_face)).setOnClickListener(btnClick);</code></pre><p>needs to be placed in order for the program to release the button has been clicked, it calls the case in my switch statement, and runs the crop face_method.</p><p>I try putting it in the if statement where I set the image View and text View, but I get a null pointer on that line I am declaring my button on.</p><p>The buttons I have on my main menu work fine, as they are in my onCreate method, but I don't know where to play this button command, and also where I need to place my reopen Camera command.</p><p>Thanks!</p>","496686","","418183","","2010-11-21 23:33:35","2010-11-21 23:37:34","Null Pointer on an attempt to call a button","<android><button><conditional><nullpointerexception>","1","0","","",""
"4241083","1","","","2010-11-21 23:36:37","0","894","<p>I have a RadioGroup inside of a RelativeLayout. I've got a few RadioButtons for different options, like ""Bob"", ""Joe"", and ""Fred"". However, I need to add an ""Other..."" option with an EditText right next to a RadioButton in case a user wants to enter ""Steve"". Is there a way to do this?</p>","483790","","","","","2010-11-21 23:58:45","How can I place an EditText and TextView in a RadioButton?","<java><android><radio-button><customization><relativelayout>","1","0","","",""
"4241182","1","","","2010-11-22 00:03:41","1","7547","<p>I am using WVGA800 skin in Android emulator, so the density (hw.lcd.density) is 240. I have to put 4 image buttons (72 pixels per inch) at the bottom of activities view. As the resolution is 480X800, I asummed that the width of image must be 120 pixels. The problem is when application is launched,  the 3 buttons take all width  and there is no place for 4th button... Then I created button image in Fireworks with resolution 240 pixels per inch and in 120px width, but problem remains. Could somebody explain how to make correct drawables (sizes and dpi) so that they can be displayed pixel in pixel on Android? </p>","515477","","","","","2011-09-08 23:16:35","Android, images and dpi","<android><resolution><dpi>","3","0","","",""
"4241184","1","4241412","","2010-11-22 00:04:06","0","184","<p>I have an app that crops faces - something the app can do in a nanosecond, but I want the user to think it takes a bit longer.  So in a case on a button click, Here is what I have:</p><pre><code>final ProgressDialog dialog = ProgressDialog.show(Main.this, """",                        ""Cropping faces..."", true);                dialog.show();            Handler handler = new Handler();            handler.postDelayed(new Runnable() {                @Override                public void run() {                    dialog.dismiss();                }            }, 3000);                            cropFaces();                            return</code></pre><p>}</p><p>The dialog shows fine and the faces crop fine too.  The problem is - when the user runs the app, the two happen simultaneously on the screen.</p><p>Is there a way to make it so the dialog appears, 3 seconds elapse on screen, and then the cropFaces runs?  That way it will look like it cropped the faces in a few seconds and then the new page appears.  Thanks!</p>","496686","","720507","","2012-05-03 17:32:55","2012-05-03 17:32:55","How do I preform an action, after a brief pause?","<android><dialog><callback>","1","1","","",""
"4241237","1","4241289","","2010-11-22 00:14:16","0","428","<p>I am designing an app that will have some activities separated in tabs. Some of them will have to perform tasks in the background will the user is in another tab. </p><p>What is the best strategy for designing an app like this? </p><p>I was thinking about using a service but it can be killed by android dalvik, isnt it? </p><p>Thanks in advance! </p>","217527","","","","","2010-11-22 00:29:18","How to design an Android application with multiples activities and operations running in background?","<android><service><background><activity>","1","2","","",""
"4241292","1","4252857","","2010-11-22 00:29:45","7","20554","<p>I've tried several answer I've found across the web, such as:</p><pre><code>Camera.Parameters parameters = mCamera.getParameters();parameters.set(""camera-id"", 2);mCamera.setParameters(parameters);</code></pre><p>or</p><pre><code>mMediaRecorder.setVideoSource(2);</code></pre><p>But it doesn't work. I've also set permissions on the manifest file:</p><pre><code>&lt;uses-permission android:name=""android.permission.CAMERA"" /&gt;&lt;uses-feature android:name=""android.hardware.camera"" /&gt;</code></pre><p>Am i missing out on something? I've searched StackOverflow and I know this has been asked before but there seem to be no confirmed solution on this, any kind of help would be appreciated.</p><p>Note: I'm using Galaxy S on the 2.1 platform</p>","460176","","460176","","2010-11-22 00:35:15","2012-10-10 15:48:16","How to use Front Facing Camera on Samsung Galaxy S","<android><android-sdk-2.1>","3","0","6","",""
"4241309","1","4241334","","2010-11-22 00:33:07","1","235","<p>Anyone know how to use an intent to display the view of one of my child layouts in my parent xml layout?  I am using ViewFlipper and want a button to be clicked to display a specific view in my xml file:</p><p>IE, something like this:</p><pre><code>    case R.id.previous_box:            Intent j = new Intent(mFlipper.setDisplayedChild(3));            startActivity(j);            return;</code></pre><p>Or something like that - thanks!</p>","496686","","","","","2010-11-22 00:39:35","Having an Intent go to a layout in my main xml file","<android><variables><activity><android-intent><calling>","1","0","","",""
"4241396","1","","","2010-11-22 00:56:25","2","2488","<p>Can anyone tell me what's wrong with this implementation?  All I want to do here is have two overlapping views that swap places when you tap the screen.  Unless I'm just using it wrong, View.bringToFront() does nothing?  </p><p>Below is all the code in my app.  Note that I added padding to the 'backView' just to make sure the two were actually overlapping.  Indeed I could see both on the screen.  While tapping the top view does indeed trigger the onClick method, nothing visibly changes in response to the calls to bringToFront.</p><pre><code>public class MainActivity extends Activity implements OnClickListener {private ImageView frontView;private ImageView backView;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    frontView = (ImageView) findViewById(com.example.R.id.FrontView);    backView = (ImageView) findViewById(com.example.R.id.BackView);    frontView.setOnClickListener(this);    backView.setOnClickListener(this);    backView.setPadding(10,0,0,0);}private boolean flag;public void onClick(View v) {    if (!flag) {        backView.bringToFront();    }    else {        frontView.bringToFront();    }    flag = !flag;}}</code></pre><p>and the corresponding 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:orientation=""vertical""    android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    &gt;&lt;ImageView      android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:id=""@+id/FrontView""    android:src=""@drawable/front""    /&gt;&lt;ImageView      android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:id=""@+id/BackView""    android:src=""@drawable/back""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Maybe it's the layout I'm using?  I'm not sure... I've tried FrameLayout and LinearLayout as well.</p>","114409","","114409","","2010-11-22 01:11:56","2011-01-11 17:08:56","Android: swapping two overlapping views","<android><gui>","2","1","","",""
"4241402","1","4241514","","2010-11-22 00:57:28","2","526","<p>In Eclipse, when I mouse hover over a built-in method, it displays a method definition including stuff like what the method does, input objects, return objects etc.</p><p>If I have a yellow line (warning) under the method I'm trying to use, I can't get the mouse-over to show the definition.</p><p>If I try hitting F3, I get a ""The Jar of this class file belongs to container ""Android 1.6"" blah blah blah.""</p><p>How do I show the definition of the method I am using when there is a warning?</p>","432209","","","","","2010-11-22 01:27:09","Can't show method definition if Eclipse recognizes a warning on the method","<java><android><eclipse>","1","1","1","",""
"4241419","1","4245895","","2010-11-22 01:01:14","0","1201","<p>I seem to be having trouble with updating a TextView from a thread.  I have a GameConnection class (which manages a socket connection) which I want to use across activities.  It calls a local ""onMessage"", which then uses the target handler to call dispatch Message.  The ""Handler"" in this case, is in my GameBrowser activity.</p><p>Here's code from the GameConnection class.</p><pre><code>in = new BufferedReader(new InputStreamReader(socket.getInputStream()));out = new PrintWriter(socket.getOutputStream(),true);String message = """".intern();// as a newline character is read, we interpret it as a messagewhile ((message = in.readLine()) != null &amp;&amp; isConnected){    onMessage(message);}</code></pre><p>As said above, a local method ""onMessage"" method handles dispatching of the message.</p><pre><code>  private void onMessage(String message){       ... // create message from String      handler.dispatchMessage( msg );  }</code></pre><p>However, when I get the response in the GameBrowser class, I get a CalledFromWrongThreadException .  Initially, I was using a callback method, which of course wasn't working.  So, after some research, I've found that I have to use a Handler, but I can't seem to get it right.</p><pre><code>public class GameBrowser extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Log.d(C.tag, ""GameBrowser.onCreate addr:"" + this);    handler = new Handler(new HandlerCallback());    connection.addMessageListener(handler);    connection.connect();    txtGameLabel = (TextView)findViewById( R.id.txtGamesLabel);    setContentView(R.layout.game_browser);}private class HandlerCallback implements Callback{    @Override    public boolean handleMessage(Message msg) {        if (txtGameLabel == null){            txtGameLabel =  (TextView)findViewById( R.id.txtGamesLabel);        }        String message = msg.getData().getString(""message"");        Log.d(C.tag, ""GameBrowser recieved message "" + message);        txtGameLabel.setText(""Data: "" + message);        return true;    }}}</code></pre>","299934","","","","","2010-11-22 13:31:43","Trying to update a TextField through a Handler, and getting CalledFromWrongThreadException","<android><android-widget>","1","0","1","",""
"4241464","1","6542529","","2010-11-22 01:11:44","5","1396","<p>I have two HTC phones, one is HTC desire and another is HTC aria. I'm using ddms to capture the screenshot on HTC desire before, it works fine. However recently I buy one HTC aria, and I found when doing screenshot on camera preview and video playing (e.g. youtube clips), the result goes black.</p><p>I think that might be some overlay issue, but just can't figure out how do capture screenshots on camera preview.</p>","211438","","","","","2011-07-01 00:34:38","Capture screen shot on Android phone when playing video and camera preview","<android><overlay><screenshot>","1","1","","",""
"4241466","1","4241478","","2010-11-22 01:12:30","6","614","<p>I've been experiencing occasional lags in my Android game when the garbage collector runs. I ran DDMS and discovered that all of the memory being allocated by my application is from this line:</p><pre><code>scoreString = String.valueOf(score);</code></pre><p>What is the best way to convert an integer to a string without allocating any memory?</p>","118391","","","","","2014-02-22 18:54:23","Convert an integer to a string without allocating memory","<java><android><memory-allocation>","2","2","2","",""
"4241491","1","4241643","","2010-11-22 01:20:31","1","873","<p>I am working in Android with SQLite.</p><p>My db has 2 tables:</p><pre><code>Table 1: cars_id(int,pri-key)reg(text)type(text)Table 2: jobs_id(int,foreign-key)date(date)</code></pre><p>I need a sqlite statment which will get me all cars which have NOT had a job in the past 3 weeks. Iam actually porting the app from c#, and the statment I use for this (in MySQL) is</p><pre><code>SELECT c.id, c.reg, c.type FROM buses c WHERE NOT EXISTS (SELECT NULL FROM jobs j WHERE j.id = c.id AND j.date &gt;= CURRENT_DATE - INTERVAL 21 DAY</code></pre><p>But the SqliteDataBase Object I am working with in android takes a different format, How would I run this query?</p><p>Thanks in advance.</p>","377613","","","","","2010-11-22 22:26:40","sqlite select query","<sql><android><database><sqlite>","1","0","","",""
"4241600","1","","","2010-11-22 01:54:14","0","784","<p>I'm attempting to use the Neucha font from Google Font Directory (<a href=""http://code.google.com/webfonts/family?family=Neucha&amp;subset=latin"" rel=""nofollow"">link</a>) in my Android app.</p><p>With other custom fonts, unsupported characters are still displayed, such as Japanese characters, as well as accented characters. However with the Neucha font, most unsupported characters (such as Asian ones) are displayed, but some accented characters (â, ã, ä, å, a, ô, õ, ö, o for example) are not displayed. Instead blank spaces are shown in their places.</p><p>Is this an issue with the font, or with Android? What can I do to get characters not supported by this font to be displayed using the default font in an EditText view? Thanks!</p>","342731","","","","","2012-06-09 08:52:16","Android: Characters not supported in custom font showing up as blanks","<android><fonts><edittext>","2","0","","",""
"4241694","1","","","2010-11-22 02:18:37","0","233","<p>I'm having trouble getting a 160dpi, 480x800 emulator to display the contents of my main.xml in a layout-large folder. It seems to still be using the main.xml in my regular layout folder. Are there any common reasons it wouldn't be reading this file correctly?</p><p>To put it into context, I have a .png called ""back_large"" in my drawable-mdpi folder. I also have a .png called ""back."" Both are 160dpi, but ""back_large"" is roughly twice the size of ""back."" In the main.xml within the layout-large folder, I have an ImageView that points to ""back_large"". In the main.xml within the regular layout folder, I have an ImageView that points to ""back."" When I run both the Normal- and Large-sized 160dpi emulators, they both pick up ""back,"" which leads me to believe layout-large is not being implemented properly. I just don't know why.</p><p>Thanks.</p>","503185","","","","","2011-07-05 09:25:59","Trouble with using layout-large with 160dpi large screen emulator (Android)","<java><android>","1","0","","",""
"4241707","1","4241736","","2010-11-22 02:20:34","0","143","<p>I made a pool of about 20 strings that each display different sayings.  I want one of those sayings to display to a text view on random.</p><p>I cast an integer as a random 1-20,</p><pre><code>int randomNumber5 = (int) Math.ceil(Math.random() * 20);</code></pre><p>and created strings named randomString1, randomString2, etc...til it hits 20.</p><p>The best way I could think to do this, was assign each string a number between 1 and 20 as a case.</p><p>So:</p><pre><code>switch(randomNumber5){  case 1:    mTheMessage.setText(R.string.randomString1);  }  case 2:    mTheMessage.setText(R.string.randomString2);  </code></pre><p>but I feel like there is a better way to do this right?</p>","496686","","","","","2010-11-22 03:29:04","Randomly displaying strings","<android><arrays><string><random><switch-statement>","3","0","","",""
"4241808","1","4245597","","2010-11-22 02:39:14","1","1905","<p>I am working in an app that shows different cars and the user needs to choose one. When you press on next the car moves out of the screen and the new one comes in.</p><p>My resources are:</p><ul><li>Car's body</li><li>Car's wheel</li></ul><p>(I need them to be separated because when the car moves I need to rotate the wheels)</p><p>I wanted to avoid <code>AbsoluteLayout</code> so my <code>CarView</code> extends `RelativeLayout. Here's the code:</p><pre><code>public class CarView extends RelativeLayout {    private ImageView mBody;    private ImageView mLeftWheel;    private ImageView mRightWheel;    private float mScale;    public CarView(Context context, AttributeSet attrs) {        super(context, attrs);    }    public CarView(Context context) {        super(context);    }    public void initView(Car car) {        mScale = getContext().getResources().getDisplayMetrics().density;        Context ctx = getContext();        RelativeLayout.LayoutParams params;        params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,                LayoutParams.WRAP_CONTENT);        params.addRule(RelativeLayout.CENTER_IN_PARENT);        mBody = new ImageView(ctx);        mBody.setLayoutParams(params);        mBody.setImageResource(R.drawable.car_body);        addView(mBody);        params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,                LayoutParams.WRAP_CONTENT);        params.addRule(RelativeLayout.CENTER_IN_PARENT);        mLeftWheel = new ImageView(ctx);        mLeftWheel.setLayoutParams(params);        mLeftWheel.setImageResource(R.drawable.car_wheel);        mLeftWheel.setPadding(0, dpToPx(79), dpToPx(188), 0);        addView(mLeftWheel);        params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,                LayoutParams.WRAP_CONTENT);        params.addRule(RelativeLayout.CENTER_IN_PARENT);        mRightWheel = new ImageView(ctx);        mRightWheel.setLayoutParams(params);        mRightWheel.setImageResource(R.drawable.car_wheel);        mRightWheel.setPadding(dpToPx(203), dpToPx(75), 0, 0);        addView(mRightWheel);    }    public void startMoving() {        RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);        rotateAnimation.setInterpolator(new LinearInterpolator());        rotateAnimation.setDuration(900L);        rotateAnimation.setRepeatCount(Animation.INFINITE);        mLeftWheel.startAnimation(rotateAnimation);        mRightWheel.startAnimation(rotateAnimation);    }    private int dpToPx(float dp) {        return (int) (dp * mScale + 0.5f);    }}</code></pre><p>Basically what I am doing is placing the body of the car and then using padding to place the wheels where they should be.</p><p>After reading <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg20288.html"" rel=""nofollow"">this</a> android developer's thread I notice that <code>RotateAnimation</code> rotates the whole view including the padding making the wheels to do some strange movement.</p><p>How should I fix this?Can you think of a better way to place the wheels <code>ImageView</code> instead of using padding?</p><p>Another issue I have is that in a certain point I want the wheels to stop moving, but the method <a href=""http://developer.android.com/reference/android/view/animation/Animation.html#cancel%28%29"" rel=""nofollow"">cancel()</a> in <code>Animation</code> is Since: API Level 8 and I need this to work on 1.5. How should I stop the rotation?</p>","119895","","119895","","2010-11-22 12:20:08","2011-06-24 09:16:24","Car animation rotating wheels","<android><imageview><rotateanimation>","1","1","1","",""
"4241850","1","4247828","","2010-11-22 02:48:01","0","291","<p>I would like to be able to format <code>java.util.Date</code> objects in a ""long"" English, Spanish, and German date format. By ""long"" I mean the locale-dependent date format that corresponds to the <a href=""http://download.oracle.com/javase/6/docs/api/java/text/DateFormat.html#LONG"" rel=""nofollow""><code>LONG</code></a> style pattern constant in <code>java.text.DateFormat</code>:</p><pre><code>DateFormat.getDateInstance(DateFormat.LONG, myLocale).format(myDate);</code></pre><p>With a standard JRE, I get date strings like:</p><pre><code>November 22, 201022 de noviembre de 201022. November 2010</code></pre><p>as expected. On Android 1.5, however, I get:</p><pre><code>November 22, 20102010 11 222010 11 22</code></pre><p>Is there a way that I can include just enough locale information with my app to be able to format dates correctly in long English, Spanish, and German formats using <code>java.text.DateFormat</code>?</p>","196844","","247221","","2010-11-22 16:43:44","2010-11-22 16:43:44","How to include just enough locale data with an app to be able to format dates in three locales?","<java><android><localization><internationalization><date-format>","1","0","","",""
"4241861","1","","","2010-11-22 02:49:44","2","1793","<p>I am trying to integrate twitter (using Twitter4j) into my android app and I have few concerns/questions:</p><p>I want to retrieve tweets that have certain #hashtag, for example #sxbsw2011.Here is the code that I am currently using:</p><pre><code>Query query = new Query(""#sxsw2011 since:2010-11-21"");  QueryResult result = twitter.search(query);  for (Tweet tweet : result.getTweets())  {       Log.d(TAG, tweet.getId() + "" "" + tweet.getFromUser() + "" : "" + tweet.getText());  }</code></pre><p>I want to put result into one of my views on my layout witch serves as conversation screen. My problem is I want to run this query every few, 4 or 5, seconds in order to get new comments. But with every search I would get all tweets that are created today. Then I would have to use tweet ID's to exclude those that are already shown on my conversation window. To me this seems wrong. <strong>Is there any other way to search for tweets and to specify some time span like few minutes?</strong> Is there better way of doing what I want? I tried to use <code>StatusListener</code>, but have problem trying to figure how to use <code>getFilterStream()</code>. </p><p>What are twitter limitations. How many times my app (it will be running on multiple user devices) can request result?</p><p>The icon 101010 in editor is not working so it's sort of impossible to make correct code indentation when typing the post.</p>","507153","","1288","","2012-09-26 16:24:40","2012-09-26 16:24:40","Twitter4j. Making query and filtering posts by #hashtag","<android><post><filtering><twitter4j>","0","2","1","",""
"4241897","1","4241924","","2010-11-22 02:58:58","2","1249","<p>Is it possible to access the USB port on Android phones?  (Droid X for example)  </p><p>Here is my usage case:<br>  Have a USB device attached to the Android phone.  The phone listens for data on this USB device.  (The USB device is connected to a USB->RS-232 converter that has I/O attached to it)</p><p>This would be slick if possible.  Does anyone know if this is possible?</p>","397075","","","","","2013-03-26 12:49:11","USB Android I/O","<android><io><usb>","4","0","","",""
"4241998","1","","","2010-11-22 03:22:54","4","1333","<p>I would like to remotely reprogram my Arduino via Android over Bluetooth SPP. The first step is to reset the ATMEGA microcontroller. This is accomplished on the Arduino by toggling the DTR line. Is there any API to control the Bluetooth SPP control lines from the Android environment?</p>","515582","","","","","2014-04-09 16:13:53","Bluetooth control signals (DTR, DSR, RTS, CTS) on Android","<android><bluetooth><arduino><avr><atmega>","2","0","","",""
"4242031","1","","","2010-11-22 03:31:38","1","384","<p>i wanna download files in my application ,</p><p>so i used threads to download , </p><p>but i found that if i close application , the  downloading stopped.</p><p>should i use ?service? to implement downloading?? or something else ??</p><p>could someone give me suggestions?</p>","422405","","","","","2011-02-08 23:18:02","android download files problem","<android>","1","0","","",""
"4242073","1","4242128","","2010-11-22 03:39:54","1","215","<p>I'm just getting started with android development, and I've ran into some problems my textbook isn't helping me with.</p><p>This is my insert function:    public long insertEntry(BudgetsItem item){        assert item.id == -1;</p><pre><code>    ContentValues newBudgetValues = new ContentValues();    newBudgetValues.put(""name"", item.name);    newBudgetValues.put(""balance"", item.balance);    item.id = db.insert(DATABASE_TABLE_NAME, null, newBudgetValues);    return item.id;}</code></pre><p>This is my table definition:</p><pre><code>private static final String TABLE_CREATE = ""CREATE "" + DATABASE_TABLE_NAME + ""(\n"" +    ""id INTEGER PRIMARY KEY AUTOINCREMENT, \n"" +    ""name TEXT, \n"" +    ""balance DOUBLE);"";</code></pre><p>And this is what is calling the adapter before it crashes:</p><pre><code>        BudgetsAdapter adapter = new BudgetsAdapter(getBaseContext());        BudgetsItem newBudget = new BudgetsItem(budgetName, balance);        if(adapter.insertEntry(newBudget) != -1){            Toast.makeText(getApplicationContext(), ""Budget Created!"", Toast.LENGTH_SHORT);            finish();        }else{            Toast.makeText(getApplicationContext(), ""Oops, something failed."", Toast.LENGTH_SHORT);        }</code></pre><p>It crashes on the db.insert line with a NullPointerException. Can anyone tell me why?</p>","12243","","","","","2010-11-22 03:52:08","Why does my Android app crash on Row insert?","<java><android><nullpointerexception>","2","0","","",""
"4242090","1","4242178","","2010-11-22 03:43:43","1","114","<p>Let's say I randomly generate a number 0 to 100.  Where 0 is really cold and 100 is red hot.  Wen the number hits, it would show an image bar (kind of like a % finished bar) that shows in the image what # you hit.</p><p>So it would kind of be like a progress bar from 0 to 100, and whatever # they hit it shows in the image of the bar in an imageview?</p>","496686","","","","","2010-11-22 04:02:55","How easy would this be to implement? Creating a % to 100 bar","<android><image><random><progress-bar><percentage>","1","1","","",""
"4242165","1","4242190","","2010-11-22 03:59:43","2","4532","<p>It's sad how hard it is to find a simple line of code that does this ""In my opinion"". <br/></p><p>Anyhow, the problem is I have a program with activities and services ""I am new to services"". <br/> I can access my SQLite DataBase from activities using</p><p>TheDB class:</p><pre><code>public TheDB(Context context) {    this.context = context;    OpenHelper openHelper = new OpenHelper(this.context);    this.db = openHelper.getWritableDatabase();}</code></pre><p>And then I can just call the methods, e.g. </p><p>myActivity class:</p><pre><code>private TheDB db;bla... bla... bla...this.db = new TheDB(this);db.insertSomething(id, name);</code></pre><p>TheDB class (method called from myActivity):</p><pre><code>public void insertSomething(String id, String name){    db.execSQL(""INSERT into "" + farmsTable+ "" (id, name)""+ "" Values ""+ "" ("" + id + "", '"" + name  + ""')"");}</code></pre><p>ALL I want to be able to do is call TheDB's methods from my service like I do from myActivity.</p><p>Do I make a new constructor? Do I change the way I instantiate it?</p>","512974","","512974","","2010-11-24 02:42:41","2010-11-24 02:42:41","How to use SQLite from Services in Android?","<android><sqlite><service>","1","2","1","",""
"4242185","1","4242244","","2010-11-22 04:04:34","0","799","<p>I have a simple scrollview in a layout that displays an About Box in a dialg format.  So it just pops up on the phone screen in a dialog.  The only way for the user to close the box is to click the back button (it is an intent).</p><p>Do I have a way of adding a close button to the box or could I have the user hit the box on the screen with their finger and close it?</p><p>Here is my xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;ScrollView  xmlns:android=""http://schemas.android.com/apk/res/android""  android:screenOrientation=""portrait""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:padding=""10dip"" &gt;  &lt;TextView   android:id=""@+id/about_box""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:text=""@string/about_text"" /&gt;   &lt;/ScrollView&gt;</code></pre>","496686","","496686","","2010-11-22 04:13:37","2010-11-22 04:17:10","Is it possible to add a button to a scroll view?","<android><xml><layout><button><scrollviewer>","1","4","","",""
"4242261","1","","","2010-11-22 04:21:15","1","453","<p>I am developing an android application that provides instruction on various topics.  Within my application, I would like to have a ""talking head"" or even a full-body person that talks with moving lips synchronized (or at least close) to the spoken output.  Ideally, I would want the head/body to move while the speech is occurring also, with eyes blinking, arms (if it has a body) moving, etc. I know how to do all the speech parts, but I've never developed animation before.  I'm using Eclipse.  I really am only looking for advice to get me started down the right path.  Is there a framework, add-on purchase, etc. that will make my life easier?  There has to be a better method than animating/rotating open/close mouth images during the speech output.  I do NOT want jib-jab type of animation!  Thank you in advance for any starting advice you can give me!</p>","515608","","515608","","2010-11-22 04:31:48","2010-11-22 04:38:00","Animation - synchronize lips to wave or MP3","<android><frameworks><animation><character><avatar>","1","0","","",""
"4242268","1","4242314","","2010-11-22 04:24:45","1","155","<p>I am trying to make a really easy xml layout and I can't seem to get it to look the way I want.</p><p>I attached a picture of what I want it to look like:</p><p><img src=""http://i.stack.imgur.com/idES9.png"" alt=""alt text""></p><p>Basically, I have a static background image in my imagebutton at the top.  Below that I have a picture the user snapped in the Photo Box.  I assume I need an image view for that, but would it be possible for me to instead pass the pic to the background of an image button too so I can make the size easier to manage?</p><p>Based on what the user chooses in the options before this layout, an option photo is shown based on what they select.  The photo would display to the right of the centered image, if that option is selected.</p><p>Below that would be a centered text view, with another separate one below that.  Finally, I would have two buttons on top of each other at the very bottom.</p><p>Could someone show me a good way to get this layout and also tell me if it is possible to take a picture that is snapped and make it the background of an image button - or if that is a bad idea?</p><p>Thanks so much!</p>","496686","","","","","2010-11-22 04:35:05","How do I go about making this layout? Having so much trouble","<android><xml><image><layout><text>","1","0","","",""
"4242295","1","4242345","","2010-11-22 04:31:51","5","2248","<p>Is there a way to embed the progress bar in the UI with out an dialog.And not programmatically but with layout xml files. I am guessing it has to be some sort of animation or a ""drawable""</p>","498584","","1292730","","2012-05-01 12:42:42","2012-05-01 12:42:42","Android progress bar embedded in ui and not in dialog","<android><progress-bar><loading>","2","0","","",""
"4242370","1","4242384","","2010-11-22 04:47:32","1","716","<p>I have a following pseudo-code.</p><pre><code>public boolean onContextItemSelected(MenuItem aItem) {      switch(aItem.getItemId()) {           case A: {                new AlertDialog.Builder(this)                  .setIcon(android.R.drawable.ic_dialog_alert)                  .setTitle(""Delete"")                  .setMessage(""Delete?"")                  .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                       @Override                       public void onClick(DialogInterface dialog, int which) {                             // do stuff A...                       }                  });                  // do stuff B...                  return true;           }      }  }</code></pre><p>The problem is that it never shows the alert dialog. However, it does things as stated in ""do stuff B...""</p><p>Does anyone know why AlertDialog is now showing?</p><p>Thank you!</p>","428031","","","","","2010-11-22 04:49:45","Android - AlertDialog within onContextItemSelected does not work","<android><alertdialog>","1","0","1","",""
"4242401","1","","","2010-11-22 04:52:55","7","6471","<h2>SOLVED</h2><p>It appears you must call to the super constructor in onActivityResult</p><pre><code>super.onActivityResult(requestCode, resultCode, data);</code></pre><hr><p>I am getting this error from TTS when I press the back button on my Activity.  Aparently it is because I am not calling shutdown() but I am, see onDestroy() below.  I have made an abstract TtsActivity Class which Activities Extend.  I am calling super.onDestroy() in all subclasses.</p><pre><code>12-05 18:04:05.268: ERROR/ActivityThread(30240): Activity com.mysite.myapp.ActivitySelectItGame has leaked ServiceConnection android.speech.tts.TextToSpeech$1@43e9b4a0 that was originally bound here12-05 18:04:05.268: ERROR/ActivityThread(30240): android.app.ServiceConnectionLeaked: Activity com.mysite.myapp.ActivitySelectItGame has leaked ServiceConnection android.speech.tts.TextToSpeech$1@43e9b4a0 that was originally bound here12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.app.ActivityThread$PackageInfo$ServiceDispatcher.&lt;init&gt;(ActivityThread.java:1121)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.app.ActivityThread$PackageInfo.getServiceDispatcher(ActivityThread.java:1016)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.app.ContextImpl.bindService(ContextImpl.java:863)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.content.ContextWrapper.bindService(ContextWrapper.java:347)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.speech.tts.TextToSpeech.initTts(TextToSpeech.java:467)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.speech.tts.TextToSpeech.&lt;init&gt;(TextToSpeech.java:433)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at com.mysite.android.library.activity.ActivityTTS.onActivityResult(ActivityTTS.java:98)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at com.mysite.myapp.ActivityGame.onActivityResult(ActivityGame.java:445)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.app.Activity.dispatchActivityResult(Activity.java:3890)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3511)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3557)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.app.ActivityThread.access$2800(ActivityThread.java:125)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2063)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.os.Handler.dispatchMessage(Handler.java:99)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.os.Looper.loop(Looper.java:123)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at java.lang.reflect.Method.invokeNative(Native Method)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at java.lang.reflect.Method.invoke(Method.java:521)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-05 18:04:05.268: ERROR/ActivityThread(30240):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>The Activity that my classes are extending</p><pre><code>public abstract class ActivityTTS extends Activity implements OnInitListener {    //TEXT TO SPEECH SERVICE    public static final int CHECK_TTS_AVAILABILITY = 101;    private static final String TAG = ""ActivityTTS"";    private TextToSpeech mTts; //Text to speech library    //MESSAGES    private String NO_TTS_ANDROID_MARKET_REDIRECT =             ""'SpeechSynthesis Data Installer' is not installed on your system, you are being redirected to"" +            "" the installer package. You may also be able to install it my going to the 'Home Screen' then "" +            ""(Menu -&gt; Settings -&gt; Voice Input &amp; output -&gt; Text-to-speech settings)"";    private String NO_TTS_AVAILABLE =             ""'SpeechSynthesis Data Installer' is not available on your system, "" +            ""you may have to install it manually yourself. You may also be able to install it my going to the 'Home Screen' "" +            ""then (Menu -&gt; Settings -&gt; Voice Input &amp; output -&gt; Text-to-speech settings)"";    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Log.d(TAG, ""onCreate() called in ActivityTTS"");        try { //A weird error was occurring on some phones with the TTS, hence the try catch            //TTS Service            Intent checkIntent = new Intent();            checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);            startActivityForResult(checkIntent, CHECK_TTS_AVAILABILITY);        } catch (Exception e) {            Toast.makeText(this, NO_TTS_AVAILABLE, Toast.LENGTH_LONG).show();            finish();        }    }    @Override    protected void onStart() {        super.onStart();    }    @Override    protected void onStop() {        super.onStop();    }    /**     * Add a custom audio file for a particular      * audio element.     *      * @param text     * @param filename     */    protected void addSpeech(String text, String filename ) {        mTts.addSpeech(text, filename);    }    /**     * For TTS     */    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        try {            //Log.d(TAG, ""TTS Response: ""+requestCode);            if (requestCode == CHECK_TTS_AVAILABILITY) {                if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {                    // success, create the TTS instance                    this.mTts = new TextToSpeech(this, this);                } else {                    // missing data, install it                    Toast.makeText(this, NO_TTS_ANDROID_MARKET_REDIRECT, Toast.LENGTH_LONG).show();                    PackageManager pm = getPackageManager();                    Intent installIntent = new Intent();                    installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);                    ResolveInfo resolveInfo = pm.resolveActivity( installIntent, PackageManager.MATCH_DEFAULT_ONLY );                    if( resolveInfo == null ) {                       // Not able to find the activity which should be started for this intent                        Toast.makeText(this, NO_TTS_AVAILABLE, Toast.LENGTH_LONG).show();                    } else {                       startActivity( installIntent );                    }                    finish();                }            }        }catch (Exception e) {            Log.e(TAG, ""Unable to access service"");            finish();        }    }    /**     * Loads when the TTS is ready     */    @Override    public void onInit(int status) {        mTts.setLanguage(Locale.getDefault());    }    /**     * Speak text     */    protected void speak(String text) {        try{            mTts.stop(); //Stop speaking            mTts.speak(text, TextToSpeech.QUEUE_FLUSH, null);        }        catch(Exception e) {            Log.e(TAG, ""TTS Failed - cannot say: ""+text );        }    }    /**     * Speak a pre-recorded word     */    protected void speak(String text, File filename) {        try{            mTts.stop(); //Stop speaking            mTts.addSpeech(text, filename.toString());            mTts.speak(text, TextToSpeech.QUEUE_FLUSH, null);        }        catch(Exception e) {            Log.e(TAG, ""TTS Failed - cannot say: ""+text );        }    }    @Override    protected void onDestroy() {        super.onDestroy();        //Close the Text to Speech Library        if(mTts != null) {            mTts.stop();            mTts.shutdown();            Log.d(TAG, ""TTS Destroyed"");        }    }    public void setLanguage(Locale audioLocale) {        mTts.setLanguage(audioLocale);    }}</code></pre><p>Here is the code related the the activity in ActivityGame</p><pre><code>public abstract class ActivityGame extends ActivityTTS {...    protected void speak() {        if (Logging.INFO) Log.i(TAG, ""Speaking"");        if(this.mVoicePreference) {            String word = mBoundService.getCurrentWord().getSpelling();            if(WordRecordingHelper.recordingExists(word)) {                try{                    File f = new File(Constants.SDCARD_RECORDINGS+WordRecordingHelper.formatRecordedWord(word));                    super.addSpeech(word, f.getAbsolutePath());                } catch (Exception e) {                    if(Logging.WARN) Log.w(TAG, ""An error occurred while trying to use addSpeech()"", e);                }            }            //play the audio            super.speak(word);          }    }    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        super.onActivityResult(requestCode, resultCode, data);        ...        }    @Override    protected void onDestroy() {        super.onDestroy();        ....        }}</code></pre><p>And here is ActivitySelectItGame, it doe not reference TTS at all, just extends ActivityGame</p><pre><code>public class ActivitySelectItGame extends ActivityGame {    ...}</code></pre><p>But I get the exact same problem from a totally unrelated Activity the extends ActivityTTS.</p>","248521","","248521","","2010-12-14 12:04:07","2014-01-22 16:31:25","TTS Error: leaked ServiceConnection android.speech.tts.TextToSpeech (solved)","<android>","5","2","","",""
"4242421","1","","","2010-11-22 04:59:23","3","1026","<p>i have used Itext and Pdf renderer library files to read the Pdf files in java..but in android i have used Same libraries reading pdf files is possible but i'm unable to display the file..</p><p>how to display the pd ffile in the emulator???</p><pre><code>File sdcard = Environment.getExternalStorageDirectory();        Log.v(""Tag:"",""entered sdcard"");        String input = ""/sdcard/andr.pdf"";        Log.v(""Tag:"",""file  recog"");//        File file = new File(sdcard, input);        try {//   PdfWriter write = new PdfWriter();   PdfReader read = new PdfReader(input);   Log.v(""Tag"",""reading------------""+read.getPageN(9).toString());//   fl.addView((View)read);   Log.v(""Tag page"",read.getPageN(5).getKeys().toString());//   PdfStream pdfd=new PdfStream(is, write);   read.getCatalog();   Log.v(""Catalog"",read.getCatalog().toString());   Log.v(""Tag:"",""pdf opened"");   System.gc();   int n = read.getNumberOfPages();   Integer num=n;   Log.v(""Tag:"",num.toString() );   Log.v(""Tag:"",""got pages"");//   int n1 = read.getFileLength();//   //   Integer num1 = n1;//   Log.v(""tag"", num1.toString());   for(int i=0;i &lt;=1;i++){//   tv.setText((CharSequence) page);   read.getPageSize(1);   Log.v(""tag"", ""page size""+read.getPageSize(1).toString());    Log.v(""Tag:"",""got pages"");    wv = new WebView(this);     setContentView(wv); //    wv.getSettings().setJavaScriptEnabled(true);//    wv.loadUrl(""/sdcard/andr.pdf"");   }  }         catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();    }</code></pre>","515623","","244296","","2010-11-22 05:02:05","2011-08-09 16:01:55","How to read Pdf in Android without using 3rd party apps?","<android>","1","0","","",""
"4242426","1","4242545","","2010-11-22 05:00:21","1","1972","<p>I want to be able to set the background of an image button in an xml file to be the picture the user took on the phone.</p><p>I have the picture set as cameraBitmap.</p><pre><code>cameraBitmap = (Bitmap) intent.getExtras().get(""data"");</code></pre><p>and I want to pass that picture to be the bakground of the imagebutton.  The problem is, the method:  <code>setBackgroundDrawable()</code> only can pass in a drawable.  How do I go about changing that Bitmap to a drawable picture and making it the background?</p><p>I currently have:</p><pre><code>private ImageButton theImageButton;theImageButton.setBackgroundDrawable(cameraBitmap);</code></pre>","496686","","","","","2010-11-22 05:29:45","How do I set the background of an image button to a picture the user took?","<android><image><background><drawable><imagebutton>","1","0","1","",""
"4242444","1","","","2010-11-22 05:03:16","1","1485","<p>Hi i am developing a clock application in android. I need to lock the screen after some amount of time duration like 5 minutes, or 10 minutes. how can i call the auto lock of the android os. Please suggest me to lock the home screen after a particular amoutn of time.</p>","501733","","501733","","2011-08-04 09:24:18","2011-10-24 19:10:45","how to enable/disable auto keylock in android","<android>","1","0","","",""
"4242479","1","","","2010-11-22 05:13:19","1","823","<p>I have this video streaming code in android2.2 </p><pre><code>VideoView videoView = (VideoView) findViewById(R.id.surface_view);MediaController mc = new MediaController(this);mc.setAnchorView(videoView);mc.setMediaPlayer(videoView);Uri video = Uri.parse(URL);videoView.setMediaController(mc);videoView.setVideoURI(video);videoView.start();</code></pre><p>But it doesnt work on android 1.6 it gives the error</p><pre><code>11-22 10:39:33.245: ERROR/PlayerDriver(31): Command PLAYER_INIT completed with an error or info UNKNOWN PVMFStatus11-22 10:39:33.245: ERROR/MediaPlayer(256): error (200, -32)11-22 10:39:33.255: ERROR/MediaPlayer(256): Error (200,-32)</code></pre>","461503","","418183","","2010-11-22 09:12:39","2010-11-22 09:12:39","live video streaming in android 1.6 gives error","<android><video-streaming>","0","2","1","",""
"4242544","1","4243273","","2010-11-22 05:29:10","1","1671","<p>I have a problem while using the scroller in my application.</p><p>I have used the scroller but it is not working properly as it is not able to maintain a consistent speed while automatically scrolling. The speed of the text is getting slower with time as the text moves upward.</p><p>Here is the code that I used for this purpose:</p><pre><code>length = prompt_text.getLineCount();Log.d(""length"",""""+length);prompt_text.setScroller(scroll);scroll.startScroll(0,0,0,10 * length, 100000 / speedAmount);</code></pre>","493193","","223391","","2010-11-24 17:10:52","2010-11-24 17:10:52","how to maintain the speed of scroller?","<android>","1","0","1","",""
"4242593","1","4300453","","2010-11-22 05:37:34","1","4599","<p>I want to implement the following logic. I have 4 activites A, B, C and D. </p><p>The flow is A -> B -> C -> D</p><p>When the user navigates from A -> C he should be able to get back to the previous activities by pressing the back button. But after reaching D pressing the back button should take him to activity A. And pressing the back button againg should exit the application instead of taking him back to B / C / D. How do I do it.</p>","421372","","","","","2010-11-29 02:39:24","How to manipulate Activity back stack?","<android><navigation><activity>","2","2","0","",""
"4242597","1","4242763","","2010-11-22 05:38:09","0","2031","<p>I have work on Application That use Internet.  </p><ul><li>It contains XML parsing from url.than</li><li>Showing Progress Dialog While parsingtime.</li><li>Stop dialog when parsing is done.</li><li>set TEXT(Data) in ListView.</li></ul><p>my issue is that, When device is connected to internet than my Apps works fine But when Device is not connected to internet ""Progress dialog"" is running for infinite time.</p><p>i want to stop dialog if device is not connected to internet or wifi. how to do this?<br>Any idea? Sorry guys.... I have change my mind i want to check internet connection when i click on button. what i have tried so far is..</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.homelayout);        mclip = (ImageButton) findViewById(R.id.clip);        mclip.setClickable(true);        mclip.setFocusable(true);        mclip.setOnClickListener(new OnClickListener() {            public void onClick(View view) {                ConnectivityManager cm = (ConnectivityManager)              getSystemService(Context.CONNECTIVITY_SERVICE);                NetworkInfo netInfo = cm.getActiveNetworkInfo();                if (netInfo != null &amp;&amp; netInfo.isConnectedOrConnecting()) {               //if it is connected to internet than start Another Activity.                startActivity(new Intent(ListViewExample.this, ClipOfDay.class));                } else if (netInfo == null) {                    AlertDialog alertDialog = new AlertDialog.Builder(ListViewExample.this).create();                    alertDialog.setTitle(""Connection Problem"");                    alertDialog.setMessage(""You are not connected to Internet"");                    alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog, int which) {                            return;                        }                    });                    alertDialog.show();                }            }        });       }</code></pre><p>But this is not working.if device is not connected to internet than i want to show AlertDialog. otherwise it will start Activity.      can Anybody tell me what to do?<br>Thanks.  </p>","472882","","418183","","2010-11-22 09:08:38","2010-11-22 09:08:38","Internet Connection in Android","<android><android-internet>","3","0","","",""
"4242608","1","4243094","","2010-11-22 05:40:58","1","4629","<p>I have used this code</p><pre><code>locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,                500, 50, this);</code></pre><p>to get my location using GPS. From what I understood, this code updates the GPS every 500milliseconds until the accuracy is about 50ms. Right? Now how do I know when it has achieved this accuracy? So that I can send the most accurate location in a text message.</p>","481239","","","","","2010-11-22 07:10:55","Android: How to get the most accurate location from GPS","<android><gps>","1","0","","",""
"4242632","1","","","2010-11-22 05:46:01","2","625","<p>I have the code of video streaming that works perfectly in android 2.2</p><pre><code>VideoView videoView = (VideoView) findViewById(R.id.surface_view);MediaController mc = new MediaController(this);videoView.setMediaController(mc);videoView.start();videoView.requestFocus();videoView.setVideoURI(video);videoView.start();videoView.requestFocus();</code></pre><p>But it doesn't work in andrid1.6 It gives the error:</p><pre><code>11-22 11:12:51.455: ERROR/PlayerDriver(31): Command PLAYER_INIT completed with an error or info UNKNOWN PVMFStatus11-22 11:12:51.467: ERROR/MediaPlayer(826): error (200, -32)11-22 11:12:51.467: ERROR/MediaPlayer(826): Error (200,-32)11-22 11:12:51.467: DEBUG/VideoView(826): Error: 200,-32</code></pre>","509412","","1108213","","2012-03-10 15:16:20","2012-03-10 15:16:20","Android live video streaming not working in android1.6","<android><video-streaming>","0","1","","",""
"4242635","1","","","2010-11-22 05:46:26","0","848","<p>I use the following code to return the Scroll View from the function.That Scroll View contain number of check boxes . I call this function and it return the Scroll View correctly.But how to get the value if any of the check box is checked i need to perform some action.How to do this ?</p><p>Scroll View return Function:</p><pre><code> public ScrollView MyViewGroup(String[] Fields,int width,int height)throws Exception{       ScrollView sc=new ScrollView(context);    sc.setLayoutParams(new LayoutParams(width,            height));    TableLayout tbl=new TableLayout(context);           for(int i=0;i&lt;Fields.length;i++){               TableRow tr=new TableRow(context);                  CheckBox ch=new CheckBox(context);        ch.setId(i);        ch.setText(Fields[i]);        tr.addView(ch);        tbl.addView(tr);                }    sc.addView(tbl);    return sc;      }</code></pre><p>and i use this function like the following way</p><pre><code>  LinearLay.addView(MyGui.MyViewGroup(strarr[],200,200);</code></pre><p>Note :</p><p>MyGui class i create TextViews,EditTexts,Buttons and ScrollView .By using this MyGui Class i create the GUI 's only.I have one activity myform .In that myform class when i click the submit button i need get the checked value's and get some other Edittext Values from the user and take action for the submit Button only.Is there any possibility to do this ???? </p>","512192","","512192","","2010-11-22 07:15:17","2010-11-22 07:15:17","how to perform action(listener) from the function?","<android>","1","0","","",""
"4242663","1","4243085","","2010-11-22 05:51:41","1","2528","<p>I am working on a web application. As per the requirement i need to create scrolling images effect when user swipe and on touch (or click) i need to move the specific image to some predefined destination.</p><p>So some stack of images has two events, on touch move it should scroll left or right and on touch start(click) it should move to some distance.</p><p>I am unable to handle both events, i want to fire only touch-move event when user swipe and want touch-start to fire when user touch or click.</p><p>But on swiping, touch start event is also firing up. Please advice me the solution.</p><p>Even i have tried click event instead of touch start but still i have same issue.</p>","504023","","1104926","","2011-12-19 13:25:11","2012-05-18 00:47:45","how to handle touch events in IOS/Android","<javascript><jquery><android><ios><mobile-safari>","3","0","","",""
"4242672","1","4243416","","2010-11-22 05:53:17","2","2342","<p>hi i have used the following code to launch an email client but it is launching only messaging app...so what should get modified in this code....</p><pre><code>Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {""vgsl.manju@gmail.com""});emailIntent.setType(""text/plain"");startActivity(Intent.createChooser(emailIntent, ""Send a mail ...""));</code></pre>","505580","","61855","","2010-11-22 08:24:49","2012-01-05 18:02:18","launching email client from my app(android)","<android><android-intent>","3","1","","",""
"4242716","1","4300608","","2010-11-22 06:00:30","8","2497","<p>My app is a kind of a pocket guide with some data for the whole year. I'm assuming users will use the program at least once with Internet access to activate the license. Or at least that's my understanding of how the Android licensing system works. I'm using ServerManagedPolicy. </p><p>Does it check periodically for the license? Is there any way that I can control this? I don't want my users to be in the middle of nowhere, with an app already and previously activated and suddenly after 1 week, 1 month, 1 year etc. the app starts limiting the usability of the app itself because the license couldn't be verified <em>again</em>. My app is going to be used in remote places with erratic net access (can't be taken for granted all the time) by people who will live there for weeks, maybe months.</p><p>I feel I should at least warn them that they will be asked every X weeks to do that. Is the license system even that draconian?</p><p>I know I can handle the errors with the ERROR_CONTACTING_SERVER flag, on the applicationError void of LicenseCheckerCallback. Is the ""VT"" response always the same (can't test this on a test account/my account)? I was just curious about how you guys treat this situation on your own real life apps. Am I missing something here? For some reason I'm feeling I am. Is there any ""catch""?</p><p><em><strong>// EDITED:</em></strong></p><p>Here is the code I'm trying right now:</p><pre><code>// ServerManagedPolicy.javaprivate void setValidityTimestamp(String validityTimestamp) {    Long lValidityTimestamp;    try {        lValidityTimestamp = Long.parseLong(validityTimestamp);    } catch (NumberFormatException e) {        // No response or not parsable, expire in one minute.        Log.w(TAG, ""License validity timestamp (VT) missing, caching for a minute"");        lValidityTimestamp = System.currentTimeMillis() + MILLIS_PER_MINUTE;        validityTimestamp = Long.toString(lValidityTimestamp);    }    // added by me---&gt;    private static long maxLicense = 1000 * 3600 * 24 * 30; // ~ roughly 30 days    private static long minLicense = 1000 * 3600 * 24 * 3;  // ~ roughly 3 days    long lMax = System.currentTimeMillis() + maxLicense;    long lMin = System.currentTimeMillis() + minLicense;    if ((lValidityTimestamp &gt; lMin) &amp;&amp; (lValidityTimestamp &lt; lMax)) {        validityTimestamp = Long.toString(lMax);    }    // &lt;--- added by me    mValidityTimestamp = lValidityTimestamp;    mPreferences.putString(PREF_VALIDITY_TIMESTAMP, validityTimestamp);}</code></pre>","489607","","502381","","2012-06-03 15:45:34","2012-06-03 15:45:34","Licensing checker longevity of the ""activated"" status. How frequent is too much for the user?","<android><licensing>","4","3","8","",""
"4242730","1","4242755","","2010-11-22 06:04:05","1","1287","<p>In my android application I have custom listview with an image and textview. In extended BaseAdapter under getView method click events of textview and image are associated with onClick method using setOnClickListener as shown in code below</p><pre><code>public View getView(int position, View convertView, ViewGroup viewGroup) {  String entry = listWords.get(position);  if(convertView == null) {   LayoutInflater inflater = (LayoutInflater) context     .getSystemService(Context.LAYOUT_INFLATER_SERVICE);   convertView = inflater.inflate(R.layout.history_row, null);  }  TextView txtWordView = (TextView) convertView.findViewById(R.id.txtWordView);  txtWordView.setText(entry);  txtWordView.setOnClickListener(this);  txtWordView.setTag(entry);  ImageView imgRemove = (ImageView) convertView.findViewById(R.id.del_x);        imgRemove.setOnClickListener(this);        imgRemove.setTag(entry);        return convertView; }</code></pre><p>and </p><pre><code>public void onClick(View view) {  try {   if(view instanceof TextView){    //Here i would like this to finish this activity with result being sent to main    //activity - something like this    //Intent result = getIntent();    //result.putExtra(""word"", _strList.get(location));    //setResult(RESULT_OK, result);    //finish();   } else {    String entry = (String) view.getTag();          listWords.remove(entry);          History objHistory = new History(this.context);          objHistory.clearHistory(entry);   }         notifyDataSetChanged();  } catch (Exception e) {  } }</code></pre><p>When clicking on image it acutally deletes that entry from List which works fine, but on clicking textview i would like to return the text of clicked textview to main activity but I am unable to achieve this, although I can do this from setOnItemClickListener of this custom listview acitivity.</p>","455814","","","","","2011-06-06 21:24:51","finish activity from custom BaseAdapter","<android><listview>","1","0","","",""
"4242746","1","","","2010-11-22 06:07:02","4","3156","<p>hey can someone tell me how to embed a file like this <a href=""http://circa-med.org/circa-med.swf"" rel=""nofollow"">http://circa-med.org/circa-med.swf</a></p><p>and play it in android. I m a beginner. So dont even know how to play video files. It will help if u are android specific.</p>","515691","","","","","2012-07-02 13:41:26","Embedding swf file as raw files in android","<android><flash>","3","0","3","",""
"4242750","1","4242800","","2010-11-22 06:07:47","3","3829","<p>I want to divide my screen in two parts,I have a <code>LinearLayout</code> and it contains two <code>LinearLayouts</code> again. </p><p>How to divide these two <code>LinearLayouts</code> into two equal parts?</p>","487604","","469983","","2012-03-23 12:12:34","2013-09-05 04:19:53","Android Layout Division","<android><android-linearlayout><linear>","4","1","1","",""
"4242765","1","4243312","","2010-11-22 06:10:08","6","9826","<p>Is it possible to display the log messages (which I print using android.util.Log) on screen in an Android application?</p><p>Or is there any other better method to just output lines on the screen? Something like System.out.println?</p>","235246","","235246","","2010-11-22 06:19:20","2014-02-26 12:37:16","show log messages on screen for android application","<android><logging>","4","1","","",""
"4242783","1","4242824","","2010-11-22 06:13:43","0","992","<p>So, does <code>int random = (int) Math.ceil(Math.random() * 5);</code> return a value of 0,1,2,3,4 rather than 1,2,3,4,5?</p><p>I have tried to test this, but it never seems to hit 0 or 5 =x</p>","496686","","488830","","2010-11-22 06:17:28","2010-11-22 06:23:58","Does math.random assume 0 to be an integer?","<android><math><random>","1","0","","",""
"4242859","1","","","2010-11-22 06:27:32","2","511","<p>On my droid phone, I get what I consider a proper pause/stop/resume/restart sequence when the home button is pressed and I then select my application. However, I'm testing on a new Samsung Galaxy tablet and when I select my application after having pressed the home button, a new activity is being launched. I do not understand why the behavior is different on the Galaxy. Any ideas? I have removed orientation config changes in the manifest, so it's not that.</p>","515706","","","","","2010-11-22 06:57:53","Home button on Samsung Galaxy tablet is causing my Activity to re-launch","<android>","1","2","","",""
"4242976","1","","","2010-11-22 06:48:58","0","585","<p>In android i am tring to fetch the data from website and displaying it through the code but i am getting these errors in logcat.</p><pre><code>11-22 12:04:28.448: WARN/System.err(810): Can't dispatch DDM chunk 4d505251: no handler defined11-22 12:05:44.558: WARN/WindowManager(577): Key dispatching timed out sending to com.hi/com.hi.hi11-22 12:05:44.569: WARN/WindowManager(577): Dispatch state: {{KeyEvent{action=1 code=82 repeat=0 meta=0 scancode=229 mFlags=8} to Window{436a8aa8 com.hi/com.hi.hi paused=false} @ 1290407250374 lw=Window{436a8aa8 com.hi/com.hi.hi paused=false} lb=android.os.BinderProxy@435e2798 fin=false gfw=true ed=true tts=0 wf=true fp=false mcf=Window{437095c8 com.hi/com.hi.hi paused=false}}}11-22 12:05:44.569: WARN/WindowManager(577): Current state:  {{null to Window{437095c8 com.hi/com.hi.hi paused=false} @ 1290407744573 lw=Window{437095c8 com.hi/com.hi.hi paused=false} lb=android.os.BinderProxy@43709460 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{437095c8 com.hi/com.hi.hi paused=false}}}11-22 12:05:44.599: INFO/ActivityManager(577): ANR (application not responding) in process: com.hi11-22 12:05:44.599: INFO/ActivityManager(577): Annotation: keyDispatchingTimedOut11-22 12:05:44.599: INFO/ActivityManager(577): CPU usage:11-22 12:05:44.599: INFO/ActivityManager(577): Load: 0.02 / 0.05 / 0.0411-22 12:05:44.599: INFO/ActivityManager(577): CPU usage from 44599ms to 23ms ago:11-22 12:05:44.599: INFO/ActivityManager(577):   system_server: 2% = 1% user + 0% kernel11-22 12:05:44.599: INFO/ActivityManager(577):   qemud: 0% = 0% user + 0% kernel11-22 12:05:44.599: INFO/ActivityManager(577):   com.android.phone: 0% = 0% user + 0% kernel11-22 12:05:44.599: INFO/ActivityManager(577):   com.hi: 0% = 0% user + 0% kernel11-22 12:05:44.599: INFO/ActivityManager(577):   events/0: 0% = 0% user + 0% kernel11-22 12:05:44.599: INFO/ActivityManager(577):   rild: 0% = 0% user + 0% kernel11-22 12:05:44.599: INFO/ActivityManager(577):   adbd: 0% = 0% user + 0% kernel11-22 12:05:44.599: INFO/ActivityManager(577): TOTAL: 1% = 0% user + 1% kernel + 0% softirq11-22 12:05:44.609: INFO/ActivityManager(577): Removing old ANR trace file from /data/anr/traces.txt11-22 12:05:44.629: INFO/Process(577): Sending signal. PID: 810 SIG: 311-22 12:05:44.629: INFO/dalvikvm(810): threadid=7: reacting to signal 311-22 12:05:44.648: INFO/Process(577): Sending signal. PID: 619 SIG: 311-22 12:05:44.648: INFO/dalvikvm(619): threadid=7: reacting to signal 311-22 12:05:44.648: INFO/Process(577): Sending signal. PID: 724 SIG: 311-22 12:05:44.648: INFO/dalvikvm(724): threadid=7: reacting to signal 311-22 12:05:44.648: INFO/Process(577): Sending signal. PID: 666 SIG: 311-22 12:05:44.648: INFO/dalvikvm(666): threadid=7: reacting to signal 311-22 12:05:44.648: INFO/Process(577): Sending signal. PID: 642 SIG: 311-22 12:05:44.659: INFO/dalvikvm(642): threadid=7: reacting to signal 311-22 12:05:44.659: INFO/Process(577): Sending signal. PID: 656 SIG: 311-22 12:05:44.659: INFO/dalvikvm(656): threadid=7: reacting to signal 311-22 12:05:44.659: INFO/Process(577): Sending signal. PID: 577 SIG: 311-22 12:05:44.659: INFO/dalvikvm(577): threadid=7: reacting to signal 311-22 12:05:44.730: INFO/dalvikvm(666): Wrote stack trace to '/data/anr/traces.txt'11-22 12:05:44.730: INFO/dalvikvm(724): Wrote stack trace to '/data/anr/traces.txt'11-22 12:05:44.739: INFO/dalvikvm(619): Wrote stack trace to '/data/anr/traces.txt'11-22 12:05:44.739: INFO/dalvikvm(577): Wrote stack trace to '/data/anr/traces.txt'11-22 12:05:44.748: INFO/Process(577): Sending signal. PID: 617 SIG: 311-22 12:05:44.748: INFO/dalvikvm(617): threadid=7: reacting to signal 311-22 12:05:44.789: INFO/dalvikvm(642): Wrote stack trace to '/data/anr/traces.txt'11-22 12:05:44.789: INFO/dalvikvm(810): Wrote stack trace to '/data/anr/traces.txt'11-22 12:05:44.829: INFO/dalvikvm(617): Wrote stack trace to '/data/anr/traces.txt'</code></pre>","515717","","418183","","2010-11-22 08:59:12","2010-11-22 09:05:55","Can't explain certain logcat messages","<android>","2","1","","",""
"4242985","1","4638104","","2010-11-22 06:50:34","2","1477","<p>I am facing a strange problem. My app works fine in 2.1 (emulator + device). But, when I use 2.2 (both emulator + device) then there is an issue with the soft keyboard. There is a Activity in landscape mode in the app (use android:screenOrientation=""landscape""). There are two EditText in that Activity. But, soft keyboard is not displaying for those. In fact, softkeyboard seems to apprear, but as a bar in the bottom. Please view the screenshot. </p><p><img src=""http://i.stack.imgur.com/56XJg.png"" alt=""screenshot""> </p><p>Any help will be appreciated. Regards Sarwar Erfan </p><p>tried different things for android:windowSoftInputMode , did not work</p><pre><code>&lt;Activity android:name="".PriceCalculator""     android:screenOrientation=""landscape""     android:windowSoftInputMode=""stateAlwaysVisible|adjustPan""     android:configChanges=""orientation""     android:label=""Pricing Calculator""&gt;    ....&lt;/Activity&gt;&lt;EditText     android:id=""@+id/adhesiveUnitPrice""     android:inputType=""numberDecimal""     android:imeOptions=""actionDone|flagNoExtractUi""     android:layout_column=""4"" android:gravity=""right""/&gt; </code></pre>","408863","","418183","","2010-11-22 10:23:30","2011-03-27 14:26:25","Softkeyboard not displaying in 2.2 landscape mode","<android>","2","2","1","",""
"4243029","1","4243183","","2010-11-22 06:57:38","0","455","<p>i want to show images from external url listed in external xml (""similar"" to picasa API).</p><p>from where i need to start, there is an app sample like this, do i can read is source?</p>","105261","","105261","","2010-11-22 07:15:58","2012-06-13 06:33:37","how to get images from external xml and view it on my app","<android>","1","0","","",""
"4243161","1","","","2010-11-22 07:21:02","0","3452","<p>I'm able to successfully use a ScrollView inside the layout xml file for an application.  However, when I tried using a ScrollView inside the layout xml file for a widget, I get a ""Problem Loading Widget"" error as soon as I drop the widget in the emulator.  If I comment out the ScrollView, then the widget shows up in the emulator.  I've pasted my layout xml file below.  Any thoughts on how to get past this error would be much appreciated.</p><p></p><pre><code>&lt;LinearLayout     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""    android:paddingBottom=""3dip""&gt;    &lt;LinearLayout        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:paddingLeft=""6dip""        android:paddingRight=""6dip""        android:paddingBottom=""3dip""&gt;        &lt;Button             android:id=""@+id/ok_widget""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:layout_gravity=""right""            android:text=""@string/button_ok"" /&gt;    &lt;/LinearLayout&gt;    &lt;ScrollView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:fillViewport=""true""        android:layout_marginBottom=""50dip""&gt;        &lt;LinearLayout             android:id=""@+id/linear_layout""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:orientation=""vertical""            android:paddingBottom=""3dip""&gt;              &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;    &lt;RelativeLayout         android:layout_marginTop=""-50dip""         android:gravity=""bottom""         android:layout_height=""wrap_content""         android:layout_width=""fill_parent""&gt;        &lt;LinearLayout            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:orientation=""horizontal""            android:paddingLeft=""6dip""            android:paddingRight=""6dip""            android:paddingBottom=""3dip""&gt;            &lt;Button                 android:id=""@+id/ok_widget""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:layout_gravity=""right""                android:text=""@string/button_ok"" /&gt;        &lt;/LinearLayout&gt;    &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p></p>","515746","","","","","2011-04-07 11:38:46","Problem with using ScrollView in a homepage widget","<android>","2","0","","",""
"4243194","1","4243225","","2010-11-22 07:25:25","0","525","<p>I have a set of strings labeled st1, st2, st3, etc...until st9.  I want to have a method that randomly shows one of those strings based off a randomly generated number...could someone please show me how to do this?</p><p>Thanks!</p>","496686","","","","","2010-11-22 08:18:14","Randomly displaying strings -","<android><arrays><string><random>","3","1","","",""
"4243242","1","","","2010-11-22 07:33:43","1","502","<p>To improve the perceived startup time of my application, I am using an image as a drawable for my initial activity as described in<br><a href=""http://developer.android.com/resources/articles/window-bg-speed.html"" rel=""nofollow"">http://developer.android.com/resources/articles/window-bg-speed.html</a><br>and it works wonders for what it is intended to do. The application seems to be presenting its first screen within a tenth of a second, much before my onCreate is even called.</p><p>However... My application, like most applications, should display under the notification bar of the system (it is not windowFullscreen, only windowNoTitle), and the background image I specify will take the size of the full screen, its top part going under the title bar.<br>My application will then start and as any well-behaved application it will display content adapted to the actual size of the viewport... which means it will not match the background image.</p><p>I could possibly leave room at the top of my startup image, but even at the same screen resolution, different devices have different size notification bars, so I can't have it fit the screen smoothly that way either - not even by supplying one image for each existing screen size, because they will have different notification bar sizes.</p><p>This happens before even the first line of code of my activity is even executed - that's the whole point of putting a background image there, to give feedback to the user as early as possible, even before the activity is actually started. The only way I can see would be to somehow tell the android framework to fit my window to the region under the bar and not the whole screen, but I couldn't find how to do that. Does anyone have an idea how to make my image closely fit the interface that will then be presented by my activity ?</p>","440355","","","","","2010-11-22 07:33:43","Android: Initial size of window, notification bar size and background image","<android><portability>","0","1","","",""
"4243323","1","4243487","","2010-11-22 07:44:34","0","4697","<p>I'm using following code to extract a string variable in my javascript file in android:</p><p>This' my javascript file:</p><pre><code>&lt;script language=""javascript""&gt;EDIT:clsVariable = ""vikrant"";function refuseClick(){clsVariable = ""vikrant"";refuse.performClick();document.getElementById(""no"").value = ""Refuse"";}&lt;/script&gt;&lt;button type=""button"" id=""no"" onClick=""refuseClick();""&gt;Je refuse&lt;/button&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>In my android class I'm writing following method on a button click. This button click event I'm calling from javascript file:</p><pre><code>    refuse.setOnClickListener(new View.OnClickListener() {  @Override  public void onClick(View v) {      Log.v(LOG_TAG, ""variable="" + clsVariable);  //This shows me null } }); wbvw = (WebView) findViewById (R.id.webvw); wbvw.setWebViewClient(new HelloWebViewClient());    wbvw.getSettings().setJavaScriptEnabled(true);    WebSettings ws = wbvw.getSettings();    ws.setJavaScriptEnabled(true);    wbvw.addJavascriptInterface(clsVariable, ""clsVariable"");    wbvw.loadUrl(""http://www.sbc.co.in/projects/AndroidTest.html"");}</code></pre><p>I'm new to this platform as well as javascripting.</p><p>What is it that I'm doing wrong?Can anybody please help?</p><p>Thanx in advance.</p>","227943","","227943","","2010-11-22 09:17:24","2010-11-22 14:46:06","addJavascriptInterface doesnt return a string value android","<javascript><android><webview>","1","0","","",""
"4243386","1","","","2010-11-22 07:54:04","1","1219","<p>I have webpage which contains username and password fields. In android webview, I loads that page and enter the user credentials to login. Now if the user logs out and logs in again, I want the previous username and password values to be retained in the fields of the webview where we enter the credentials. I have seen some methods like setHttpAuthUsernamePassword,savePassword like this in webview class of android. I ve tried with these methods to save the credentials and tried to get the values by this method getHttpAuthUsernamePassword. But it is not working. May I know how to do this using these methods or is there any other way to do this ? Any help appreciated greatly.</p>","404196","","","","","2010-11-22 09:27:11","Retain username and password in android webview","<android><passwords><webview><username><retain>","3","0","","",""
"4243540","1","","","2010-11-22 08:21:35","2","3720","<p>I just want to know is there any way to compile and run my android application codes online, without installing the SDK on the computer ?</p><p>Thanks!</p><p>Abhinav.</p>","515791","","","","","2014-03-21 19:32:54","android- how can I compile my codes online?","<android>","4","2","1","",""
"4243684","1","4245672","","2010-11-22 08:45:22","19","5373","<p>Since I've seen a <a href=""http://www.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html"">presentation from Google IO</a> I'm a bit confused in the question, if it's better to use content providers or databases. Or it makes no difference if I don't want to share any data with other applications.</p><p>If I've understood it right, content providers based on SQLite DBs and it's also possible that content of them is only accessable for my application.</p><p>Can you give some explanations?</p><p>Thank you very much,</p><p>Mur</p>","408780","","408780","","2010-11-22 10:28:26","2010-11-22 13:05:11","Android. Content provider or Database?","<android><sqlite><android-contentprovider>","2","2","9","",""
"4243704","1","4321080","","2010-11-22 08:49:54","12","26408","<p>I have created a custom dialog and a layout xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;Button        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Tap Me""        android:onClick=""dialogClicked"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>In the dialog class I've implemented the method ""dialogClicked(View v)"":</p><pre><code>public class TestDialog extends Dialog { public TestDialog(final Context context) {  super(context); } @Override protected void onCreate(final Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.dialog); } public void dialogClicked(final View view) {  System.out.println(""clicked""); }}</code></pre><p>When I tap the button I get a NoSuchMethodException 'dialogClicked'. Setting the onClick handler in layout xml works fine for activities, but not in dialogs. Any ideas? What I'm doing wrong?</p>","515803","","418183","","2010-11-22 08:54:16","2011-12-22 21:50:50","Using onClick attribute in layout xml causes a NoSuchMethodException in Android dialogs","<android><onclick><nosuchmethoderror>","9","1","4","",""
"4243764","1","6040349","","2010-11-22 08:59:29","0","427","<p>Hi I have created Expandible list view using BaseExpandableListAdapter. If i scroll the list then I found the default cache color as black but my background colour of list is white. I want to set cachecolour as white. </p><p>How to set cachecolorhint to a class that extends BaseExpandableListAdapter in android</p><p>ThanksSunil Kumar Sahoo</p>","111988","","","","","2011-05-18 05:41:58","How to set cachecolorhint to a class that extends BaseExpandableListAdapter","<android>","1","0","1","",""
"4243873","1","4253655","","2010-11-22 09:16:15","1","320","<p>Good morning everyone,I've got an issue when trying posting on my facebook wall from an application developed on an Android phone.Here's the problem: Sometimes different ""strange"" error message appear like ""error with HelloIdahoFalls.com"" or ""HelloSiouxCity.com"" or ""HolyPlanets Connect"" and so on.I really don't know why these sites appear on my error log. Seems like my Android KeyHash is in conflict with some of this sites.The strange thing is that sometimes my application works and posts correctly on my wall.Any idea?Hope I've been clear enough.</p>","510975","","","","","2010-11-24 11:17:42","Facebook error when posting on wall from Android. Strange sites appear","<android><facebook>","1","0","0","",""
"4243894","1","","","2010-11-22 09:19:37","24","45794","<p>Why when i use SimpleCursorAdapter for ListView i have items height in ListView like this - <img src=""http://i.stack.imgur.com/tS8xS.jpg"" alt=""listview image""></p><p>(My code based on <a href=""http://stackoverflow.com/questions/2982948/sqlite-and-populating-list-view-android"">this</a>)</p><p><strong>But when using arrays Listview items have big height</strong>  </p><p><img src=""http://i.stack.imgur.com/tSrYu.png"" alt=""listview big""></p><p>(I learn listview based on <a href=""http://androidpeople.com/android-listview-example/"" rel=""nofollow"">this</a>)</p><p>Row layout for item listview is</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView android:id=""@+id/text1""xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content""android:layout_height=""wrap_content""/&gt;</code></pre><p><strong>So My question is why there is a difference in row heights when using ArrayAdapter and SimpleCursorAdapter?</strong></p>","515837","","2218452","","2013-05-22 13:52:09","2013-08-21 18:17:52","android listview item height","<android><listview><row><android-arrayadapter><simplecursoradapter>","6","1","10","",""
"4243989","1","4244308","","2010-11-22 09:35:03","5","2710","<p>I am having a EditText in which I have to accept <strong>alphanumeric</strong> input from user which is specific to pattern, and hyphens <strong>'-'</strong> are inserted automatically.</p><pre><code>""XXX-XXX-XXXX""</code></pre><p>how to achieve that ? Is there any pattern tool in android ?</p>","447238","","","","","2010-11-22 10:12:54","EditText input with pattern android","<android><patterns><edittext><alphanumeric>","1","0","","",""
"4244030","1","","","2010-11-22 09:40:37","1","818","<p>Is there a possibility for an android app to run as a service in the background, intercept keydown events from the <strong>hardware</strong> keyboard and change behavior (i.e. the resulting character) in some special cases?</p><p>The idea in mind is to have sort of a keyboard layout fix, mainly making important special characters available using an alternative keymap instead of having to select from a huge grid on the touch screen. Sometimes, the default keymap of a mobile devices do not represent all important characters, even more when it comes to non-english languages.</p><p>Thanks for inspiration :)Peter</p><p>EDIT: additionally emphasized <strong>hardware</strong></p>","397673","","397673","","2010-11-22 15:30:10","2010-11-22 15:30:10","Android: How to intercept keydown globally (on hardware keyboard)","<android><keyboard><keyboard-shortcuts><keyboard-layout><mobile-application>","1","2","1","",""
"4244298","1","4244697","","2010-11-22 10:12:00","1","1277","<p>i have like a 100 images in my assets folder and i want to be able to curl them with the finger (no button) to make the app more dynamic. Is there an animation that lets me do this? Im also wondering if i have to create a 100 activities for this manually :( or can i turn them and show the next picture in the same activity?</p><p>Thanks in advance</p>","499488","","499488","","2010-11-22 10:27:24","2010-11-22 10:59:55","how to turn/flip/curl image in android","<android><animation>","1","0","1","",""
"4244371","1","5170474","","2010-11-22 10:19:58","6","3080","<p>As per my understanding, Content Provider is a means for accessing database contents.</p><p>And to access the database, the Authority part is required. This authority part is provided by CONTENT_URI.Thus Content_URI is a means for giving authority to the database.As far as CONTENT_URI is concerened, it is generally of the form</p><pre><code>content://com.example.transportationprovider/trains/122______ |____________________________________|_____ |___   A                      B                     C     DWhere A = Content,      B = Authority Part      c = Path determining what data to request      D = specific data</code></pre><p>Above scenario is a ideal scenario where-in we pass /trains as the only database name.But what if, i have the following content_uri:</p><pre><code>content://com.example.transportationprovider/land/bus/133</code></pre><p>In this case, <code>/land/bus</code> is the path segments.</p><p>But then internally how this data is stored in the database ? Or how content Provider interpret this data?</p><p>Please help me.</p>","515152","","135152","","2011-07-05 17:53:14","2011-12-01 09:54:42","Content_URI in content Provider","<android><android-contentprovider>","1","0","1","",""
"4244398","1","4245232","","2010-11-22 10:23:46","0","284","<p>I am developing a mobile app for android, with eclipse as my platform. Whenever I use the back button of the mobile using the emulator,the app closes. I want to just go back to the previous page, but it exits the app. How can I do it? I really hope you could me with this.Thanks in advance! </p>","515883","","881229","","2014-01-28 15:47:11","2014-01-28 15:47:11","Developing mobile app for android","<android><eclipse><android-emulator>","3","1","","",""
"4244404","1","","","2010-11-22 10:24:40","0","194","<p>i am trying to implement a calender application just similar to <img src=""http://i.stack.imgur.com/E0Vsb.png"" alt=""this image""></p><p>what is  the particular green color mark. how to design that?</p><p>is that green indicator is a custom widget???</p>","430652","","430652","","2011-08-07 18:09:28","2012-03-30 07:38:34","what is the widget near calendar and how to design that in android?","<android><calendar><widget>","0","2","","",""
"4244419","1","4244673","","2010-11-22 10:26:10","0","1147","<p>i'm trying to use this to download mp3 files</p><pre><code>Intent downloadIntent = new Intent(Intent.ACTION_VIEW, Uri.parse( ""http://www.xxx.com/1.mp3""));</code></pre><p>but it always opens another application to play this mp3 file....</p><p>i only want to download it ,how can i do ? thanks</p>","422405","","446461","","2010-11-22 10:33:19","2012-01-19 14:30:08","android activity download files","<java><android><download>","2","0","","",""
"4244449","1","4245261","","2010-11-22 10:30:01","0","657","<p>In my application pressing a list row or a button means executing the same commands. My problem is that the list and the button have different listeners (AdapterView.OnItemClickListener vs. View.OnClickListener). How can I add the code for the 2 views (as a listener) without having duplicate code.</p><p>Best Regards</p>","460611","","302328","","2010-11-22 11:09:53","2010-11-23 10:19:15","Same listener for list and button","<android><onclick>","3","0","","",""
"4244495","1","","","2010-11-22 10:34:50","0","206","<p>Hi *I need to show a map by passing the address. however, in some cases, the whole app will be forced to close. it may be because of gecoding the address to coordinate. My question is what is the best way to handle the exception while calling the map? The following function is my function for getting the gecoder results.however, it is still not perfect. what should i do in order to avoid the shut down of the app? thanks a lot!!penny</p><pre><code>private void findLocation(final String locationName) {    Thread thrd = new Thread() {        @Override        public void interrupt() {            super.interrupt();        }        @Override        public void run() {            try {                addressList = geocoder.getFromLocationName(locationName, 2);            } catch (IOException e) {                MyLog.e(e.getMessage());            }            uiCallback.sendEmptyMessage(0);        }    };    thrd.start();}</code></pre>","502958","","","","","2010-11-24 18:16:25","Android show google map problem!","<java><android><exception><google-maps>","1","3","1","",""
"4244498","1","","","2010-11-22 10:35:12","12","4237","<p>I need some help on streaming live video from android camera to server. What is the best approach in acheiving this ? Is it possible to use MediaRecorder for streaming video over internet ?</p>","315619","","","","","2012-09-27 12:39:16","Streaming live video from android camera to server","<android><camera>","2","0","6","",""
"4244533","1","4244844","","2010-11-22 10:39:29","1","1054","<p>I am new to android programming. In my application, i want to implement automatic scrolling. So, i used scroller for this purpose.It is performing scrolling but not maintaining constant speed till the end of scrolling the text. Can anyone help me out of this problem. Here, is the code used for scrolling:</p><pre><code>prompt_text.setScroller(scroll);scroll.startScroll(scroll_x,scroll_y,0,50 * speedAmount, 100000/speedAmount);</code></pre>","493193","","263521","","2010-11-22 10:48:34","2010-11-22 11:16:56","how to maintain the speed of scroller?","<android><scrolling>","2","1","","",""
"4244574","1","","","2010-11-22 10:44:31","5","1886","<p>Is there an API or webservice we could use to get statistics about an app in the Android Market?Like AndroidZoom.com and AndroLib.com. Both sites have a lot of info about apps.Where did the data come from?Thanks for replying.</p><p>Regards, Rick</p>","447811","","","","","2012-07-30 08:16:47","Android Market Statistics API?","<android><web-services><statistics><google-play>","1","0","1","2012-07-30 11:42:01",""
"4244711","1","4244968","","2010-11-22 11:01:30","2","3139","<p>I have an app on Android that reacts to incoming calls.Now, since the OS shuts my app down whenever it want,I need a way to to listen to the incoming calls and launch the app when it happens.</p><p>Will a BroadcastReceiver help? (just like launching on device restart)</p><p>Any idea?</p><p>thanks!</p>","257764","","","","","2010-11-22 11:50:40","Launch app on incoming call (android)","<android>","3","0","3","",""
"4244849","1","","","2010-11-22 11:17:36","1","2775","<p>I have a bitmap displayed on ImageView now i want to give a facility to write comment typed by the user on that bitmap.</p><p>i tried using </p><pre><code> Canvas canvas = new Canvas(srcBitmap); canvas.drawText(""Hello"", 100,100,null);</code></pre><p>but this is giving me following error </p><blockquote>  <p>java.lang.IllegalStateException:  Immutable bitmap passed to Canvas  constructor</p></blockquote><p>later on i want to save this whole image a bitmap</p>","405383","","","","","2011-02-09 09:51:37","write comment on bitmap","<android><canvas><bitmap>","1","0","","",""
"4244879","1","4244963","","2010-11-22 11:22:03","15","31806","<p>I'm trying to read a JSON array. Here is my code. </p><pre><code>        JSONArray jArray = new JSONArray(jsonString);        System.out.println(""*****JARRAY*****""+jArray.length());        for(int i=0;i&lt;jArray.length();i++){                JSONObject json_data = jArray.getJSONObject(i);                Log.i(""log_tag"",""_id""+json_data.getInt(""account"")+                        "", mall_name""+json_data.getString(""name"")+                        "", location""+json_data.getString(""number"")+                        "", telephone""+json_data.getString(""url"")+                        "",----""+json_data.getString(""balance"")+                        "",----""+json_data.getString(""credit"")+                        "",----""+json_data.getString(""displayName"")                );        }</code></pre><p>And my sample JSON files syntax is as follows, </p><pre><code>{    ""list"": [        {            ""account"": 1,            ""name"": ""card"",            ""number"": ""xxxxx xxxx xxxx 2002"",            ""url"": ""http://www.google.com"",            ""balance"": 1.0,            ""credit"": 1.0,            ""displayName"": ""hsbc bank""         },        {            ""account"": 2,            ""name"": ""card2"",            ""number"": ""xxxxx xxxx xxxx 3003"",            ""url"": ""http://www.google.com"",            ""balance"": 2.0,            ""credit"": 2.0,            ""displayName"": ""nsb bank""         }     ],    ""count"": 2}</code></pre><p>It has a curly brace in front. When i try to execute this code block it gives an error saying</p><blockquote>  <p>A JSONArray text must start with '['  at character 1 of....</p></blockquote><p>Has anyone encountered a problem like this? Any help would be greatly appreciated. Please show me a sample code block if can. Thanks in advance.</p>","511737","","283084","","2013-10-27 19:14:55","2013-10-27 19:14:55","Reading a Json Array in android","<java><android><json>","2","0","7","",""
"4244889","1","4245070","","2010-11-22 11:23:01","1","10469","<p>I just create the Layout design using java code only not from the XML Layout Designs.Like the following </p><pre><code> LinearLayout llay=new LinearLayout(this);TextView tv1=new TextView(this);tv1.setText(""New Layout"");llay.addView(tv1);</code></pre><p>How do use the  LayoutInflater inflater for my LinearLayout ??? I am new to Android </p>","512192","","512192","","2010-11-22 11:41:22","2011-04-14 12:58:42","How do use the LayoutInflater inflater?","<android>","2","0","1","",""
"4244999","1","","","2010-11-22 11:37:10","0","2244","<p>Im trying to build an app which tries to auto focus the camera before starting the video recording. Directly using <code>MediaRecorder</code> does not auto focus the camera. For that i am Using <code>Camera</code> and using the callback I can autofocus it. But providing this instance to the <code>MediaRecorder</code> gives me a lot of issues. Following is the code im using for recording</p><pre><code>public boolean startRecording(){    try    {        mCamera.unlock();        mediaRecorder = new MediaRecorder();        mediaRecorder.setCamera(mCamera);        mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);        mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);        CamcorderProfile profile = CamcorderProfile                .get(CamcorderProfile.QUALITY_LOW);        mediaRecorder.setProfile(profile);        mediaRecorder.setMaxDuration(maxDurationInMs);        File file = new File(outputFile);        if (file.exists())            file.delete();        file = new File(outputFile);        try        {            file.createNewFile();        }        catch (IOException e1)        {            // TODO Auto-generated catch block            e1.printStackTrace();            Log.e(""Deepak"", ""*** first catch ***"");        }        mediaRecorder.setOutputFile(outputFile);        mediaRecorder.setPreviewDisplay(mHolder.getSurface());        mediaRecorder.setMaxFileSize(maxFileSizeInBytes);        mediaRecorder.prepare();        mediaRecorder.start();        return true;    }    catch (IllegalStateException e)    {        Log.e(TAG, e.getMessage());        e.printStackTrace();        return false;    }    catch (IOException e)    {        Log.e(TAG, e.getMessage());        e.printStackTrace();        return false;    }}</code></pre><p>The Camera attributes are as follows:</p><pre><code>Camera.Parameters parameters = mCamera.getParameters();    List&lt;Size&gt; sizeList = parameters.getSupportedPreviewSizes();    parameters.setPreviewFormat(ImageFormat.JPEG);    parameters            .setPreviewSize(sizeList.get(0).width, sizeList.get(0).height);    mCamera.setParameters(parameters);    mCamera.startPreview();</code></pre><p>All this is giving me the following error message:</p><pre><code>    11-22 16:51:25.314: DEBUG/Preview(4052): !!!!!!!!!!111Starting recording!!!!!!!!!!!!!!11-22 16:51:25.334: ERROR/audio_input(59): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value11-22 16:51:25.334: ERROR/audio_input(59): VerifyAndSetParameter failed11-22 16:51:25.334: ERROR/CameraInput(59): Unsupported parameter(x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value)11-22 16:51:25.334: ERROR/CameraInput(59): VerifiyAndSetParameter failed on parameter #011-22 16:51:25.344: DEBUG/AuthorDriver(59): setParamVideoEncodingBitrate() 25600011-22 16:51:25.384: INFO/MediaRecorderJNI(4052): prepare: surface=0x222968 (id=1)11-22 16:51:25.394: ERROR/PVOMXEncNode(59): PVMFOMXEncNode-Video_M4V::DoPrepare(): Got Component OMX.qcom.video.encoder.mpeg4 handle 11-22 16:51:25.394: WARN/CameraInput(59): refCount 011-22 16:51:25.394: ERROR/VENC_ENC(59): VENC_ERROR update_param_port_def::1643 Frame rate is for input port (refer to OMX IL spec)11-22 16:51:25.394: ERROR/VENC_ENC(59): VENC_ERROR get_parameter::952 unsupported index 0x700000b11-22 16:51:25.394: ERROR/VENC_ENC(59): VENC_ERROR set_parameter::2720 unsupported index 0x700000b11-22 16:51:25.394: ERROR/VENC_ENC(59): VENC_ERROR translate_profile::1015 unsupported profile11-22 16:51:25.394: ERROR/VENC_ENC(59): Bitrate 25600011-22 16:51:25.394: ERROR/VENC_ENC(59): VENC_ERROR get_parameter::952 unsupported index 0x600000511-22 16:51:25.394: ERROR/VENC_ENC(59): VENC_ERROR set_parameter::2720 unsupported index 0x600000511-22 16:51:25.394: ERROR/PVOMXEncNode(59): PVMFOMXEncNode-Audio_AMRNB::DoPrepare(): Got Component OMX.PV.amrencnb handle 11-22 16:51:25.394: DEBUG/CameraInput(59): Intended mFrameWidth=176, mFrameHeight=144 11-22 16:51:25.404: DEBUG/CameraInput(59): Actual mFrameWidth=176, mFrameHeight=144 11-22 16:51:25.404: ERROR/VENC_ENC(59): VENC_ERROR ven_translate_config::428 Invalid mp4 configuration 11-22 16:51:25.424: INFO/AudioHardwareQSD(59): Routing audio to Speakerphone11-22 16:51:25.424: DEBUG/AudioHardwareQSD(59): Switching audio device to 11-22 16:51:25.424: DEBUG/AudioHardwareQSD(59): Speakerphone11-22 16:51:25.454: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.494: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.534: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.554: INFO/AudioHardwareQSD(59): AudioHardware PCM record is going to standby.11-22 16:51:25.554: INFO/AudioHardwareQSD(59): Routing audio to Speakerphone11-22 16:51:25.564: INFO/AudioHardwareQSD(59): do input routing device 80000011-22 16:51:25.564: INFO/AudioHardwareQSD(59): Routing audio to Speakerphone with back mic11-22 16:51:25.564: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.574: WARN/AudioFlinger(59): write blocked for 143 msecs, 52 delayed writes, thread 0xd7a811-22 16:51:25.604: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.644: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.684: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.754: DEBUG/AudioHardwareQSD(59): Switching audio device to 11-22 16:51:25.754: DEBUG/AudioHardwareQSD(59): Speakerphone11-22 16:51:25.764: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.814: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.844: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.884: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.924: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:25.964: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:26.004: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:26.044: ERROR/CameraInput(59): Recording is not ready (iPeer 0x3bc14 iState 2 iWriteState 1 iClockState 0), frame dropped11-22 16:51:28.824: INFO/AudioHardwareQSD(59): AudioHardware pcm playback is going to standby.11-22 16:51:31.324: DEBUG/Preview(4052): !!!!!!!!!!Stoping recording!!!!!!!!!!!!!!</code></pre><p>This creates a file on the specified location which is totally obscured, just a bunch of green horizontal lines.</p><p>All permission are placed. Using Android 2.2. Tried the exact code as <a href=""http://integratingstuff.com/2010/10/18/writing-code-that-captures-videos-on-android/"" rel=""nofollow"">this</a> but still got similar <code>VENC_ERROR</code></p>","237403","","","","","2011-08-19 08:20:35","Problem with Video recording after auto focus in Android","<android><android-sdk-2.2><android-camera>","1","0","2","",""
"4245090","1","","","2010-11-22 11:49:05","4","7967","<p>I'm checking out PhoneGap API for Android and was trying out the camera sample application example and installed in my Android Phone (2.1 Galaxy S). However after running the app and taking a picture the image was not retrieved. From what I understand in the code, after taking the picture, the image would be displayed in a 60x60 below the button. I tried printing out the base64 value in an alert message but I didn't get any response as well (also no error alerts were displayed). Is there something I missed or should be doing? or did modify the camera function for Android (I'm ueing PhoneGap 0.9.2)</p><p>Aside from that, the rest of the function seem to work properly. I was able to load and display the images from the library, etc. </p><p>Sample code can be found in the url below<a href=""http://docs.phonegap.com/phonegap_camera_camera.md.html"" rel=""nofollow"">http://docs.phonegap.com/phonegap_camera_camera.md.html</a></p><p>Thanks in advance.</p>","515985","","","","","2012-03-28 23:52:25","PhoneGap on Android: camera.getPicture success proceedure not being called","<android><camera><phonegap>","3","2","1","",""
"4245123","1","4245499","","2010-11-22 11:53:41","0","1468","<p>I am making a media player application in which i have a Mp3 file URL that i need to http stream down over Android MediaPlayer.</p><p>Now My Streaming is working very fine . Song is getting downloaded and Played Successfully.But i need to show the Downloading and Song Progress over a ProgressBar/SeekBar.As soon i got my initial data buffer filled with some song data my streamer plays the song.</p><p>But i need to know the total duration of song so that i can set the Progress Bar accordingly.As soon my Media Player starts playing the song. I call</p><p>mediaPlayer.getDuration() for getting the file duration .. But it is not giving me the right data untill the whole song get downloaded....</p><p>This is bad . as it seems getDuration() Method of MediaPlayer is showing the duration on the basis of downloaded content instead of checking the header of Mp3 file.....</p><p>I am following the tutorial for Http streaming audio song from the following Link</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></p><p>Any Help would be appreciated.Thanks</p>","467592","","","","","2010-12-30 04:33:27","How to get mp3 file duration Http streamed over Android MediaPlayer","<android>","2","0","","",""
"4245162","1","","","2010-11-22 11:58:16","2","2181","<p>By using command prompt access the device shell/terminal. then use the su command getting permission denied error. Why this happening?</p><p>how can i solve this problem.</p>","309990","","","","","2010-12-10 15:38:59","su: permission denied error","<android>","2","2","","",""
"4245193","1","4245527","","2010-11-22 12:02:02","0","8660","<p>I set </p><pre>locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 0f, this);<br></pre><p>it has an odd behavior, locationChanged gets called every second instead of any time close to 1 minute.  Secondly, locationChanged gets called every second for like 10 seconds, then stops completely, the gps satalites icon disappears, then only resumes again when the screen returns from display timeout.<br>what's wrong?</p><p>I'm currently  on android 1.5.</p>","121196","","121196","","2010-11-22 12:08:39","2012-08-08 07:29:11","android LocationManager.requestLocationUpdates with minTime >0 not working as expected","<android><locationmanager>","1","0","","",""
"4245211","1","9599135","","2010-11-22 12:05:05","0","1894","<p>I am new with WIFI connectivity with android. I want to create the application to send the messages to WIFI devices with my android devices so for this i want to ask how to connect our android device to WIFI devices to send the messages.</p><p>thanks and regardsAmit</p>","339116","","236128","","2010-11-22 12:27:19","2013-03-22 12:56:01","android WIFI connectivity","<android><wifi>","2","1","","",""
"4245214","1","4248618","","2010-11-22 12:05:32","1","308","<p>i to implement my same application for both 320x480 and 480x854 resolutions. For this purpose i copied my images in hdpi and mdpi drawable folders but still it is not working with480x854 resolution. What i must do other than this to solve my problem?Thanks</p>","493193","","493193","","2010-12-02 06:05:55","2010-12-02 06:05:55","How to develop application for both 320x480 and 480x854?","<java><android>","2","0","","",""
"4245235","1","4245394","","2010-11-22 12:07:50","0","1880","<p>my app should have a button say start/stop upon click it should capture the emulator screen including mouse movements and what's on the screenand when stopped, it will stop capturing the screen...</p>","505580","","","","","2010-11-22 13:53:47","capturing the emulator screen(android):","<android><emulator>","1","0","","",""
"4245288","1","","","2010-11-22 12:15:00","4","1797","<p>I need suggestion on handling few Wifi scenarios in my application.</p><p>Suppose my application is running and device is kept idle for a while and it has gone into sleep mode. In the sleep mode the wifi is automatically turned off. Now again when the device is brought back from the sleep mode it takes some time to turn on the Wifi state.Now if during this time app background service is making http request, how we handle that scenario?</p><p>OR</p><p>suppose if Wifi is not available, device is trying to connect to the GPRS/3G and if during this period if user/background service is making the http request, how we handle it in the code?</p>","516040","","","","","2010-11-22 12:47:20","Monitoring the WiFi on android device","<android><networking><wifi>","1","0","2","",""
"4245308","1","4245388","","2010-11-22 12:18:30","3","1188","<p>I am developing an android application based on web services. How can I run query (server using php and MySQL) based on the item clicked and get the result from the web. I also want to show some values as list (List layout). Is there anyway to accomplish this?</p>","395959","","569101","","2013-04-11 12:09:44","2013-04-11 12:09:44","How to get values for an android application","<php><android><mysql>","1","0","2","",""
"4245358","1","","","2010-11-22 12:24:57","1","568","<p>Hey guys, sry, my third question belonging to this topic, but it doesnt start to work.</p><p>This is my result... each and every time. (all jars / adapter included) - also it results with '<strong>Valid Adapter, calling handle</strong>' but it also always say '<strong>failure</strong>'</p><pre><code>11-22 13:14:02.634: DEBUG/AdWhirl SDK(2621): Will call rotateAd() in 30 seconds11-22 13:14:32.634: INFO/AdWhirl SDK(2621): Rotating Ad11-22 13:14:32.634: DEBUG/AdWhirl SDK(2621): Dart is &lt;48.07955443549056&gt; of &lt;100.0&gt;11-22 13:14:32.644: DEBUG/AdWhirl SDK(2621): Showing ad:11-22 13:14:32.644: DEBUG/AdWhirl SDK(2621):     nid: 7e779e360983412dad4d46c180a3493c11-22 13:14:32.644: DEBUG/AdWhirl SDK(2621):     name: admob11-22 13:14:32.644: DEBUG/AdWhirl SDK(2621):     type: 111-22 13:14:32.644: DEBUG/AdWhirl SDK(2621):     key: a14c9xxxx1e3aacf0111-22 13:14:32.644: DEBUG/AdWhirl SDK(2621):     key2: 11-22 13:14:32.644: DEBUG/AdWhirl SDK(2621): Valid adapter, calling handle()11-22 13:14:32.854: DEBUG/AdWhirl SDK(2621): AdMob failure11-22 13:14:32.854: ERROR/AdWhirl SDK(2621): nextRation is null!11-22 13:14:32.854: DEBUG/AdWhirl SDK(2621): Will call rotateAd() in 30 seconds11-22 13:15:02.854: INFO/AdWhirl SDK(2621): Rotating Ad11-22 13:15:02.854: DEBUG/AdWhirl SDK(2621): Dart is &lt;31.576009879080946&gt; of &lt;100.0&gt;11-22 13:15:02.864: DEBUG/AdWhirl SDK(2621): Showing ad:11-22 13:15:02.864: DEBUG/AdWhirl SDK(2621):     nid: 7e779e360983412dad4d46c180a3493c11-22 13:15:02.864: DEBUG/AdWhirl SDK(2621):     name: admob11-22 13:15:02.864: DEBUG/AdWhirl SDK(2621):     type: 111-22 13:15:02.864: DEBUG/AdWhirl SDK(2621):     key: a14cxxxxxacf0111-22 13:15:02.864: DEBUG/AdWhirl SDK(2621):     key2: 11-22 13:15:02.864: DEBUG/AdWhirl SDK(2621): Valid adapter, calling handle()11-22 13:15:03.114: DEBUG/AdWhirl SDK(2621): AdMob failure11-22 13:15:03.114: ERROR/AdWhirl SDK(2621): nextRation is null!11-22 13:15:03.114: DEBUG/AdWhirl SDK(2621): Will call rotateAd() in 30 seconds11-22 13:15:33.117: INFO/AdWhirl SDK(2621): Rotating Ad11-22 13:15:33.117: DEBUG/AdWhirl SDK(2621): Dart is &lt;74.7807305713731&gt; of &lt;100.0&gt;11-22 13:15:33.117: DEBUG/AdWhirl SDK(2621): Showing ad:11-22 13:15:33.117: DEBUG/AdWhirl SDK(2621):     nid: 90728xxxx734a2669b1c15ebbfd911-22 13:15:33.117: DEBUG/AdWhirl SDK(2621):     name: zestadz11-22 13:15:33.117: DEBUG/AdWhirl SDK(2621):     type: 2011-22 13:15:33.117: DEBUG/AdWhirl SDK(2621):     key: 14131C047A50414B4Exxxxxxx146584xxx5683822911-22 13:15:33.117: DEBUG/AdWhirl SDK(2621):     key2: 11-22 13:15:33.117: DEBUG/AdWhirl SDK(2621): Valid adapter, calling handle()11-22 13:15:36.274: DEBUG/AdWhirl SDK(2621): ZestADZ failure11-22 13:15:36.274: ERROR/AdWhirl SDK(2621): nextRation is null!11-22 13:15:36.274: DEBUG/AdWhirl SDK(2621): Will call rotateAd() in 30 seconds</code></pre><p>my code, used to do so:</p><pre><code>AdWhirlTargeting.setTestMode(false);AdManager.setTestDevices( new String[] { ""5B7D2A0178D212B6E94E22A15725A3D3"" } ); //my mobileRelativeLayout layout = (RelativeLayout) this.findViewById(R.id.widget54xx);AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, ""548feca89xxadWhirlIDf482a"");adWhirlLayout.setAdWhirlInterface(this);final int DIP_WIDTH = 320; final int DIP_HEIGHT = 52; final float DENSITY = getResources().getDisplayMetrics().density; int scaledWidth = (int) (DENSITY * DIP_WIDTH + 0.5f); int scaledHeight = (int) (DENSITY * DIP_HEIGHT + 0.5f); RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(scaledWidth, scaledHeight);adWhirlLayout.setBackgroundColor(Color.BLACK); //just for debuglayout.addView(adWhirlLayout, adWhirlLayoutParams);layout.invalidate();</code></pre><p>the layout and everything seems to be fine. also height, should be working (results on my device with 52px) and i really dont know, whats the problem.</p><p>best regards,and i'd be really thankful for any kind of tip,cV /mike</p>","371749","","","","","2011-01-13 15:35:11","Adwhirl SDK always return 'Networkname - failure'; Adapter, calling handle, everything fine","<android><networking><admob><adwhirl>","1","0","","",""
"4245472","1","","","2010-11-22 12:41:16","1","4444","<p>I want to create the android application in which i send the data from the android device to desktop application using wifi devices. I am not confirmed but i think that it can be possible with the socket programming. so please help me to give guidence for how to send data from android device to desktop using WIFI.</p>","339116","","213269","","2010-11-22 12:55:22","2011-05-30 11:26:31","How to do socket programming in android","<android><sockets><wifi>","2","0","","",""
"4245522","1","","","2010-11-22 12:46:09","4","2470","<p>this is my problem: I'm writing an alternative contacts app which is specified to work with A LOT of different languages and alphabets. When querying names in my own language, Swedish, the names using umlaut characters are sorted in an illogical manner to me, but logical to unicode i suppose:</p><p>Should be/Swedish style: A, B, C, ..., Z, Å, Ä, Ö.</p><p>Query result: A, Å, Ä, B, ..., N, O, Ö, P, ...</p><p>I assume this will be a problem in any language that deviates from the latin alphabet. All tests I've made are on the emulator. My dev group are making changes to the framework so low-level answers are welcome as well.</p><pre><code>Uri uri = ContactsContract.Contacts.CONTENT_URI;String[] projection = new String[] {       ContactsContract.Contacts._ID,       ContactsContract.Contacts.DISPLAY_NAME,       ContactsContract.Contacts.PHOTO_ID       };String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + "" = '1'"";String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + "" COLLATE LOCALIZED ASC"";mCursor = managedQuery(uri, projection, null, null, sortOrder);</code></pre><p>Update: we're currently investigating this track: <a href=""http://www.rgagnon.com/javadetails/java-0343.html"" rel=""nofollow"">Sort a String array</a>, TBC...I also added it as an issue on Google Code.</p>","476711","","476711","","2010-11-22 14:58:33","2010-12-01 07:16:40","Android contacts: Incorrect localized collation/sorting","<android><sqlite><localization><contacts><collation>","1","2","1","",""
"4245636","1","4245729","","2010-11-22 13:00:11","0","176","<p>I'm creating an Android application that will register an Observer and listen for events, I will probably use one of the suggestions by Mark in <a href=""http://stackoverflow.com/questions/2468874/how-can-i-update-information-in-an-android-activity-from-a-background-service"">this previous question.</a></p><p>However, my question is, how can I create a ""stub"" on Android that I can use to fire events at my applications observer? For the purpose of this example, we'll assume that my app is listening for a wifi signal strength, I need to create something that will run on the emulator (or device) that will mock up data to ""pretend"" it has a strong/weak signal, and to relay that to my app.</p><p>Any suggestions?</p>","155695","","","","","2010-11-22 13:21:35","What is the best way to implement a ""stub"" on Android?","<android><stubbing>","1","0","","",""
"4245712","1","4347648","","2010-11-22 13:09:43","1","1748","<p>I am attempting to compile a list of Android phones which can be put into USB Host mode or have serial capability.</p><p>Are there any phones, other than what is listed here that have either USB Host/USB OTG or Serial capability?</p><p>Serial:</p><p>HTC Dream<br>HTC Magic<br>HTC Hero<br>HTC/Google Nexus One<br></p><p>USB:</p><p>Motorola Droid<br>Nexus One<br>Galaxy Nexus</p>","516126","","58074","","2014-04-10 13:45:37","2014-04-10 13:45:37","USB Host or Serial capability in Android Phones","<android><serial-port><usb>","1","3","","2014-01-14 06:57:31",""
"4245795","1","4245825","","2010-11-22 13:20:24","2","8577","<blockquote>  <p>android.database.sqlite.SQLiteConstraintException:  error code 19: constraint failed</p></blockquote><p>error in my application and not sure why.</p><p>It happens when i add a new Inbox item into my database.</p><p>here is the Create statement of my inbox table:</p><pre><code>CREATE TABLE inbox (uid text, title text, sender text, timeRecieved text, PRIMARY KEY(uid));</code></pre><p>implemented using these static final Strings;</p><pre><code>public static final String LABEL_INBOX_UID = ""uid"";    public static final String LABEL_INBOX_TITLE = ""title"";    public static final String LABEL_INBOX_SENDER = ""sender"";    public static final String LABEL_INBOX_TIME_RECIEVED = ""timeRecieved"";    public static final int COLUMN_INBOX_UID = 0;    public static final int COLUMN_INBOX_TITLE  = 1;    public static final int COLUMN_INBOX_SENDER= 2;    public static final int COLUMN_INBOX_TIME_RECIEVED = 3;    public static final String TABLE_NAME_INBOX = ""inbox"";    public static final String TABLE_CREATE_INBOX = ""CREATE TABLE ""        + TABLE_NAME_INBOX + "" ("" + LABEL_INBOX_UID + "" text, ""        + LABEL_INBOX_TITLE + "" text, "" + LABEL_INBOX_SENDER        + "" text, "" + LABEL_INBOX_TIME_RECIEVED + "" text, ""     + ""PRIMARY KEY("" + LABEL_INBOX_UID + "")"" + "");"";</code></pre><p>And here is the method that gets a inbox item and put it inside a contentValues()</p><pre><code>@Override    protected void insertItem(InboxListItem object, String table) {        InboxListItem item = object;        inboxItemValue = new ContentValues();        inboxItemValue.put(LABEL_INBOX_UID, item.getUid());         Log.d(TAG, ""item.getUid() "" + item.getUid());        inboxItemValue.put(LABEL_INBOX_TIME_RECIEVED, item.getTimeRecieved());        Log.d(TAG, ""item.getTimeRecieved() "" + item.getTimeRecieved());        inboxItemValue.put(LABEL_INBOX_TITLE, item.getTitle());        Log.d(TAG, ""item.getTitle() "" + item.getTitle());        inboxItemValue.put(LABEL_INBOX_SENDER, item.getSender());        Log.d(TAG, ""item.getSender() "" + item.getSender());        Log.d(TAG, ""TABLE_CREATE_EVENTS ="" + TABLE_CREATE_EVENTS);        Log.d(TAG, ""TABLE_CREATE_INBOX ="" + TABLE_CREATE_INBOX);        Log.d(TAG, ""TABLE_CREATE_CONTACTS ="" + TABLE_CREATE_CONTACTS);        database().insert(TABLE_NAME_INBOX, null, inboxItemValue);        Log.d(TAG, ""database().insert(TABLE_NAME_INBOX, null, inboxItemValue);"");    }</code></pre><p>O and here is the full exception message:</p><blockquote>  <p>11-22 12:24:39.606:  ERROR/Database(773): Error inserting  sender=Mit Technology Review  uid=663b074a-16c8-46fb-a420-e0ebf716e212  title=Emerging Technologies Friday  Update (11/19/2010)  timeRecieved=2010-11-19T06:02:36.000Z  11-22 12:24:39.606:  ERROR/Database(773):  android.database.sqlite.SQLiteConstraintException:  error code 19: constraint failed 11-22  12:24:39.606: ERROR/Database(773):<br>  at  android.database.sqlite.SQLiteStatement.native_execute(Native  Method) 11-22 12:24:39.606:  ERROR/Database(773):     at  android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:55)  11-22 12:24:39.606:  ERROR/Database(773):     at  android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1549)  11-22 12:24:39.606:  ERROR/Database(773):     at  android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1410)  11-22 12:24:39.606:  ERROR/Database(773):     at  com.kc.database.InboxDbWrapper.insertItem(InboxDbWrapper.java:44)  11-22 12:24:39.606:  ERROR/Database(773):     at  com.kc.database.InboxDbWrapper.insertItem(InboxDbWrapper.java:1)  11-22 12:24:39.606:  ERROR/Database(773):     at  com.kc.database.DbWrapper.insertAllItemsToDb(DbWrapper.java:42)  11-22 12:24:39.606:  ERROR/Database(773):     at  com.kc.database.InboxDbWrapper.populateTable(InboxDbWrapper.java:54)  11-22 12:24:39.606:  ERROR/Database(773):     at  com.kc.main.screen.HomeMainScreenOne.loadDataToDb(HomeMainScreenOne.java:225)  11-22 12:24:39.606:  ERROR/Database(773):     at  com.kc.main.screen.AbstractMainScreen.onCreate(AbstractMainScreen.java:125)  11-22 12:24:39.606:  ERROR/Database(773):     at  com.kc.main.screen.HomeMainScreenOne.onCreate(HomeMainScreenOne.java:51)  11-22 12:24:39.606:  ERROR/Database(773):     at  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  11-22 12:24:39.606:  ERROR/Database(773):     at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)  11-22 12:24:39.606:  ERROR/Database(773):     at  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)  11-22 12:24:39.606:  ERROR/Database(773):     at  android.app.ActivityThread.access$2300(ActivityThread.java:125)  11-22 12:24:39.606:  ERROR/Database(773):     at  android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)  11-22 12:24:39.606:  ERROR/Database(773):     at  android.os.Handler.dispatchMessage(Handler.java:99)  11-22 12:24:39.606:  ERROR/Database(773):     at  android.os.Looper.loop(Looper.java:123)  11-22 12:24:39.606:  ERROR/Database(773):     at  android.app.ActivityThread.main(ActivityThread.java:4627)  11-22 12:24:39.606:  ERROR/Database(773):     at  java.lang.reflect.Method.invokeNative(Native  Method) 11-22 12:24:39.606:  ERROR/Database(773):     at  java.lang.reflect.Method.invoke(Method.java:521)  11-22 12:24:39.606:  ERROR/Database(773):     at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)  11-22 12:24:39.606:  ERROR/Database(773):     at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)  11-22 12:24:39.606:  ERROR/Database(773):     at  dalvik.system.NativeStart.main(Native  Method)</p></blockquote><p>Thanks in advance:</p><p>Edit: Somemore info. I had previously created a events and contactsList table succesfully and that seems  to work fine. here is the code below:</p><p>Contacts:</p><pre><code>// Variables used to create the events table    public static final String TABLE_NAME_CONTACTS = ""contactsList"";    public static final String LABEL_CONTACTS_UID = ""uid"";    public static final String LABEL_CONTACTS_FULLNAME = ""fullname"";    public static final String TABLE_CREATE_CONTACTS = ""CREATE TABLE ""            + TABLE_NAME_CONTACTS + "" ("" + LABEL_CONTACTS_UID + "" text, ""            + LABEL_CONTACTS_FULLNAME + "" text, "" + ""PRIMARY KEY(""            + LABEL_CONTACTS_UID + "")"" + "");"";    public static final int COLUMN_CONTACTS_UID = 0;public static final int COLUMN_CONTACTS_FULLNAME = 1;CREATE TABLE contactsList (uid text, fullname text, PRIMARY KEY(uid));</code></pre><p>calendar events:</p><pre><code>public static final String LABEL_EVENTS_UID = ""uid"";    public static final String LABEL_EVENTS_TITLE = ""title"";    public static final String LABEL_EVENTS_LOCATION = ""location"";    public static final String LABEL_EVENTS_DATE = ""date"";    public static final String LABEL_EVENTS_TIME = ""time"";    public static final String LABEL_EVENTS_TIMEZONE = ""timezone"";    public static final int COLUMN_EVENTS_UID = 0;    public static final int COLUMN_EVENTS_TITLE = 1;    public static final int COLUMN_EVENTS_LOCATION = 2;    public static final int COLUMN_EVENTS_DATE = 3;    public static final int COLUMN_EVENTS_TIME = 4;    public static final int COLUMN_EVENTS_TIMEZONE = 5;    // Variables used to create the events table    public static final String TABLE_NAME_EVENTS = ""events"";    public static final String TABLE_CREATE_EVENTS = ""CREATE TABLE ""            + TABLE_NAME_EVENTS + "" ("" + LABEL_EVENTS_UID + "" text, ""            + LABEL_EVENTS_TITLE + "" varchar(30), "" + LABEL_EVENTS_LOCATION            + "" varchar(30), "" + LABEL_EVENTS_DATE + "" varchar(30), ""            + LABEL_EVENTS_TIME + "" varchar(30), "" + LABEL_EVENTS_TIMEZONE            + "" varchar(30), "" + ""PRIMARY KEY("" + LABEL_EVENTS_UID + "")"" + "");"";CREATE TABLE events (uid text, title varchar(30), location varchar(30), date varchar(30), time varchar(30), timezone varchar(30), PRIMARY KEY(uid));</code></pre>","444668","","444668","","2010-11-22 14:12:06","2012-07-16 12:29:59","android.database.sqlite.SQLiteConstraintException","<android>","4","0","1","",""
"4245803","1","4245996","","2010-11-22 13:21:42","13","8887","<p>I am working with Bluetooth Chat sample code. In sample app the Device opens up in another screen but I have implemented the same code with the difference that DeviceListActivity is called as soon as the app is started but this opens it in another screen and I want that it should be opened as pop-up in Bluetooth chat sample code.</p><p>Can someone let me know how to open Activity as pop-up?</p>","261566","","","","","2012-12-25 09:12:18","open activity as pop-up and not in other screen in Android?","<android><activity><pop-up>","1","0","3","",""
"4245809","1","","","2010-11-22 13:23:06","0","978","<p>I'm building a text at runtime that will be put into a TextView.This text has composed with different size fonts.I must calculate the width in pixels of this text.I have tried to use Paint.measureText, but it does not consider the different font sizes.How can I calculate the real width?</p><p>this is an example:</p><pre><code>LinearLayout text = (LinearLayout) findViewById(R.id.LinearLayout);SpannableStringBuilder str = new SpannableStringBuilder(""0123456789"");str.setSpan(new RelativeSizeSpan(2f), 3, 6, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);TextView tmp = new TextView(this);tmp.setText(str,BufferType.SPANNABLE);text.addView(tmp);Float dim = tmp.getPaint().measureText(str, 0, str.length());</code></pre><p>In this example, if I set the relative size to ""2f "" or ""3f""(for example), the total size that returns ""MeasureText"" is the same.</p><p>Thanks</p>","516130","","516130","","2010-11-23 14:30:28","2012-05-16 07:23:24","Calculate SpannableString witdh","<android><textview>","2","0","1","",""
"4245838","1","4245955","","2010-11-22 13:26:23","1","1166","<p>I'm trying to make iPhone-style EditText element on android.The one that will have an additional clear button appear on the right after text input.</p><p>Adding a new button is not a problem, but I'm a bit stuck with another thing.</p><p>A button occupies some space on the right part of EditText, and now characters display beneath the button. How to change maximum shown length of input for EditText?<br>I want EditText width to be N pixels, and editable area to be N-M pixels.</p><p>EditText.setWidth changes width for whole edit box.<br>EditText.setEllipsize should be the proper solution, but docs are empty, and as I see it truncates text based on some String value.<br>Applying a LengthFilter cut's the input length to number of characters.</p><p>Thanks in advance.</p>","453991","","","","","2012-03-11 16:42:26","iphone-style text edit on android","<android>","3","0","","",""
"4245904","1","4246069","","2010-11-22 13:32:41","0","309","<p>I'm trying to get some information from a web... with the code above...</p><pre><code>URL url = new URL(webpage);URLConnection connection;connection = url.openConnection();BufferedReader in;InputStreamReader inputStreamReader;inputStreamReader = new InputStreamReader(connection.getInputStream(), ""iso-8859-1"");in = new BufferedReader(new InputStreamReader(connection.getInputStream()));</code></pre><p>But I'm having a problem with the encoding when I'm reading it. The page is in spanish, and it has some simbols like ""ñ"" or ""á"". The header of the source code of the page says that it's in ""iso-8859-1"", and I've tried with ""utf-8"", but none of them works... when I try to set the text I'm reading from the URL to a TextView it just shows garbage in the simbols I've told....</p><p>Any ideas?</p><p>Thanks!</p>","506712","","","","","2010-11-22 13:52:35","Problem with the encoding of a web page","<java><android>","1","0","","",""
"4246015","1","4246868","","2010-11-22 13:44:37","8","2961","<p>Is it possible to share resources across APK's?  For example, can application A (in APK A) load an icon or layout view from application B (in APK B)?</p>","512309","","","","","2010-11-22 15:15:57","Can you share resources across APK's?","<android>","3","0","4","",""
"4246049","1","","","2010-11-22 13:49:39","4","8128","<p>HiI'm trying to find out about what the differences are in operating systems of mobile devices compared to those in desktop machines. Specifically things like memory management, scheduling etc.</p><p>I'm aware that mobile operating systems must need to do several other things like power management and worry about the smaller memory capacity. </p><p>Does anyone have any good resources to find out about the technical differences in mobile operating systems to their desktop counterpart and maybe specifically about android OS?</p>","516170","","635608","","2011-11-05 14:35:04","2011-11-05 14:35:04","Fundamental differences between Linux OS and Mobile OS (android)","<android><operating-system><linux-kernel><dalvik>","3","0","","",""
"4246118","1","4246167","","2010-11-22 13:57:36","2","1598","<p>In Android can the OnLongClickListener be used with EditTexts and TextViews or just Buttons?</p>","497517","","","","","2010-11-22 14:02:55","OnLongClick with Text View & Edit Text","<android><onlongclicklistener>","2","0","","",""
"4246184","1","4246259","","2010-11-22 14:03:45","1","91","<p>what view is this in android, I have seen this in iphone can any one help<img src=""http://i.stack.imgur.com/Bx4kz.png"" alt=""alt text""></p><p>the one shown in bottom near footer</p><p><img src=""http://i.stack.imgur.com/w7pP3.png"" alt=""alt text""></p>","392574","","","","","2010-11-22 14:14:32","what view is this in android, I have seen this in iphone can any one help","<android>","3","0","","",""
"4246416","1","6117843","","2010-11-22 14:28:01","1","5230","<p>I have this requirement to send my application background and then bring it to foreground on some key capture intents (not from application launcher offcourse) So How can I send the current tasks to background and bring the same to foreground  ?</p>","505011","","","","","2011-05-24 22:56:45","Sending task to background and Bring it to foreground","<android>","3","0","","",""
"4246436","1","4246558","","2010-11-22 14:29:37","2","972","<p>I am trying to get the bounds of my mapview but I had the problem that the latitude is always set to 0 and longtitude is always set to 360*1E6. According to this link, that is because it will only offer the right coordinates when the map is fully loaded:<a href=""http://stackoverflow.com/questions/2667386/mapview-getlatitudespan-and-getlongitudespan-not-working"">Mapview getLatitudeSpan and getLongitudeSpan not working</a></p><p>Now, I am totally confused about the solution, I made this method which I call from the onCreate of my mainactivity (the mapview):</p><pre><code>public int[][] getBounds(){ GeoPoint center = this.mapView.getMapCenter(); int latitudeSpan = this.mapView.getLatitudeSpan(); int longtitudeSpan = this.mapView.getLongitudeSpan(); int[][] bounds = new int[2][2]; bounds[0][0] = center.getLatitudeE6() + (latitudeSpan/2); bounds[0][1] = center.getLongitudeE6() + (longtitudeSpan/2); bounds[1][0] = center.getLatitudeE6() - (latitudeSpan/2); bounds[1][1] = center.getLongitudeE6() - (longtitudeSpan/2); return bounds;}</code></pre><p>How do I make this wait for the mapview to load? I've looked in the API for postDelayed, but I cannot get it to work.</p><p>Forgive me if I am being stupid o.o'</p>","298593","","","","","2010-11-22 14:41:19","MapView latitudeSpan / longtitudeSpan not working","<android><android-mapview><latitude-longitude><hack><postdelayed>","1","0","","",""
"4246548","1","4247276","","2010-11-22 14:40:28","7","4210","<p>is it possible to capture what's going on in an android screen as video, either on the device itself or the emulator?</p><p>thanks!</p>","97688","","","","","2012-11-26 11:32:29","android: video capturing on device or emulator","<android><video><capture>","3","0","1","2012-11-27 00:00:23",""
"4246621","1","","","2010-11-22 14:47:14","2","2364","<p>I am new to android and I started this sample from google but i have a problem and couldn't get pass it. </p><p>This line has an error in DictonaryDatabase.java.</p><pre><code>InputStream inputStream = resources.openRawResource(R.raw.definitions);</code></pre><p>and the error says ""raw cannot be resolved or is not in a field.""</p><p>I have imported the Java.R but this didn't seem to fix it.I also have created a raw folder but didn't fix it.</p><p>thanks for your help.</p>","516247","","473070","","2010-11-22 14:48:03","2012-11-23 15:58:20","Android: Searchable Dictionary error: (R.raw.definitions)","<android><dictionary>","4","0","","",""
"4246799","1","4247511","","2010-11-22 15:08:10","1","345","<p>Can finish() be used to close an activity from a service?  If not, what is the proper way to end an activity from a Service?  I've created an activity from my service and need to close it.</p>","513939","","","","","2010-11-22 16:10:30","What is the proper way to close an Activity from a Service?","<android>","2","1","1","",""
"4246834","1","","","2010-11-22 15:11:35","0","2714","<p>I have followed twice this basic tutorial to create a map + an overlay with the AndroidMarker (when you tap him, a popup should appear)And I still have the same problem, when I press the marker, the application crashed on the dialog.show(). </p><p>Can you tell me how to debug such problem please ?</p><p><a href=""http://www.anddev.org/map-tutorials-f18/popup-when-i-tap-marker-t49121.html"" rel=""nofollow"">My sources can be found here</a> (Link is dead. The requested topic does not exist.)</p><pre><code>11-23 12:48:51.364: WARN/WindowManager(59): Attempted to add window with non-application token WindowToken{43f3eb70 token=null}.  Aborting.11-23 12:48:51.384: DEBUG/AndroidRuntime(307): Shutting down VM11-23 12:48:51.384: WARN/dalvikvm(307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)11-23 12:48:51.454: ERROR/AndroidRuntime(307): FATAL EXCEPTION: main11-23 12:48:51.454: ERROR/AndroidRuntime(307): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.view.ViewRoot.setView(ViewRoot.java:509)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.app.Dialog.show(Dialog.java:241)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.app.AlertDialog$Builder.show(AlertDialog.java:802)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.markerTest.HelloItemizedOverlay.onTap(HelloItemizedOverlay.java:45)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:453)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:347)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:533)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.google.android.maps.MapView.onTouchEvent(MapView.java:647)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.view.View.dispatchTouchEvent(View.java:3766)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.app.Activity.dispatchTouchEvent(Activity.java:2086)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.os.Handler.dispatchMessage(Handler.java:99)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.os.Looper.loop(Looper.java:123)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at java.lang.reflect.Method.invokeNative(Native Method)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at java.lang.reflect.Method.invoke(Method.java:521)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-23 12:48:51.454: ERROR/AndroidRuntime(307):     at dalvik.system.NativeStart.main(Native Method)11-23 12:48:51.534: WARN/ActivityManager(59):   Force finishing activity com.markerTest/.markerTest</code></pre><p>thx</p><p>Swan</p>","516276","","569101","","2013-09-09 10:18:40","2013-09-09 10:18:40","Android map popup on tap","<android><google-maps><popup><tap>","1","2","","",""
"4246842","1","4247428","","2010-11-22 15:12:34","1","1375","<p>Id like to use the blue compass needle we all know from the Gmaps app. </p><ul><li>Is there a widget available I justhave to turn on? </li><li>If not, could you provide meTutorials or the name of classes Ishould take a look at?</li></ul>","433718","","","","","2010-11-22 16:04:16","Compass widget for MapActivity (Android)","<android><android-maps>","1","3","2","",""
"4246851","1","4246888","","2010-11-22 15:13:35","1","1316","<p>I need to dynamically move 2 seekbars. While the user moves one, the other will have to move also accordingly to the values of the first.I've created 2 seekbars but they move independent from each other, how can i ""link"" them so, for ex. the second seekbar moves 1/10th of the first?Thanks</p><p><code><pre>seekBarSM.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){  @Override  public void onProgressChanged(SeekBar seekBarSM, int progress,         boolean fromUser) {  seekBarSMValue.setText(String.valueOf(progress));   }   @Override   public void onStartTrackingTouch(SeekBar seekBarSM) {        }   @Override   public void onStopTrackingTouch(SeekBar seekBarSM) {    }});</p><p>seekBarSF.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){  @Override  public void onProgressChanged(SeekBar seekBarSF, int progress,         boolean fromUser) {  seekBarSFValue.setText(String.valueOf(progress));   }   @Override   public void onStartTrackingTouch(SeekBar seekBarSF) {      }   @Override   public void onStopTrackingTouch(SeekBar seekBarSF) {      }});</pre></code></p>","516279","","","","","2010-11-22 15:17:54","How to dynamically move seekbar from another seekbar in android?","<android><seekbar>","1","0","0","",""
"4246895","1","4247059","","2010-11-22 15:18:35","0","1196","<p>how can i get the rotation of the device in the four main orientations? and is there a corresponding event that i can capture?</p><p>also, is it possible to disable this rotation for my app?</p><p>thanks!</p>","97688","","97688","","2010-11-22 17:45:17","2012-07-12 12:18:11","android device rotation","<android><rotation><device>","1","0","","",""
"4246955","1","4247765","","2010-11-22 15:24:08","0","2591","<p>I am trying to call rest web services in andoid, but i have always a time out exception.The code is:</p><pre><code>HttpClient httpclient = new DefaultHttpClient();  HttpGet request = new HttpGet(""http://XXXX:8080/YYY/zzzz?username=0001epd&amp;password=1111"");ResponseHandler&lt;String&gt; handler = new BasicResponseHandler();  try {          String result = httpclient.execute(request, handler);  } catch (ClientProtocolException e) {             e.printStackTrace();  } catch (IOException e) {            e.printStackTrace();             }  httpclient.getConnectionManager().shutdown();  </code></pre><p>Do you have any idea where is the error?</p><p>In the manifest I added  android.permission.INTERNET</p>","422688","","244296","","2010-11-22 16:09:42","2012-06-13 07:24:49","Time out exception when invoke rest webservice in android","<android><web-services>","3","0","","",""
"4247044","1","4747663","","2010-11-22 15:31:54","12","2375","<p>Is there a way of ascertaining if a Google Streetview panorama is available from an Android application (i.e. using Java). I have seen other questions stating that there is a Javascript function available, but no alternatives seem to exist for PHp or Python or other server-side technologuies.</p><p>The impact of calling Google Streetview where no panorama exists is simply a black screen and a ""spinny thing"".</p><p>Is there any way around this?Thanks for your time.....</p>","516282","","","","","2013-05-15 18:56:49","Google Streetview existence function - NOT Javascript","<java><android><google-street-view>","4","0","4","",""
"4247055","1","","","2010-11-22 15:32:48","2","657","<p>I'm having a problem with spinners in a form activity.</p><p>I was expecting a spinner to gain focus when a user ""touched"" it but this does not seem to happen. A spinner only seems to gain focus if I use my tracker ball (on a Nexus One) to move between the different components.</p><p>This is annoying because I'm using the android:selectAllOnFocus=""true"" attribute on the first EditText view in the form. Because the spinners never take focus away from the EditText component its contents are always hi-lighted (which is ugly IMO).</p><p>I've tried using </p><p><code>    spinner.requestFocus();</code></p><p>but this (seemingly) has no effect.</p><p>I've tried requesting focus on the spinner in a AdapterView.OnItemSelectedListener but his just results in</p><p><code>Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44cb0380</code></p><p>Can anyone explain this odd behaviour and/or possible ways around it.</p><p>Many Thanks,</p><p>Tim</p>","509357","","","","","2013-12-31 07:18:13","spinners and focus","<android>","1","1","1","",""
"4247233","1","","","2010-11-22 15:46:15","0","427","<p>We have a user name and telephone field. User opens android keyboard and enters user name. Then in the keyboard user clicks the ‘Next’ button and it launches the telephone type keyboard.But the same behavior is not observed in case of swift keyboard. If user chooses swift keyboard, App doesn’t bring the telephone keyboard on click of telephone field.</p><p>What is going wrong here? Any suggestion.Is there anyway I can enforce user to use Android Keyboard?</p>","512660","","","","","2010-11-22 19:34:22","Android App - Keyboard Type","<android><types><keyboard>","1","1","","",""
"4247246","1","4247725","","2010-11-22 15:47:40","0","2025","<p>How do you send a large (>5MB) post parameter (among other post parameters) in Android? </p><p>I'm currently using <code>org.apache.http.client.methods.HttpPost</code> and a list of <code>BasicNameValuePair</code> to send the post params.</p><pre><code> HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(someURL); List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(); nameValuePairs.add(new BasicNameValuePair(""param1"", ""value1"")); nameValuePairs.add(new BasicNameValuePair(""param2"", hugeValue)); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); httpclient.execute(httppost);</code></pre><p><code>hugeValue</code> is a very large string that I would like to read from an <code>InputStream</code> and send as I read it. How can I do this?</p>","143378","","143378","","2010-11-22 15:53:51","2010-11-22 16:33:19","Send large post param in Android","<android><http><post><http-post>","1","3","1","",""
"4247382","1","","","2010-11-22 15:59:43","2","660","<p>I am trying android samples and i am wondering how to modify the dictionary list (database).  I can't seem to find the database file.  In the raw folder there is the definitions.txt, i tried to modify this but it doesn't seem to affect the search results.</p><p>please help.</p><p>many thanks.</p>","516247","","21234","","2010-11-22 16:20:08","2013-01-06 11:38:01","How to edit Searchable Dictionary list?","<android><dictionary>","4","0","0","",""
"4247385","1","","","2010-11-22 16:00:01","9","48140","<p>i have a list View in my app (this is the xml layout):</p><pre><code>   &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""       android:id=""@+id/arrayList""       android:layout_width=""fill_parent""android:layout_height=""fill_parent""       android:textFilterEnabled=""true""       android:scrollbars=""vertical""       android:drawSelectorOnTop=""true""&gt;&lt;/ListView&gt;</code></pre><p>Each item of my list View is composed of two TextView:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout android:layout_width=""fill_parent""       xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/row_container""       android:padding=""5px"" android:layout_height=""wrap_content""       android:background=""@color/white"" android:shrinkColumns=""0""&gt;               &lt;TableRow&gt;               &lt;TextView android:layout_height=""wrap_content""                       android:layout_width=""wrap_content"" android:layout_below=""@+id/description""                       android:id=""@+id/description""                       android:textColor=""@color/black""                       android:scrollHorizontally=""true""                       android:singleLine=""true""&gt;&lt;/TextView&gt;       &lt;/TableRow&gt;       &lt;TableRow&gt;               &lt;TextView android:layout_width=""wrap_content""                       android:layout_height=""wrap_content"" android:id=""@+id/result""                       android:textColor=""@color/grey""                       android:maxLines=""1""                       android:scrollHorizontally=""true""&gt;&lt;/TextView&gt;       &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>I'm populating my listView from an ArrayAdapter, in this way:</p><pre><code>public class Matches extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);            //set layout    setContentView(R.layout.list_layout);  // obtain reference to listview  ListView listView = (ListView) findViewById(R.id.arrayList);  ArrayAdapter&lt;Match&gt; arrayAdapter = new ArrayAdapter&lt;Match&gt;(        this, R.layout.custom_row, R.id.description, createItems()) {     @Override     public View getView (int position, View convertView, ViewGroup parent){        Match item = getItem (position);        LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);        View rowView = inflater.inflate(R.layout.custom_row, null);        TextView description = (TextView)rowView.findViewById(R.id.description);        TextView result = (TextView)rowView.findViewById(R.id.result);        description.setText(item.description + ""  Risultato: "" + item.result );        result.setText(item.date + ""  "" + item.hour);        return rowView;     }  };  listView.setAdapter(arrayAdapter);</code></pre><p>My goal is to be able to change the text color and the backgorund of these child views whenever the parent is selected or pressed.</p><p>How can i do it?</p>","516337","","431780","","2010-11-22 16:10:09","2013-04-02 05:33:17","How to change color of ListView items on focus and on click","<android><listview><background-color><listviewitem>","3","1","12","",""
"4247429","1","","","2010-11-22 16:04:17","0","772","<p>I am New To Android,My Requirement is to Attach an ImageFile and an AudioFile to an E-mail in android?can anyone help me..?Thanks in advance   </p>","513745","","","","","2012-12-25 08:46:42","How To attach an image and an audio file to an email in android?","<android>","2","0","","",""
"4247470","1","4247728","","2010-11-22 16:07:11","0","330","<p>I set setCursorVisible(false) on my EditText to get rid of the blinking cursor.  Unfortunately, this also gets rid of highlighting.  Why?  How can I get rid of the cursor and not the highlighting?</p>","406790","","","","","2010-11-22 16:33:43","setCursorVisible loses highlighting","<android><highlighting><edittext>","1","0","","",""
"4247607","1","4247801","","2010-11-22 16:21:06","2","1995","<p>I want to center a text inside a TextView relative to the parent layout and not relative to the textview.</p><p>Example in this code in want to center text list_title relative to my screen width:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutandroid:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;TextView        android:layout_weight=""75""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:id=""@+id/list_title"" /&gt;    &lt;Button        android:layout_weight=""15""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:minWidth=""90px""        android:text=""@string/filter""        android:visibility=""gone""        android:id=""@+id/button_filter"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Have you a solution?</p><p>Thanks for your help</p>","80487","","","","","2012-07-16 11:52:51","Center text relative to layout","<android>","5","0","","",""
"4247681","1","4247706","","2010-11-22 16:28:13","0","956","<p>Hey all - In Android, I wrote a number of strings in my string.xml I would like to display on a TextView based on a random number...Here is what I have:</p><pre><code>  int randCropPercentage = (int) Math.ceil(Math.random() * 100);    Random randPhrase50 = new Random();        int[] array50 = new int[] { R.string.ss2, R.string.ss4, R.string.ss5,                R.string.st4, R.string.st5, R.string.tt2, R.string.tt3,                R.string.tt5, R.string.to2, R.string.to3, R.string.to4,                R.string.os5 };        int randPhrase = randPhrase50.nextInt(array50.length - 1);</code></pre><p>Inside an if statement, I have this:</p><pre><code> if (randomCropPercentage &lt; 50){                mTheMessage.setText(array50(randPhrase));                            //etc</code></pre><p>But I know I am not doing it right because I get the error:</p><pre><code>The method array50(int) is undefined for the type MAIN</code></pre><p>Any ideas?</p>","496686","","","","","2010-11-22 16:31:46","Displaying a random string on a TextView in a layout","<android><arrays><string><random><textview>","2","0","","",""
"4247818","1","4257367","","2010-11-22 16:42:01","13","13471","<p>As an experiment, I would like to use the platform key of my custom built Android platform to sign an arbitrary APK, that is built via the NDK. What is the process to go about doing this?</p>","440093","","","","","2014-03-16 15:36:54","Android: After building platform source, how to sign arbitrary APK with platform key?","<android><android-ndk>","2","0","14","",""
"4247865","1","","","2010-11-22 16:46:20","3","2236","<p>I have a very simple widget application which consists of a <code>LinearLayout</code> with a background and an <code>ImageButton</code>.</p><p>In the <code>AppWidgetProvider</code> <code>onUpdate()</code> method, I register the click of the button to broadcast an intent. When the widget first loads, everything runs fine and the click is captured. The problem occurs when the screen is rotated, and the click is never captured again even if the screen is rotated back.</p><p>What do I have to do to re-register the click when the screen rotates?</p><p>below is some segments of code I am using.</p><p>AppWidgetProvider</p><pre><code>@Overridepublic void onReceive(Context context, Intent intent)    {    super.onReceive(context, intent);    if(intent.getAction().equals(""test.CLICK""))    {        CallTestMethod(context);    }}@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager,    int[] appWidgetIds) {    final int N = appWidgetIds.length;    // Perform this loop procedure for each App Widget that belongs to this provider    for (int i=0; i&lt;N; i++) {        int appWidgetId = appWidgetIds[i];        RemoteViews views=new RemoteViews(context.getPackageName(), R.layout.widget);                    Intent clickintent=new Intent(""test.CLICK"");        PendingIntent pendingIntentClick=PendingIntent.getBroadcast(context, 0, clickintent, PendingIntent.FLAG_UPDATE_CURRENT);        views.setOnClickPendingIntent(R.id.change_mode, pendingIntentClick);        SetInitialLayout(context);        appWidgetManager.updateAppWidget(appWidgetId, views);    }    super.onUpdate(context, appWidgetManager, appWidgetIds);}</code></pre><p>Manifest</p><pre><code>&lt;receiver android:name="".Widget"" android:label=""@string/widget_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.appwidget.action.ACTION_APPWIDGET_CONFIGURE"" /&gt;            &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;            &lt;action android:name=""test.CLICK"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data android:name=""android.appwidget.provider"" android:resource=""@xml/widget_mode_switcher"" /&gt;                &lt;/receiver&gt;</code></pre><p>Layout</p><pre><code>    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/widget_layout""    android:layout_width=""140dip""    android:layout_height=""140dip""    android:scaleType=""fitCenter""    android:orientation=""vertical""    android:background=""@drawable/background""&gt;    &lt;ImageButton        android:id=""@+id/change_mode""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:scaleType=""fitCenter""        android:orientation=""vertical""        android:src=""@drawable/none_selected""        android:background=""@null""        android:clickable=""true"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Thank you anyone for your help!</p>","516387","","713773","","2012-01-27 19:28:39","2012-01-27 19:28:39","Button click lost on widget when screen is rotated","<android><android-widget><widget>","5","0","2","",""
"4247938","1","4248040","","2010-11-22 16:53:45","2","727","<p>I'm processing a large number of database records, each with a unique key.</p><p>Due to the nature of my database, my processing method may encounter the same key twice since it is a relational database and one record may have more than one ""parent"" record.</p><p>It is a waste of precious time, processing power, memory, and file size to process records multiple times.  Thus I need a way to keep a record of which ids I have already processed.</p><p>I have looked at HashTable, since it is O(1) for get and put functions and those are the only functions I need.  However it seems like a waste of memory to have essentially a (1000+)/Load Factor chunk of memory essentially storing boolean values.  Plus I don't know my desired capacity and would have to put up with a lot of rehashes or allocated a lot more memory than I need.</p><p>I think am looking for a data structure that you can add a value to it and have it give an error of some kind if the id already exists in the collection, like returning false from the <code>put(T value)</code> method. </p>","131871","","","","","2010-11-23 22:04:19","Better data structure than HashTable to keep track of processed records?","<java><android><data-structures><hash>","5","0","","",""
"4248004","1","","","2010-11-22 17:01:28","0","1423","<p>I got a list of element displayed with a SimpleAdapter that gets the list of element to display.The element in the list of object (the one that I pass to the SimpleAdapter) have a field that I want to use to differentiate the style of elements (elments are TextView) to display but I don't know how to do it.</p><p>Thanks in advance</p><p>Jaxer</p>","499140","","","","","2010-11-22 17:26:27","Android SimpleAdapter change element style","<android><coding-style><textview>","1","0","1","",""
"4248093","1","4295812","","2010-11-22 17:10:49","0","1615","<p>I just want get my video playUrl in android....I have checked the relevant issues about use YouTubeSample in android ,Their answer is yesBut when i run my code in emulator or my android device it does not workmy code is:</p><pre><code>    import java.io.IOException;    import com.google.api.client.googleapis.GoogleHeaders;    import com.google.api.client.googleapis.GoogleTransport;    import com.google.api.client.googleapis.json.*;    import com.google.api.client.http.*;    import android.app.Activity;    import android.os.Bundle;    import android.widget.TextView;    public class main extends Activity {     HttpTransport transport;        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            Debug.enableLogging();            try {              try {                HttpTransport transport = setUpTransport();                showVideos(transport);              } catch (HttpResponseException e) {                throw e;              }            } catch (Throwable t) {              t.printStackTrace();            }        }        private static HttpTransport setUpTransport() {            HttpTransport transport = GoogleTransport.create();            GoogleHeaders headers = (GoogleHeaders) transport.defaultHeaders;            headers.setApplicationName(""Google-YouTubeSample/1.0"");            headers.gdataVersion = ""2"";            transport.addParser(new JsonCParser());            return transport;          }          private static VideoFeed showVideos(HttpTransport transport)              throws IOException {            //View.header(""Get Videos"");            // build URL for the video feed for ""search stories""            YouTubeUrl url = YouTubeUrl.forVideosFeed();            url.author = ""cecol3500123"";            // execute GData request for the feed            VideoFeed feed = VideoFeed.executeGet(transport, url);            //View.display(feed);            return feed;          }    }</code></pre><p>I compile it ok ,but on the device just get <strong>the application main has stopped unexpectedly</strong> </p><p>I found I always stopped on code:<code>HttpTransport transport = GoogleTransport.create();</code> </p><p>The AndroidManifest has set permission :    <code>&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;</code></p><p>And my project has <strong>google api java client library</strong>.     What I set, is it okay?    I have tried all possible(I had modified the code, again and again) .    I do not know how to do.    Please help me ,I just want get my video playUrl in android....    (Or can someone give me right code ? )  .    sorry for my poor English</p><pre><code>renew with debug tracethis is my program Debug trace                             11-23 09:45:10.466: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f0700e5                                 11-23 09:45:10.486: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020031        11-23 09:45:10.496: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020030        11-23 09:45:10.506: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f050000       11-23 09:45:10.716: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060000            11-23 09:45:10.856: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060001                       11-23 09:45:11.866: DEBUG/ddm-heap(180): Got feature list request    11-23 09:45:12.166: DEBUG/ddm-heap(185): Got feature list request                11-23 09:45:12.526: DEBUG/ddm-heap(165): Got feature list request               11-23 09:45:12.716: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f0700e5                             11-23 09:45:12.756: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020031                                11-23 09:45:12.767: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020030                           11-23 09:45:12.776: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f050000                       11-23 09:45:12.796: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060000                        11-23 09:45:12.826: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060001     11-23 09:45:13.286: DEBUG/ddm-heap(143): Got feature list request    11-23 09:45:13.646: WARN/BackupManagerService(62): dataChanged but no participant pkg='com.android.providers.settings' uid=10017      11-23 09:45:13.946: WARN/BackupManagerService(62): dataChanged but no participant pkg='com.android.providers.settings' uid=10017    11-23 09:45:14.426: DEBUG/dalvikvm(62): GC freed 8344 objects / 558776 bytes in 461ms    11-23 09:45:14.826: INFO/ActivityManager(62): Start proc com.android.email for broadcast     com.android.email/com.android.exchange.BootReceiver: pid=205 uid=10023 gids={3003, 1015}11-23 09:45:14.836: INFO/ActivityManager(62): Starting activity: Intent {        act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.testcom/.main }        11-23 09:45:15.066: DEBUG/AndroidRuntime(185): Shutting down VM          11-23 09:45:15.076: DEBUG/dalvikvm(185): DestroyJavaVM waiting for non-daemon threads to exit           11-23 09:45:15.106: DEBUG/dalvikvm(185): DestroyJavaVM shutting VM down    11-23 09:45:15.106: DEBUG/dalvikvm(185): HeapWorker thread shutting down    11-23 09:45:15.116: DEBUG/dalvikvm(185): HeapWorker thread has shut down     11-23 09:45:15.127: DEBUG/jdwp(185): JDWP shutting down net...    11-23 09:45:15.127: INFO/dalvikvm(185): Debugger has detached; object registry had 1 entries               11-23 09:45:15.147: DEBUG/dalvikvm(185): VM cleaning up            11-23 09:45:15.226: ERROR/AndroidRuntime(185): ERROR: thread attach failed         11-23 09:45:15.496: DEBUG/dalvikvm(185): LinearAlloc 0x0 used 639500 of 5242880 (12%)          11-23 09:45:15.566: WARN/ActivityManager(62): Activity pause timeout for     HistoryRecord{43cec138 com.android.launcher/.Launcher}     11-23 09:45:15.676: INFO/ActivityManager(62): Start proc com.testcom for activity     com.testcom/.main: pid=210 uid=10027 gids={3003, 1015}   11-23 09:45:16.266: DEBUG/ddm-heap(205): Got feature list request   11-23 09:45:16.786: DEBUG/ddm-heap(210): Got feature list request   11-23 09:45:16.976: DEBUG/dalvikvm(30): GC freed 284 objects / 10848 bytes in 1262ms   11-23 09:45:17.517: DEBUG/dalvikvm(30): GC freed 50 objects / 2224 bytes in 410ms   11-23 09:45:17.647: INFO/dalvikvm(210): Could not find method    com.google.api.client.googleapis.GoogleTransport.create, referenced from method com.testcom.main.setUpTransport     11-23 09:45:17.657: WARN/dalvikvm(210): VFY: unable to resolve static method 4:     Lcom/google/api/client/googleapis/GoogleTransport;.create ()Lcom/google/api/client/http/HttpTransport;11-23 09:45:17.657: DEBUG/dalvikvm(210): VFY: replacing opcode 0x71 at 0x0009    11-23 09:45:17.677: DEBUG/dalvikvm(210): Making a copy of Lcom/testcom/main;.setUpTransport code (128 bytes)    11-23 09:45:17.687: WARN/dalvikvm(210): VFY: unable to find class referenced in signature (Lcom/google/api/client/http/HttpTransport;)11-23 09:45:17.697: WARN/dalvikvm(210): Unable to resolve superclass of Lcom/testcom/YouTubeUrl; (6)11-23 09:45:17.777: WARN/dalvikvm(210): Link of class 'Lcom/testcom/YouTubeUrl;' failed   11-23 09:45:17.777: INFO/dalvikvm(210): Could not find method     com.testcom.YouTubeUrl.forVideosFeed, referenced from method com.testcom.main.showVideos11-23 09:45:17.787: WARN/dalvikvm(210): VFY: unable to resolve static method 40:     Lcom/testcom/YouTubeUrl;.forVideosFeed ()Lcom/testcom/YouTubeUrl;11-23 09:45:17.787: DEBUG/dalvikvm(210): VFY: replacing opcode 0x71 at 0x0007    11-23 09:45:17.826: DEBUG/dalvikvm(210): Making a copy of Lcom/testcom/main;.showVideos code (56 bytes)    11-23 09:45:17.867: WARN/dalvikvm(210): VFY: unable to find class referenced in signature (Lcom/google/api/client/http/HttpTransport;)      11-23 09:45:17.877: WARN/dalvikvm(210): VFY: unable to find class referenced in signature (Lcom/google/api/client/http/HttpTransport;)      11-23 09:45:17.927: WARN/dalvikvm(210): VFY: unable to resolve exception class 13 (Lcom/google/api/client/http/HttpResponseException;)   11-23 09:45:17.937: WARN/dalvikvm(210): VFY: unable to find exception handler at addr 0x13     11-23 09:45:17.947: WARN/dalvikvm(210): VFY:  rejected Lcom/testcom/main;.onCreate (Landroid/os/Bundle;)V     11-23 09:45:17.957: WARN/dalvikvm(210): VFY:  rejecting opcode 0x0d at 0x0013    11-23 09:45:17.957: WARN/dalvikvm(210): VFY:  rejected Lcom/testcom/main;.onCreate     (Landroid/os/Bundle;)V11-23 09:45:18.017: WARN/dalvikvm(210): Verifier rejected class Lcom/testcom/main;    11-23 09:45:18.017: WARN/dalvikvm(210): Class init failed in newInstance call     (Lcom/testcom/main;)11-23 09:45:18.027: DEBUG/AndroidRuntime(210): Shutting down VM     11-23 09:45:18.037: WARN/dalvikvm(210): threadid=3: thread exiting with uncaught exception (group=0x4001b188)11-23 09:45:18.047: ERROR/AndroidRuntime(210): Uncaught handler: thread main exiting due to uncaught exception     11-23 09:45:18.107: DEBUG/dalvikvm(30): GC freed 2 objects / 48 bytes in 568ms    11-23 09:45:18.167: ERROR/AndroidRuntime(210): java.lang.VerifyError: com.testcom.main    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at    java.lang.Class.newInstanceImpl(Native Method)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at java.lang.Class.newInstance(Class.java:1479)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)   11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)   11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.os.Handler.dispatchMessage(Handler.java:99)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.os.Looper.loop(Looper.java:123)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.app.ActivityThread.main(ActivityThread.java:4363)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at java.lang.reflect.Method.invokeNative(Native Method)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at java.lang.reflect.Method.invoke(Method.java:521)       11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)    11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at dalvik.system.NativeStart.main(Native Method)    11-23 09:45:18.237: INFO/ActivityThread(205): Publishing provider    com.android.email.provider: com.android.email.provider.EmailProvider   </code></pre>","516411","","680757","","2013-11-13 13:22:20","2013-11-13 13:22:20","I can not use google api java client YouTubeSample in android app","<android><google-api>","3","0","","",""
"4248181","1","","","2010-11-22 17:20:13","0","1067","<p>Hello I have a working example of a service that gets notified form an alarm manager object, the interval changes according to the user's preferences, this works fine when the interval is 5-10-20-30 minutes but when I schedule an alarm for one hour my service is never notified,is there any known bug about that? shoulden't the alarm notifies my service?thanks maxsap</p>","234898","","","","","2011-01-07 19:13:57","android alarm manager long interval","<android>","2","2","0","",""
"4248197","1","4248935","","2010-11-22 17:21:17","1","272","<p>In android, I have a View Flipper that has a child on it that I would like to play a short .wav on when it is accessed some of the time (basically on random).</p><p>Is there a quick and easy way to play that wav right when the xml layout is accessed by the user?</p><p>I have a main class with a bunch of methods, so I can't really place it in onCreate...the layout page is shown based on when the user clicks a button - and it is all in a Linear Layout on a view Flipper</p><p>Thanks!  </p>","496686","","","","","2010-11-22 18:35:46","Playing a short .wav on a layout in Android","<android><layout><audio><wav>","1","0","","",""
"4248200","1","","","2010-11-22 17:21:48","2","6872","<p>I'm new to Android development, and I am trying to get familiar with it with some tutorials from developer.android.com. I'm working on the <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow""><code>TabLayout</code> example</a>, and I'm doing everything in the example. However, when I run it through the emulator, the program loads but when I try to start the application it says that was happened a problem and attends me to force down! Because I followed the tutorial step by step, I believe that I have made a mistake in the AndroidManifest file. Here is what I wrote:</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".HelloTabWidget"" 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 android:name="".ArtistsActivity"" android:label=""@string/app_name""       &gt; &lt;/activity&gt; &lt;activity android:name="".AlbumsActivity"" android:label=""@string/app_name""          &gt; &lt;/activity&gt; &lt;activity android:name="".SongsActivity"" android:label=""@string/app_name""          &gt; &lt;/activity&gt;&lt;/activity&gt;</code></pre><p><p>can anybody help me to run this??its very important for me to learn as i m a computer eng university student and my thesis will be an application for android!!thanks a lot for your time!!</p>","516427","","121493","","2010-11-22 17:32:03","2010-11-22 17:57:31","Problem with AndroidManifest.xml file","<android><android-manifest>","2","3","1","",""
"4248231","1","4248346","","2010-11-22 17:24:27","1","3746","<p>My Use case like this- User is in my application - User presses home key (application goes to background)</p><p>Now user wants to go back to the same application (task in android terms)one way is it through the application launcher BUT for my application there is no icon provided.</p><p>Instead user have to launch app with some ""key combinations "". Essentially I have to write program to simulate application launcher.</p><p>So How can ""application launching"" be achieved with CODE? any leads would be highly appreciated.</p>","505011","","","","","2011-03-14 10:51:43","writing a own application launcher for android","<android>","2","2","1","",""
"4248259","1","4248394","","2010-11-22 17:27:09","0","334","<p>The twitter and facebook apps allow you to click on a username which in turn takes you to a new activity. How can this be achieved?</p><p>I know there is Linkify, but it seems like it can only send you to a browser/phonecall/ etc. How can I make text that are like ""@mynamehere"" clickable so that it starts a new activity?</p>","19875","","19875","","2010-11-22 17:33:03","2010-11-22 17:39:27","How to make usernames clickable like the Twitter and Facebook app?","<java><android><regex><linkify>","2","0","","",""
"4248330","1","4249302","","2010-11-22 17:32:50","0","917","<pre><code>                    String s=""..&lt;td colspan=2 style='border-bottom: solid 1px #efefef; width:100%'&gt;"" +                    ""&lt;iframe width=\""100%\"" height=\""150\"" frameborder=\""0\"" style=\""border: solid 1px #dedede; padding:2px;\"" scrolling=\""no\"" "" +                    ""src=\""http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=hu&amp;geocode=&amp;"" +                    ""q=""+address+""&amp;ie=UTF8&amp;hq=&amp;hnear=""+address+""&amp;z=14&amp;output=embed\""&gt;&lt;/iframe&gt;""+                    ""&lt;/td&gt;"" +                    ""&lt;/tr&gt;..."";webview.loadDataWithBaseURL (null, s, ""text/html"", ""utf-8"",   ""about:blank"");</code></pre><p>and then its not working... showing up a ""loading"" and login window. why? in a normal browser this works. </p>","472537","","","","","2010-11-22 19:17:19","Android add map address to a webview (iframe)","<android><webview>","1","0","","",""
"4248441","1","","","2010-11-22 17:44:13","2","1148","<p>I'm writing an Android application that plays back voice mails using MediaPlayer, which are just WAV files that have been sent to the device.  When I play the file, it's played on the device's speaker, or else it plays through headphones if they're plugged in.</p><p>What I want to do is play the file so that it sounds to the user as if it's at the same volume level as a normal phone call.  Is there a way to route playback so that the file is played through the phone's earpiece instead of out of the speaker?</p>","14606","","","","","2010-11-23 05:54:10","How to play audio files at phone volume level, not speaker volume","<android>","2","0","","",""
"4248464","1","","","2010-11-22 17:47:22","0","672","<p>I have a JPEG sketch of my apartment. And I wish to write an android app which loads this JPEG file and behaves as a map to the user so that user can track is movement.</p><p>I am really confused whether a JPEG file can be used as a map, if it can, please let me know how can I mark the movement of the user on that map.</p><p>Any sample code would be really appreciated.</p>","514369","","1185170","","2012-03-23 01:04:40","2012-03-23 01:04:40","android : to use image has a map","<android><image><map>","1","3","0","",""
"4248492","1","","","2010-11-22 17:50:12","2","793","<p>In my Android app I have 2 layouts, one for portrait and one for landscape.</p><p>In both layouts I have a TextView that the user can change by clicking on, by default it reads 'ON'If the user presses it then it changes to 'OFF' All well and good.</p><p>However if it's set to OFF and the screen is rotated the text view resets to ON. How can I stop this from happening?</p><p>Many thanks</p>","497517","","","","","2011-07-15 11:21:03","Screen rotation changes settings","<android><rotation>","1","0","","",""
"4248560","1","4363216","","2010-11-22 17:57:25","0","2113","<p>Recently Eclipse started showing this error in its Error Log:</p><blockquote>  <p>Error validating C:\android-sdk-windows\tools\lib\devices.xml</p></blockquote><p>I also noticed, when editing XML layout files (layout mode) all the dropdowns for Devices, Config and Locale are empty. I remember befere I used to be able to select various devices sizez, orientations, etc. here.</p><p>Any idea how to fix this.</p><p>Thanks.</p>","507153","","37980","","2010-11-22 18:00:34","2010-12-06 04:24:56","Eclipse problem. Error validating C:\android-sdk-windows\tools\lib\devices.xml","<android><eclipse><validation>","1","1","","",""
"4248574","1","4248921","","2010-11-22 17:58:37","2","759","<p>How do you print a POST request for debugging in Android?</p><p>I'm using either <a href=""http://developer.android.com/reference/org/apache/http/client/methods/HttpPost.html"" rel=""nofollow"">HttpPost</a> or <a href=""http://developer.android.com/reference/java/net/HttpURLConnection.html"" rel=""nofollow"">HttpURLConection</a>.</p><p>The intent is to give the POST request to another member of the team so they can reproduce it in another platform.</p>","143378","","143378","","2010-11-22 20:13:34","2010-11-22 20:13:34","Print POST request for debugging","<android><debugging><http><post>","1","1","","",""
"4248609","1","","","2010-11-22 18:02:22","2","1883","<p>I'm developing a browser application for Android 2.2. Of course, this application needs an UI element to enter a URL.Is there a way to reuse UI components like those used in the default Android browser, Dolphin HD or Fennec? I do not want to rebuild all the features from scratch like - auto-completion / Suggestions from google - auto-selecting the domain name (without ""www."")</p>","516472","","","","","2010-11-22 22:15:56","Is there a (reusable) Android UI component for an URL input field supporting autocompletion and suggestions?","<android><url><browser>","2","0","","",""
"4248642","1","4249220","","2010-11-22 18:06:00","2","1080","<p>HiI wan to create a contact, so here is my code:</p><pre><code>Intent addPersonIntent = new Intent(Intent.ACTION_INSERT_OR_EDIT);addPersonIntent.putExtra(Insert.NAME, ""asd"");addPersonIntent.setType(Contacts.People.NAME);addPersonIntent.putExtra(Insert.PHONE_TYPE, Contacts.Phones.TYPE_WORK);addPersonIntent.putExtra(Insert.PHONE, Uri.decode(""123""));addPersonIntent.putExtra(Insert.PHONE_TYPE, Contacts.Phones.TYPE_MOBILE);addPersonIntent.putExtra(Insert.PHONE, Uri.decode(""123""));addPersonIntent.setType(Contacts.Phones.CONTENT_ITEM_TYPE);...startActivity(addPersonIntent);</code></pre><p>Why the only thing that is created is the mobile number, I never got the ""work"" number?</p>","514496","","375874","","2010-11-22 18:26:22","2010-11-23 13:14:26","Android create contact problem","<android><insert><android-intent><contacts>","2","0","","",""
"4248673","1","4248725","","2010-11-22 18:08:42","1","3434","<p>In android, my app provides a button that the user can click to return them back to the screen that appears when the app is opened (onCreate).</p><p>How can I set that button to return the user to the main menu?</p><p>I have something like this in a switch statement (on click):</p><pre><code>         case R.id.return_main:            onCreate();            return;</code></pre><p>Where return_main is the id of the button....I know that isn't right but I couldn't think of any other way.</p><p>Thanks!</p>","496686","","","","","2013-07-09 04:55:16","Returning to main menu in android by a button click","<android><return><main><back><oncreate>","4","0","","",""
"4248857","1","4249209","","2010-11-22 18:26:52","6","1304","<p>I imagine there are two options:</p><ol><li><p>Build a parallel ANT script and bypass the IDE (seems pretty inefficient when the IDE is so good)</p></li><li><p>Somehow integrate Proguard/yGuard or similar with IntelliJ</p></li></ol><p>I've tried installing plugins for Proguard/yGuard into IntelliJ but neither seem to be working (installed ok, but don't appear under Facets), and actually I'm not 100% sure these plugins will help me obfuscate or whether they just provide a de-obfuscation facility for debugging.</p><p>I figure ANT is the best route, but would appreciate your thoughts. I just want a way to reduce the chances of someone reverse-engineering apps, but without spending hours setting it up.</p>","477415","","918414","","2012-06-30 02:39:39","2012-06-30 02:39:39","How do I easily obfuscate an Android app when using IntelliJ IDEA?","<android><intellij-idea><obfuscation><proguard>","2","4","","",""
"4248876","1","4249430","","2010-11-22 18:29:18","10","2918","<p>The Three20 project is really nice for building iPhone apps quickly using common libraries: </p><p><a href=""https://github.com/facebook/three20"" rel=""nofollow"">https://github.com/facebook/three20</a></p><p>Is there anything like this for Android?</p>","19875","","","","","2012-07-05 19:28:04","Are there libraries similar to the Three20 Project for Android?","<java><android><three20>","2","0","3","",""
"4248954","1","4259328","","2010-11-22 18:38:37","4","10609","<p>I have a Dialog with a <code>EditText</code> and a button. This <code>EditText</code> will name the database table I will create so its of the utmost importance it is validated. So i would like to pose 2 questions:</p><p>1) This is quite simple, but i couldn't fin it anywhere: what characters can a database table name accept? Can it accept numbers? And can a number be the first character?</p><p>2) I've managed to validate the <code>EditText</code> using <code>TextWtacher</code>. Here's the code:</p><pre><code>et_name.addTextChangedListener(new TextWatcher() {public void afterTextChanged(Editable s) {    String filtered_str = s.toString();        if (filtered_str.matches("".*[^a-z^0-9].*"")) {        filtered_str = filtered_str.replaceAll(""[^a-z^0-9]"", """");        s.clear();        // s.insert(0, filtered_str);        Toast.makeText(context,            ""Only lowercase letters and numbers are allowed!"",            Toast.LENGTH_SHORT).show();    }}    public void beforeTextChanged(CharSequence s, int start, int count, int after) {}    public void onTextChanged(CharSequence s, int start, int before, int count) {}});</code></pre><p>Currently, if the user inserts any character other than lowercase letters and numbers, the textbox is cleared. If I uncomment <code>s.insert(0, filtered_str);</code> in order to to replace the EditText with the filtered string, my app hangs. And guess what I find in the debug?</p><p>ERROR/AndroidRuntime(2454): <code>java.lang.StackOverflowError</code>  =D</p><p>The question is... how can I replace the s text?</p><p>-> <code>s.replace(0, s.toString().length(), filtered_str);</code> (remove s.clear, of course) doesn't seem to work either.</p>","295342","","45668","","2011-05-14 11:48:48","2012-12-26 20:27:06","EditText validation with TextWatcher","<java><android><string><edittext><textwatcher>","4","0","1","",""
"4249036","1","","","2010-11-22 18:47:45","5","5810","<p>I have an Activity that implements a Gesture Detector to catch the user fling input for navigation to other screens.  That was working fine - but - I recently updated a class that derives from BaseActivity to add an onClick function and now that click event seems to block the onFling from being hit.  The onClick is tied to a TextView area (in a LinearLayout) I have on my screen.  The resultsClick method is wired to the TextView using its onClick property in the XML layout.  </p><p>I've tried changing the return values in onSingleTapUp and onDown without luck.  I've also tried adding log statements to all the functions below as well.  None of them fire when I fling in the TextView area but they do on other areas of the screen.</p><p>Maybe I am using the wrong search terms, but I couldn't seem to find an example that addressed this - yet I'm sure this problem has been solved before.  </p><pre><code>public class DerivedActivity extends BaseActivity{   ...   /**    * resultsClick - The user clicked on the Results area    * @param v    */   public void resultsClick(View v)   {      try      {         Log.i(this.toString(), ""resultsClick"");         startActivity(new Intent(this, Results_TabHost.class ));      }      catch (Exception e)      {         Log.e(this.toString(), ""Exception"" + e.toString());      }   }// end resultsClick   ...}</code></pre><p>Here is the base class that implements the GestureListener code</p><pre><code>public class BaseActivity extends    ActivityGroup                           implements OnGestureListener{   ...   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;   public boolean onFling(MotionEvent e1,                           MotionEvent e2,                           float velocityX,                           float velocityY)   {      try      {         Log.i(this.toString(), ""onFling"");         // jump right out if not a swipe/fling         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 )         {            Log.i(this.toString(), ""fling left"");            rightArrowClick(null);         }         else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp;                   Math.abs(velocityX)   &gt; SWIPE_THRESHOLD_VELOCITY )         {            Log.i(this.toString(), ""fling right"");            leftArrowClick(null);         }      }      catch (Exception e)      {         Log.e(this.toString(), ""Exception"" + e.toString());      }      return true;   }// end onFling   // These next methods we are required to have - even if unused -    // in order for the Gesture Handling to work   @Override   public boolean onTouchEvent(MotionEvent motionEvent)   {      return this.gestureDetector.onTouchEvent(motionEvent);   }   @Override   public void onLongPress(MotionEvent e)   {      // Intentionally not handling - must be overridden by listener class   }   @Override   public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)   {      // Intentionally not handling - must be overridden by listener class      // Intentionally returning true - per code examples      return true;   }   @Override   public void onShowPress(MotionEvent e)   {      // Intentionally not handling - must be overridden by listener class   }   @Override   public boolean onSingleTapUp(MotionEvent e)   {      // Intentionally not handling - must be overridden by listener class      // Intentionally returning true - per code examples      return true;   }   @Override   public boolean onDown(MotionEvent e)   {      // Intentionally not handling - must be overridden by listener class      // Intentionally returning true - per code examples      return true;   }...}</code></pre>","418714","","","","","2012-08-23 23:30:06","Android onClick blocking onFling","<android><activity><onclick><gesture-recognition>","3","0","","",""
"4249065","1","4249097","","2010-11-22 18:50:52","-1","172","<p>I think the error is from this manifest file ?!! when i want to start this activity ""SearchResultForm"" i have the exception ??</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""ayanoo.forms""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/search"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".MainActivity""  android:label=""@string/app_name"" android:launchMode=""standard""&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=""PersonDataForm"" android:label=""@layout/person_data_form""&gt;&lt;/activity&gt;    &lt;activity android:name=""SearchResultForm"" android:theme=""@style/CodeFont""&gt;&lt;/activity&gt;    &lt;activity android:name=""SendMessageForm"" android:theme=""@style/CodeFont""&gt;&lt;/activity&gt;&lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_MOCK_LOCATION""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre>","508377","","203600","","2010-11-22 18:55:43","2010-11-22 21:38:45","I've an exception when run android application?","<android>","2","5","","",""
"4249237","1","4249273","","2010-11-22 19:08:55","3","15697","<p>I have a hidden image button in one of my xmls layouts, with a background set to a drawable image.  I set the visibility to invisible, as I only want the image to display every once in a while.  The problem is, even if the drawable isn't shown, the image button still takes us space - Is there a way to hide the background image, and make it's dimensions 0 until I call on it to be shown in my main class?</p><p>Thanks!</p><p>Edit:  So in my xml, how would I write that?</p><pre><code>&lt;ImageButton android:id=""@+id/myimage"" android:visibility=""invisible"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""center"" android:background=""@drawable/my_image""&gt;&lt;/ImageButton&gt;</code></pre><p>I want to have the image always gone, unless a certain condition occurs, I then want the image to be visible under that one condition.  So in my xml I would need to be set to GONE, but in my conditional statement so I say something like:</p><p>myimage.setVisibility(SHOW);?</p>","496686","","496686","","2010-11-22 19:30:58","2010-11-22 19:30:58","Can I hide an image button on a layout, (dimensions and background) until a call to set visible?","<android><layout><imagebutton><dimensions><visible>","3","0","1","",""
"4249240","1","4249264","","2010-11-22 19:09:24","0","1330","<p>Where can i learn simple simple 2d graphic. I came up with this simple idea(may be alot of these game) however i got a bucket sprite and ball sprites. the ball will randomly fall down and you have to catch them by rotate the phone.I already got sprites(PNG) so were do i start. Canvas? wo</p>","502419","","","","","2010-11-22 19:12:16","Android Development: simple 2d graphic with sprite","<android>","1","0","","",""
"4249299","1","4249390","","2010-11-22 19:16:53","2","1113","<p>I haven't worked on Android development for more than a year now. The latest SDK I have on my XP machine is 1.5 R3. I'd like to update to the 2.2 SDK but the android.com guide does not apply to the SDK I have installed. For example the AVD Manager from eclipse does not show specified dialog.</p><p>Any one upgraded his SDK please let me know what to do.</p><p>Thank you. </p>","260261","","","","","2010-11-22 19:27:31","How to upgrade Android 1.5 R3 SDK to 2.2?","<android>","1","0","","",""
"4249304","1","","","2010-11-22 19:17:27","17","2372","<p>I am developing an Android application which requires users to register and log on to a website and then use that registration information in an Android app. Should I be using oauth or openid or is there something better to make it not a requirement that I develop a single-use authentication system?</p>","516282","","516282","","2011-11-17 10:57:04","2011-11-17 10:57:04","OAuth/OpenID - which should I use?","<android><oauth><openid>","1","2","5","",""
"4249372","1","4249938","","2010-11-22 19:25:33","1","376","<p>I've got a small android application that implements the <a href=""http://en.wikipedia.org/wiki/Observer_pattern"" rel=""nofollow"">Observer pattern.</a></p><p>I want my ""subject"" (or the thing being observed) to change its state, such as changing its String from <code>hello</code> to <code>hello world</code>.</p><p>How can I do this via the emulator?</p><p>I need my (observing) android application to still run in the foreground so it can display whatever is being observed, but I need to find some way to alter the state of the observed object, is it possible to do this via the command line? How else can I ""poke"" the observed object to change its state.</p><p>One dirty-hack method I can think of is to set the observed object up in a loop, so every 10 seconds it changes its state, but that is not good as then I won't have control over it.</p>","155695","","","","","2010-11-22 20:29:41","How can I ""poke"" an android application that adheres to the Observer pattern?","<android><observer-pattern>","1","3","","",""
"4249506","1","4249570","","2010-11-22 19:39:45","0","180","<p>We going to develop commercial application that will run on Android platform and now I'm thinking about distribution model.</p><p>Application itself will be of no use to regular Android user and will be installed only by people who know why they need it. Application will authenticate with server prior to launch. </p><p>We as a company will charge application users monthly fee and will track usage, etc via our servers.</p><p>So, I was wondering if there ""locked"" portion of market for this kind of stuff? Or, do I release app as a free one and if random people download it - they just won't be able to use it?</p><p>What is the best way to do that? Can I install application by giving users our URL?</p><p>I'm trying to make it as easy as possible.</p><p>Thanks!</p>","509600","","","","","2010-11-22 20:20:38","Distributing service-based application on android market","<android>","2","0","1","",""
"4249525","1","4887511","","2010-11-22 19:42:44","4","922","<p>I have a <code>ListView</code> in which each item has a complex layout that contains, at some point, a <code>TextView</code> with <code>android:inputType=""text""</code> and <code>android:ellipsize=""marquee""</code>. My problem is that <code>inputType=""text""</code> does <em>something</em> that renders the whole listview item un-clickable. I've tried:</p><ul><li><code>android:descendantFocusability=""blocksDescendants""</code> on the top-most layout of an item,</li><li><code>android:focusable=""false""</code> on the <code>TextView</code> itself,</li><li><code>android:focusableInTouchMode=""false""</code> on the <code>TextView</code> itself,</li><li><code>android:clickable=""false""</code> on the <code>TextView</code> itself,</li><li><code>android:editable=""false""</code> on the <code>TextView</code> itself.</li></ul><p>Nothing worked.</p><p>The reason why I use <code>android:inputType=""text""</code> on a <code>TextView</code> is so that it becomes single-line and <code>android:ellipsize=""marquee""</code> actually works. I've done my homework:</p><ul><li><code>android:singleLine</code> is deprecated*</li><li><code>android:lines=""1""</code>, as suggested <a href=""http://stackoverflow.com/questions/3354589/using-inputtype-on-a-textview-in-a-list-item-layout"">here</a>, doesn't work, the text still wraps, you just don't get to see the second line, so the marquee effect does not appear.</li></ul><hr><p>* or is it? My Ctrl+Space in Eclipse says this about <code>android:singleLine</code> (emphasis mine):</p><blockquote>  <p>Constrains the text to a single horizontally scrolling line instead of    letting it wrap onto multiple lines, and advances focus instead of    inserting a newline when you press the enter key. * <strong>Deprecated</strong>:    This attribute is deprecated and is replaced by the textMultiLine    flag in the inputType attribute. Use caution when altering    existing layouts, as the default value of singeLine is false (multi-   line mode), but if you specify any value for inputType, the default    is single-line mode. (If both singleLine and inputType attributes    are found, the inputType flags will override the value of    singleLine.). [boolean]</p></blockquote><p>However, <a href=""http://d.android.com/reference/android/widget/TextView.html#attr_android:singleLine"" rel=""nofollow"">the docs</a> do not say anything about any deprecation.</p><p>What's going on here?</p>","180784","","","","","2011-02-03 14:42:50","inputType makes item un-clickable","<android><android-layout>","3","1","","",""
"4249621","1","4249657","","2010-11-22 19:55:25","1","797","<p>Is there any way of running 2 (or potentially more) applications on the emulator at the same time?</p><p>I have an application that obtains its data from another application, therefore I want to modify data in application A and then see how application B handles it.</p><p>I'm intending to have some kind of ""slider"" on application A, therefore I need them both to be running at the same time to see the ""slider"" on application B update.</p>","155695","","","","","2010-11-22 20:15:39","Android emulator, how can I control 2 applications simultaneously?","<android><emulator>","2","1","","",""
"4249695","1","4641507","","2010-11-22 20:04:23","178","80750","<p>I'm installing the Android SDK on a fresh installation of Fedora 14 (Linux). I installed eclipse, and ran the tools/android sdk tool to install all the Eclipse components for the SDK. I was able to get DDMS to install when selecting it by itself.</p><p>And for the last component - the Android developer tools, I'm getting the ugly error message pasted below. </p><p>Now I'm Stuck in Eclipse dependency hell. </p><p>I've searched through the available packages in Fedora and I can't find the one that has the files necessary to satisfy this Eclipse dependency. Can anybody please translate what it is that Eclipse is asking for and what Fedora package it lives in?</p><p>The ugly error:</p><pre class=""lang-none prettyprint-override""><code>Cannot complete the install because one or more required items could not be found.  Software being installed: Android Development Tools 0.9.9.v201009221407-60953 (com.android.ide.eclipse.adt.feature.group 0.9.9.v201009221407-60953)  Missing requirement: Android Development Tools 0.9.9.v201009221407-60953 (com.android.ide.eclipse.adt.feature.group 0.9.9.v201009221407-60953) requires 'org.eclipse.wst.sse.core 0.0.0' but it could not be found</code></pre>","268803","","313758","","2011-12-12 17:58:12","2014-03-20 15:50:02","ADT requires 'org.eclipse.wst.sse.core 0.0.0' but it could not be found","<android><eclipse><eclipse-plugin><android-sdk-2.2>","30","0","37","","2014-03-18 04:24:38"
"4249735","1","4251865","","2010-11-22 20:07:09","1","210","<p>I have read into the <code>finish();</code> commands and the <code>FLAG_ACTIVITY_CLEAR_TOP</code> commands and also checked out Common Ware's answer on killing app, but I am not sure how to put this into my app.  </p><p>Basically, I have a user click a button that takes them to the camera.  The user then snaps a photo and it brings them to a layout view.  The user then clicks a button that takes them to one of 2 views, depending on a some conditions.</p><p>The user is then allowed to either retake a photo, or go to the main menu (depending).  My problem is, if the user goes back to the main menu, and snaps another, then another, etc...the activities stack, so when I click the 'Main Menu' button the app goes back through eached stack activity until finally it goes back to the main menu.  Is there a way to kill each activity with one of these lines, so even if a user retakes a photo, they will only need to go back once to get to the main menu?</p><p>Thanks for anyhelp.</p>","496686","","","","","2010-11-23 01:19:47","Preventing multiple activities from stacking with a camera snap","<android><menu><stackoverflow><return><back>","1","0","","",""
"4249783","1","4249825","","2010-11-22 20:12:58","1","766","<p>I have seen many examples of creating a custom titlebar: <a href=""http://zaman91.wordpress.com/2010/03/16/android-how-to-add-custom-title-bar/"" rel=""nofollow"">http://zaman91.wordpress.com/2010/03/16/android-how-to-add-custom-title-bar/</a></p><p>Is there a simpler way of doing this? I think it is a bit overkill to have to implement the custom titlebar code in onCreate() for every activity.</p>","19875","","180538","","2010-11-22 20:29:55","2010-11-22 20:43:13","How can I create a custom titlebar for all of my activities?","<java><android><themes><android-layout>","2","0","","",""
"4249784","1","4250098","","2010-11-22 20:13:17","2","466","<p>Just wondering if is there a way to create background task in Android using HTML5 API instead of using native Java SDK?</p>","5558","","","","","2010-11-22 20:46:19","creating background Android process using HTML5 API","<android><html5>","1","0","","",""
"4249897","1","4253078","","2010-11-22 20:25:14","24","35893","<p>I need to pass a reference to the class that does the majority of my processing through a bundle.</p><p>The problem is it has nothing to do with intents or contexts and has a large amount of non-primitive objects. How do I package the class into a parcelable/serializable and pass it to a <code>startActivityForResult</code>?</p>","480691","","180538","","2010-11-22 20:29:23","2013-02-07 20:41:59","How to send objects through bundle","<android><serialization><activity><bundle><parcelable>","8","3","5","",""
"4249911","1","4274165","","2010-11-22 20:26:46","2","7772","<p>I know how to create Open/WEP/PSK/PSK2 configuration programmatically.</p><p>ex.</p><pre><code>WifiConfiguration conf = new WifiConfiguration();conf.SSID = ""ssid"";conf.preSharedKey = ""\""password\"""";conf.status = WifiConfiguration.Status.ENABLED;        conf.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40); conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104);conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);conf.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);conf.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);conf.allowedProtocols.set(WifiConfiguration.Protocol.WPA);conf.allowedProtocols.set(WifiConfiguration.Protocol.RSN);int res = wifi.addNetwork(conf);boolean b = wifi.enableNetwork(res, true);</code></pre><p>But how do I create one for '802.1x EAP'?Looking into the source code at:..\packages\apps\Settings\src\com\android\settings\wifi\WifiDialog.java</p><pre><code>case AccessPoint.SECURITY_EAP:                config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);                config.allowedKeyManagement.set(KeyMgmt.IEEE8021X);                config.eap.setValue((String) mEapMethod.getSelectedItem());                config.phase2.setValue((mPhase2.getSelectedItemPosition() == 0) ? """" :                        ""auth="" + mPhase2.getSelectedItem());                config.ca_cert.setValue((mEapCaCert.getSelectedItemPosition() == 0) ? """" :                        KEYSTORE_SPACE + Credentials.CA_CERTIFICATE +                        (String) mEapCaCert.getSelectedItem());                config.client_cert.setValue((mEapUserCert.getSelectedItemPosition() == 0) ? """" :                        KEYSTORE_SPACE + Credentials.USER_CERTIFICATE +                        (String) mEapUserCert.getSelectedItem());                config.private_key.setValue((mEapUserCert.getSelectedItemPosition() == 0) ? """" :                        KEYSTORE_SPACE + Credentials.USER_PRIVATE_KEY +                        (String) mEapUserCert.getSelectedItem());                config.identity.setValue((mEapIdentity.length() == 0) ? """" :                        mEapIdentity.getText().toString());                config.anonymous_identity.setValue((mEapAnonymous.length() == 0) ? """" :                        mEapAnonymous.getText().toString());                if (mPassword.length() != 0) {                    config.password.setValue(mPassword.getText().toString());                }</code></pre><p>Seems to do the work but 'config.eap' is not accessable from my application.</p><p>Is there a way to configure EAP types or is it not possible?</p>","432056","","","","","2011-04-12 13:38:58","Android: How to create EAP wifi configuration programmatically?","<android><configuration><wifi>","3","0","0","",""
"4250107","1","4250210","","2010-11-22 20:47:26","1","640","<p>In android, is there a way I can conditionally play a small .wav file when a layout is displayed to the user (on load), like so:</p><pre><code>if (randonGen == 3) {                //play small wav sound here                        mTheMessage = (TextView) findViewById(R.id.resultText);                mTheImageButton = (ImageButton) findViewById(R.id.face_image);            mTheImageButton.setBackgroundDrawable(bitDraw);            mThePicture.setImageBitmap(cameraBitmap);   }</code></pre><p>Where the code to call my <code>sound.wav</code> from my assets folder is called and played?</p>","496686","","","","","2010-11-22 21:02:08","play a simple .wav on a view page?","<android><audio><load><wav>","2","0","","",""
"4250146","1","4250231","","2010-11-22 20:53:54","3","689","<p><br>I am doing the Android ""Hello, Testing"" Tutorial using Eclipse Galileo. (<a href=""http://developer.android.com/resources/tutorials/testing/helloandroid_test.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/testing/helloandroid_test.html</a>) When I try to compile and run the program I get an error saying ""com.example.helloandroid.R.id cannot be resolved"".  </p><pre><code>package com.example.helloandroid.test;  import com.example.helloandroid.HelloAndroid;  import android.test.ActivityInstrumentationTestCase2;  import android.widget.TextView;public class HelloAndroidTest extends ActivityInstrumentationTestCase2&lt;HelloAndroid&gt;  {        private HelloAndroid mActivity;  // the activity under test        private TextView mView;          // the activity's TextView (the only view)        private String resourceString;        public HelloAndroidTest()     {              super(""com.example.helloandroid"", HelloAndroid.class);        }        @Override        protected void setUp() throws Exception     {                super.setUp();                mActivity = this.getActivity();                mView = (TextView) mActivity.findViewById(com.example.helloandroid.R.id.textview);                resourceString = mActivity.getString(com.example.helloandroid.R.string.hello);        }        public void testPreconditions()     {              assertNotNull(mView);        }        public void testText()     {              assertEquals(resourceString,(String)mView.getText());        }}  </code></pre><p>Thanks for any help/advise you can offer!</p>","516633","","19405","","2011-01-02 21:43:14","2011-07-06 14:22:22","Android Programming Error","<android><testing>","2","1","","",""
"4250149","1","4250209","","2010-11-22 20:54:06","24","23131","<p>I am trying to implement a custom titlebar:</p><p>Here is my Helper class:</p><pre><code>import android.app.Activity;import android.view.Window;public class UIHelper {    public static void setupTitleBar(Activity c) {        final boolean customTitleSupported = c.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);        c.setContentView(R.layout.main);        if (customTitleSupported) {            c.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.titlebar);        }    }}</code></pre><p>Here is where I call it in onCreate():</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setupUI();}private void setupUI(){     setContentView(R.layout.main);     UIHelper.setupTitleBar(this);}</code></pre><p>But I get the error:</p><pre><code>requestFeature() must be called before adding content</code></pre>","19875","","56285","","2014-01-28 10:03:09","2014-01-28 10:03:09","requestFeature() must be called before adding content","<android><android-layout><android-activity>","3","0","3","",""
"4250326","1","4251012","","2010-11-22 21:18:52","1","3851","<p>I've got the following Button declared in my main.xml</p><pre><code>&lt;Button android:name=""@+id/clickedStartService""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:onClick=""clickedStartService""        android:text=""Start""        /&gt;&lt;Button android:name=""@+id/clickedStopService""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:onClick=""clickedStopService""        android:text=""Stop""        /&gt;</code></pre><p>And I have the following methods in the activity..</p><pre><code>@Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }public void clickedStartService(View v)    {        startService(new Intent(this, LocalService.class));    }    public void clickedStopService(View v)    {        stopService(new Intent(this, LocalService.class));    }</code></pre><p>I'm getting the following error when I click the button. I have tried rebuilding the project in my IDE and have also restarted the emulator, but same error re-appears. I've followed the documentation on the <a href=""http://developer.android.com/reference/android/widget/Button.html"" rel=""nofollow"">Android developers</a> site, and I've had this working in a separate project, I just can't get it to work here..</p><pre><code>ERROR/AndroidRuntime(335): FATAL EXCEPTION: main        java.lang.IllegalStateException: Could not find a method clickedStartService(View) in the activity class com.jameselsey.observerpattern.MyApp for onClick handler on view class android.widget.Button        at android.view.View$1.onClick(View.java:2059)        at android.view.View.performClick(View.java:2408)        at android.view.View$PerformClick.run(View.java:8816)        at android.os.Handler.handleCallback(Handler.java:587)        at android.os.Handler.dispatchMessage(Handler.java:92)        at android.os.Looper.loop(Looper.java:123)        at android.app.ActivityThread.main(ActivityThread.java:4627)        at java.lang.reflect.Method.invokeNative(Native Method)        at java.lang.reflect.Method.invoke(Method.java:521)        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)        at dalvik.system.NativeStart.main(Native Method)        Caused by: java.lang.NoSuchMethodException        at java.lang.Class.getDeclaredMethods(Native Method)        at java.lang.ClassCache.getDeclaredPublicMethods(ClassCache.java:166)        at java.lang.ClassCache.getDeclaredMethods(ClassCache.java:179)        at java.lang.ClassCache.findAllMethods(ClassCache.java:249)        at java.lang.ClassCache.getFullListOfMethods(ClassCache.java:223)        at java.lang.ClassCache.getAllPublicMethods(ClassCache.java:204)        at java.lang.Class.getMethod(Class.java:984)        at android.view.View$1.onClick(View.java:2052)        ... 11 more</code></pre>","155695","","","","","2012-08-21 14:17:10","Unable to bind onClick xml onto a method in my activity","<android><android-2.1-eclair>","2","4","1","",""
"4250395","1","4250444","","2010-11-22 21:28:03","0","443","<p>Lets say i got an webview with my website for example. can i add like a watermark(textView this case) on top of the webview?Is this possible to add a component on top of another without having that black space if you try to offset the text.</p><p>Need an transparent background and place the object on top of the other one</p><p>thank you!</p>","502419","","","","","2010-11-22 21:37:13","Android Development: XML layout place ontop like watermark","<android>","2","0","","",""
"4250434","1","4250790","","2010-11-22 21:32:13","9","8763","<p>How can I read GPS raw data, to be more specific I need the saellites pseudo range.This data is not available in NMEA format.</p>","516681","","213269","","2010-11-22 22:30:54","2012-03-17 00:23:56","How can I get the GPS raw data (satellites pseudo range)?","<android><gps><nmea>","3","1","5","",""
"4250447","1","4250488","","2010-11-22 21:34:37","0","1532","<p>How can I create a XML file that has identation or, at least, line breaks between each tag?</p><p>I'm using class XMLSerializer (available in Android) to handle the XML creation. </p><pre><code>XMLSerializer serializer = new XMLSerializer();StringWriter writer = new StringWriter();serializer.setOutput(writer);String xmlFileContents = writer.toString();</code></pre><p>Then I use the contents of xmlFileContents to create a file, using a BufferedWriter. The file is written, but the XML is not idented, and would like it to be.</p><p>Thanks.</p>","425749","","","","","2010-11-22 21:40:47","Creating XML file with identation","<android><xml><xmlserializer>","1","2","","",""
"4250451","1","","","2010-11-22 21:35:03","1","1046","<p>first of all sorry for my bad english :)I'm new on programming for Android...I'm trying to setup a view on runtime. I've created my own View class ( derived from AbsoluteView ) successfully, but if i try to resize the content of the view, nothing happens :(</p><p>Here is the full code i have wrote :</p><pre><code>package com.CaliskanDevelopment.LottoGenerator;import android.content.Context;import android.util.AttributeSet;import android.widget.AbsoluteLayout;import android.widget.ToggleButton;@SuppressWarnings(""deprecation"")public class CSelectNumbersLayout extends AbsoluteLayout {private ToggleButton    m_clButton;public CSelectNumbersLayout( Context    clContext ){    super( clContext );    CreateButtons();}public CSelectNumbersLayout( Context        clContext,                             AttributeSet   clAttributeSet ){    super( clContext, clAttributeSet );    CreateButtons();}public CSelectNumbersLayout( Context        clContext,                             AttributeSet   clAttributeSet,                             int            i32DefStyle ){    super( clContext, clAttributeSet, i32DefStyle );    CreateButtons();}private void CreateButtons(){    LayoutParams    clLayoutParams = (LayoutParams) generateDefaultLayoutParams();    int             i32ButtonWidth = 10;    int             i32ButtonHeight = 10;    int             i32PosX = 0;    int             i32PosY = 0;    clLayoutParams.x = i32PosX;    clLayoutParams.y = i32PosY;    clLayoutParams.width = i32ButtonWidth;    clLayoutParams.height = i32ButtonHeight;    m_clButton = new ToggleButton( getContext() );    m_clButton.setText( ""setText"" );    m_clButton.setTextOn( ""setTextOn"" );    m_clButton.setTextOff( ""setTextOff"" );    m_clButton.setLayoutParams( clLayoutParams );    this.addView( m_clButton );}protected void onSizeChanged( int   i32Width,                              int   i32Height,                              int   i32OldWidth,                              int   i32OldHeight ){    int i;    int i32ButtonWidth = ( i32Width / 7 );    int i32ButtonHeight = ( i32Height / 7 );    int i32PosX;    int i32PosY;    if ( i32ButtonWidth &gt; i32ButtonHeight )        i32ButtonWidth = i32ButtonHeight;    else if ( i32ButtonHeight &gt; i32ButtonWidth )        i32ButtonHeight = i32ButtonWidth;    i32PosX = ( i32Width / 2 ) - ( ( i32ButtonWidth * 7 ) / 2 );    i32PosY = ( i32Height / 2 ) - ( ( i32ButtonHeight * 7 ) / 2 );    LayoutParams    clLayoutParams = (LayoutParams) m_clButton.getLayoutParams();    clLayoutParams.x = i32PosX;    clLayoutParams.y = i32PosY;    clLayoutParams.width = i32ButtonWidth;    clLayoutParams.height = i32ButtonHeight;    m_clButton.setLayoutParams( clLayoutParams );    m_clButton.invalidate();    this.invalidate();}}</code></pre><p>I'm trying to resize the created buttons in function onSizeChanged, because i have readed that this is the first time where i know how big is my view. Calling things like</p><pre><code>m_clButton.invalidate();m_clButton.postInvalidate();this.invalidate();</code></pre><p>does not have the desired result.The View is inside a Tab. If i click on the tab first time to show this Layout the Buttons are 10 x 10 ( as i created in the constructor ), i have debugged the Code, it runs over onSizeChanged but the buttons are not resized.If i show another view and click at this tab again the buttons are resized.</p><p>I think the problem is to refresh the view in function onSizeChanged(), but how to do this ???</p><p>Thanks in advance...</p><p>Hasan Caliskan</p>","516658","","516658","","2010-11-22 21:44:41","2010-11-23 09:50:50","Set size of a ToggleButton dynamicly","<android>","0","2","","",""
"4250542","1","","","2010-11-22 21:48:49","3","1327","<p>Has anyone found a way to do perform speech recognition without displaying Google's voice recognition dialog box?  Can this be suppressed during recognition, or if not, hidden from view?  I would still need to be able to initiate the voice capture, detect the silence to let me know the capture is complete, then convert to text.</p>","515608","","213269","","2010-11-22 22:32:47","2013-02-28 11:11:12","Need voice recognition without Google dialog box","<android><dialog><voice><voice-recognition>","1","1","","2013-02-28 18:24:01",""
"4250599","1","4250847","","2010-11-22 21:58:12","16","22531","<p>I have a <strong>ListView</strong>, which is in <strong>singleChoice mode</strong>. All I want is to display a RadioButton to the side, that when clicked highlights to say it is selected, and when a different one is clicked that one goes back to unselected and the new one becomes selected. Why is this so hard? This should not be this complicated. I've spent <strong>DAYS</strong> looking for an appropriate answer to this and I have found nothing, so I'm asking hopefully in a clear and concise manner.</p><p>My layout for the listview <strong>(R.layout.view_orders)</strong>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ListView         android:choiceMode=""singleChoice""        android:id=""@android:id/list""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:divider=""@drawable/list_divider""        android:dividerHeight=""1px""        android:focusable=""false""        android:focusableInTouchMode=""false""        android:cacheColorHint=""#00000000""&gt;&lt;/ListView&gt;</code></pre><p>My custom row <strong>(R.layout.orders_row)</strong>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    xmlns:app=""http://schemas.android.com/apk/res/com.xxx.xxxxxx""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""horizontal""    android:padding=""6dip""&gt;    &lt;com.xxx.xxxxxx.VerticalLabelView        app:text=""SHORT""        app:textColor=""#666""        app:textSize=""14sp""        android:id=""@+id/state""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:layout_centerVertical=""true"" /&gt;    &lt;TextView        android:id=""@+id/quantity""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/state""         android:layout_centerVertical=""true""        android:gravity=""center""        android:textSize=""40sp""        android:layout_margin=""2dip""        android:minWidth=""30dip""        android:textColor=""#555"" /&gt;    &lt;RelativeLayout        android:layout_toRightOf=""@id/quantity""        android:layout_centerVertical=""true""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;TextView            android:id=""@+id/instrument""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:textSize=""20sp""            android:textColor=""#333""            android:layout_marginLeft=""2dip""            android:layout_marginRight=""2dip""            /&gt;        &lt;TextView            android:id=""@+id/deets""            android:layout_below=""@id/instrument""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:textSize=""16sp""            android:textColor=""#888""            android:layout_marginLeft=""2dip""            android:layout_marginRight=""2dip""            /&gt;    &lt;/RelativeLayout&gt;        &lt;RadioButton            android:id=""@+id/selector""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentRight=""true""            android:layout_centerVertical=""true""            /&gt;&lt;/RelativeLayout&gt;</code></pre><p>My <strong>onCreate()</strong> method:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.view_orders);    client = new Client(handler);    ola = new OrdersAdapter(this, R.layout.orders_row, Orders);    setListAdapter(ola);    final RelativeLayout loading = (RelativeLayout) findViewById(R.id.loading);    panel = (PositionsPanel) findViewById(R.id.panel);    Utility.showProgressBar(loading);    client.Connect(""orders"");}</code></pre><p>Now everything underlying works as expected, you click on a radiobutton and through it's tag I can appropriately select that item from the list and manipulate it how I want. However, when the first radio button is clicked, the last one will be selected. Click that same radio button again, and it is now selected as well. Click it once more and nothing happens, both the last and the first are selected. Now I click any other one on the list, it gets selected like expected. Click anyone of the selected radio buttons and nothing happens, the radio button remains selected.</p><p>I have tried using the following in <strong>onCreate()</strong>:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.view_orders);    client = new Client(handler);    ola = new OrdersAdapter(this, android.R.layout.simple_list_item_single_choice, Orders);    setListAdapter(ola);    final RelativeLayout loading = (RelativeLayout) findViewById(R.id.loading);    panel = (PositionsPanel) findViewById(R.id.panel);    Utility.showProgressBar(loading);    client.Connect(""orders"");}</code></pre><p>and that just shows no radio buttons at all. <strong>AWESOME</strong>. </p><p>Now maybe (read: most likely), I'm just dense and can't figure this out, but I've seen this question asked a lot with no real answer. Lots of references to other tutorials or to the Commonsware guy's book. However, the comments are old now and his repository has changed so much, that those are no longer correct answers.</p><p>So, does anyone have any idea how to get the expected functionality out of this? Or failing that, just pass me along the GMail app's source code. :)</p>","50391","","","","","2012-08-10 00:55:09","Android ListView with RadioButton in singleChoice mode and a custom row layout","<android><listview><radio-button><listviewitem>","4","0","1","",""
"4250617","1","","","2010-11-22 22:01:28","0","1115","<p>How can i listen to Ultrasonic sound in Android platform?</p>","516712","","","","","2010-11-22 22:09:55","Ultrasonic sound in Android","<android>","2","1","","2010-11-22 22:12:04",""
"4250839","1","4250879","","2010-11-22 22:26:50","1","358","<p>I have read into the <code>finish();</code> commands and the <code>FLAG_ACTIVITY_CLEAR_TOP</code> commands and also checked out Common Ware's answer on killing app, but I am not sure how to put this into my app.</p><p>Basically, I have a user click a button that takes them to the camera. The user then snaps a photo and it brings them to a layout view. The user then clicks a button that takes them to one of 2 views, depending on a some conditions.</p><p>The user is then allowed to either retake a photo, or go to the main menu (depending). My problem is, if the user goes back to the main menu, and snaps another, then another, etc...the activities stack, so when I click the 'Main Menu' button the app goes back through eached stack activity until finally it goes back to the main menu. Is there a way to kill each activity with one of these lines, so even if a user retakes a photo, they will only need to go back once to get to the main menu?</p><p>Thanks!</p>","496686","","","","","2010-11-22 22:32:02","Killing activities before they stack, so recalling an activity doesn't cause an overflow","<android><activity><stackoverflow><return>","1","0","","",""
"4250849","1","","","2010-11-22 22:28:19","0","303","<p>I'm using a custom list adapter. The code for each file used is posted here;<a href=""http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/"" rel=""nofollow"">link text</a></p><p>It's great and works perfect for what I need. Except that I can't figure out how to access the view for a single entry so I can change it's background color when I add it to the adapter. For my use each item added will have a status which determines what background color the item needs to be.</p><p>I can do this with a simple list, but I'm just learning about using more complex layouts in order to create more useful custom lists, and I'm lost with this one.</p>","516734","","","","","2010-11-22 22:28:19","How would I change the background color of certain rows using this custom list adapter?","<android>","0","7","","",""
"4250903","1","","","2010-11-22 22:34:51","6","4298","<p>I created a DatePickerPreference, i.e. I extended DialogPreference and created a DatePicker object inside and had it working almost perfectly. It changes values when you click the arrows up and down and saves the value you select.</p><p>However, if you click inside the field and types the new value there, it doesn't save the updated value! When using the arrows, the onDateChanged() method is always called; when user enters the field and edits it, it will only call onDateChanged if he selects another field (and in this case, if he edits the last field and just hit OK, the last edit will be ignored). I found that <a href=""http://www.ebessette.com/d/TimePickerPreference#comment-367"">Eric Besette posted a similar problem with his TimePickerPreference</a></p><p>Here is my code:</p><pre><code>    public class DatePickerPreference extends DialogPreference implements  OnDateChangedListener, OnDateSetListener {    @Override    protected View onCreateDialogView() {        DatePicker picker = new DatePicker(getContext());        mDate = getPersistedLong(System.currentTimeMillis());        Calendar calendar = Calendar.getInstance();        calendar.setTimeInMillis(mDate);        int day = calendar.get(Calendar.DAY_OF_MONTH);        int month = calendar.get(Calendar.MONTH);        int year = calendar.get(Calendar.YEAR);        picker.init(year, month, day, this);        return picker;    }    public void onDateChanged(DatePicker view, int year, int monthOfYear,              int dayOfMonth) {        mDate = (new Date(year - 1900, monthOfYear, dayOfMonth)).getTime();    }    public void onDateSet(DatePicker view, int year, int monthOfYear,              int dayOfMonth) {        onDateChanged(view, year, monthOfYear, dayOfMonth);    }    @Override    public void setDefaultValue(Object defaultValue) {        super.setDefaultValue(String.valueOf((              new Date(String.valueOf(defaultValue))).getTime()));    }    @Override    protected void onDialogClosed(boolean positiveResult) {        super.onDialogClosed(positiveResult);        if(positiveResult) {            if(isPersistent()) {                persistLong(mDate);            }            callChangeListener(String.valueOf(mDate));        }    }    public int getYear() { /*(...)*/ }    public int getMonth() { /*(...)*/ }    public int getDay() { /*(...)*/ }    public DatePickerPreference(Context context, AttributeSet attrs) {        super(context, attrs);        init();    }    public DatePickerPreference(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        init();    }    public void init() { setPersistent(true); }    public void setDate(Date date) { mDate = date.getTime(); }    public void setDate(long milisseconds) { mDate = milisseconds; }    public String getDate(int style) {        return DateFormat.getDateInstance(style).format(new Date(mDate));    }    public long getDate() { return mDate; }    private long mDate;    public static final int DATE_SHORT = DateFormat.SHORT;    public static final int DATE_MEDIUM = DateFormat.MEDIUM;    public static final int DATE_LONG = DateFormat.LONG;    public static final int DATE_FULL = DateFormat.FULL;    public static final int DATE_DEFAULT = DateFormat.DEFAULT;}</code></pre>","327782","","","","","2012-07-05 15:04:32","Custom DatePicker as Preference does not keep value when user edits value in field","<android><datepicker><preference>","3","3","5","",""
"4250923","1","4250941","","2010-11-22 22:37:08","12","17419","<p>I already have the button:</p><pre><code>&lt;Button android:layout_height=""wrap_content"" android:layout_width=""fill_parent""android:drawableLeft=""@drawable/empty""android:id=""@+id/buttonMyText"" android:text=""  myText"" android:textSize=""20px"" android:gravity=""left""&gt;&lt;/Button&gt;</code></pre><p>I have the ""empty"" icon show on the button when the program starts.</p><p>What I want to do is change the button's icon automatically from my code (low, medium and high) based on user inputs</p><p>I tried:</p><pre><code>Button myButton = bla... bla... bla...</code></pre><p>But I cant figure out</p><pre><code>myButton.(what?)</code></pre>","512974","","","","","2012-08-22 13:27:14","How to Change a Button's Icon Programmatically?","<android><layout><text><button><icons>","1","1","2","",""
"4250968","1","4251003","","2010-11-22 22:44:08","3","19419","<p>I am not sure how to send HTTP Auth headers.</p><p>I have the following HttpClient to get requests, but not sure how I can send requests?</p><pre><code>public class RestClient extends AsyncTask&lt;String, Void, JSONObject&gt; {        private String convertStreamToString(InputStream is) {            /*             * To convert the InputStream to String we use the             * BufferedReader.readLine() method. We iterate until the             * BufferedReader return null which means there's no more data to             * read. Each line will appended to a StringBuilder and returned as             * String.             */            BufferedReader reader = new BufferedReader(new InputStreamReader(is));            StringBuilder sb = new StringBuilder();            String line = null;            try {                while ((line = reader.readLine()) != null) {                    sb.append(line + ""\n"");                }            } catch (IOException e) {                e.printStackTrace();            } finally {                try {                    is.close();                } catch (IOException e) {                    e.printStackTrace();                }            }            return sb.toString();        }        /*         * This is a test function which will connects to a given rest service         * and prints it's response to Android Log with labels ""Praeda"".         */        public JSONObject connect(String url) {            HttpClient httpclient = new DefaultHttpClient();            // Prepare a request object            HttpGet httpget = new HttpGet(url);            // Execute the request            HttpResponse response;            try {                response = httpclient.execute(httpget);                // Examine the response status                Log.i(""Praeda"", response.getStatusLine().toString());                // Get hold of the response entity                HttpEntity entity = response.getEntity();                if (entity != null) {                    // A Simple JSON Response Read                    InputStream instream = entity.getContent();                    String result = convertStreamToString(instream);                    // A Simple JSONObject Creation                    JSONObject json = new JSONObject(result);                    // Closing the input stream will trigger connection release                    instream.close();                    return json;                }            } catch (ClientProtocolException e) {                e.printStackTrace();            } catch (IOException e) {                e.printStackTrace();            } catch (JSONException e) {                e.printStackTrace();            }            return null;        }        @Override        protected JSONObject doInBackground(String... urls) {            return connect(urls[0]);        }        @Override        protected void onPostExecute(JSONObject json) {        }    }</code></pre>","19875","","","","","2011-11-17 02:57:51","How can I send HTTP Basic Authentication headers in Android?","<java><android><json><httpclient><http-authentication>","3","0","2","",""
"4251027","1","4251445","","2010-11-22 22:52:32","0","2858","<p>I have some png files that I am applying a color to.  The color changes depending on a user selection.  I change the color via 3 RGB values set from another method.  The png files are a random shape with full transparency outside the shape.  I don't want to modify the transparency, only the RGB value.  Currently, I'm setting the RGB values pixel by pixel (see code below).</p><p>I've come to realize this is incredibly slow and possibly just not efficient enough do in an application.  Is there a better way I could do this?</p><p>Here is what I am currently doing.  You can see that the pixel array is enormous for an image that takes up a decent part of the screen:</p><pre><code>public void foo(Component component, ComponentColor compColor, int userColor) {    int h = component.getImages().getHeight();    int w = component.getImages().getWidth();    mBitmap = component.getImages().createScaledBitmap(component.getImages(), w, h, true);    int[] pixels = new int[h * w];    //Get all the pixels from the image    mBitmap[index].getPixels(pixels, 0, w, 0, 0, w, h);    //Modify the pixel array to the color the user selected    pixels = changeColor(compColor, pixels);    //Set the image to use the new pixel array    mBitmap[index].setPixels(pixels, 0, w, 0, 0, w, h);}public int[] changeColor(ComponentColor compColor, int[] pixels) {    int red = compColor.getRed();    int green = compColor.getGreen();    int blue = compColor.getBlue();    int alpha;    for (int i=0; i &lt; pixels.length; i++) {        alpha = Color.alpha(pixels[i]);        if (alpha != 0) {            pixels[i] = Color.argb(alpha, red, green, blue);        }    }    return pixels;}</code></pre>","432209","","432209","","2010-11-22 23:30:45","2011-07-09 21:27:10","Faster way to set a (PNG) bitmap color instead of pixel by pixel","<java><android><colors>","2","3","","",""
"4251107","1","4251139","","2010-11-22 23:05:01","0","1678","<p>I have a linearlayout that is filled with texviews dynamically when i click on a button , but the content of linearlayout doesn't appear, how can i redraw it ??</p>","508377","","","","","2010-11-23 02:36:33","how to redraw linearlayout after clicking on button in android?","<android>","2","1","","",""
"4251141","1","4251189","","2010-11-22 23:08:50","0","927","<p>I´ve seen similars code that use this but i gives me this error ""URLEncoder cannot be resolved"" on this line: </p><p>String paramString = p.getName() + ""="" + URLEncoder.encode(p.getValue(),""UTF-8"");</p><p>It says the function is encode(String s, String enc)On ""enc"" it says the encoded scheme to be used.</p><p>I´m running Eclipse SDK Version: 3.6.1 and i don´t know how to solve this error.</p>","516765","","","","","2010-11-22 23:15:04","""URLEncoder cannot be resolved"" - URLEncoder.encode(p.getValue(),""UTF-8"");","<android><eclipse><rest><http-post>","1","0","","",""
"4251313","1","4251396","","2010-11-22 23:31:19","0","236","<p>I have an ImageView that I set to center inside the linear layout of a basic page in my xml file.  I snap a photo, detect for faces and display it on my ImageView.  The problem is, it always displays on the left side of my phone (I have the app permanently set to portrait mode)...I want the width 'parent_fill' and I want the height a fixed height, but any change I make does nothing to how it is displayed.</p><p>Here is my xml code:</p><pre><code>&lt;!-- the second view on the flipper --&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:gravity=""center""&gt;&lt;ImageButton android:id=""@+id/YesButtonTitle"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@drawable/yesface"" android:layout_gravity=""top|center""&gt;&lt;/ImageButton&gt;&lt;ImageView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:id=""@+id/image_view""        android:gravity=""center""        android:layout_weight=""1.0""/&gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:id=""@+id/message""        android:gravity=""center_horizontal""        android:padding=""10dip""/&gt;        &lt;Button                android:layout_gravity=""center_horizontal""        android:layout_width=""fill_parent""        android:textStyle=""bold"" android:id=""@+id/action_button"" android:selectAllOnFocus=""false"" android:layout_height=""100dip"" android:text=""Click here to crop detected face""/&gt;    &lt;/LinearLayout&gt; </code></pre><p>Here is where I set the bitmap to the ImageView:</p><pre><code>((Button) findViewById(R.id.action_button))                    .setOnClickListener(btnClick);            mTheMessage.setText(R.string.faceMessage);            mThePicture = (ImageView) findViewById(R.id.image_view);            mThePicture.setImageBitmap(bitmap565);</code></pre><p>bitmap565 is defined as:</p><pre><code>Bitmap bitmap565 = Bitmap.createBitmap(width, height,                    Config.RGB_565);</code></pre><p>then compressed:</p><pre><code>try {                FileOutputStream fos = new FileOutputStream(filepath);                bitmap565.compress(CompressFormat.JPEG, 90, fos);                fos.flush();                fos.close();            } catch (FileNotFoundException e) {                e.printStackTrace();            } catch (IOException e) {                e.printStackTrace();            }</code></pre><p>Before I display the bmp on the Image View.  Anyone have any ideas why it will not behave and will the image view correctly?</p>","496686","","","","","2010-11-23 07:19:40","I cannot for the life of me figure out why my picture is not displaying correctly","<android><xml><image><layout><imageview>","2","0","","",""
"4251465","1","4251496","","2010-11-22 23:56:05","8","13236","<p>Hey all - is it possible to make an entire linear layout scrollable when it needs to be? (when all of the elements in the layout don't fit on the main screen)?</p><p>I know it is doable with views, etc...but is there a way to incorporate everything on the layout to be scrollable at the same time?</p><p>Maybe scrollable is not the right term...basically - if one of the elements (a button in this case) doesn't entirely make it onto the main screen of the phone and I need to slide a finger down to access it...if that makes sense.</p>","496686","","","","","2014-02-14 15:12:08","How to make a linear layout scrollable?","<android><xml><layout><scrolling>","3","0","1","",""
"4251491","1","4251530","","2010-11-23 00:01:18","2","1020","<p>I've been playing around with the Android Accelerometer of late using the Android SDK and the Adobe AIR for Android SDK on my Motorola Droid.  What I've noticed is that the accelerometer works just fine, but I was wondering if it is possible to compensate in some fashion so that I don't have to use the device in a horizontal position.  In other words, I want to use the accelerometer to control my visual display, but initialize it(or modify in some way) so that I don't have to hold it perfectly flat (not much fun having to lean over the phone).</p><p>Does anyone know how I can hold the device comfortably in my hand, say 45 degrees, and still utilize the accelerometer to provide forward/backwards readings?  Is this possible?  Any examples of this this available?</p>","411435","","","","","2011-02-28 20:07:53","Using the Android Accelerometer without having the device flat","<android><air><accelerometer><uiaccelerometer>","3","0","","",""
"4251532","1","","","2010-11-23 00:10:57","28","22979","<p>I just reformatted my computer. I have windows xp sp3 32 bit.I install java jdkandroid sdkeclipse ide</p><p>When I go to make a new android project i get this error.</p><p>Project 'HelloAndroid2' is missing required source folder: 'gen'</p><p>Please help i'm new to eclipse so give detail responses.</p>","516805","","","","","2013-09-18 07:57:48","java missing required source folder: 'gen'","<android><sdk>","12","4","2","",""
"4251623","1","4253015","","2010-11-23 00:26:03","2","3782","<p>If I understand it correctly, bindService() with BIND_AUTO_CREATE will start a service and will not die until all bindings are all unbinded.</p><p>But if I bindService(BIND_AUTO_CREATE) at onCreate() and hit back button to close the activity, the service calls onDestroy() and dies also.</p><p>I don't call unbind() at anytime.So is that mean when the Activity got destroyed, the binding got destroyed also and the service gets destroyed also?</p><p>What if I want the service to be always running, at the same time when the activity startsI want to bind it so that I can access the service?</p><p>If I call StartService() and then bindService() at onCreate(), it will restart the service at every launch of Activity. (Which I don't want).</p><p>So I could I start service once and then bind next time I launch the activity?</p>","432056","","","","","2014-03-19 13:59:58","Android: Service stops when Activity is closed","<android><service><bind>","2","0","1","",""
"4251631","1","4251909","","2010-11-23 00:27:52","1","1247","<p>I have an existing AVD I'm running in the Android emulator, but I'd like to change its Device ID.  Can this be done either in Android SDK and AVD Manager or by editing any of the files in my ~/.android directory?</p>","166","","","","","2011-03-07 06:08:09","How can I change the DeviceID on my Android Virtual Device?","<android><avd>","2","2","1","",""
"4251673","1","4251791","","2010-11-23 00:34:40","1","4712","<p>Am I correctly sending an HTTPPost? I am checking my encodedAuthString against my webserver and can verify the string is correct. Not sure why I am unable to authenticate.</p><pre><code>public JSONObject connect(String url) {            HttpClient httpclient = new DefaultHttpClient();            // Prepare a request object            HttpPost httppost = new HttpPost(url);            String authString = usernameEditText.getText().toString() + "":"" + passwordEditText.getText().toString();            String encodedAuthString = Base64.encodeToString(authString.getBytes(),Base64.DEFAULT);            String finalAuthString = ""Basic "" + encodedAuthString;            // Execute the request            HttpResponse response;            try {                  httppost.addHeader(""Authorization"", finalAuthString);                response = httpclient.execute(httppost);                // Examine the response status                Log.i(""Praeda"", response.getStatusLine().toString());                // Get hold of the response entity                HttpEntity entity = response.getEntity();                if (entity != null) {                    // A Simple JSON Response Read                    InputStream instream = entity.getContent();                    String result = convertStreamToString(instream);                    // A Simple JSONObject Creation                    JSONObject json = new JSONObject(result);                    // Closing the input stream will trigger connection release                    instream.close();                    return json;                }            } catch (ClientProtocolException e) {                e.printStackTrace();            } catch (IOException e) {                e.printStackTrace();            } catch (JSONException e) {                e.printStackTrace();            }            return null;        }        @Override        protected JSONObject doInBackground(String... urls) {            return connect(urls[0]);        }        @Override        protected void onPostExecute(JSONObject json) {            String authorized = ""200"";            String unauthorized = ""401"";            String notfound = ""404"";            String status = new String();            try {                // Get the messages array                JSONObject response = json.getJSONObject(""response"");                status = response.getString(""status"");                if(status.equals(authorized))                    Toast.makeText(getApplicationContext(), ""Authorized"",Toast.LENGTH_SHORT).show();                else if (status.equals(unauthorized))                    Toast.makeText(getApplicationContext(), ""Unauthorized"",Toast.LENGTH_SHORT).show();                else if(status.equals(notfound))                    Toast.makeText(getApplicationContext(), ""Not found"",Toast.LENGTH_SHORT).show();            } catch (JSONException e) {                System.out.println(e);            } catch (NullPointerException e) {                System.out.println(e);            }        }    }</code></pre><p><strong>UPDATE:</strong></p><p>When I hard-code the encoded string, everything is fine.</p><p>When I use the Base64 encoder I get the same results as the encoded string, but the server returns a 401.</p>","19875","","19875","","2010-11-23 01:51:13","2013-11-21 19:05:22","Problem sending HTTP headers in Java","<java><android><json><http><httpclient>","2","0","2","",""
"4251745","1","4251988","","2010-11-23 00:51:44","1","2013","<p>I have a TextView in my layout which has an attribute ""clickable=true"" set in XML. This is to allow it behave like a button with both text and icon. Now, I add to that TextView HTML text via call HTML.fromHtml(), and apply                                               Linkify.addLinks after that. </p><p>The problem is: in such configuration, links are not clickable. Is there any suggestion, how to allow user click on links, other from creating custom TextView-based class? </p><p>Thanks</p>","94892","","","","","2010-12-10 22:32:52","Android: Clickable TextView with Linkified links","<android><android-widget><android-layout>","2","1","1","",""
"4251841","1","4252033","","2010-11-23 01:14:59","0","1154","<p>Here is my code:</p><pre><code>DefaultHttpClient client = new DefaultHttpClient();HttpGet request = new HttpGet(url);HttpResponse response = client.execute(request);</code></pre><p>This works for every url I have tried so far, except for some urls that contain an anchor.  Some of these anchored urls return a 400. The weird thing is that it isn't all links that contain an anchor, a lot of them work just fine.</p><p>Unfortunately, I have to be really general as I can't provide the specific urls here.</p><p>The links are completely valid and work just fine in any browser, but the HttpClient returns a 400 when trying the link.  If I remove the anchor it will work.</p><p>Any ideas what to look for?</p><p>For example:  <code>http://www.somedomain.com/somedirectory/somepage#someanchor</code></p><p>Sorry again for the generics</p><p>EDIT: I should mention this is for Android.</p>","445348","","","","","2014-02-13 08:22:29","400 error with HttpClient for a link with an anchor","<java><android><anchor><httpclient>","4","0","1","",""
"4251905","1","","","2010-11-23 01:26:57","1","2035","<p>this is my code used to create table </p><pre><code> private static final String DATABASE_CREATE =            ""create table notes (_id integer primary key autoincrement,""
    + ""title text not null, body text not null,email text not null,group text);"";</code></pre><p>the logcat shows:</p><pre><code>11-23 08:22:32.992: ERROR/AndroidRuntime(1008): FATAL EXCEPTION: main11-23 08:22:32.992: ERROR/AndroidRuntime(1008): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android/com.android.managecontact}: android.database.sqlite.SQLiteException: near ""group"": syntax error: , while compiling: SELECT _id, title, body, email, group FROM notes ORDER BY title11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.os.Handler.dispatchMessage(Handler.java:99)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.os.Looper.loop(Looper.java:123)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at java.lang.reflect.Method.invokeNative(Native Method)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at java.lang.reflect.Method.invoke(Method.java:521)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at dalvik.system.NativeStart.main(Native Method)11-23 08:22:32.992: ERROR/AndroidRuntime(1008): Caused by: android.database.sqlite.SQLiteException: near ""group"": syntax error: , while compiling: SELECT _id, title, body, email, group FROM notes ORDER BY title11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.database.sqlite.SQLiteCompiledSql.&lt;init&gt;(SQLiteCompiledSql.java:64)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:80)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:46)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1229)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1184)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1264)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at com.android.database.fetchAllNotes(database.java:156)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at com.android.managecontact.fillData(managecontact.java:118)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at com.android.managecontact.onCreate(managecontact.java:89)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)11-23 08:22:32.992: ERROR/AndroidRuntime(1008):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)</code></pre>","510992","","345717","","2010-11-23 01:34:00","2013-02-04 10:07:27","SQLITE create table error","<android><sqlite>","2","0","","",""
"4251952","1","4252002","","2010-11-23 01:38:01","2","152","<p>Is there a truefire way to make sure my app will display the same on my Motorola Droid 2 as it will on other Androids?</p><p>I use nothing more than basic Linear Layouts, Image Views, Buttons etc - is there a good checklist to go by before I even think about launching an app?</p><p>Clipping issues, What SDK I should launch my app in, etc...?</p>","496686","","","","","2010-11-23 01:51:53","How do I ensure my android app will look the same on all android phones?","<android><compatibility><clipping>","2","1","","",""
"4251956","1","4253332","","2010-11-23 01:39:22","0","537","<p>I am new to Android</p><p>Can anyone provide an example/help on this.</p><p>For example having a TextView's contents on an Activity automatically changed by a Service.</p><p>I already managed to get the service running, is there a listener I could use on the Activity class?</p><p>please please please provide examples with answers</p>","512974","","","","","2010-11-23 06:24:37","How to Control an Activity's Contents from a Service?","<android><service><activity><communication><listener>","2","2","","",""
"4252088","1","4252495","","2010-11-23 02:06:50","0","426","<p>Does anyone know the step by step settings to put your app so it can show up in the 2.1 market? My app has been in the market for a few days, and a couple 2.1 users says that they cannot find it. It shows in the 2.2 though. Can someone help?</p>","516883","","","","","2010-11-23 03:28:18","My published app not showing up in 2.1 market","<android><marketplace>","1","2","","",""
"4252111","1","4252195","","2010-11-23 02:11:32","0","430","<p>Could someone please help me to understand why the following block of code keeps throwing this error? It's driving me crazy trying to debug this.</p><pre><code>    public int getContactsCountByGroupId(int id) {      Cursor c = db.rawQuery(""SELECT COUNT(*) AS total FROM msg_group_lu WHERE group_id = ?"", new String[] {String.valueOf(id)});      DatabaseUtils.dumpCursor(c);      int retval = c.getInt(c.getColumnIndex(""total""));    return retval;}</code></pre><p>The dump seems to indicate this;0 {    total=0}</p><p>This is telling me that there is data in column 0, but yet everytime it tries to execute the line with this code;</p><pre><code>int retval = new Integer(c.getInt(c.getColumnIndex(""total"")));</code></pre><p>It gives me this error;CursorIndexOutOfBoundsException: Index -1 requested, with size of 1</p><p>I have tried everything I can think of to try to fix this and am completely stumped. :(</p><p>I hope someone knows what causes this.</p>","485710","","","","","2012-01-07 02:07:39","Android cursor headaches","<android><cursor>","1","0","","",""
"4252152","1","","","2010-11-23 02:20:26","1","559","<p>I want to have multiple widgets started within my app.  I do not want to have to hold down on the screen and click add widget</p><p>is this possible?</p><p>It must be possible because on my MyTouch4G the HTC sense items have this enabled such as the calendar, weather and suchNow I know that this is an overrided homescreen madew by htc, so I hesitate to wonder if this is something that they do for themselves and is not supported in android... But I do hope, this would be very crucial for my application... We have multiple size widgets, and do not want people to have to select through them in the widget screen, but instead add them from inside the main application</p>","478183","","","","","2010-11-23 02:20:26","Start Widget Configure Activity or AppWidgetProvider from inside of Activity","<android><android-widget><appwidget>","0","0","","",""
"4252323","1","4252359","","2010-11-23 02:50:33","1","123","<p>I have a basic linear layout, with image view that display photos, textviews that show text etc...and when I test my whole app on my android 2, there is never any part of the screen that doesn't show.  But when I test it in the QVGA emulator, half the view is off the screen.  Now, some of my text is defined to a certain size.</p><p>I never use px (only dip) in any of my xml.  I use fill_parent, wrap_content where it is needed and never fix a height or length.  Could it be with my text, I use say, textSize = 22dip?  I couldn't find documentation on why that would not work in all sizes.</p><p>Could it be that some apps need to be programmed to those screen sizes?  Or am I missing something?</p><p>Thanks! </p>","496686","","","","","2010-11-23 02:58:54","How do I get around clipping issues with my app in smaller phones?","<android><testing><cross-platform><dimensions><clipping>","1","0","","",""
"4252354","1","","","2010-11-23 02:57:48","2","683","<p>i want to use button.setonclicklistener and onListItemClick what i need to do </p>","510992","","","","","2010-11-23 03:48:56","button on listview i want to use button.setonclicklistener and onListItemClick what i need to do","<android><list><view>","1","1","","",""
"4252371","1","4252381","","2010-11-23 03:01:57","2","1798","<p>I am pretty new to this but I was told I could get good help here. A friend and myself are playing around with creating Android apps (using ADT)</p><p>Here is how we are trying to make the program:  in an activity, a user sets threshold values for the X and Y axis on the accelerometer.  When the user hits button ""Start"", startService is invoked and starts TiltService.  </p><p>TiltService is designed to run in the background always on the phone without user interaction.  TiltService constantly compares the threshold with the accelerometer values and will vibrate if they are off.  </p><p>My problem is I can't seem to get the putExtra() data correctly. I have overridden the onStartCommand in my service but I get the message ""unreachable code"" when I save the getExtras() to a bundle.</p><p>Here is the relevant code (I can post the whole thing, just do not want to clog up page)</p><p>TiltMeterActivity</p><pre><code>private Intent dataIntent = null;private float FORWARD_THRESHOLD = 4f;private float BACKWARD_THRESHOLD = -3f;private float UPWARD_THRESHOLD = 3f;private float DOWNWARD_THRESHOLD = -3f;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        bstart = (Button)findViewById(R.id.btnStart);        dataIntent = new Intent();        dataIntent.setClass(TiltMeterActivity.this, TiltService.class);        dataIntent.putExtra(""fowardThreshold"", FORWARD_THRESHOLD);        dataIntent.putExtra(""backwardThreshold"", FORWARD_THRESHOLD);        dataIntent.putExtra(""upwardThreshold"", UPWARD_THRESHOLD);        dataIntent.putExtra(""downwardThreshold"", DOWNWARD_THRESHOLD);        bStart.setOnclickListener(new View.OnClickListener() {            public void onClick(View v) {                startService(dataIntent);            }        });    }</code></pre><p>TiltService</p><pre><code>private Bundle thresholdData = new Bundle();private float Z_FORWARD_THRESHOLD = 0f;private float Z_BACKWARD_THRESHOLD = 0f;private float Y_UPWARD_THRESHOLD = 0f;private float Y_DOWNWARD_THRESHOLD = 0f;public int onStartCommand(Intent intent, int flags, int startId) {        // TODO Auto-generated method stub        return super.onStartCommand(intent, flags, startId);        thresholdData = intent.getExtras(); // The problem area (Eclipse says this is unreachable code)        Z_FORWARD_THRESHOLD = thresholdData.getFloat(""forwardThreshold"");        Z_BACKWARD_THRESHOLD = thresholdData.getFloat(""backwardThreshold"");        Y_UPWARD_THRESHOLD = thresholdData.getFloat(""upwardThreshold"");        Y_DOWNWARD_THRESHOLD = thresholdData.getFloat(""downwardThreshold"");        return START_STICKY;    }</code></pre><p>I thought I understood the basic of how Intents could pass data, but I guess I don't.  Is it obvious what I am missing?  Thanks for any help</p>","516917","","1108213","","2012-03-09 13:56:00","2012-03-09 13:56:00","Unable to get data from Activity to Service","<android><service><android-intent>","2","0","","",""
"4252400","1","4252837","","2010-11-23 03:07:00","3","1061","<p>In my Android application, it is noticed that when the device goes to sleep/standby WiFi is disconnected. When the device wakes up, it gets reconnected. Before making a<br>httpClient.execute(..) call to remote server we check if the device is connected to n/w. When the data transfer is being done and if the device goes to sleep then Android runtime will switch to another medium for connectivity(3G,GPRS etc.). </p><ol><li>Is the switch from WiFi to alternate cellular service say 3G, seamless?  </li><li>How do I wait for WiFi to become available again? Should I use Thread.sleep(delay) when the WiFi wakes up? I have seen broadcast actions when the WiFi state changes.</li></ol><p>In general, what is the ideal approach to handling WiFi disconnects in a mobile app? </p>","366053","","","","","2010-11-23 04:43:40","Approach to handle WiFi disconnects","<android><network-programming><android-wifi>","1","0","3","",""
"4252434","1","4252692","","2010-11-23 03:12:31","7","4394","<p>I am new to the notion of WakeLock and need your help.</p><p>Questions:  </p><ol><li><p>I assume WakeLock to be some type of lock which when held by the executing code prevents the device from sleeping. What if the device is already in sleep/standby mode, will the code execute then? Assuming that it would never acquire a WakeLock?  </p></li><li><p>When a long running task(abt 7-8 sec) is done in a background thread(AsyncTask) should I be bothered about holding a WakeLock? Does AsyncTask already acquire it for me?</p></li><li><p>links to official documentations and writeup on wakelocks are appreciated.</p></li></ol><p>Thanks.</p>","366053","","","","","2011-11-24 06:23:44","Beginner questions: Wakelocks","<android><wakelock>","2","1","3","",""
"4252444","1","","","2010-11-23 03:15:22","0","431","<p>I have an autocomplete of a String Array of drinks. I want to be able to get the index of that String Array so I can use that index for another array that correlates to the String Array of drinks.</p><p>Thanks,Andrew</p>","2309633","","","","","2010-11-23 03:15:22","Getting Index of AutoComplete Android","<android><arrays><string><autocomplete>","0","2","","",""
"4252461","1","","","2010-11-23 03:17:53","3","531","<p>We have an android app that currently sends data to a php script which writes to a mysql DB on the same server.  We are thinking of using a scalable DB server e.g. FathomDB (which is just based on amazon RDS &amp; rackspace) so that we can handle load increases easily.  </p><p>The question is how does our android app write to these remote DBs? Do they have some kind of rest API, or allow you to have a php script similar to the one we have in place at the moment?</p>","435281","","71724","","2010-11-23 03:32:57","2011-12-14 14:05:52","How to write to a remote DB from an android app","<mysql><android><amazon-rds>","1","0","","",""
"4252529","1","4252674","","2010-11-23 03:34:55","0","517","<p>I have tested my app in a debugger for many different sizes, and realized I will probably need a scrollView to allow the user to view the full layout.</p><p>The issue, is I use a flipper in my main.xml with multiple linear layouts like so:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ViewFlipper    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/your_flipper""    android:screenOrientation=""portrait""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     &lt;!-- the second view on the flipper --&gt;    &lt;!-- ImageView --&gt;    &lt;!-- TextViews --&gt;    &lt;!-- Buttons --&gt;    &lt;!-- Image Buttons --&gt;&lt;/LinearLayout&gt;&lt;!-- the 3rd view on the flipper --&gt;&lt;!-- ImageView --&gt;&lt;!-- TextViews --&gt;&lt;!-- Buttons --&gt;&lt;!-- Image Buttons --&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""&lt;/LinearLayout&gt;&lt;!-- the 4th view on the flipper --&gt;&lt;!-- ImageView --&gt;&lt;!-- TextViews --&gt;&lt;!-- Buttons --&gt;&lt;!-- Image Buttons --&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>I made the ImageViews, Buttons, TextViews, etc comments so not to bloat the code - </p><p>This is in my main xml file, where all the layouts are displayed.  How can I go about easily adding a scroll view to each layout, so if it is too big for the screen of a certain phone, the user can scroll through the page to see all the content?</p><p>Thanks!</p>","496686","","","","","2010-11-23 04:04:41","Implementing the ability to scroll (when needed) to phones that might be too small","<android><xml><layout><scrollviewer><dimensions>","2","0","","",""
"4252575","1","4252617","","2010-11-23 03:45:39","0","118","<p>Hey all, I received a termination on my app and this error in the logcat:</p><pre><code>11-22 22:41:25.193: ERROR/AndroidRuntime(30974): FATAL EXCEPTION: main11-22 22:41:25.193: ERROR/AndroidRuntime(30974): java.lang.ArrayIndexOutOfBoundsException11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at com.project.main.main.analyzeFace(main.java:316)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at com.project.main.main.access$1(main.java:209)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at com.project.main.main$1$1.run(main.java:381)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at android.os.Handler.handleCallback(Handler.java:587)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at android.os.Handler.dispatchMessage(Handler.java:92)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at android.os.Looper.loop(Looper.java:143)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at android.app.ActivityThread.main(ActivityThread.java:4701)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at java.lang.reflect.Method.invokeNative(Native Method)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at java.lang.reflect.Method.invoke(Method.java:521)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-22 22:41:25.193: ERROR/AndroidRuntime(30974):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>When I tried snapping a photo in my app.  Any idea what this could be?</p>","496686","","","","","2010-11-23 03:54:56","An error I cannot decipher -","<android><fatal-error><logcat>","2","4","","",""
"4252668","1","","","2010-11-23 04:03:39","0","841","<p>I got skia native crash when return <code>~SkSpriteBlitter()</code>, below is the tombstone and stack trace. Does anyone get this issue before?</p><pre class=""lang-none prettyprint-override""><code>[tombstone]signal 11 (SIGSEGV), fault addr 00000000 r0 bec3a434  r1 ab248078  r2 ab248080  r3 ab2494dc r4 bec3a558  r5 bec3a434  r6 002ae6b0  r7 bec3a558 r8 00000000  r9 bec3a5e8  10 bec3a434  fp 00000000 ip 000002dc  sp bec3a2d8  lr ab169da4  pc 00000000Stack Trace:signal 11 (SIGSEGV), fault addr 00000000 r0 bec3a434  r1 ab248078  r2 ab248080  r3 ab2494dc r4 bec3a558  r5 bec3a434  r6 002ae6b0  r7 bec3a558 r8 00000000  r9 bec3a5e8  10 bec3a434  fp 00000000 ip 000002dc  sp bec3a2d8  lr ab169da4  pc 00000000  cpsr 20010010         #00  pc 00000000           #01  pc 00069da0  /system/lib/libskia.socode around pc:code around lr:ab169d84 e793100c e1a04000 e5900008 e2812008 ab169d94 e5842000 ebffa1ac e1a00004 ebffd501 ab169da4 e1a00004 e8bd8010 000df754 00000278 ab169db4 e59f302c e59fc02c e92d4010 e08f3003 ab169dc4 e1a04000 e793000c e5841008 e2802008 stack:    bec3a298  bec3a434  [stack]    bec3a29c  000000ff      bec3a2a0  00145a70  [heap]    bec3a2a4  ab1978d0  /system/lib/libskia.so    bec3a2a8  ab249d8c  /system/lib/libskia.so    bec3a2ac  46d9bc40  /dev/ashmem (deleted)    bec3a2b0  47367c40  /dev/pmem    bec3a2b4  00000001      bec3a2b8  000003c0      bec3a2bc  000003c0      bec3a2c0  000000f0      bec3a2c4  00145a70  [heap]    bec3a2c8  bec3a434  [stack]    bec3a2cc  002ae6b0  [heap]    bec3a2d0  df002777      bec3a2d4  e3a070ad  #01 bec3a2d8  bec3a5e8  [stack]    bec3a2dc  bec3a434  [stack]    bec3a2e0  00000000      bec3a2e4  ab174d90  /system/lib/libskia.so    bec3a2e8  00000140      bec3a2ec  bec3a434  [stack]    bec3a2f0  00000124      bec3a2f4  0000003a      bec3a2f8  00000003      bec3a2fc  00000000      bec3a300  bec3a434  [stack]    bec3a304  00000000      bec3a308  8096c560  /system/lib/libdvm.so    bec3a30c  afa013ad  /system/lib/liblog.so    bec3a310  bec3a734  [stack]    bec3a314  465f4347      bec3a318  4d5f524f      bec3a31c  4f4c4c41[stack trace]signal 11 (SIGSEGV), fault addr 00000000 r0 bec3a434  r1 ab248078  r2 ab248080  r3 ab2494dc r4 bec3a558  r5 bec3a434  r6 002ae6b0  r7 bec3a558 r8 00000000  r9 bec3a5e8  10 bec3a434  fp 00000000 ip 000002dc  sp bec3a2d8  lr ab169da4  pc 00000000Stack Trace:  RELADDR   FUNCTION                             FILE:LINE  00000000  (unknown)                            (unknown)  v------&gt;  ~SkSpriteBlitter                     external/skia/src/core/SkBlitter_Sprite.cpp:29  00069da0  SkSpriteBlitter::~SkSpriteBlitter()  external/skia/src/core/SkBlitter_Sprite.cpp:29Stack Data:  ADDR      VALUE     FILE:LINE/FUNCTION  bec3a298  bec3a434    bec3a29c  000000ff    bec3a2a0  00145a70    bec3a2a4  ab1978d0  external/skia/src/core/SkSpriteBlitter_ARGB32.cpp:313                      SkSpriteBlitter::ChooseD32(SkBitmap const&amp;, SkPaint const&amp;, void*, unsigned int)  bec3a2a8  ab249d8c  external/skia/include/core/SkPixelRef.h:36                      ~SkPixelRef  bec3a2ac  46d9bc40  (unknown)                      (unknown)  bec3a2b0  47367c40  (unknown)                      (unknown)  bec3a2b4  00000001    bec3a2b8  000003c0    bec3a2bc  000003c0    bec3a2c0  000000f0    bec3a2c4  00145a70    bec3a2c8  bec3a434    bec3a2cc  002ae6b0    bec3a2d0  df002777    bec3a2d4  e3a070ad    bec3a2d8  bec3a5e8    bec3a2dc  bec3a434    bec3a2e0  00000000    bec3a2e4  ab174d90  external/skia/src/core/SkDraw.cpp:1093                      SkDraw::drawBitmap(SkBitmap const&amp;, SkMatrix const&amp;, SkPaint const&amp;) const  bec3a2e8  00000140    bec3a2ec  bec3a434    bec3a2f0  00000124    bec3a2f4  0000003a    bec3a2f8  00000003    bec3a2fc  00000000    bec3a300  bec3a434    bec3a304  00000000    bec3a308  8096c560  ??:0                      ??  bec3a30c  afa013ad  system/core/liblog/logd_write.c:209                      __android_log_print  bec3a310  bec3a734    bec3a314  465f4347    bec3a318  4d5f524f    bec3a31c  4f4c4c41</code></pre>","516948","","995926","","2012-05-22 08:01:24","2012-05-22 08:01:24","I got skia native crash when return ~SkSpriteBlitter()","<android><crash><android-ndk><android-2.2-froyo><skia>","1","0","","",""
"4252734","1","4252790","","2010-11-23 04:18:50","0","1066","<p>From my main.java:</p><pre><code>    Cursor c = db.getDue();    String[] columns = new String[] { ""_id"", ""date"" };      int[] to = new int[] { R.id.num, R.id.date };    SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this,            R.layout.lventer, c, columns, to);    ListView lv1 = (ListView)findViewById(R.id.ListView01);    lv1.setAdapter(mAdapter);</code></pre><p>From my database wrapper class:</p><pre><code>    public Cursor getDue() {    //String getdue = ""SELECT * FROM tb1""; // this returns _id+date and displays them in the listview via the cursor adapter, defined above    String getdue = ""SELECT _id, max(date) AS date FROM tb1 GROUP BY _id"";// this only works if I remove the ""date"" bindings defined above, only letting me see the _id, i want to see both _id and date in the lit view.    return db.rawQuery(getdue,null);</code></pre><p>If I use the second select statment then it crashes unless I remove the ""date"" from the cursor adapter/listview bindings, if I do this then It will show the returned _id in the listview, but I want to see both _id and date in the listview.</p><p>I have been told that the second statment might returns a different type for date because of the max function ( I am not very sql literate, yet), but I thought that sqlite was loose with datatypes? Can anybody help, thanks in advance.</p><p>** UPDATE** This is the command that wont work with 2 columns fr the list view:</p><pre><code> SELECT _id, max(date) FROM jobs GROUP BY _id HAVING max(date) &lt; (date-21)</code></pre>","377613","","377613","","2010-11-23 04:40:22","2010-11-23 04:40:22","android sqlite listview cursor problem","<android><database><sqlite>","1","0","","",""
"4252756","1","4253067","","2010-11-23 04:24:22","0","750","<p>I am in a single class, using 2 different methods.</p><p>In one method I have:</p><pre><code>private void detect();    int facesFound = detector.findFaces(bitmap565, faces);</code></pre><p>detector, bitmap565 and faces are all defined in the same method.</p><p>In another method, I would like to call the value of facesFound.</p><p>So:</p><pre><code>private void crop(){if (facesFound &gt; 1){}</code></pre><p>My issue is, I cannot access that integer from the method because it is cast locally.  What is my best way to alter my code to call it?</p><p>Edit: to add method:</p><pre><code>private final View.OnClickListener btnClick = new View.OnClickListener() {        @Override        public void onClick(View v) {            switch (v.getId()) {   case R.id.action_button:        crop();</code></pre><p>So are you saying declare an integer at the top of my class that is defined as getting the integer passed back through my new private int detect() method?</p>","496686","","496686","","2010-11-23 05:42:56","2010-11-23 05:42:56","Calling an integer to a method cast in a private void","<android><methods><integer><call>","1","5","","",""
"4252794","1","4252897","","2010-11-23 04:33:19","11","4827","<p>I have 2 styles defined inside styles.xml. I want to apply it to a textview. How to implement that using style = ""@style/""</p>","504162","","","","","2014-01-15 23:40:09","multiple style values inside a view","<android>","4","0","","",""
"4252907","1","4253820","","2010-11-23 04:57:30","6","7803","<p>How can I execute an action (maybe an Intent) on every specified time (e.g. Every day on 5AM)? It has to stay after device reboots, similar to how cron works.</p><p>I am not sure if I can use <code>AlarmManager</code> for this, or can I?</p>","11238","","","","","2011-09-13 22:58:23","How to set a persistent/regular schedule in Android?","<android><cron><scheduled-tasks><scheduling><scheduler>","2","1","5","",""
"4252949","1","","","2010-11-23 05:04:32","-2","85","<p>so pls give a specific answer.</p>","1474158","","","","","2010-11-23 06:04:38","i am android devloper want to know what is the flow of programm for RSS application need to do for","<android>","2","6","","2010-11-23 17:35:13",""
"4252956","1","4252974","","2010-11-23 05:05:19","1","631","<p>HI,i have extended BaseAdapter, my size of the list is 20,but it is showing only 7 records, after the 7th record it is showing again from 0.</p><p>public class ContactsAdapter extends BaseAdapter {    private List elements;    private Context c;</p><pre><code>public ContactsAdapter(Context c, List&lt;ContactBean&gt; Tweets) {    this.elements = Tweets;    this.c = c; }public int getCount() {    return elements.size(); }public Object getItem(int position) {    System.out.println("":: ::""+position);    System.out.println(""Printing Postions ::""+elements.get(position));    return elements.get(position);  }public long getItemId(int id) {    return id;  }public void Remove(int id) {        notifyDataSetChanged(); }public View getView(int position, View convertView, ViewGroup parent) {    LinearLayout rowLayout;    ContactBean t = elements.get(position);    if (convertView == null) {        rowLayout = (LinearLayout) LayoutInflater.from(c).inflate(                R.layout.list_view, parent, false);        TextView tv_name = (TextView) rowLayout.findViewById(R.id.txt_contacts_name);        tv_name.setText(t.getFirstName());    } else {        rowLayout = (LinearLayout) convertView;    }    return rowLayout;}</code></pre><p>}</p><p>Please help </p>","487604","","","","","2010-11-23 05:09:50","Problem with BaseAdapter","<android><adapter><base>","1","0","1","",""
"4253033","1","4253047","","2010-11-23 05:20:04","0","1349","<p>I know you can set fastScroll for listViews, but currently I would like to use a ListActivity with a simplecursoradapter instead. Is there a way to make such a view fast scroll?</p>","129638","","741249","","2012-05-02 14:22:13","2012-05-02 14:22:13","Enabling fastscroll from a ListActivity with a simplecursoradapter","<android><listactivity><simplecursoradapter><fastscroll>","1","0","","",""
"4253045","1","4253132","","2010-11-23 05:24:26","0","1095","<p>I really only need my scrollview wrapped around 1 of the 3 linear layouts I have in my view flipper, but I try to wrap it around my 3rd child and it gives me the error that ScrollView can only host one direct child.</p><p>Any workarounds?</p><pre><code>    &lt;ViewFlipper&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 android:id=""@+id/ScrollView01""         android:layout_width=""fill_parent""           android:layout_height=""110dp""&gt;  &lt;!--- Stuff ---&gt; &lt;/ScrollView&gt;&lt;/LinearLayout&gt;&lt;/ViewFlipper&gt;</code></pre>","496686","","","","","2010-11-23 05:42:09","What do I do if I have a ViewFlipper and ScrollView only wraps one child?","<android><xml><layout><scrollviewer><viewflipper>","1","0","","",""
"4253051","1","4253489","","2010-11-23 05:26:18","0","757","<p>public class check extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>}void myonclick(View view){    Intent mIntent = new Intent(this,check2.class);     startActivity(mIntent);}</code></pre><p>}</p><p>class check2 extends Activity {</p><pre><code>@Overridepublic 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>}</p><p>hi this is my code when i run this ..and when i click a button it will show error in emulator has (The Application Check has stopped unexpectedly)..please help me out to navigate..im new to android..thank u..</p>","510553","","","","","2010-11-23 07:09:18","Navigation from one screen to another screen not working in android","<android>","2","0","0","",""
"4253070","1","4253093","","2010-11-23 05:29:56","0","88","<p>I posted a detailed question here:</p><p><a href=""http://stackoverflow.com/questions/4252194/need-help-closing-accessing-my-views-in-a-simple-app-included-an-img-of-my-progr"">Need help closing/accessing my views in a simple app (included an img of my program layout)</a></p><p>but I might have been too confusing.</p><p>Basically, I have an app that has a main menu where the user can click a button to open a camera.  The user then snaps a photo and it is displayed on a page.  The user will then click another button that detects faces.  If faces are detected, the user is sent to a final page that shows the cropped face, etc...I give the user the ability to return to the main menu or snap a new photo.</p><p>Let's say a new photo is snapped and the user does it a few more times.  Now I have multiple saved instances of old snapped photos (presented on the layout).  How do I kill the previous instance (the layout from before he decided to snap a new photo)?  So when I try to close the app it doesn't go back to the previous instance (displayed layout of said snapped photo).</p><p>Thanks for any help, I am so confused on this one thing.</p>","496686","","","","","2010-11-23 05:35:35","Having serious trouble trying to close old methods/activities in my app","<android><layout><activity><closing>","1","0","","",""
"4253082","1","4254539","","2010-11-23 05:32:45","1","392","<p>I am implementing XML parsing in android.Can anyone help me out by telling what I must do to implement a SAX parsing method in my application?</p>","493193","","223391","","2010-11-23 16:53:16","2010-11-23 16:53:16","how can I do SAX parsing method in android?","<android><xml>","3","0","1","",""
"4253118","1","4253191","","2010-11-23 05:39:42","14","9556","<p>Here is how my app is laid out:</p><ol><li>onResume() user is prompted to login</li><li>If user logs in, he can continue using the app<strong>3. If the user logs out at any time, I want to prompt login again</strong></li></ol><p>How can I achieve this?</p><p>Here is my MainActivity:</p><pre><code>@Override    protected void onResume(){        super.onResume();        isLoggedIn = prefs.getBoolean(""isLoggedIn"", false);        if(!isLoggedIn){            showLoginActivity();        }    }</code></pre><p>Here is my LoginActivity:</p><pre><code>@Override        protected void onPostExecute(JSONObject json) {            String authorized = ""200"";            String unauthorized = ""401"";            String notfound = ""404"";            String status = new String();            try {                // Get the messages array                JSONObject response = json.getJSONObject(""response"");                status = response.getString(""status"");                if(status.equals(authorized)){                    Toast.makeText(getApplicationContext(), ""You have been logged into the app!"",Toast.LENGTH_SHORT).show();                    prefs.edit().putBoolean(""isLoggedIn"",true);                    setResult(RESULT_OK, getIntent());                    finish();                }                else if (status.equals(unauthorized)){                    Toast.makeText(getApplicationContext(), ""The username and password you provided are incorrect!"",Toast.LENGTH_SHORT).show();                     prefs.edit().putBoolean(""isLoggedIn"",true);                }                else if(status.equals(notfound)){                    Toast.makeText(getApplicationContext(), ""Not found"",Toast.LENGTH_SHORT).show();                     prefs.edit().putBoolean(""isLoggedIn"",true);                }            } catch (JSONException e) {                System.out.println(e);            } catch (NullPointerException e) {                System.out.println(e);            }        }    }</code></pre><p>After the user has successfully logged in:</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {        if (resultCode == RESULT_OK) {            Toast.makeText(getApplicationContext(), ""BOOM SHAKA LAKA!"",Toast.LENGTH_SHORT).show();        }    }</code></pre><p>The problem is, onResume() is called before onActivityResult() so when the user has successfully logged in, my main activity does not get notified because onResume() gets called first.</p><p>Where is the best place to prompt for login?</p>","19875","","844882","","2013-01-02 03:53:09","2013-04-28 16:21:10","Is onResume() called before onActivityResult()?","<java><android><activity><android-lifecycle><activity-lifecycle>","3","0","3","",""
"4253222","1","","","2010-11-23 06:01:25","4","1561","<p>How can I add a radioButton in the main PreferenceScreen in android ? I do not want to add ListPreference for the radio button option. Like CheckBoxPreference ,I want to add radio ButtonPrefernce in PreferenceScreen. Need Help!!!!!!!!!!!!</p><p>Rgds,Praween</p>","292605","","","","","2012-10-19 06:39:09","How to add Radio Button in PreferenceScreen in android?","<android>","2","1","2","",""
"4253233","1","","","2010-11-23 06:04:35","4","14163","<p>When I call a Web Service, it returns me this exception: java.net.SocketException Permission denied. I dont know waht is the actual problem. I don't know how to solve this?</p><p>home.java page :</p><pre><code>     try      {        url = new URL(""http://localhost/TraderLevels/subscriber.php"");             conn = (HttpURLConnection) url.openConnection();             dis = conn.getInputStream();     }     catch (Exception e)      {            e.printStackTrace();     }</code></pre><p>subscriber.php</p><pre><code>$username=""root"";        $password="""";        $database=""mydb"";        $server=""localhost"";$connection = mysql_connect($server,$username,$password); if (!$connection) {   die('Not connected : ' . mysql_error()); } $db_selected = mysql_select_db($database, $connection); if (!$db_selected) {   die('Can\'t use db : ' . mysql_error()); }    $query=""SELECT * from user"";    $result = mysql_query($query);    $dom = new DOMDocument('1.0','UTF-8');    $dnode = $dom-&gt;createElement('usesssrdetails');    $docNode = $dom-&gt;appendChild($dnode);    $result = mysql_query($query);   $rowNo=1;  while ($row = @mysql_fetch_assoc($result)) {  $node = $dom-&gt;createElement('user');  $categoryNode = $docNode-&gt;appendChild($node);  $idNode = $dom-&gt;createElement('userid',($row['userID']));  $categoryNode-&gt;appendChild($idNode);                $idNode = $dom-&gt;createElement('email',($row['email']));  $categoryNode-&gt;appendChild($idNode);  $rowNo=$rowNo+1; } $kmlOutput = $dom-&gt;saveXML(); echo $kmlOutput;?&gt;</code></pre><h3>Update:</h3><p>I solved  the above problem by adding  the below code in the manifest. </p><pre><code>&lt; uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>But I got another exception : java.net.ConnectException: localhost/127.0.0.1:80 - Connection Refused. </p><p>Please tell me how to avoid this problem.</p>","517050","","1288","","2011-06-10 13:16:27","2012-11-21 03:00:11","Exception with web service ( java.net.SocketException Permission denied ) in Android","<android><web-services><socketexception>","4","3","0","",""
"4253239","1","","","2010-11-23 06:05:29","1","922","<p>In my application, I have a service that uses a handler to execute a runnable after a randomized amount of time.  The program works fine - for a few hours.  All of a sudden, the program will throw a nullpointerexception with the following trace:</p><pre><code>java.lang.NullPointerExceptionat com.martin.ontime.OnTimeService$2.run(OnTimeService.java:224)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)</code></pre><p>Additionally, as soon as the app force closes, I can restart the app and the exception won't be thrown for another few hours.  Abbreviated code regarding the handler is as follows:</p><pre><code>public class AppService extends Service{ /**XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX INITIATE ALL THE GLOBAL VARIABLES XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/ //Handler that times the processes private Handler h = new Handler(); /**XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/ /**XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    EXECUTE ALL CREATE FUNCTIONS XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/ @Override public void onCreate(){  super.onCreate();  //Clear all timers  h.removeCallbacks(setTime);  h.removeCallbacks(setAuto);  //Set a timer to start the processes  h.postDelayed(setAuto, 0); } /**XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/     /**XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    EXECUTE THESE FUNCTIONS WHEN SERVICE IS STOPPED XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/      @Override public void onDestroy(){  //Clear all timers  h.removeCallbacks(setTime);  h.removeCallbacks(setAuto); }    /**XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/      /**XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    HANDLER RUNNABLE XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/      //Runnable private Runnable setAuto = new Runnable() {  public void run(){   //Create a random number generator   Random r = new Random();   //Determine a random amount of time until time is changed   long d = r.nextInt(5) * 60 * 1000;   //Wait   h.postDelayed(setTime, d);  } }; //Runnable used to set a random allowance private Runnable setTime = new Runnable() {  public void run(){   try {    //Create a random number generator    Random r = new Random();    //Determine a random amount of time until time is changed    long d = r.nextInt(30) * 60 * 1000 + 1800000;    //Wait    h.postDelayed(setAuto, d);                           ***TRY/CATCH SURROUNDS A DATA OUTPUT STREAM***   }   catch (IOException e){    e.printStackTrace();   }  } };    /**XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/    }</code></pre><p>I have another program that also seems to have this problem in its service.  I only copied the code that concerns the handler and the runnable and is shared by both programs.  I hope this is enough information to sort this problem out.  If anymore information is needed, I'll certainly fill in some blanks.  It would be a great help for these and my future apps!</p>","517013","","","","","2011-07-30 06:10:04","Handler Throwing NullPointerException After Several Hours","<android><service><nullpointerexception><handler><runnable>","1","1","1","",""
"4253249","1","4254248","","2010-11-23 06:08:10","3","1197","<p>Does Android provide a notification of being in vicinity of a new Wifi Network? Whether the device is configured to connect to that wifi network depends on whether the device has the wifi configuration set for that particular wifi network, but is it possible to get notification whenever entering any new wifi network?<br>I saw the WifiManager class but the states inside the class do not seem to achieve what I am trying to do. Any ideas?</p>","452307","","","","","2010-11-23 13:25:24","Android - Get Notified when a new access point is detected?","<android><android-wifi><wifimanager>","1","1","1","",""
"4253267","1","4516853","","2010-11-23 06:12:50","0","6945","<p>I got a message as below:</p><p>ERROR/ActivityManager(80): fail to set top app changed!</p><p>then application crashed, ActivityManager force finishing all pages. The screen black , then the home page re_load slowly.</p><p>My phone : htc g8 wildfire  os2.1</p><p>It maybe related with google map. Because I use GoogleMap in my application. This Question occur when the user use the googleMap frequently.( Bad influence for user)</p><p>Anybody has ideas? Please help me, thanks.</p><p>Not any exception message exists in logcat</p><hr><p>logcat message:</p><p>11-23 15:39:48.916: DEBUG/PhoneWindow(1295): DebugMonitor class=android.app.AlertDialog focus=true11-23 15:39:49.776: DEBUG/PhoneWindow(1295): DebugMonitor class=com.ceosoft.alumlife.activity.finder.AlumniFinderResultMapViewActivity focus=true11-23 15:39:50.796: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.817: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.836: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.846: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.866: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.886: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.896: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.916: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.936: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.956: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.977: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.986: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:50.996: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.016: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.027: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.046: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.066: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.076: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.096: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.116: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.126: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.146: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.166: ERROR/libagl(87): uses alphaPlaneWorkaround11-23 15:39:51.526: DEBUG/LocationMasfClient(87): getNetworkLocation(): Returning cache location with accuracy 75.011-23 15:39:52.076: DEBUG/LocationManagerService(87): Acquired wakelock11-23 15:39:52.116: DEBUG/LocationManagerService(87): Released wakelock11-23 15:39:53.076: DEBUG/dalvikvm(547): GC freed 7842 objects / 523016 bytes in 273ms11-23 15:39:53.457: WARN/dalvikvm(87): disableGcForExternalAlloc: true11-23 15:39:53.466: INFO/ActivityManager(87): Starting activity: Intent { cmp=com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity }11-23 15:39:53.516: DEBUG/Sensors(87): open_akm, fd=15311-23 15:39:53.536: DEBUG/AK8973(67): Compass Start11-23 15:39:53.566: WARN/dalvikvm(87): disableGcForExternalAlloc: false11-23 15:39:53.576: DEBUG/Sensors(87): close_akm, fd=15311-23 15:39:53.606: DEBUG/PhoneWindow(1295): DebugMonitor class=com.ceosoft.alumlife.activity.finder.AlumniFinderResultMapViewActivity focus=false11-23 15:39:53.676: DEBUG/PhoneWindow(1295): DebugMonitor class=com.ceosoft.alumlife.activity.finder.AlumniFinderActivity focus=true11-23 15:39:53.916: DEBUG/FriendStreamWidgetView(856): onLayoutRemovedOrActivityDestroy11-23 15:39:53.916: INFO/ActivityManager(87): Displayed activity com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity: 416 ms (total 416 ms)11-23 15:39:54.016: DEBUG/dalvikvm(856): threadid=21 wakeup: interrupted11-23 15:39:54.046: DEBUG/AK8973(67): Compass CLOSE 11-23 15:39:54.057: INFO/Process(856): Sending signal. PID: 856 SIG: 911-23 15:39:54.076: INFO/WindowManager(87): WIN DEATH: Window{44dc6098 com.htc.launcher/com.htc.launcher.Launcher paused=false}11-23 15:39:54.086: INFO/ActivityManager(87): Process com.htc.launcher (pid 856) has died.11-23 15:39:54.116: DEBUG/NewsService(934): onDestroy11-23 15:39:54.116: DEBUG/StockScheduler(206): exit()11-23 15:39:54.136: DEBUG/MediaPlaybackService(532): MediaPlayback is onUnbind: null ref count: 011-23 15:39:54.136: ERROR/MediaPlaybackService(532): BadQueue mPlayListLen : 0 mAlbumListLen : 0 mShrinkAlbumListLen : 011-23 15:39:54.146: DEBUG/MediaPlaybackService(532): saveQueue mPlayListLen : 011-23 15:39:54.146: DEBUG/MediaPlaybackService(532): saveQueue mAlbumListLen : 011-23 15:39:54.146: DEBUG/MediaPlaybackService(532): saveQueue mShrinkAlbumListLen : 011-23 15:39:54.176: DEBUG/MediaPlaybackService(532): onUnbind finished11-23 15:39:54.186: DEBUG/MediaPlaybackService(532): !!!! @@@@@@@@ onDestroy11-23 15:39:54.196: DEBUG/JOGBALL(87): Jogball, + set_jogball_mode mode=011-23 15:39:54.196: VERBOSE/HtcLockScreen(87): get INTENT_ACTION_NOTIFICATION_REMOVE, stop music11-23 15:39:54.206: DEBUG/MediaPlayer(532): unregisterHDMINotification11-23 15:39:54.216: ERROR/MusicPluginManager(532): resetMusicPluginManager called!!11-23 15:39:54.216: DEBUG/MediaPlaybackService(532): onDestroy finished11-23 15:39:55.296: WARN/dalvikvm(87): disableGcForExternalAlloc: true11-23 15:39:55.296: INFO/ActivityManager(87): Starting activity: Intent { cmp=com.ceosoft.alumlife/.activity.finder.AlumniFinderByLocationActivity }11-23 15:39:55.326: DEBUG/Sensors(87): open_akm, fd=14911-23 15:39:55.336: DEBUG/AK8973(67): Compass Start11-23 15:39:55.356: WARN/dalvikvm(87): disableGcForExternalAlloc: false11-23 15:39:55.387: DEBUG/Sensors(87): close_akm, fd=14911-23 15:39:55.426: DEBUG/PhoneWindow(1295): DebugMonitor class=com.ceosoft.alumlife.activity.finder.AlumniFinderActivity focus=false11-23 15:39:55.546: DEBUG/PhoneWindow(1295): DebugMonitor class=com.ceosoft.alumlife.activity.finder.AlumniFinderByLocationActivity focus=true11-23 15:39:55.706: INFO/ActivityManager(87): Displayed activity com.ceosoft.alumlife/.activity.finder.AlumniFinderByLocationActivity: 396 ms (total 396 ms)11-23 15:39:55.906: DEBUG/NetworkLocationProvider(87): setMinTime: 200011-23 15:39:55.916: DEBUG/WifiService(87): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@447f3bd8}11-23 15:39:55.916: DEBUG/WifiService(87): enable and start wifi due to updateWifiState11-23 15:39:55.967: DEBUG/AK8973(67): Compass CLOSE 11-23 15:39:57.596: DEBUG/WifiService(87): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@447f3bd8}11-23 15:39:57.596: DEBUG/WifiService(87): enable and start wifi due to updateWifiState11-23 15:39:57.606: DEBUG/NetworkLocationProvider(87): getLocation(): triggering a wifi scan11-23 15:39:57.606: ERROR/wpa_supplicant(190): wpa_supplicant_ctrl_iface_ap_scan: 211-23 15:39:57.606: ERROR/wpa_supplicant(190): Scan request11-23 15:39:57.656: DEBUG/NetworkLocationProvider(87): onCellLocationChanged [21124,18941]11-23 15:39:57.796: DEBUG/PhoneWindow(1295): DebugMonitor class=android.app.AlertDialog focus=true11-23 15:39:57.896: DEBUG/PhoneWindow(1295): DebugMonitor class=com.ceosoft.alumlife.activity.finder.AlumniFinderByLocationActivity focus=false11-23 15:39:58.576: INFO/wpa_supplicant(190): CTRL-EVENT-SCAN-RESULTS  Ready11-23 15:39:58.586: INFO/wpa_supplicant(190): - wpa_supplicant_event_scan_results RETURN (ap_scan = 2)-11-23 15:39:58.586: ERROR/wpa_supplicant(190): wpa_supplicant_ctrl_iface_ap_scan: 111-23 15:39:58.626: DEBUG/NetworkLocationProvider(87): updateWifIScanResults(): 9 APs11-23 15:39:58.656: DEBUG/LocationMasfClient(87): getNetworkLocation(): Returning cache location with accuracy 75.011-23 15:39:58.826: DEBUG/PhoneWindow(1295): DebugMonitor class=com.ceosoft.alumlife.activity.finder.AlumniFinderByLocationActivity focus=true11-23 15:39:58.876: WARN/InputManagerService(87): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4482ab9011-23 15:39:58.936: DEBUG/LocationManagerService(87): Acquired wakelock11-23 15:39:58.957: DEBUG/LocationManagerService(87): Released wakelock11-23 15:39:59.216: DEBUG/dalvikvm(547): GC freed 7514 objects / 523712 bytes in 102ms11-23 15:39:59.547: WARN/dalvikvm(87): disableGcForExternalAlloc: true11-23 15:39:59.556: INFO/ActivityManager(87): Starting activity: Intent { cmp=com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity }11-23 15:39:59.576: DEBUG/Sensors(87): open_akm, fd=14811-23 15:39:59.596: DEBUG/AK8973(67): Compass Start11-23 15:39:59.606: WARN/dalvikvm(87): disableGcForExternalAlloc: false11-23 15:39:59.637: DEBUG/Sensors(87): close_akm, fd=14811-23 15:39:59.666: DEBUG/PhoneWindow(1295): DebugMonitor class=com.ceosoft.alumlife.activity.finder.AlumniFinderByLocationActivity focus=false11-23 15:39:59.756: DEBUG/PhoneWindow(1295): DebugMonitor class=com.ceosoft.alumlife.activity.finder.AlumniFinderActivity focus=true11-23 15:40:00.026: INFO/ActivityManager(87): Displayed activity com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity: 461 ms (total 461 ms)11-23 15:40:00.046: DEBUG/ActivityManager(87): Uninstalling process com.ceosoft.alumlife11-23 15:40:00.046: DEBUG/ActivityManager(87): Force removing process ProcessRecord{44985ae0 1295:com.ceosoft.alumlife/10056} (com.ceosoft.alumlife/10056)11-23 15:40:00.066: INFO/Process(87): Sending signal. PID: 1295 SIG: 911-23 15:40:00.077: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderByLocationActivity11-23 15:40:00.077: WARN/ActivityManager(87): Activity HistoryRecord{44c64238 com.ceosoft.alumlife/.activity.finder.AlumniFinderByLocationActivity} being finished, but not in LRU list11-23 15:40:00.086: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity11-23 15:40:00.086: WARN/ActivityManager(87): Activity HistoryRecord{44929e30 com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity} being finished, but not in LRU list11-23 15:40:00.086: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderResultMapViewActivity11-23 15:40:00.096: DEBUG/AK8973(67): Compass CLOSE 11-23 15:40:00.096: WARN/ActivityManager(87): Activity HistoryRecord{44efd9f8 com.ceosoft.alumlife/.activity.finder.AlumniFinderResultMapViewActivity} being finished, but not in LRU list11-23 15:40:00.096: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderResultActivity11-23 15:40:00.107: WARN/ActivityManager(87): Activity HistoryRecord{44e60180 com.ceosoft.alumlife/.activity.finder.AlumniFinderResultActivity} being finished, but not in LRU list11-23 15:40:00.107: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity11-23 15:40:00.107: WARN/ActivityManager(87): Activity HistoryRecord{44ddbe20 com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity} being finished, but not in LRU list11-23 15:40:00.116: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderByLastNameActivity11-23 15:40:00.116: INFO/WindowManager(87): WIN DEATH: Window{448c7380 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultActivity paused=false}11-23 15:40:00.127: DEBUG/NetworkLocationProvider(87): removeListener(): settings11-23 15:40:00.136: DEBUG/NetworkLocationProvider(87): removeListener(): server.checkin11-23 15:40:00.136: INFO/WindowManager(87): WIN DEATH: Window{44c230b0 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderActivity paused=false}11-23 15:40:00.136: INFO/WindowManager(87): WIN DEATH: Window{44b81008 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.WelcomePhotoActivity paused=false}11-23 15:40:00.136: INFO/WindowManager(87): WIN DEATH: Window{44c93400 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.LoginActivity paused=false}11-23 15:40:00.146: INFO/WindowManager(87): WIN DEATH: Window{44dc52a0 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultActivity paused=false}11-23 15:40:00.146: INFO/WindowManager(87): WIN DEATH: Window{44ae2800 Loading paused=false}11-23 15:40:00.146: INFO/WindowManager(87): WIN DEATH: Window{44bd5c08 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.MainActivity paused=false}11-23 15:40:00.156: INFO/WindowManager(87): WIN DEATH: Window{44eaa0d0 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderActivity paused=false}11-23 15:40:00.156: INFO/WindowManager(87): WIN DEATH: Window{44d1c2d0 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultActivity paused=true}11-23 15:40:00.156: INFO/WindowManager(87): WIN DEATH: Window{44baa668 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.MainActivity paused=false}11-23 15:40:00.166: INFO/WindowManager(87): WIN DEATH: Window{44c79b50 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderActivity paused=true}11-23 15:40:00.166: INFO/WindowManager(87): WIN DEATH: Window{44cb0268 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultActivity paused=false}11-23 15:40:00.166: INFO/WindowManager(87): WIN DEATH: Window{44c4eec0 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultMapViewActivity paused=false}11-23 15:40:00.176: INFO/WindowManager(87): WIN DEATH: Window{448db420 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultActivity paused=false}11-23 15:40:00.186: DEBUG/NetworkLocationProvider(87): removeListener(): providers.settings11-23 15:40:00.197: INFO/WindowManager(87): WIN DEATH: Window{44db2478 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderActivity paused=false}11-23 15:40:00.197: INFO/WindowManager(87): WIN DEATH: Window{44ecdc68 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultActivity paused=false}11-23 15:40:00.197: INFO/WindowManager(87): WIN DEATH: Window{448bc038 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultActivity paused=false}11-23 15:40:00.206: INFO/WindowManager(87): WIN DEATH: Window{44ce0d40 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderByLastNameActivity paused=false}11-23 15:40:00.206: INFO/WindowManager(87): WIN DEATH: Window{44b990d8 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultMapViewActivity paused=true}11-23 15:40:00.206: INFO/WindowManager(87): WIN DEATH: Window{44ed0fd0 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultActivity paused=false}11-23 15:40:00.216: INFO/WindowManager(87): WIN DEATH: Window{44ed1630 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultActivity paused=false}11-23 15:40:00.216: INFO/WindowManager(87): WIN DEATH: Window{44d09548 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderActivity paused=false}11-23 15:40:00.216: INFO/WindowManager(87): WIN DEATH: Window{44c03570 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultMapViewActivity paused=false}11-23 15:40:00.227: INFO/WindowManager(87): WIN DEATH: Window{44cf6370 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderByLocationActivity paused=true}11-23 15:40:00.227: WARN/ActivityManager(87): Activity HistoryRecord{44d405f0 com.ceosoft.alumlife/.activity.finder.AlumniFinderByLastNameActivity} being finished, but not in LRU list11-23 15:40:00.236: INFO/WindowManager(87): WIN DEATH: Window{44caf158 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderActivity paused=true}11-23 15:40:00.236: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity11-23 15:40:00.246: DEBUG/NetworkLocationProvider(87): removeListener(): server.vpn11-23 15:40:00.256: INFO/WindowManager(87): WIN DEATH: Window{448c6f38 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultMapViewActivity paused=false}11-23 15:40:00.256: INFO/WindowManager(87): WIN DEATH: Window{448cb150 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultMapViewActivity paused=false}11-23 15:40:00.266: INFO/WindowManager(87): WIN DEATH: Window{44c537c8 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderByLastNameActivity paused=true}11-23 15:40:00.266: INFO/WindowManager(87): WIN DEATH: Window{44c2ef18 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderResultMapViewActivity paused=false}11-23 15:40:00.266: INFO/WindowManager(87): WIN DEATH: Window{44d907e8 com.ceosoft.alumlife/com.ceosoft.alumlife.activity.finder.AlumniFinderActivity paused=false}11-23 15:40:00.286: WARN/ActivityManager(87): Activity HistoryRecord{44c97590 com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity} being finished, but not in LRU list11-23 15:40:00.286: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderResultMapViewActivity11-23 15:40:00.286: WARN/ActivityManager(87): Activity HistoryRecord{44cd2cd0 com.ceosoft.alumlife/.activity.finder.AlumniFinderResultMapViewActivity} being finished, but not in LRU list11-23 15:40:00.286: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderResultActivity11-23 15:40:00.286: WARN/ActivityManager(87): Activity HistoryRecord{44ecc5d0 com.ceosoft.alumlife/.activity.finder.AlumniFinderResultActivity} being finished, but not in LRU list11-23 15:40:00.286: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity11-23 15:40:00.286: WARN/ActivityManager(87): Activity HistoryRecord{44d085b8 com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity} being finished, but not in LRU list11-23 15:40:00.286: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderByLastNameActivity11-23 15:40:00.286: WARN/ActivityManager(87): Activity HistoryRecord{44db60e8 com.ceosoft.alumlife/.activity.finder.AlumniFinderByLastNameActivity} being finished, but not in LRU list11-23 15:40:00.286: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity11-23 15:40:00.286: WARN/ActivityManager(87): Activity HistoryRecord{44decc00 com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity} being finished, but not in LRU list11-23 15:40:00.286: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderResultActivity11-23 15:40:00.286: WARN/ActivityManager(87): Activity HistoryRecord{44e53b08 com.ceosoft.alumlife/.activity.finder.AlumniFinderResultActivity} being finished, but not in LRU list11-23 15:40:00.296: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.wdm11-23 15:40:00.296: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.settings.accountsync11-23 15:40:00.306: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.android.htcsetupwizard11-23 15:40:00.306: DEBUG/NetworkLocationProvider(87): removeListener(): com.broadcom.bt.app.system11-23 15:40:00.306: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderResultMapViewActivity11-23 15:40:00.316: DEBUG/NetworkLocationProvider(87): removeListener(): android11-23 15:40:00.316: WARN/ActivityManager(87): Activity HistoryRecord{44d4ce40 com.ceosoft.alumlife/.activity.finder.AlumniFinderResultMapViewActivity} being finished, but not in LRU list11-23 15:40:00.316: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderResultActivity11-23 15:40:00.326: WARN/ActivityManager(87): Activity HistoryRecord{44b0d9a8 com.ceosoft.alumlife/.activity.finder.AlumniFinderResultActivity} being finished, but not in LRU list11-23 15:40:00.326: DEBUG/NetworkLocationProvider(87): removeListener(): providers.subscribedfeeds11-23 15:40:00.326: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity11-23 15:40:00.326: DEBUG/NetworkLocationProvider(87): removeListener(): location11-23 15:40:00.336: DEBUG/NetworkLocationProvider(87): removeListener(): providers.htcCheckin11-23 15:40:00.336: WARN/ActivityManager(87): Activity HistoryRecord{448e68e8 com.ceosoft.alumlife/.activity.finder.AlumniFinderActivity} being finished, but not in LRU list11-23 15:40:00.336: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.MainActivity11-23 15:40:00.336: WARN/ActivityManager(87): Activity HistoryRecord{44d7c800 com.ceosoft.alumlife/.activity.MainActivity} being finished, but not in LRU list11-23 15:40:00.346: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.MainActivity11-23 15:40:00.346: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.AddProgramWidget11-23 15:40:00.346: WARN/ActivityManager(87): Activity HistoryRecord{44c5f7e8 com.ceosoft.alumlife/.activity.MainActivity} being finished, but not in LRU list11-23 15:40:00.356: DEBUG/NetworkLocationProvider(87): removeListener(): CSDFunctionG11-23 15:40:00.356: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.WelcomePhotoActivity11-23 15:40:00.356: WARN/ActivityManager(87): Activity HistoryRecord{44f2ae88 com.ceosoft.alumlife/.activity.WelcomePhotoActivity} being finished, but not in LRU list11-23 15:40:00.356: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.LoginActivity11-23 15:40:00.366: DEBUG/NetworkLocationProvider(87): removeListener(): providers.subscribedfeeds11-23 15:40:00.386: DEBUG/NetworkLocationProvider(87): setMinTime: 200011-23 15:40:00.396: DEBUG/NetworkLocationProvider(87): removeListener(): settings11-23 15:40:00.396: DEBUG/NetworkLocationProvider(87): removeListener(): server.checkin11-23 15:40:00.407: DEBUG/NetworkLocationProvider(87): removeListener(): providers.settings11-23 15:40:00.417: DEBUG/NetworkLocationProvider(87): removeListener(): server.vpn11-23 15:40:00.426: DEBUG/Sensors(87): open_akm, fd=12211-23 15:40:00.436: INFO/ActivityManager(87): Start proc com.ceosoft.alumlife for activity com.ceosoft.alumlife/.activity.EntryActivity: pid=1413 uid=10056 gids={3003, 1015}11-23 15:40:00.436: DEBUG/ActivityManager(87):   Force finishing activity com.ceosoft.alumlife/.activity.EntryActivity11-23 15:40:00.446: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.wdm11-23 15:40:00.457: DEBUG/AK8973(67): Compass Start11-23 15:40:00.486: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.settings.accountsync11-23 15:40:00.496: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.android.htcsetupwizard11-23 15:40:00.506: DEBUG/NetworkLocationProvider(87): removeListener(): com.broadcom.bt.app.system11-23 15:40:00.516: DEBUG/NetworkLocationProvider(87): removeListener(): android11-23 15:40:00.527: DEBUG/NetworkLocationProvider(87): removeListener(): providers.subscribedfeeds11-23 15:40:00.527: INFO/ActivityManager(87): Start proc com.htc.launcher for activity com.htc.launcher/.Launcher: pid=1418 uid=9999 gids={3003, 1015, 3002, 3001}11-23 15:40:00.536: ERROR/ActivityManager(87): fail to set top app changed!11-23 15:40:00.546: DEBUG/dalvikvm(1418): Rosie launcher will have a 32MB heap11-23 15:40:00.546: DEBUG/NetworkLocationProvider(87): removeListener(): location11-23 15:40:00.576: DEBUG/NetworkLocationProvider(87): removeListener(): providers.htcCheckin11-23 15:40:00.576: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.AddProgramWidget11-23 15:40:00.586: DEBUG/NetworkLocationProvider(87): removeListener(): CSDFunctionG11-23 15:40:00.586: DEBUG/ActivityManager(87): Received spurious death notification for thread android.os.BinderProxy@44edaa7011-23 15:40:00.586: WARN/ActivityManager(87): Activity HistoryRecord{44bd9ea0 com.ceosoft.alumlife/.activity.LoginActivity} being finished, but not in LRU list11-23 15:40:00.596: WARN/ActivityManager(87): Activity HistoryRecord{448b9da8 com.ceosoft.alumlife/.activity.EntryActivity} being finished, but not in LRU list11-23 15:40:00.626: DEBUG/NetworkLocationProvider(87): removeListener(): providers.subscribedfeeds11-23 15:40:00.636: DEBUG/NetworkLocationProvider(87): setMinTime: 200011-23 15:40:00.636: DEBUG/NetworkLocationProvider(87): removeListener(): settings11-23 15:40:00.647: DEBUG/NetworkLocationProvider(87): removeListener(): server.checkin11-23 15:40:00.666: DEBUG/NetworkLocationProvider(87): removeListener(): providers.settings11-23 15:40:00.666: DEBUG/NetworkLocationProvider(87): removeListener(): server.vpn11-23 15:40:00.666: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.wdm11-23 15:40:00.686: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.settings.accountsync11-23 15:40:00.716: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.android.htcsetupwizard11-23 15:40:00.716: DEBUG/NetworkLocationProvider(87): removeListener(): com.broadcom.bt.app.system11-23 15:40:00.716: DEBUG/NetworkLocationProvider(87): removeListener(): android11-23 15:40:00.736: DEBUG/NetworkLocationProvider(87): removeListener(): providers.subscribedfeeds11-23 15:40:00.746: DEBUG/NetworkLocationProvider(87): removeListener(): location11-23 15:40:00.776: DEBUG/NetworkLocationProvider(87): removeListener(): providers.htcCheckin11-23 15:40:00.776: DEBUG/NetworkLocationProvider(87): removeListener(): com.htc.AddProgramWidget11-23 15:40:00.786: DEBUG/NetworkLocationProvider(87): removeListener(): CSDFunctionG11-23 15:40:00.816: DEBUG/NetworkLocationProvider(87): removeListener(): providers.subscribedfeeds11-23 15:40:00.816: DEBUG/NetworkLocationProvider(87): setMinTime: 54000011-23 15:40:00.986: INFO/dalvikvm(1413): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=38)11-23 15:40:01.056: INFO/dalvikvm(1418): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=38)11-23 15:40:01.076: INFO/dalvikvm(1413): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=44)11-23 15:40:01.097: DEBUG/Sensors(87): close_akm, fd=12211-23 15:40:01.136: INFO/UsageStats(87): Unexpected resume of com.htc.launcher while already resumed in com.ceosoft.alumlife11-23 15:40:01.146: WARN/dalvikvm(87): disableGcForExternalAlloc: false11-23 15:40:01.157: INFO/dalvikvm(1418): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=36)11-23 15:40:01.196: WARN/dalvikvm(1418): Refusing to reopen boot DEX '/system/framework/com.htc.framework.jar'11-23 15:40:01.266: INFO/ActivityThread(1418): Publishing provider com.htc.launcher.settings: com.htc.launcher.LauncherProvider11-23 15:40:01.496: DEBUG/AK8973(67): Compass CLOSE 11-23 15:40:01.516: WARN/SettingUtil(1418): loadSettings(), cursor == null, content provider is not exist11-23 15:40:01.886: DEBUG/dalvikvm(1418): GC freed 2766 objects / 235752 bytes in 103ms11-23 15:40:02.586: DEBUG/WifiService(87): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@447f3bd8}11-23 15:40:02.586: DEBUG/WifiService(87): enable and start wifi due to updateWifiState11-23 15:40:02.666: DEBUG/dalvikvm(1418): GC freed 1319 objects / 97424 bytes in 163ms11-23 15:40:02.866: DEBUG/NetworkLocationProvider(87): setMinTime: 54000011-23 15:40:02.897: DEBUG/WifiService(87): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@447f3bd8}11-23 15:40:02.916: DEBUG/NetworkLocationProvider(87): onCellLocationChanged [21124,18941]11-23 15:40:02.936: DEBUG/WifiService(87): enable and start wifi due to updateWifiState11-23 15:40:03.096: DEBUG/HomeLoaders(1418): load applications11-23 15:40:03.116: DEBUG/HomeLoaders(1418): loading user items11-23 15:40:03.116: DEBUG/HomeLoaders(1418):   --> starting workspace loader11-23 15:40:03.116: DEBUG/RosieDbDebug(1418): startLoaders(false)11-23 15:40:03.146: INFO/HtcLockScreen(87): get INTENT_ACTION_WALLPAPER_CHANGED11-23 15:40:03.386: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.396: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.416: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.436: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.466: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.486: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.496: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.516: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.526: DEBUG/PhoneWindow(1418): DebugMonitor class=android.app.ProgressDialog focus=true11-23 15:40:03.546: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.566: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.566: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.586: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F11-23 15:40:03.596: DEBUG/dalvikvm(1418): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F</p>","517055","","517055","","2010-11-23 07:43:33","2011-05-18 15:38:01","android window death and application crash","<android>","1","3","","",""
"4253289","1","4253447","","2010-11-23 06:17:01","0","956","<p>I have a private onClickListener class with a switch statement for everybutton</p><p>Some buttons, like returning to my main menu, allow me to have an Intent, because the main menu is called in the defining of the class in the onCreate() like so:</p><pre><code>//return to main menucase R.id.return_main:                Intent intent = new Intent(main.this, main.class);                startActivity(intent);                finish();</code></pre><p>But how do I create an activity (on a button call) when I want to access a method that is also within the class I am in?</p><p>I can't do:</p><pre><code>case R.id.snap_another:Intent intentCam = new Intent(main.openCamera(), main.class);  startActivity(intentCam); finish();  </code></pre><p>Basically, I need to be able to kill the last layout the user was shown when he called openCamera() the first time.  Can I finish(); methods in a case or do I have to somehow make this an intent?</p>","496686","","","","","2010-11-23 06:47:47","Can I call a method on a button click via an intent?","<android><layout><activity><android-intent><close>","1","0","","",""
"4253328","1","4253393","","2010-11-23 06:23:18","45","25196","<p>I've found the <code>R.string</code> pretty awesome for keeping hardcoded strings out of my code, and I'd like to keep using it in a utility class that works with models in my application to generate output. For instance, in this case I am generating an email from a model outside of the activity. </p><p><strong>Is it possible to use <code>getString</code> outside a <code>Context</code> or <code>Activity</code></strong>? I suppose I could pass in the current activity, but it seems unnecessary. Please correct me if I'm wrong!</p><p>Edit: Can we access the resources <em>without</em> using <code>Context</code>?</p>","210920","","1542891","","2014-02-28 11:24:54","2014-02-28 11:28:10","getString Outside of a Context or Activity","<java><android><string><android-resources><android-context>","4","0","16","",""
"4253414","1","4643043","","2010-11-23 06:40:54","0","543","<p>11-17 15:04:15.477: ERROR/AndroidRuntime(3411): <strong><em>Uncaught handler: thread main exiting due to uncaught exception</em></strong>11-17 15:04:15.507: ERROR/AndroidRuntime(3411): <strong><em>com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceException:</em></strong> <em><strong>oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed:</em></strong> htts:///api.linkedin.com/uas/oauth/requestToken11-17 15:04:15.507: ERROR/AndroidRuntime(3411): at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:146)11-17 15:04:15.507: ERROR/AndroidRuntime(3411): at com.ceosoft.alumlife.util.LinkedInAuthenticateHelper.getRequestToken(LinkedInAuthenticateHelper.java:66)11-17 15:04:15.507: ERROR/AndroidRuntime(3411): at com.ceosoft.alumlife.util.LinkedInAuthenticateHelper.authenticateApp(LinkedInAuthenticateHelper.java:53)11-17 15:04:15.507: ERROR/AndroidRuntime(3411): at .........11-17 15:04:15.507: ERROR/AndroidRuntime(3411): <strong><em>Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: htts:///api.linkedin.com/uas/oauth/requestToken</em></strong>11-17 15:04:15.507: ERROR/AndroidRuntime(3411): at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)11-17 15:04:15.507: ERROR/AndroidRuntime(3411): at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)11-17 15:04:15.507: ERROR/AndroidRuntime(3411): at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:138)11-17 15:04:15.507: ERROR/AndroidRuntime(3411): ... 25 more11-17 15:04:15.507: ERROR/AndroidRuntime(3411): <strong><em>Caused by: java.io.FileNotFoundException: https:/.//api.linkedin.com/uas/oauth/requestToken</em></strong>11-17 15:04:15.507: ERROR/AndroidRuntime(3411): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.........</p><p><em><strong>My code as follows:</em></strong>private LinkedInRequestToken getRequestToken() {</p><p>Log.d(TAG, ""API_KEY = "" + OAUTH_CONSUMER_KEY);   Log.d(TAG, ""SECRET_KEY = "" + OAUTH_CONSUMER_SECRET );</p><p>mOauthService = LinkedInOAuthServiceFactory.getInstance().createLinkedInOAuthService(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET);   Log.d(TAG, ""mOauthService = LinkedInOAuthServiceFactory.getInstance()"");   requestToken = mOauthService.getOAuthRequestToken(CALLBACK_URL); //this line occur error   Log.d(TAG, ""LinkedInRequestToken requestToken = mOauthService"");   return requestToken;</p><p>}</p><hr><p>I don't have power put more than one hyperlink  at here.So I'm sorry!</p><p>Note:   ""htts"" it means https<br>        ""///"" is ""//""</p>","517055","","517055","","2010-11-23 07:54:44","2012-06-19 13:22:25","My phone (htc g8 wildfire os2.1) not support LinkedIn","<android><linkedin>","3","2","","",""
"4253462","1","4254544","","2010-11-23 06:51:22","0","247","<p>I am using a <code>ScheduledThreadPoolExecutor</code> and when I have multiple scheduled threads running I am getting <code>threadid=xx: bogus mon 1+0&gt;0; adjusting</code> in LogCat.</p><p>Can anyone shed any light on what this means, is it bad and if so how do I stop it?Thanks.</p>","436166","","","","","2010-11-23 09:32:52","What does threadid bogus mon mean?","<android>","1","0","1","",""
"4253519","1","4254055","","2010-11-23 06:59:40","2","4749","<p>hai how set video in full screen now i am attach my screen shot....</p><p><img src=""http://i.stack.imgur.com/MGGT6.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/ZJbsQ.png"" alt=""alt text""></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""videothumb.videothumb""  android:versionCode=""1""  android:versionName=""1.0""&gt; &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".videothumb"" 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=""ViewVideo"" android:label=""@string/app_name""          android:theme=""@android:style/Theme.Black.NoTitleBar.Fullscreen""&gt;   &lt;intent-filter&gt;&lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;   &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;   &lt;/intent-filter&gt;   &lt;/activity&gt;   &lt;/application&gt;   &lt;uses-sdk android:minSdkVersion=""8"" /&gt;   &lt;uses-permission android:name=""android.permission.MOUNT_UNMOUNT_FILESYSTEMS""&gt;   &lt;/uses-permission&gt;   &lt;/manifest&gt; </code></pre><p>ViewVideo.java</p><pre><code>package videothumb.videothumb;import android.app.Activity;import android.content.Intent;import android.media.MediaPlayer;import android.os.Bundle;import android.view.SurfaceView;import android.view.View;import android.view.Window;import android.view.WindowManager;import android.view.View.OnClickListener;import android.widget.GridView;import android.widget.MediaController;import android.widget.VideoView;public class ViewVideo extends Activity {  private String filename;  private VideoView Video;  @Override  public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,            WindowManager.LayoutParams.FLAG_FULLSCREEN);        setContentView(R.layout.main1);        Video=(VideoView)findViewById(R.id.VideoView01);        System.gc();        Intent i = getIntent();        Bundle extras = i.getExtras();        filename = extras.getString(""videofilename"");        Video.setVideoPath(filename);        Video.setMediaController(new MediaController(this));        Video.requestFocus();        Video.start();    }  } `</code></pre><p>xml coding:</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;VideoView android:id=""@+id/VideoView01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;/VideoView&gt;&lt;/LinearLayout&gt;</code></pre>","486554","","486554","","2010-11-23 10:32:05","2012-12-19 13:03:40","how to set video in full screen","<java><android><video>","4","2","","",""
"4253569","1","4253599","","2010-11-23 07:06:52","5","4999","<p>I implement a project which contain a activity group mainActivity.This main activity contains 3 other activity groups.</p><p>When I try to start myaccountactivity which is an activitygroup, it works for api more than 1.6 but if i tried to run it on 1.6 i get following wrror</p><pre><code>11-23 12:22:15.005: ERROR/AndroidRuntime(412): java.lang.VerifyError: com.myproject.android.MyAccountActivity11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at java.lang.Class.newInstanceImpl(Native Method)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at java.lang.Class.newInstance(Class.java:1472)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.Instrumentation.newActivity(Instrumentation.java:1097)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:2242)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at com.myproject.android.myproject.showMyAccountAtivity(myproject.java:396)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at com.myproject.android.myproject.onActivityResult(myproject.java:456)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.Activity.dispatchActivityResult(Activity.java:3625)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.ActivityGroup.dispatchActivityResult(ActivityGroup.java:123)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3220)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3266)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.ActivityThread.access$2600(ActivityThread.java:116)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.os.Handler.dispatchMessage(Handler.java:99)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.os.Looper.loop(Looper.java:123)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at android.app.ActivityThread.main(ActivityThread.java:4203)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at java.lang.reflect.Method.invokeNative(Native Method)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at java.lang.reflect.Method.invoke(Method.java:521)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)11-23 12:22:15.005: ERROR/AndroidRuntime(412):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I tried to fins out solution but no use. Please if anyody knows how to solve or knows reason why it is coming let me know.. </p><p>Thanks</p>","289597","","345717","","2010-11-23 07:10:25","2010-11-23 07:39:52","android java.lang.VerifyError on startactivity in 1.6","<android>","1","0","2","",""
"4253628","1","","","2010-11-23 07:15:36","0","593","<p>I've found some tutorial teaching me how to upload a file to my server through PHP and html form.</p><p>Even throught I always fail in all of these tutorial :(... I still assume these tutorial is correct.</p><p>Most of these tutorial tall me that we can make metatdata form in PHP in our server, and use HttpURLConnection class in android.</p><p>But I can't figure our how these tutorial automatically push the ""submit"" as what we usually do in browser @@""</p><p>Most these tutorial like this:</p><pre><code>  URL url =new URL(actionUrl);  HttpURLConnection con=(HttpURLConnection)url.openConnection();  con.setDoInput(true);  con.setDoOutput(true);  con.setUseCaches(false);  con.setRequestMethod(""POST"");  con.setRequestProperty(""Connection"", ""Keep-Alive"");  con.setRequestProperty(""Charset"", ""UTF-8"");  con.setRequestProperty(""Content-Type"",                     ""multipart/form-data;boundary=""+boundary);  //omit some code that start to output the file stream to url connection stream  ds.writeBytes(end);  ds.writeBytes(twoHyphens + boundary + twoHyphens + end);  //omit some code theat start read url connection response stream</code></pre><p>(I am sorry that i omit some lines of minor code here, but the tutorial result tell us that after we use these connection setup to PHP form, we can get the response from another PHP action page that stroe file in server and return some info about the file)</p><p>So, I guess these tutorial essentially push the ""submit"" button in someway, because we get response from action PHP page rather than the PHP form(with submit button) page.</p><p>But I can't figure out how they do it at all....</p><p>Anyone can help me??? Thx!!</p><p>(if you have better solution to upload file to server or manipulate with PHP webpage, please also give me some suggestion!! thx!!)</p>","339956","","","","","2010-11-23 08:27:35","How to mimic action of ""push submit"" button of PHP form in android HttpURLConnection","<php><android><httpurlconnection>","1","0","","",""
"4253696","1","","","2010-11-23 07:25:32","0","2563","<p>Hi plz provide me code for connecting webservices in android by using HttpClient step by step. also mentioned method name how to set.</p><p>Suppose My Method name is : ActiveSurveyList()and URL:  http://.....</p><p>Plz suggest ASAP.</p><p>Thanx Braj</p>","517108","","21234","","2010-11-23 07:59:44","2010-11-23 07:59:44","Web service connection with Android by using HttpClient","<android><web-services>","1","0","","",""
"4253711","1","4253777","","2010-11-23 07:29:26","2","242","<p>As we know there are several methodology for http connection.<br>My social network application will start a lot of uploading, downloading and synchronization's task.<br>So I need stable and more efficiency connection.<br>How many methods for http connection in Android?<br>Which one is more efficiency?<br>Exception HttpURLConnection, how can I set up a connection to post and get ?  </p>","206630","","","","","2010-11-23 07:41:39","Which way is most stable and efficiency for http connection at android platform","<android>","1","1","","",""
"4253784","1","4253795","","2010-11-23 07:43:12","3","981","<p>Is there an easy way to develop UI in android?</p>","450487","","","","","2010-12-12 18:59:35","How to easily develop android UI?","<android><uikit>","3","0","","",""
"4253815","1","4253906","","2010-11-23 07:48:07","0","2582","<p>i try to deserialize a json string with the help of gson. While gson.fromJson I get the following error:</p><blockquote>  <p>No-args constructor for class xyz; does not exist. Register an InstanceCreator with Gson for this type to fix this problem</p></blockquote><p>I tried to work with an InstanceCreate but I didn't get this running.I hope you can help me.</p><p>JSON String</p><pre><code>[{    ""prog"": ""Name1"",    ""name"": ""Name2"",    ""computername"": ""Name3"",    ""date"": ""2010-11-20 19:39:55""},{    ""prog"": ""Name1"",    ""name"": ""Name2"",    ""computername"": ""Name3"",    ""date"": ""2010-11-20 12:38:12""}</code></pre><p>]</p><p>according to gson I have to cut the first and last chars (""["" and ""]"")according to <a href=""http://www.jsonlint.com/"" rel=""nofollow"">http://www.jsonlint.com/</a> the string is with the chars correct... :?:</p><p>the code looks like that:</p><pre><code>    public class License {   public String prog;   public String name;   public String computername;   public String date;   public License() {      this.computername = """";      this.date = """";      this.name = """";      this.prog = """";       // no-args constructor   }}</code></pre><hr><pre><code>               String JSONSerializedResources = ""json_string_from_above""           try         {              GsonBuilder gsonb = new GsonBuilder();              Gson gson = gsonb.create();              JSONObject j;              License[] lic = null;              j = new JSONObject(JSONSerializedResources);              lic = gson.fromJson(j.toString(), License[].class);               for (License license : lic) {                  Toast.makeText(getApplicationContext(), license.name + "" - "" + license.date, Toast.LENGTH_SHORT).show();            }         }         catch(Exception e)         {            Toast.makeText(getApplicationContext(), ""Error: "" + e.getMessage(), Toast.LENGTH_LONG).show();             e.printStackTrace();         }</code></pre><p>regards Chris</p>","517123","","517123","","2010-11-23 08:17:49","2013-01-27 08:38:43","gson --> ""No-args constructor for class xyz"" with arrays","<android><json><gson>","3","0","","",""
"4253898","1","4253967","","2010-11-23 08:02:19","1","278","<p>I new to app development and I have been working on a Flash card app. There is a main screen and the user chooses a button. On the emulator when I touch a button to go to a new activity, my app force closes. I have added the activity in the manifest.The second activity has its own layout (main2.xml).My buttons look like this:</p><pre><code>Button add = (Button) findViewById(R.id.add);add.setOnClickListener(new View.OnClickListener() {    @Override    public void onClick(View view) {        Intent addIntent = new Intent(view.getContext(), Add.class);        startActivity(addIntent);    }});</code></pre><p>Any ideas of what's going wrong? If more info is needed I can supply it, I've been stuck here for two days. Thanks</p>","517131","","251173","","2010-11-23 10:07:43","2011-03-31 20:41:09","Simple Droid App force closes when switching activities","<java><android>","2","2","","",""
"4254090","1","4254516","","2010-11-23 08:34:34","2","132","<p>I used this code to send a text message</p><pre><code>  try {     SmsManager sms = SmsManager.getDefault();     sms.sendTextMessage(number, null, ""Hi"", null, null);  }  catch (IllegalArgumentException e) {      //show error  }</code></pre><p>For some reason the system is sending 2 messages. Does it have anything to do with the code?</p>","481239","","","","","2010-11-23 09:29:19","Android: Phone Sending 2 SMSs","<android><sms>","1","2","","",""
"4254099","1","4254133","","2010-11-23 08:36:56","6","1320","<p>I'm currently facing a problem where I should store my object structure on the android device. </p><p>The usecase: I'm starting a call to an applicationserver (with the great help of <a href=""http://developer.android.com/reference/android/os/AsyncTask.html"">AsyncTask</a>), get a well known response (xml-response) from the server, parse the data and transform it finally into my object structure (highly complex class diagram with many associations between the classes). So far it's working, thanks to the great XMLPullParser ;)I'm wondering where to store (and of course share) the fetched data between my activities... I already know that I can use sqlite, but I do not have an or-mapper (like hibernate in the j2ee environment). I'm also not allowed to store this sensitive data on the device (in sqlite or file system), so my first approach was to store this data in a singleton (which is of cource being held in memory...). But what happens when system is getting on low memory, can android ""destroy"" the data stored in my singleton? I already read about extending the <a href=""http://developer.android.com/reference/android/app/Application.html"">android.app.Application</a> class... So what is the best way to securely store object data (called from ""webservice"") on android devices?</p><p>Thanks in advance!</p><p>BTW: Android development is that cool! We are currently porting a Windows Mobile 6.5 App to Android and iPhone, and my colleague (reponsible for iPhone-dev) is complaining all the time^^</p>","248755","","","","","2010-11-23 09:33:58","Where to store large application data on android devices?","<android><security><data><object><store>","1","0","1","",""
"4254139","1","4653150","","2010-11-23 08:42:47","4","8228","<p>hey guys, i've a problem with progress dialog on opening an activity (called activity 2 in example).The activity 2 has a lot of code to execute in this OnCreate event.</p><pre><code>final ProgressDialog myProgressDialog = ProgressDialog.show(MyApp.this,getString(R.string.lstAppWait), getString(R.string.lstAppLoading), true);new Thread() {    public void run() {        runOnUiThread(new Runnable() {            @Override            public void run() {                showApps();            }        });        myProgressDialog.dismiss();    }}.start(); </code></pre><p>The showApps function launch activity 2.</p><p>if i execute this code on my button click event on activity 1, i see the progress, but she doesn't move and afeter i have a black screen during 2 or 3 seconds the time for android to show the activity.</p><p>If i execute this code in the OnCreate of Activity2 and if i replace the showApps by the code on OnCreate, Activity1 freeze 2 seconds, i don't see the progress dialog, and freeze again 2 seconds on activity 2 before seeing the result.</p><p>An idea ?</p>","431652","","180538","","2010-11-23 12:24:21","2011-01-11 00:55:17","Progress Dialog on open activity","<android><progressdialog>","4","1","2","",""
"4254183","1","4254240","","2010-11-23 08:48:57","4","1131","<p>Just wondering is there special API to access/read/modify HTC Sense features for Android devices? I mean some vendors has special add-on API/libraries for their devices (like Samsung Galaxy Tab) - so did HTC guys left any open door to access those HTC Sense UI functions?</p>","472270","","","","","2010-11-23 08:56:25","HTC Sense API for Android?","<android><htc><htcsense>","1","4","1","",""
"4254241","1","4254639","","2010-11-23 08:56:42","2","305","<p>In my application, I used a library that displays ads in my app. When a user clicks on the ad, it launches the Browser app, and the <code>onClick</code> events are handled by the library itself.</p><p>I also have a placed code in <code>onPause()</code> and <code>onStart()</code> methods that detects whether any of my Activities are sent to background (user pressed Home) or switching between any of my Activities.</p><p>So if the app is either freshly opened (no instance is running) or re-opened from background, it will display a dialog box. If the user is only switching from any of my Activites, then the dialog box shouldn't be displayed.</p><p>Now the problem is that when the user clicks on an Ad, the Browser app gets loaded and would mean that my App has been sent to background, and so when the user closes the Browser, it will still display the dialog box when it shouldn't.</p><p>Is it even possible for my App to determine the previously displayed external Activity (ie. Browser) and not display the dialog box?</p><p>Or are there better approaches that I can follow in implementing such setup?</p><p>Thanks in advance.</p>","411597","","","","","2010-11-23 09:43:23","Android: Determine the previously displayed external Activity","<android><activity>","2","0","","",""
"4254270","1","4403250","","2010-11-23 09:00:12","3","358","<p>I have an issue with a virtual keyboard.</p><p>This Soft Keyboard Covers Data Fields - and can't See what's going on. </p><p>I want to use this soft keypad and at the same time it should not become a problem to use data fields.</p><p>So how can I manage  the data fields in such cases?</p>","512025","","1471203","","2013-01-09 11:00:03","2013-01-09 11:00:03","Virtual keypad is hiding data elements of the screen","<java><android><android-layout>","2","1","1","",""
"4254314","1","4254330","","2010-11-23 09:06:22","0","187","<p>hi im new to android i have added defined login screen in one screen or activity im now navigating to next activity where i have to place elements for user to enter there details ..but where to place these elements since there is only one main.xml..</p>","510553","","","","","2010-11-23 09:08:48","once we navigate from one activity to other .where can define elements for new activity since there is only one main.xml","<android>","1","0","1","",""
"4254401","1","","","2010-11-23 09:18:03","3","1957","<p>I don't know if it's clear from the title what I asked, so here are some steps to reproduce (assuming you have a layout with a spinner):</p><ol><li>Tap on the spinner > dropdown list opens.</li><li>Rotate the device from portrait to landscape (or vice-versa) > the list is closing.</li></ol><p>My problem is that I would like to keep the list opened after rotating the device. I know that this is usually possible if overriding <strong>onConfigurationChanged</strong>, but I have defined a different layout for landscape mode, so in my onConfigurationChanged method I have to call <strong>setContentView</strong> and set the adapter for the landscape spinner, which closes the dropdown view that was opened in portrait mode.</p><p>Is there a way I could prevent the dropdown list from closing or perhaps forcing it to show after rotating the device?</p>","496058","","","","","2010-11-24 11:03:03","Can I force the dropdown view of a spinner to stay visible on orientation changes?","<android><drop-down-menu><spinner>","2","0","1","",""
"4254500","1","","","2010-11-23 09:27:59","1","165","<p>I have three activities, Activity1, Activity2, and Activity3.. Activity1 is the main activity from which am switching to other two activities. While I switch to Activity2 from main activity it starts properly, when I switch to Activity3 from main activity and come back to the Activity2 all previous data will be lost and it starts from starting.</p><p>Is there any other way to switch to the activities other than using the startActivity() method.</p>","517214","","","","","2010-11-23 11:06:19","In Android, while switching between the screens the GPS data is lost","<android>","2","1","","",""
"4254669","1","4263672","","2010-11-23 09:46:28","0","1153","<p>I have and audio recorder and player first i can record audio then the recorded audio can be played ,when audio is playing i want my seekbar thumb move smoothly but currently it have no smooth movement also the fast switching of play and pause sometimes fail my application by saying that illegal state :anybody please suggest a solution for improving my audio player . recding no pblm</p><pre><code>public class RecorderActivity extends Activity{    public static int          AUDIO_RECORDING_RESULT=0; public static int       FROM_AUDIO_RECDING_HOME=0; public static int       FROM_AUDIO_RECDING_SEARCH=0; public static int       FROM_AUDIO_RECDING=0; private static MediaRecorder                 recorder;    private static Button                        recd_stop_audio;    private static Button                        audio_play_pause;    private static Chronometer                   audio_recding_time;    private static Chronometer                   audio_playtime_begin;    private static TextView                      audio_playtime_end;    public static  int                           audio_play_pause_flag         = 1;    private static int                           audio_recding_stop_flag       = 1;    private static SeekBar                       audio_seekbar_play_indication;    private static View                          v1;    private static View        v2;    private static View        v3;    private static TextView       textview_audio_information_grade;    private static TextView                      textview_audio_information1;    private static TextView                      textview_audio_information2_1;    private static TextView                      textview_audio_information2_2;    private static TextView                      textview_audio_information2;    private static TextView                      textview_audio_information3;     private static int                           audio_seekbar_progress;    private static int                           audio_seekbar_incr;    private Button                               continue_audio;    private static Button                        delete_recding;    private static MediaPlayer                   mp;    private static int                           audio_paused_flag             = 0;    private static TextView                      txt_audio_serviceprovidername; public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.audio);  MyCustomesData.context=RecorderActivity.this;   final AlertDialog.Builder builder = new AlertDialog.Builder(RecorderActivity.this);   audio_paused_flag=0;   FROM_AUDIO_RECDING=0;   AUDIO_RECORDING_RESULT=0;   MyCustomesData.sumitAReport_PAGE=MyCustomesConstants.USER_AUDIO;   continue_audio = (Button) findViewById(R.id.Button_Voice_Record_Continue);   textview_audio_information_grade=(TextView)findViewById(R.id.Description_grade);         textview_audio_information1 = (TextView) findViewById(R.id.Description);         textview_audio_information2 = (TextView) findViewById(R.id.Description2);         textview_audio_information2_1=(TextView)findViewById(R.id.Description2_1);         textview_audio_information2_2=(TextView)findViewById(R.id.Description2_2);         textview_audio_information3= (TextView)findViewById(R.id.Description3);         v1 = (View) findViewById(R.id.View1);         v2 = (View) findViewById(R.id.View22);         v3=  (View) findViewById(R.id.View33);         audio_seekbar_play_indication = (SeekBar) findViewById(R.id.SeekBar01);         audio_playtime_begin = (Chronometer) findViewById(R.id.TimerStart);         audio_playtime_end = (TextView) findViewById(R.id.TimerStop);         audio_recding_time = (Chronometer) findViewById(R.id.Rec_Timer_ID);         recorder = new MediaRecorder();         recd_stop_audio = (Button) findViewById(R.id.Button_record_sound);         audio_play_pause = (Button) findViewById(R.id.Button_Play_Sound);         delete_recding = (Button) findViewById(R.id.Button_Delete_Sound);         txt_audio_serviceprovidername=(TextView)findViewById(R.id.TextView_Audio_Provider);         txt_audio_serviceprovidername.setText(MyCustomesData.MyCustomesListContext.getProviderName());         audio_seekbar_play_indication.setOnClickListener(null);         audio_seekbar_play_indication.setEnabled(false);         audio_play_pause.setEnabled(false);            delete_recding.setEnabled(false);         showHelpInformation();         if(MyCustomesData.MyCustomesListContext.isAudioRecd())         {          showRecdingInformation();          audio_play_pause.setEnabled(true);             delete_recding.setEnabled(true);         }           recd_stop_audio.setOnClickListener(new OnClickListener() {               public void onClick(View v) {                  if (audio_recding_stop_flag == 0) {                    audiorecding();                   } else {                    audiorecding();                   }               }           });           audio_play_pause.setOnClickListener(new OnClickListener() {               public void onClick(View v) {                playaudio();                             }           });           audio_recding_time.setOnChronometerTickListener(new OnChronometerTickListener() {    public void onChronometerTick(Chronometer chronometer) {     if(chronometer.getText().equals(""02:00""))     {      audiorecding();     }    }   });         **//UPDATING SEEKBAR USING CHRONOMETER**             audio_playtime_begin.setOnChronometerTickListener(new OnChronometerTickListener() {               public void onChronometerTick(Chronometer chronometer) {               if(!audio_playtime_begin.getText().equals(""00:00""))                {                 audio_seekbar_play_indication.setProgress(audio_seekbar_progress);                    audio_seekbar_progress = audio_seekbar_progress + audio_seekbar_incr;                }                else                 audio_seekbar_progress=1;               }           });           delete_recding.setOnClickListener(new OnClickListener() {               public void onClick(View v) {                   audio_seekbar_progress = 1;                           if (mp != null) {                           if (audio_play_pause_flag == 0) {                          audio_play_pause_flag =1;                          audio_playtime_begin.stop();                          mp.stop();                             mp.reset();                             mp.release();                             audio_play_pause.setBackgroundResource(R.drawable.play1);                           }                       }                       recorder = new MediaRecorder();                       v1.setVisibility(View.VISIBLE);                       v2.setVisibility(View.VISIBLE);                       recd_stop_audio.setEnabled(true);                       audio_play_pause.setEnabled(false);                       delete_recding.setEnabled(false);                          audio_play_pause.setBackgroundResource(R.drawable.play1);                       audio_play_pause_flag = 1;                     audio_playtime_begin.stop();                     audio_playtime_begin.setBase(SystemClock.elapsedRealtime());                     audio_paused_flag = 0;                       audio_playtime_end.setText(""00:00""); // Seekbar End Time                       audio_recding_time.setBase(SystemClock.elapsedRealtime()); // Recording time                       audio_seekbar_play_indication.setProgress(0);                       MyCustomesData.MyCustomesListContext.setAudioRecd(false);                       showHelpInformation();               }           });           continue_audio.setOnClickListener(new OnClickListener() {               public void onClick(View v) {                System.out.println(""The Staus of report""+MyCustomesData.MyCustomesListContext.isAudioRecd()+"":""+MyCustomesData.MyCustomesListContext.getTextReport());                if (audio_recding_stop_flag == 0)                {                 audiorecding();                }                if(audio_play_pause_flag == 0)                {                mp.stop();                   mp.reset();                   mp.release();                   audio_seekbar_play_indication.setProgress(100); //Max value                     audio_playtime_begin.stop();                      audio_play_pause_flag = 1;                     audio_play_pause.setBackgroundResource(R.drawable.play1);                }              StringBuffer txtReport=new StringBuffer(MyCustomesData.MyCustomesListContext.getTextReport());              String txtreport=new String(txtReport);              txtreport=txtreport.trim();             if(!MyCustomesData.MyCustomesListContext.isAudioRecd()&amp;&amp;txtreport.length()==0)             {               builder.setMessage(""xxxxxxxxxxxxxxxx."").setCancelable(false).setPositiveButton(""OK"", new DialogInterface.OnClickListener() {                         public void onClick(DialogInterface dialog, int id) {                             dialog.cancel();                             FROM_AUDIO_RECDING=0;                       AUDIO_RECORDING_RESULT=0;                       finish();                         }                     });                     AlertDialog alert = builder.create();                     alert.setTitle(""Attention"");                     alert.setIcon(R.drawable.alert_dialog_icon);                     alert.show();             }             else              {              AUDIO_RECORDING_RESULT=1;              finish();              }               }           }); }    static void audiorecding()    {          audio_play_pause.setEnabled(false);          delete_recding.setEnabled(false);        if (audio_recding_stop_flag == 0) {           int maxtime = audio_seekbar_play_indication.getMax();         audio_recding_stop_flag = 1;         audio_recding_time.stop();          recorder.stop();            recorder.reset();            recorder.release();             audio_seekbar_progress = 1;            recd_stop_audio.setBackgroundResource(R.drawable.rec_btn);          audio_play_pause.setEnabled(true);            delete_recding.setEnabled(true);           MyCustomesData.MyCustomesListContext.setAudioRecd(true);           if(audio_recding_time.getText().equals(""00:00""))           {            audio_recding_time.setText(""00:01"");            MyCustomesData.MyCustomesListContext.setAudioRecdingTime( ""00:01"");             }           else           MyCustomesData.MyCustomesListContext.setAudioRecdingTime( audio_recding_time.getText().toString());           showRecdingInformation();        }         else {            audio_recding_stop_flag = 0;            try {             showHelpInformation();             audio_playtime_begin.setBase(SystemClock.elapsedRealtime());               audio_playtime_end.setText(""00:00"");               audio_seekbar_play_indication.setProgress(0);             MyCustomesListMain.path = InitialValueLoader.sanitizePath(""MyCustomAudio/VoiceReport"");                InitialValueLoader.filecheck(MyCustomesListMain.path);                audio_play_pause.setEnabled(false);                delete_recding.setEnabled(false);                recd_stop_audio.setBackgroundResource(R.drawable.recording_stop);                audio_recding_time.setBase(SystemClock.elapsedRealtime());                recorder.release();                audio_recding_time.start();                  recorder = new MediaRecorder();                recorder.setAudioSource(MediaRecorder.AudioSource.MIC); // AudioSource                recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); // OutputFormat                recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);                recorder.setOutputFile(MyCustomesListMain.path);                recorder.prepare();                recorder.start();            } catch (Exception e) {                e.printStackTrace();                recorder.reset();                recorder.release();            }     }    }    private static void playaudio()     {           showRecdingInformation();           recd_stop_audio.setEnabled(false);              if (audio_play_pause_flag == 1) {               audio_play_pause_flag = 0;               v2.setVisibility(View.GONE);               audio_playtime_end.setText(audio_recding_time.getText());               audio_play_pause.setBackgroundResource(R.drawable.play2);                     if (audio_paused_flag == 1) {                         audio_paused_flag = 0;                         int stoppedMilliseconds = 0;                         String chronoText = audio_playtime_begin.getText().toString();                         String array[] = chronoText.split("":"");                         if (array.length == 2) {                           stoppedMilliseconds = Integer.parseInt(array[0]) * 60 * 1000                               + Integer.parseInt(array[1]) * 1000;                         } else if (array.length == 3) {                           stoppedMilliseconds = Integer.parseInt(array[0]) * 60 * 60 * 1000                                + Integer.parseInt(array[1]) * 60 * 1000                               + Integer.parseInt(array[2]) * 1000;                         }                         stoppedMilliseconds=stoppedMilliseconds+1000;                         audio_playtime_begin.setBase(SystemClock.elapsedRealtime() - stoppedMilliseconds);                         audio_seekbar_progress=audio_seekbar_progress - 1;                         audio_playtime_begin.start();                         mp.start();                     } else                     {                         v2.setVisibility(View.GONE);                         try {                          audio_play_pause.setBackgroundResource(R.drawable.play2);                             audio_seekbar_progress = 1;                                                  audio_seekbar_play_indication.setMax(getTotalAudioRecdingTime(MyCustomesData.MyCustomesListContext.getAudioRecdingTime()));                             audio_play_pause.setBackgroundResource(R.drawable.play2);                             audio_playtime_end.setText(MyCustomesData.MyCustomesListContext.getAudioRecdingTime());                             audio_seekbar_incr = 1;                             audio_playtime_begin.setBase(SystemClock.elapsedRealtime());                             audio_seekbar_play_indication.setProgress(0);                             audio_playtime_begin.start();                             mp = new MediaPlayer();                             mp.setOnCompletionListener(new OnCompletionListener() {             public void onCompletion(MediaPlayer mp) {               mp.stop();                           mp.reset();                           mp.release();                           audio_playtime_begin.stop();                           audio_seekbar_play_indication.setProgress(0);                           audio_playtime_begin.setText(MyCustomesData.MyCustomesListContext.getAudioRecdingTime());                           audio_seekbar_play_indication.setProgress(getTotalAudioRecdingTime(MyCustomesData.MyCustomesListContext.getAudioRecdingTime())); //Max value                             audio_play_pause_flag = 1;                              audio_play_pause.setBackgroundResource(R.drawable.play1);                             recd_stop_audio.setEnabled(true);             }            });                             mp.setDataSource(MyCustomesListMain.path);                             mp.prepare();                             mp.start();                         } catch (Exception e) {                             e.printStackTrace();                             mp.stop();                          mp.reset();                          mp.release();                             audio_playtime_begin.stop();                         }                     }           }           else           {            System.out.println(""Audio Palyer Paused&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"");               audio_play_pause_flag = 1;               audio_paused_flag = 1;               audio_play_pause.setBackgroundResource(R.drawable.play1);               audio_playtime_begin.stop();               mp.pause();           }     }    private static int getTotalAudioRecdingTime(String recdingtime)    {    int timeM=Integer.valueOf(recdingtime.substring(0, 2));     System.out.println(""The Minute""+timeM);    int timeS=Integer.valueOf(recdingtime.substring(3, 5));    int totaltimeinS=timeM*60+timeS;    return totaltimeinS;    }    private static void showHelpInformation()    {    }    private static void showRecdingInformation()    {    }}</code></pre>","487219","","487219","","2010-11-23 09:57:25","2011-03-09 10:24:48","Android Audio Player","<android>","1","2","","",""
"4254759","1","","","2010-11-23 09:55:21","0","611","<p>I am developing an application,In My application,I am downloading lot of images from url using dom parsing.It is working fine.i wanna use cache memory for when i  see that image in first time ,that image downloaded from url,otherwise ie second time again see that image will not download from url,That time i will display that image from cache memory.how to implement in my application.</p><p>Thanks all</p>","500595","","","","","2010-11-23 09:59:32","How can i implement cache memory for display image?","<android>","1","0","","",""
"4254862","1","","","2010-11-23 10:07:10","-2","5665","<p>I'm new to Android and Java. I'm doing a login page program. In that program I don't know how to do user authentication or validation process. </p><p>please help me </p><pre><code>public class demo extends Activity implements OnClickListener { /** Called when the activity is first created. */ EditText txtbox1, txtbox2; private DataHelper dh; Button button2, button1; String name1, name2, name; String DB_PATH, DATABASE_NAME; String unames; TextView tv; private static final String TABLE_NAME = ""table1"";  private DataHelper db; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  txtbox1 = (EditText) findViewById(R.id.EditText01);  txtbox2 = (EditText) findViewById(R.id.EditText02);  button2 = (Button) findViewById(R.id.Button02);  button1 = (Button) findViewById(R.id.Button01);  button1.setOnClickListener(this);  button2.setOnClickListener(this);  tv = (TextView) this.findViewById(R.id.mywidget);          tv.setSelected(true);  }@Override public void onClick(View v) {  // TODO Auto-generated method stub  int i = v.getId();  {   if (i == R.id.Button01) {    name1 = txtbox1.getText().toString();    name2 = txtbox2.getText().toString();    System.out.println(""txtbox1"" + txtbox1);    System.out.println(""name1"" + name1);    System.out.println(""name2"" + name2);    StringBuilder sb = new StringBuilder();    sb.append(""Insert Employee Details:\n"");      dh = new DataHelper(this);          dh.deleteAll();    dh.insert(name1);    dh.insert(name2);    Toast.makeText(getApplicationContext(), name1,      Toast.LENGTH_LONG).show();    List&lt;String&gt; names = this.dh.selectAll();    /* sb.append(""Names in database:\n""); */    for (String name : names) {     sb.append(name + ""\n"");     System.out.println(""name="" + names);     Log.d(""EXAMPLE"", ""names size - "" + names.size());    }   }  }  if (i == R.id.Button02)  System.out.println(""ok"");  System.out.println(""name="" + unames);/*     GetValue();*/  {   if (name1.equals(unames)) {    System.out.println(""ok1"");    Toast.makeText(getApplicationContext(), name1,      Toast.LENGTH_LONG).show();   } else {    System.out.println(""no"");    /*     * Toast.makeText(getApplicationContext(),no ,     * Toast.LENGTH_LONG).show();     */   }  } }}</code></pre><p>database part</p><pre><code>public class DataHelper { private static final String DATABASE_NAME = ""example1rrrr.db""; private static final int DATABASE_VERSION = 1; private static final String TABLE_NAME = ""table1""; private static final String name = ""name""; private static final String password = ""password""; private static final String KEY_ROWID = ""rowid""; private Context context; private static 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 asc"");  if (cursor.moveToFirst()) {   do {    list.add(cursor.getString(0));   } while (cursor.moveToNext());  }  if (cursor != null &amp;&amp; !cursor.isClosed()) {   cursor.close();  }  return list; } private static class OpenHelper extends SQLiteOpenHelper {  OpenHelper(Context context) {   super(context, DATABASE_NAME, null, DATABASE_VERSION);  }  @Override  public void onCreate(SQLiteDatabase db) {   db.execSQL(""CREATE TABLE "" + TABLE_NAME     + ""(id INTEGER PRIMARY KEY, 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>","509442","","218589","","2010-11-23 10:14:03","2013-08-11 03:46:43","Login page in android using database","<android>","1","6","1","",""
"4254871","1","","","2010-11-23 10:08:23","0","796","<p>I have two services:a provider of data and a receiver.</p><p>i try to do this way:</p><p>PROVIDER:</p><pre><code>Intent i1 = new Intent(feasibilityEngine.this, SOSFeeder.class);i1.putExtra(SENSOR_STRING, ""f[i]"");startService(i1);</code></pre><p>RECEIVER</p><pre><code>Intent intent = getIntent();Bundle b = new Bundle();int i = b.getInt(SENSRO_STRING);</code></pre><p>but i can't use the getIntent().</p><p>Someone can help me?TNKS</p>","494575","","","","","2010-11-23 11:49:47","passing data from a Service to another","<android><service><android-intent>","2","0","","",""
"4254994","1","4255119","","2010-11-23 10:20:24","2","1427","<p>I'm trying to implement a drag and drop functionality in an android application. The drag part is done, the one thing left is to figure out on which view will the dragged view dropped on. Here's the onTouch function of my dragged view:</p><pre><code>public boolean onTouch(View v, MotionEvent event) {  // Is the event inside of this view?  if (!mRegion.contains((int) event.getX(), (int) event.getY())) {   return false;  }  if (event.getAction() == MotionEvent.ACTION_DOWN) {   ...   System.out.println(""**** IMAGE DRAG STARTED!"");   return true;  } else if (event.getAction() == MotionEvent.ACTION_MOVE) {                        ...   this.invalidate();   return true;     } else if (event.getAction() == MotionEvent.ACTION_UP){   System.out.println(""**** ICON DRAG ENDED!"");   return false;  } else {   return true;  } }</code></pre><p>So basically all motion events are handled except the ACTION_UP (the moment when the view is realeased). The question is how should I make this event to be called in the parent (pass it to the parents onTouch handler), so I can find out where it was dropped. I have implemented onTouch handling in the parent but no event is caught.</p><p>Thanks,Levi</p>","469341","","","","","2010-11-23 10:34:17","How to handle onTouch Event of a child in parent?","<android><touch><parent><drag>","1","1","2","",""
"4254996","1","","","2010-11-23 10:20:48","0","853","<p>how to find  out the data transfer rate while sending and recieving the data from server in android application.</p>","517271","","","","","2010-11-23 10:53:22","android data transfer rate","<android>","1","0","","",""
"4255068","1","4255092","","2010-11-23 10:29:21","1","1926","<p>I'm stuck with a service, which can't be found using it's explicit component name in the starting intent sent by startService().The classes are in the same project and package. The explicit service calling with its component name is intentional, because it's supposed to be a private service, and the startService/stopService method instead of the bindService is intentional too, because the service should run in the background without any activity communicating with it.Must be a stupid mistake, but I spent 2 days looking for it and no luck yet. I have an other project too, which uses the same service calling method and it works, compared the two multiple times, but no real difference.What can I be possibly be doing wrong?</p><pre><code>//main activity which controls the service @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  //...  Intent intent = new Intent(this, Logger01Service.class);  startService(intent);  //... }</code></pre><p>The error in the debugger's log:</p><pre><code>11-23 11:07:28.711: WARN/ActivityManager(1279): Unable to start service Intent { cmp=com.biroalex.test.logger/.LoggerService }: not found</code></pre><p>What can I be possibly be doing wrong?</p>","500505","","","","","2010-11-23 10:50:52","Service not found using its component name","<android><service>","3","0","","",""
"4255121","1","5061354","","2010-11-23 10:34:25","1","953","<p>Please if any one know how to play Flash(flv) file in android's ImageView..i need to develop game which plays flv file as background.. </p><p>thanks in andvance</p>","392924","","21234","","2010-11-23 10:37:34","2011-07-31 14:18:06","Play flash(flv) file in ImageView android","<android><imageview>","2","0","","",""
"4255173","1","","","2010-11-23 10:40:17","0","468","<p>I am new to android, so thought of doing a small project on Native Contacts. Application should Add, Update &amp; Delete Native Contacts through my application.</p><p>Adding &amp; Deleting native contacts is working fine, but Update contacts is not working at all.</p><p>This is the code i am using for Update &amp; Delete :-</p><p>Delete :-</p><pre><code>cr.delete(uri, People._ID + ""="" + id, null);</code></pre><p>Update :-</p><pre><code>values.put(""data1"", ""Student_Name"");cr.update(Uri.parse(""content://com.android.contacts/data/""),              values, ""raw_contact_id="" + id, null);</code></pre><p>Suppose i am adding a new contact in the Native itself i.e without using with my AddtoNative method :-</p><blockquote>  <p>Name : Robert</p>    <p>Home Phone : 111111111</p>    <p>Work Phone : 222222222</p>    <p>Mobile Phone: 333333333</p>    <p>Work Fax  : 444444444</p>    <p>Home Email : robert@gmail.com</p></blockquote><p>If I have use update code given below :-</p><pre><code>values.put(""data1"", ""Student_Name"");cr.update(Uri.parse(""content://com.android.contacts/data/""),              values, ""raw_contact_id="" + id, null);</code></pre><p>All data gets updated and gives the result :-</p><blockquote>  <p>Name          : Student_Name</p>    <p>Home Phone : Student_Name</p>    <p>Work Phone  : Student_Name</p>    <p>Mobile Phone: Student_Name</p>    <p>Work Fax     : Student_Name</p>    <p>Home Email  : Student_Name</p></blockquote><p>But in update, I just want to only update Work phone number or Home Phone number or Home Email field.</p><p>Any suggestions guys.........</p><p>Thanks in Advance.</p><p>RegardsRaki</p>","517292","","234976","","2011-11-28 01:41:50","2011-11-28 01:41:50","How to update contact fields individually?","<android>","1","0","","",""
"4255276","1","","","2010-11-23 10:54:07","6","2391","<p>Is there a method that will take an absolute (X, Y) screen coordinate and return the View it corresponds to?  Basically, ""if the user touched here, which View would receive the event?""</p><p>I'm writing a game that involves a gesture that allows the player to draw a path through many different widgets, affecting them as they go.  However, the MotionEvents only report the initial View that was touched, along with X/Y coordinates of where the pointer is now.  I'd like an easy way to retrieve the View they're currently hovering over, without having to loop through all Views to manually check their bounding box against the coordinates.</p>","517309","","","","","2012-02-23 07:11:08","How to get View from X/Y coordinates","<android>","1","3","3","",""
"4255279","1","4311189","","2010-11-23 10:54:46","2","1527","<p>In my app, me downloading different image and saving inside sdcard under a folder. That file is later used in my app.<br>What i need is, make this folder only visible to my app. I mean the images should not be available in Android Gallery and other.<br>Me also saving the sqllite file inside this folder. I also want to restrict any other access  to this sqllite file.<br>Is there anyway to set permission like anything for folder and file, so that it can only available to my app?Is there anyway to lock a folder or a file to some specific app?<br>Thanks in advance.   </p>","477754","","477754","","2011-01-20 10:03:14","2011-01-20 10:03:14","prevent media scan, set permission or lock the folder and file in android","<android><locking><file-permissions>","3","0","","",""
"4255410","1","","","2010-11-23 11:09:11","1","197","<p>I want to extend the Device Administration framework for my Enterprise needs, so for example I would be able to better control which applications installed on the device. Is there a way to it? (Without rooting the device) </p>","517329","","759866","","2013-09-29 23:32:17","2013-09-29 23:32:17","Advanced Device Administration Options","<android><security>","1","0","","",""
"4255441","1","4256220","","2010-11-23 11:13:33","2","1571","<p>i have a tabbed layout with 2 tabs, every tab has it's own view. I search for a function that can overwritten that is called every time if i click on a tab to show the layout.</p><p>Thanks in advance...</p><p>Hasan Caliskan</p><p>EDIT:</p><p>thanks for you answers, but it doesn't work...</p><pre><code>onWindowVisibilityChanged</code></pre><p>is called one time if i start my app.</p><pre><code>onFocusChanged</code></pre><p>function is never called ???</p><p>Or i'm doing something wrong ?Here is the code i've implemented...</p><pre><code>protected void onWindowVisibilityChanged(int a){    int c = 0;    c+= 1;}protected void onFocusChanged(boolean b, int i , Rect rec){    int c = 0;    c += 1;}</code></pre>","516658","","507519","","2011-12-11 18:40:15","2011-12-11 18:40:39","Is there a function in Android like onShow in MFC for layout","<android><layout>","2","2","1","",""
"4255453","1","","","2010-11-23 11:14:41","2","722","<p>hey guys im following the Sudoku tutorial in Hello Android the 3ed edition and i cant get rid of this error, here are my files</p><p>manifest.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=""org.example.sudoku""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Sudoku""                  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/about_title"" &gt;&lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>strings.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""app_name""&gt;Sudoku&lt;/string&gt;    &lt;string name=""main_title""&gt;Android Sudoku&lt;/string&gt;    &lt;string name=""continue_label""&gt;Continue&lt;/string&gt;    &lt;string name=""new_game_label""&gt;New Game&lt;/string&gt;    &lt;string name=""about_label""&gt;About&lt;/string&gt;    &lt;string name=""about_text""&gt;\Sudoku is a logic-based number placement puzzle.Starting with a partially completed 9x9 grid, theobjective is to fill the grid so that each row, each column, and each of the 3x3 boxes contains the digits1 to 9 exactly once.&lt;/string&gt;    &lt;string name=""exit_label""&gt;Exit&lt;/string&gt;&lt;/resources&gt;</code></pre><p>about.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;ScrollView     xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:padding=""10dip"" &gt;     &lt;TextView     android:id=""@+id/about_content""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""@string/about_text"" /&gt;     &lt;/ScrollView&gt;  </code></pre>","517338","","24054","","2010-11-23 11:23:34","2012-06-08 13:25:18","error no rescources that matches the given name (at ""label"" with value ""@string/about_title""","<java><android>","3","0","","",""
"4255487","1","4256025","","2010-11-23 11:20:21","0","354","<p>I am trying to retrieve <em><strong>Phone</strong></em> Number hence using</p><pre><code>String addrWhere = Contacts.Phones.NUMBER + "" = "" + userNumber;  String id = """";  Cursor c = mContext.getContentResolver().query(    Contacts.Phones.CONTENT_URI,    new String[] { Contacts.Phones._ID }, addrWhere, null, null);  try {   if (c.getCount() &gt; 0) {    c.moveToFirst();    id = c.getString(0);    Log.i(""IDS"", id);   }  } finally {   c.close();  }  return id;</code></pre><p>can anyone lemme know mistake in this??? or any <strong>suggestions</strong> for the same??</p>","434912","","157247","","2010-11-23 11:22:38","2010-11-23 12:31:05","How do you retrieve an ID from a phone number?","<android><numbers><contacts><phone>","2","1","0","",""
"4255589","1","4255851","","2010-11-23 11:33:31","1","1122","<p>i'm very new to the Android world: i have an autocompletetextview that allows me to choose from a list of cities.How can i display the city i've selected from that list? (This list is quite big)</p>","517354","","","","","2011-07-06 10:21:58","Android - identify selected item from an autocompletetextview","<android><autocompletetextview>","1","0","","",""
"4255672","1","","","2010-11-23 11:44:09","2","1045","<p>I want to do Bluetooth connection in Service. And there needs to be interaction between Activities and Services. The service should be started as soon as the app is started and should be able to communicate with UI Activities on certain situations. </p><p>What should be the appropriate way of doing it? If I bind the service from only one Activity then that service will be communicating only with that Activity. So, do I need to take AIDL based approach or is there any other way out for this?</p><p>Otherwise, can I have a class that extends Application class and then start the service from there and bind the Application class instead?</p>","261566","","","","","2011-09-10 08:52:51","Binding to Service from Activity or starting service in different process?","<android><service>","2","0","1","",""
"4255764","1","","","2010-11-23 11:55:59","1","1365","<p>What I'm trying to do:I want the user to be able to custom gestures and name them ""up"",""down""..etc. Then when the user runs my application, it loads up a WebView with a particular url like <a href=""http://google.com"" rel=""nofollow"">http://google.com</a>. Then the user can draw the gesture he created earlier. So if he draws the ""up"" gesture, then another webview opens.</p><p>My problem:When I try to draw the gesture over the webview, it doesn't draw. Rather it scrolls the webview.</p><p>What have I tried:Already created a GestureOverlayView and put the WebView within that. Unfortunately, the GestureOverlayView is unable to detect the gestures as the WebView gets scrolled.</p><p>My Code:</p><pre><code>public class WebViewCenter extends Activity implements OnGesturePerformedListener {/** Called when the activity is first created. */GestureLibrary mLibrary;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //WebView webview = (WebView)findViewById(R.id.WebView01);    //webview.loadUrl(""http://www.google.com"");    //Button btnStart = (Button)findViewById(R.id.Start);    //btnStart.setOnClickListener(this);    mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);    GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures_overlay);    gestures.addOnGesturePerformedListener(this);    WebView webview = (WebView)findViewById(R.id.WebView);    webview.getSettings().setJavaScriptEnabled(true);    webview.loadUrl(""http://live.com"");}public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {    mLibrary.load();    ArrayList&lt;Prediction&gt; predictions = mLibrary.recognize(gesture);    Log.i(""Default Marker"", predictions.get(0).toString());    if (predictions.size() &gt; 0) {        String action = predictions.get(0).name;        Log.i(""Gesture"", action);        if (""up"".equals(action)) {            Log.i(""Up_gesture"", ""Up gesture detected"");            Intent int_up = new Intent(WebViewCenter.this, WebViewUp.class);            WebViewCenter.this.startActivity(int_up);            //return true;            //Toast.makeText(this, ""Adding a contact"", Toast.LENGTH_SHORT).show();        }         /*else        {            Log.i(""Marker 2"", ""god knows what ur upto"");        }*/    }}</code></pre><p>Any advice as to how can I separate the WebView scrolling from the gesture building?</p><p>Thanks,Pawan</p>","517382","","","","","2011-04-07 07:19:08","Gestures with WebView","<java><android>","0","3","","",""
"4255768","1","4255786","","2010-11-23 11:56:59","2","162","<p>This must be a noob question, but I can't find the proper wait to achieve the following:</p><p>In android, I made a subclass MyView extending a View class. In B, I've defined a method mMethod not present in the View class.</p><p>Now, I want to set an OnClickListener interface on MyView. Doing this, I must override a onClick method when defining a new OnClickListener. Furthermore, I would like to access the mMethod method in onClick, but the overriden method is expecting a View class instance, not a MyView's one. So what can I do ?</p><p>To be more precise:</p><pre><code>public class MyView extends View{  ...    public void mMethod(){    ...    }}</code></pre><p>And in the main class (Activity)</p><pre><code>MyView  myView = new MyView () //It's not the correct constructor, but it's not the pointmyView.setOnClickListener(new OnClickListener(){    @Override    public boolean onClick(View v){        //Here I would like to access mMethod of MyView        ???    }}</code></pre><p>Is using <code>myView.mMethod()</code> is the only solution ? Is it possible to downcast <code>v</code> to <code>(MyView)v</code> ? If so, how to do it ? Should I define a sub-interface ?</p><p>Thank you!</p>","377088","","","","","2010-11-23 12:00:21","Accessing a submethod of an argument of an overriden method in android?","<java><android><override><downcasting>","1","0","2","",""
"4255781","1","","","2010-11-23 11:59:23","0","619","<p>HI,</p><p>How can i add, 4-radiobuttons and 2-checkBoxes in the same ListPreference in Android PreferenceScreen in android ? Need Help.Thanks in adv.</p><p>rgds,Praween</p>","292605","","292605","","2010-11-24 05:08:53","2010-11-24 05:08:53","How to add radio buttons and checkBox in the same ListPreference in android?","<android>","1","0","","",""
"4255793","1","","","2010-11-23 12:01:09","-2","370","<pre><code>public class Sendfile extends Activity {/** Called when the activity is first created. */public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);String url = ""http://http://192.168.0.158:4299"";File file = new File(Environment.getExternalStorageDirectory(),    ""sendingfile.txt"");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 neededhttppost.setEntity(reqEntity);HttpResponse response = httpclient.execute(httppost);Toast.makeText(getApplicationContext(), response.toString(),     Toast.LENGTH_LONG).show();   // Do something with response...  } catch (Exception e) {   // show error  } }}</code></pre>","515966","","180538","","2010-11-23 12:03:01","2010-11-23 12:11:07","problem on sending file to server in android..formated code","<android>","1","3","","",""
"4255847","1","5150540","","2010-11-23 12:08:02","2","4668","<p>can anybody give example how to implement gesture detector onfling in webview in android</p><p>Thanks</p>","426344","","180538","","2010-11-23 12:14:49","2011-03-01 04:52:29","how to implement gesture detector onfling in webview in android","<android><gesture-recognition><onfling><gesturedetector>","2","0","4","",""
"4255859","1","4256395","","2010-11-23 12:09:37","9","28882","<p>I am working on some example in which i want to drag the image corresponding to touch in Android. Does anybody have an idea about how I can do it?</p>","501483","","213269","","2010-11-23 13:22:28","2011-10-03 11:39:33","Touch and drag image in android","<android><touch><drag>","2","2","8","",""
"4255938","1","","","2010-11-23 12:19:05","0","474","<p>I have a question for you: i have an application where some apks could be downloaded and installed. I launch installation in this way:</p><blockquote>  <p>Intent myIntent = new Intent();<br>                  myIntent.setAction(android.content.Intent.ACTION_VIEW);<br>                  myIntent.setDataAndType(Uri.parse(""file://"" + getFilesDir() + ""/"" + m_sLastFileName ), ""application/vnd.android.package-archive"");<br>                  startActivity(myIntent);</p></blockquote><p>Now i have this problem: i want to know which apks the user has installed, so the question is: can i mark the installed applications in a way that i can recognise them as ""My App""?Or can you suggest me an alternative solution?</p><p>thanks.</p>","451247","","","","","2010-11-23 12:32:04","Android Marking an application installed","<android><install>","1","0","","",""
"4256047","1","4256134","","2010-11-23 12:32:37","0","185","<p>I am developing an Android frontend to a web application using its API.</p><p>This Android application will expose some extra features if the user is a 'pro'.</p><p>Therefore I need the Android app to acquire the information whether an account is pro. That is done while getting the token. In other words, when the Android application requests a token to the web application via the API, the web application provides also a flag representing whether the user is a pro.</p><p>When the Android app gets that piece of information, it stores it in the SharedPreferences, like this:</p><pre><code>this.sharedPreferencesEditor.putBoolean(Account.PRO_ACCOUNT, isPro).commit();</code></pre><p>Then the Android app reads that value to decide whether a certain feature is available to that user.</p><p>Now, my question is: is that approach easily hackable? I mean, can some clever user work-around this system and get pro-features even if they are not pro-users? How could do that?</p><p>Can you suggest a better system to accomplish that?</p><p>Thanks,<br>Dan</p>","354742","","","","","2010-11-23 12:42:11","Android - store whether a user account is pro in a secure way","<android>","1","0","","",""
"4256096","1","4256119","","2010-11-23 12:36:47","0","2085","<p><br>I am wrting an android application which displays some buttons dynamically in a linear layout with vertical orientation.When ever we click on any button a new activity should start in the same frame . How can this be possible ? can anyone help me in solving this issue.I will be waiting for reply.</p><p><br>Thanks in Advance,</p>","429501","","","","","2010-11-27 10:06:40","how to display an activity in Framelayout","<android>","1","0","","",""
"4256166","1","4469487","","2010-11-23 12:46:20","0","3783","<p>I have a soap webservice that returns something like this:</p><pre><code>ListResult{id=123;result=ListItem{currencyID=2; currencyISO=EUR; desc=description; hasEMagazine=true; hasPrintMagazine=true; incentiveB=0; incentiveE=1000; objectCatalogID=123; objectID=12345; objectTypeID=1; picURL=url; priceB=222 ; priceRB=anyType{};0 sortID=0; title=title; uniqueProductAttrID=0; };result=ListItem{currencyID=2; currencyISO=EUR; desc=description; hasEMagazine=true; hasPrintMagazine=true; incentiveB=0; incentiveE=1000; objectCatalogID=123; objectID=12345; objectTypeID=1; picURL=url; priceB=222 ; priceRB=anyType{};0 sortID=0; title=title; uniqueProductAttrID=0; };result=ListItem{currencyID=2; currencyISO=EUR; desc=description; hasEMagazine=true; hasPrintMagazine=true; incentiveB=0; incentiveE=1000; objectCatalogID=123; objectID=12345; objectTypeID=1; picURL=url; priceB=222 ; priceRB=anyType{};0 sortID=0; title=title; uniqueProductAttrID=0; };</code></pre><p>Now I would like to generate a list of Results out of this object. I get a result Object that has 20 Properties and if I retrieve one of this properties I get a SoapPrimitive containing the whole ListItem as a String.</p><p>Is there an elegant way to retrieve the needed values from this SoapPrimitive Object without parsing the String manually?</p>","114066","","","","","2010-12-17 10:14:27","How to parse a list of objects retrieved with ksoap on Android?","<android><web-services><soap><ksoap2>","2","0","","",""
"4256330","1","4256486","","2010-11-23 13:12:35","5","8458","<p>I have this database of 100+ images (of country flags) in my drawable folder.</p><p>Now I want to display the flag of the country you're currently in, in an ImageView.</p><p>I get the country with <code>String country_variable = address.getCountryCode();</code></p><p>And I set the image with <code>flag.setImageDrawable(getResources().getDrawable(R.drawable.country_variable));</code></p><p>As you all know R.drawable.country_variable wont't work because the compiler can't find a image named country_variable in the drawable folder.</p><p>What is the best way to do this?</p>","517460","","470542","","2011-05-21 12:20:19","2013-01-23 16:02:15","Dynamically load Image in ImageView in Android","<android><image><dynamic>","2","3","1","",""
"4256491","1","","","2010-11-23 13:28:55","2","1086","<p>I wanted to write an application that makes use of the camera taking extremely slow frame-rate video and uploading it.   Right now I am reading over this: <a href=""http://itp.nyu.edu/~sve204/mobilemedia_spring10/androidCamera101.pdf"" rel=""nofollow"">http://itp.nyu.edu/~sve204/mobilemedia_spring10/androidCamera101.pdf</a></p><p>My question was in regards to the camera's use.  The above article makes use of a canvas to preview the image, if one didn't want to preview the image before taking it could that be done?  Is it necessary to use a preview of the camera image or can I just call takepicture to take the picture and catch the resulting callback to save it to a file?   If so how would that be done?  </p><p>(It's been a long time since I've done any programming in Java) </p>","517490","","","","","2010-11-24 15:38:12","Android Camera use application","<android><camera>","3","0","1","",""
"4256558","1","","","2010-11-23 13:39:20","0","498","<p>I am beginner of Android.  I found the TabActivity with ExpandableListActivity example.I have 3 tabs, Artics, Album, Songs.  In the Album, with AlbumActivity I would liketo list all albums.  I run the programme, when I click on Album it run into error toforce down.  Where I did wrong?</p><p>album_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:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;    &lt;TextView android:id=""@+id/android:empty""          android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""@string/no_album""/&gt;&lt;/LinearLayout&gt;</code></pre><p>AlbumActivity.java</p><pre>public class AlbumsActivity extends ExpandableListActivity  {......onCreate...        setContentView(R.layout.album_list);        registerForContextMenu(getExpandableListView());</pre>","1312633","","","","","2011-06-01 02:37:18","Android Tabactivity with ExpandableListActivity","<android>","1","1","","",""
"4256734","1","4256772","","2010-11-23 14:00:40","11","30851","<p>I am a recent computer science student and have intermediate knowledge of java. However I am good at PHP.</p><p>Please suggest me a fastest way to learn Android and start developing apps immediately.</p>","517525","","29995","","2012-05-10 18:45:41","2012-05-10 18:45:41","What is the fastest way to learn Android and quickly start developing apps?","<android>","5","2","5","2012-05-10 21:26:09",""
"4256740","1","","","2010-11-23 14:01:48","3","1097","<p>As I understand it, I have three location providers to choose from: GPS, Network and Passive.</p><p>I would like to obtain my location by detecting the Wi-Fi network I'm connected to, I believe both Cell Triangulation and Wi-Fi location determination is covered under the Network provider.</p><p>However, despite being connected to a Wi-Fi access point, my program always seems to use cell triangulation rather than Wi-Fi to determine my location (assumed based on the huge inaccuracy of the returned coordinates).</p><p>It doesn't look like there's any way to force the use of Wi-Fi only? How does Android decide when to use Wi-Fi over cell triangulation?</p>","172749","","","","","2010-11-23 14:28:51","Android: Force use of Wi-Fi as Location Provider","<android><geolocation><location><wifi><provider>","1","0","2","",""
"4256829","1","4256876","","2010-11-23 14:12:21","3","15872","<p>I'm trying to get the street name of my current location but I can't seem to get it.</p><p>I use this method to retrieve the Address:</p><pre><code>public Address getAddressForLocation(Context context, Location location) throws IOException {        if (location == null) {            return null;        }        double latitude = location.getLatitude();        double longitude = location.getLongitude();        int maxResults = 1;        Geocoder gc = new Geocoder(context, Locale.getDefault());        List&lt;Address&gt; addresses = gc.getFromLocation(latitude, longitude, maxResults);        if (addresses.size() == 1) {            return addresses.get(0);        } else {            return null;        }    }</code></pre><p>And then I can do things like. <code>address.getLocality()</code> and <code>address.getPostalCode()</code></p><p>But what I want is the street name. Like in ""Potterstreet 12"". When I print the AddressLine(0) and AddressLine(1) I only get the postalcode, city and country.</p><p>How can I retrieve the street name of the position i'm currently at?</p>","517460","","","","","2014-01-08 19:35:32","Getting street name from Address/Location object in Android","<android><google-maps><geolocation>","5","0","5","",""
"4256880","1","","","2010-11-23 14:18:49","1","944","<p>User of my Android app says that it's crashing, without the force close dialog - the Activity just disappears and homescreen is shown. He sent this error log, what does it mean?</p><pre><code>I/DEBUG   ( 1337): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***I/DEBUG   ( 1337): Build fingerprint: 'verizon/inc/inc/inc:2.1-update1/ERE27/161494:user/release-keys'I/DEBUG   ( 1337): pid: 13046, tid: 13059  &gt;&gt;&gt; cz.fhejl.pubtran &lt;&lt;&lt;I/DEBUG   ( 1337): signal 11 (SIGSEGV), fault addr 0000000bI/DEBUG   ( 1337):  r0 00000003  r1 000000ab  r2 00000008  r3 00000002I/DEBUG   ( 1337):  r4 46d29d3e  r5 43057f08  r6 4730cca8  r7 00000846I/DEBUG   ( 1337):  r8 ad0100c0  r9 00000008  10 45052698  fp 003722a0I/DEBUG   ( 1337):  ip 00000046  sp 4730cc68  lr ad014bb8  pc ad01125c  cpsr 20000010I/DEBUG   ( 1337):          #00  pc 0001125c  /system/lib/libdvm.soI/DEBUG   ( 1337):          #01  pc 0001ac10  /system/lib/libdvm.soI/DEBUG   ( 1337):          #02  pc 0001a0c4  /system/lib/libdvm.soI/DEBUG   ( 1337):          #03  pc 00050fe0  /system/lib/libdvm.soI/DEBUG   ( 1337):          #04  pc 00051012  /system/lib/libdvm.soI/DEBUG   ( 1337):          #05  pc 00045598  /system/lib/libdvm.soI/DEBUG   ( 1337):          #06  pc 00010010  /system/lib/libc.soI/DEBUG   ( 1337):          #07  pc 0000fae4  /system/lib/libc.soI/DEBUG   ( 1337): I/DEBUG   ( 1337): code around pc:I/DEBUG   ( 1337): ad01124c e7950102 e7951103 e3500000 0a000f66 I/DEBUG   ( 1337): ad01125c e5903008 e0800101 e1510003 2a000f49 I/DEBUG   ( 1337): ad01126c e1f470b4 e5902010 e207c0ff e7852109 I/DEBUG   ( 1337): I/DEBUG   ( 1337): code around lr:I/DEBUG   ( 1337): ad014ba8 112fff10 ea000003 e1a00004 fa01340e I/DEBUG   ( 1337): ad014bb8 e3500000 112fff10 e5054008 e24f800c I/DEBUG   ( 1337): ad014bc8 e2488c4b e1d470b0 e5960038 e3500000 I/DEBUG   ( 1337): I/DEBUG   ( 1337): stack:I/DEBUG   ( 1337):     4730cc28  000003a0  I/DEBUG   ( 1337):     4730cc2c  4513aca8  /dev/ashmem/mspace/dalvik-heap/2 (deleted)I/DEBUG   ( 1337):     4730cc30  00000018  I/DEBUG   ( 1337):     4730cc34  ad01859c  /system/lib/libdvm.soI/DEBUG   ( 1337):     4730cc38  40036740  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)I/DEBUG   ( 1337):     4730cc3c  43057f08  I/DEBUG   ( 1337):     4730cc40  ad08b368  /system/lib/libdvm.soI/DEBUG   ( 1337):     4730cc44  00000322  I/DEBUG   ( 1337):     4730cc48  ad0100c0  /system/lib/libdvm.soI/DEBUG   ( 1337):     4730cc4c  46d29c32  /data/dalvik-cache/data@app@cz.fhejl.pubtran.apk@classes.dexI/DEBUG   ( 1337):     4730cc50  45052698  /dev/ashmem/mspace/dalvik-heap/2 (deleted)I/DEBUG   ( 1337):     4730cc54  ad046099  /system/lib/libdvm.soI/DEBUG   ( 1337):     4730cc58  46d29c32  /data/dalvik-cache/data@app@cz.fhejl.pubtran.apk@classes.dexI/DEBUG   ( 1337):     4730cc5c  46d29d38  /data/dalvik-cache/data@app@cz.fhejl.pubtran.apk@classes.dexI/DEBUG   ( 1337):     4730cc60  df002777  I/DEBUG   ( 1337):     4730cc64  e3a070ad  I/DEBUG   ( 1337): #00 4730cc68  00000000  I/DEBUG   ( 1337):     4730cc6c  4730cca8  I/DEBUG   ( 1337):     4730cc70  00015fc8  [heap]I/DEBUG   ( 1337):     4730cc74  ad01aba8  /system/lib/libdvm.soI/DEBUG   ( 1337):     4730cc78  43057fe4  I/DEBUG   ( 1337):     4730cc7c  ad08ddc8  /system/lib/libdvm.soI/DEBUG   ( 1337):     4730cc80  4730ced8  I/DEBUG   ( 1337):     4730cc84  429ee550  /data/dalvik-cache/system@framework@framework.jar@classes.dexI/DEBUG   ( 1337):     4730cc88  003722a0  [heap]I/DEBUG   ( 1337):     4730cc8c  ad01ac14  /system/lib/libdvm.soI/DEBUG   ( 1337): #01 4730cc90  003722a0  [heap]I/DEBUG   ( 1337):     4730cc94  4730cca8  I/DEBUG   ( 1337):     4730cc98  ad01aba8  /system/lib/libdvm.soI/DEBUG   ( 1337):     4730cc9c  ad01a0c8  /system/lib/libdvm.so</code></pre><p>This is log output, after the moment it crashes. My app doesn't use NDK, it uses Android Library Project and I'm loading some classes via Class.forName(...).</p>","243225","","","","","2010-11-24 00:14:31","What does this Android error log mean?","<android>","1","3","","",""
"4256955","1","4257528","","2010-11-23 14:27:11","0","1482","<p>I'm trying to understand Android's View structure and I'm a little confused on how to position child views </p><p>Let's say I have a <code>FrameLayout</code> that will contain my custom view. My custom view only draws a rectangle 50x50 px. </p><p>So I set my <code>View.setMeasureDimension(50, 50);</code> Now how should I move this view? I found a couple of ways of doing it.</p><p>1: I could do something like <code>canvas.drawRect(new Rect(offsetX, offsetY, right, bottom));</code> but this will make my View larger and thereby <code>my measureWidth / height</code> are not valid any longer?</p><p>2: Set padding on the parent element, and thereby affect the <code>left / top View.getLeft() / View.getTop()</code>. But this will affect all child elements.</p><p>3: Use <code>View.offsetLeftAndRight( number of pixels to move )</code>. I do not quite understand what this actually does. Does it cause some kind of <code>canvas.translate()</code> ? But this way I need to keep the state on how many times I called <code>offsetLeftANdRight()</code> because calling <code>offsetLeftANdRight(10)</code> and then <code>offsetLeftANdRight(10)</code> will move it 20px.</p><p>I'm a bit confused on what way is the ""correct"" way of doing it. Is there a better way?</p>","246234","","72882","","2012-12-13 21:38:20","2012-12-13 21:38:20","Position subviews in Android","<android><android-layout>","1","0","","",""
"4256970","1","","","2010-11-23 14:28:57","0","352","<p>I'm using db4o to store different objects in an android application. I get json contents from a sever then them into Objects (contacts here) that I store in a db4o file.</p><pre><code>ObjectContainer mainDB = Db4oEmbedded.openFile(dbConfig(), DB_MAIN);mainDB.store(aContact);</code></pre><p>Now if I directly make a query to get them back from the DB, it works.</p><pre><code>try {ObjectSet&lt;Contact&gt; result = db.queryByExample(Contact.class);contacts = new ArrayList&lt;Contact&gt;(result);} catch (Exception e) {e.printStackTrace();}</code></pre><p>I can loop on the arraylist and the contacts are there, I can print their names and other fiels. But now if I close de db :</p><pre><code>mainDB.close();</code></pre><p>If I reopen it with the same code, there's nothing inside anymore, contacts.size() returns 0.What's wrong? Any idea? Thanks in advance...</p>","507323","","","","","2010-11-26 00:19:09","DB4O close() wipe the DB?","<android><database><db4o><object-persistence>","2","5","1","",""
"4257045","1","8698364","","2010-11-23 14:34:19","3","16010","<p>how can I register my application so that when I receive a sms my app appears in dialog Complete action using. I have put in an intent code</p><pre><code>&lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW""/&gt;            &lt;action android:name=""android.intent.action.SENDTO""/&gt;            &lt;category android:name=""android.intent.category.DEFAULT""/&gt;            &lt;category android:name=""android.intent.category.BROWSABLE""/&gt;            &lt;data android:scheme=""sms""/&gt;&lt;/intent-filter&gt;</code></pre><p>but it's not working... should I use receiver? Note that the activity in which I've inserted this code is not main activity. Thanks</p>","517558","","","","","2012-05-03 22:14:14","android: register application to receive sms","<android>","4","0","3","",""
"4257161","1","","","2010-11-23 14:45:44","4","2328","<p>How can I detect key presses reliably with a hard or soft keyboard?</p><p>My app remotely controls another device over wifi, and I need to detect every key press on either a soft or hard keyboard.  I don't really need an EditText because I just need to send the characters one at a time as they are pressed and don't need the final text string.</p><p>I have tried using an EditText with OnKeyPress, but ran into the problems <a href=""http://stackoverflow.com/questions/1967740/onkeylistener-not-working-with-soft-keyboard-android"">here</a> with not getting key presses with soft keyboards.  And <a href=""http://developer.android.com/intl/zh-CN/reference/android/text/TextWatcher.html"" rel=""nofollow"">TextWatcher</a> isn't a good option because I need each key press.</p><p>I'll use an EditText if I have to, but would prefer not to.  What I really want is to:</p><ul><li>Bring up a soft keyboard when the user hits a Search button</li><li>User presses keys and I transmit the codes to remote device.  Don't really need to see anything on screen in an EditText since it will be shown on the remote device</li><li>User presses the custom Done button on the soft keyboard to close it</li></ul><p>Any suggestions?</p>","264604","","","","","2010-11-23 17:26:24","Soft keyboard without an EditText & detecting key presses","<android><keyboard><onkeydown>","1","2","","",""
"4257193","1","","","2010-11-23 14:48:15","0","901","<p>I have a problem with seeking with Android MediaPlayer class. I am playing a local video file, drawing it on a surfaceView. It plays ok, but when I call seekTo(msec) it does not seek. Furhermore, I added a listener (OnSeekComplete) and added callback.</p><p>It never gets to the onSeekComplete method. Does anyone know why is that, any  good reason, any good workarond ?</p>","346583","","","","","2010-11-23 17:29:14","Android::MediaPalyer.seekTo() method not working","<android><media-player><seek>","1","0","","",""
"4257242","1","4262510","","2010-11-23 14:51:46","2","4625","<p>Hi There I'm looking to create a custom call application.</p><p>i.e I want to replace the default application handling call :S.</p><p>I'M SURE THAT <strong>I WANT TO REINVENT THE WHEEL</strong>  Sometimes current wheels are ain't good for me.</p><p>Can you put me on a start up line. I used to be a married to M$ "".net developer"", and I'm in love with gOOgle.</p>","200428","","","","","2012-06-04 17:15:40","Create a custom call handling Application","<android><call><phone>","2","1","1","",""
"4257265","1","4265275","","2010-11-23 14:53:40","2","3118","<p>When you talk on the phone in Android the light sensor is working. If you cover the top left corner of the screen, the display turns black and you can't see anything.</p><p>I would like to cancel that feature and I tried working with <a href=""http://developer.android.com/intl/fr/reference/android/hardware/Sensor.html"" rel=""nofollow"">Android Sensors</a> and the <a href=""http://developer.android.com/intl/fr/reference/android/hardware/Sensor.html#TYPE_LIGHT"" rel=""nofollow"">Light Sensor</a> but it is not working.</p><p>This is my code:</p><pre><code> senMgrLight=(SensorManager)getSystemService(Context.SENSOR_SERVICE);    senMgrLight.registerListener(onSensorListener,            senMgrLight.getDefaultSensor(Sensor.TYPE_LIGHT),                SensorManager.SENSOR_DELAY_FASTEST);</code></pre><p>Thanks.</p>","178016","","","","","2011-10-16 03:22:25","Disable Light sensor during call - Android","<android><sensor>","4","0","1","",""
"4257374","1","5019422","","2010-11-23 15:02:46","38","19668","<p>I'm looking for a good ORM for my android application and at first glance it seems like for a mobile device I would prefer to use something simpler maybe. The thing is I'm just assuming here with no real evidence, so I thought I would ask the community's opinion (maybe there's is someone that has been through the experience). It is a fairly large(for mobile) application and will be run on a dedicated tablet.</p><p>What does everyone else think ? Is Hibernate too much for an android application ? Will there be performance problems ?</p><p>What would you use instead if you think it is too much ?</p><p>I am aware there are other questions asking for alternatives, but I decided to ask since most of those questions simply assumed it was an overkill and asked for other options and I started wondering ""Is it really and overkill ? Why ?"" Due to my lack of experience I simply think it it, but can't really provide an answer if I'm asked to explain why. Is it performance ? Is it too much configuration (Which I don't mind) ? </p><p>Thanks!</p>","146100","","146100","","2010-11-23 15:16:36","2012-11-22 10:59:17","Is Hibernate an overkill for an Android application?","<java><android><performance><hibernate>","3","0","16","2013-09-18 18:56:07",""
"4257464","1","4257517","","2010-11-23 15:11:55","2","4593","<p>I am adding a series of custom views to a LinearLayout.  I have overridden the onMeasure method of these custom views, to return the dimensions based on certain parameters.  Based on user input, I would like to change these parameters, to change the size of the views.  How can I force the LinearLayout to ""re-layout"" it's children, to reflect the new dimensions?</p><p>Thank you</p>","426493","","","","","2010-11-23 15:16:28","In Android, how to re-layout views?","<android>","1","0","","",""
"4257616","1","4257656","","2010-11-23 15:23:31","1","614","<p>i am having an xml main.xml,which has few layouts</p><blockquote>  <p>LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""      android:id=""@+id/mainl""      android:tag=""aa""      android:orientation=""vertical""      android:layout_height=""wrap_content""      android:layout_width=""fill_parent""</p>    <p>/LinearLayout</p></blockquote><p>Is it possible to add one more layout inside the LinearLayout from the Activity at Runtime.i am able to create Layout in Activity(without using xml) ,but problem in adding this layout to xml at runtime ,anyone has a solution</p>","413770","","","","","2010-11-23 17:38:20","android layout form activity","<android>","2","0","","",""
"4257695","1","4265279","","2010-11-23 15:30:21","0","444","<p>I downloaded the 'ExampleAppWidget' (by Android Official documentation).I opened it with Eclipse. I've no compiling errors.I'm trying to test it pressing <kbd>F11</kbd> key (as with a classic application that is not a widget), but I think that this is not the right way, as a matter of fact Android return me a null pointer exception at runtime.The question is: HOW TO TEST A WIDGET DEVELOPED WITH ECLIPSE, ON ANDROID?</p><p>Thanks very much indeed in advance!Geltry</p>","489146","","1391924","","2013-12-26 10:38:33","2013-12-26 10:38:33","beginner - how to test a widget?","<android><eclipse><android-widget>","2","0","","",""
"4257724","1","4849414","","2010-11-23 15:32:44","2","1431","<p>I have the following framework for my application:1. a Network thread that runs in the background (a queue) for issuing request and get async responses. The thread is started and stopped in the Application Object so it's leaving through out the whole application.2. a DataManager which is also a member of Application and has different DataManagers for the data types i retrieve from the network. the data manager itself is the listener for the responses from the network so it's safe until the application itself dies.3. this is the problematic part. Some of my Adapters and part of my Activities are DataListeners for my DataManagers, that means that the data manager keeps a reference to them.</p><p>When a phone call or some other phone event occurs i've noticed that the activity is usually in paused and not destroyed and so receives my events, which is ok. the problem starts when landscape\portrait is changed. since i keep a referenced to the activity in an Application bound object, the activity can't be destroyed on one hand, BUT the event is still getting to the listener, only the wrong one...Basically i can fix that issue by removing the listener in onDestroy and retaining configuration boolean to tell me that request was allready issues and i just need to put a listener and try to retrieve the data from the data manager.</p><p>However :-) i was wondering how android handles this cases usually, if for example this was a Service running. or if the Service is a local Service that used Bound and passed on the Activity as a Listener to the network Event, the same things happen, untill the listener is not removed the Activity is leaked and lives on, but without it, no way to get callbacks from the network...an Intent requires serilaztion and deserilazation of data which can be heavy (Bitmaps for example?)</p><p>And anywa, asuming i send an intent on each respose i get, how do i get the intent to the Activity (i know of getIntent, but if i get another one , not related, do i get it as an 'event' ?)</p>","312288","","","","","2011-01-31 09:44:49","Activity as a listener and memory leaks","<android><memory-leaks><activity>","3","0","3","",""
"4257843","1","4258060","","2010-11-23 15:42:35","22","29359","<p>I would like to create an EditText which only excepts numbers, has a maximum of 4 numbers, and is never narrower than it would be if filled with 4 numbers (does not shrink when empty, or have to expand to accommodate 4 numbers... is fixed.)</p><p>The first 2 are accomplished with: android:inputType=""number"" and android:maxLength=""4"".  How can I set the minimum length?</p><p>Thank you.</p>","426493","","","","","2013-09-12 07:19:50","In Android, how to create EditText of fixed width?","<android>","8","0","6","",""
"4257884","1","4258125","","2010-11-23 15:45:39","0","673","<p>I have developed an Android App that contains a list of information. I want the list to retrieve new data from the sever whenever the app 'wakes up' from multasking. Right now it just displays the old data and does not refresh.</p><p>Can someone tell me what function/method I am looking for?</p>","300129","","","","","2010-11-23 16:11:25","Android - Detect `App Became Active' from Mulitiasking?","<android><multitasking><wakeup>","2","0","","",""
"4257976","1","4258659","","2010-11-23 15:56:40","4","1711","<p>I have an options menu (it pops up when you press the menu key of the phone) with 5 buttons, all of them with one 48x48 image and text.</p><p>Now the five buttons are displayed in two rows, but I want to reduce the size of them to fit all five buttons into one row.</p><p>How can I achieve this?</p><p>Can I do it with parameters in the menu's layout XML file?</p>","479886","","535664","","2011-04-28 19:46:40","2011-04-28 19:46:40","How can i change the size of the buttons of my options menu?","<android><options-menu>","2","0","0","",""
"4258152","1","4258240","","2010-11-23 16:13:55","1","265","<p><strong>Emulator --- Device</strong></p><p>Hey people. I'm not very experienced in Android development, so I would like to know what I have to expect.</p><p>I wrote an app of about 1000 lines of code, which is running perfectly fine in the emulator. So what will it be like when I install it on a physical device? Ain't got one here at the moment, but I will get my hands on one on the next days. Will there be a bunch of nasty errors? Just some design stuff? Errors, that cant be reproduced in the emulator?</p><p>Thanks in advance</p><p>EnflamedSoul</p>","486084","","","","","2010-11-23 16:21:52","Emulator to Physical","<android><android-emulator>","3","7","","",""
"4258241","1","","","2010-11-23 16:21:55","0","674","<p>Hey Guys! How one Android application can query other applications (permissions and usage), like<a href=""https://www.mylookout.com/premium/"" rel=""nofollow"">mylookout app</a>, I'm fascinated by that!I thought that my app cannot be access by other apps (just via content provider\remote services)....</p><p>Thanks M</p>","517329","","517329","","2010-11-24 07:31:12","2011-02-22 19:23:41","Query Other App Permissions","<android><security><permissions><apk>","1","0","","",""
"4258322","1","4258387","","2010-11-23 16:29:03","1","101","<p>I start a new activity when clicking on a button , but the content(ui components) of the new activity doesn't appear , why ??</p><pre><code>button listener to start new activity   m_sendButton.setOnClickListener(      new OnClickListener(){       public void onClick(View view) {       Intent in = new Intent(context, SendMessageForm.class);                            // i.putExtra(""id"",""4"");       context.startActivity(in);        //Toast toast = Toast.makeText(context, ""Error. Please try again later"", Toast.LENGTH_SHORT);       //toast.show();        } }    ); </code></pre><p>SendMessageForm.java</p><pre><code>import android.app.Activity;import android.os.Bundle;public class SendMessageForm extends Activity { public void onCreat(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.search_result_form); }}</code></pre><p>search_result_form.xml (just for test)</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/rootLayout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;Button android:text=""Send"" android:id=""@+id/btnBacksds""     android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","508377","","244296","","2010-11-23 16:33:04","2010-11-23 16:34:02","why the content of the activity doesn't appear (in android)?","<android>","1","0","","",""
"4258340","1","4258578","","2010-11-23 16:30:31","1","309","<p>Usually when an <code>Activity</code> starts using an <code>Intent</code> ,it uses from right to left transitions.i want to start activity that uses from left to right transitions.How to do this?</p>","461972","","844882","","2012-03-22 20:23:19","2012-03-22 20:23:39","Activity on android","<android>","2","0","3","",""
"4258388","1","","","2010-11-23 16:34:37","1","1171","<p>I am new to andorid , I want help with google custom search api use in android</p>","517711","","","","","2010-11-23 16:34:37","any example for google custom search api in android","<android>","0","2","","",""
"4258493","1","4398926","","2010-11-23 16:43:10","4","5187","<p>I newbie in Android and before ask question here i was googling, but on this question i can't find answer. (also this stackoverflow.com/questions/4195089 don't have answer).</p><p>In my test app on emulator i have error <strong>ERROR/Cursor(1512): Invalid statement in fillWindow()</strong> on LogCat when i press back button on second activity.<br /><sub><i>11-23 19:06:05.050: DEBUG/TestDB/Debug/MainActivity(1512): onCreate<br />11-23 19:06:06.820: DEBUG/TestDB/Debug/MainActivity(1512): openDataBase<br />11-23 19:06:07.240: DEBUG/TestDB/Debug/MainActivity(1512): String[] from<br />11-23 19:06:07.270: DEBUG/TestDB/Debug/MainActivity(1512): SimpleCursorAdapter<br />11-23 19:06:07.500: DEBUG/TestDB/Debug/MainActivity(1512): myDbHelper.close<br />11-23 19:06:07.520: DEBUG/TestDB/Debug/MainActivity(1512): onStart<br />11-23 19:06:07.551: DEBUG/TestDB/Debug/MainActivity(1512): onResume<br />11-23 19:06:09.040: INFO/ActivityManager(587): Displayed activity ru.olegi/.MainActivity: 7962 ms<br />11-23 19:06:11.850: INFO/ActivityManager(587): Starting activity: Intent { comp={ru.olegi/ru.olegi.AnotherActivity} }<br />11-23 19:06:12.100: DEBUG/TestDB/Debug/AnotherActivity(1512): onCreate<br />11-23 19:06:12.970: INFO/ActivityManager(587): Displayed activity ru.olegi/.AnotherActivity: 1100 ms<br />11-23 19:06:14.550: ERROR/Cursor(1512): Invalid statement in fillWindow()<br />11-23 19:06:14.590: DEBUG/TestDB/Debug/MainActivity(1512): onStart<br />11-23 19:06:14.600: DEBUG/TestDB/Debug/MainActivity(1512): onResume<br /></i></sub><br/></p><p>All code stored in onCreate. So when i press back, ListView is empty. For fix this i move code to onStart. Here is log for this and again have Invalid statement in fillWindow()<br /><sub><i>11-23 19:26:06.280: DEBUG/TestDB/Debug/MainActivity(6597): onCreate<br />11-23 19:26:06.462: DEBUG/TestDB/Debug/MainActivity(6597): onStart<br />11-23 19:26:06.700: DEBUG/TestDB/Debug/MainActivity(6597): openDataBase<br />11-23 19:26:06.740: DEBUG/TestDB/Debug/MainActivity(6597): String[] from<br />11-23 19:26:06.750: DEBUG/TestDB/Debug/MainActivity(6597): SimpleCursorAdapter<br />11-23 19:26:06.981: DEBUG/TestDB/Debug/MainActivity(6597): myDbHelper.close<br />11-23 19:26:07.010: DEBUG/TestDB/Debug/MainActivity(6597): onResume<br />11-23 19:26:08.030: INFO/ActivityManager(587): Displayed activity ru.olegi/.MainActivity: 3876 ms<br />11-23 19:26:15.419: INFO/ActivityManager(587): Starting activity: Intent { comp={ru.olegi/ru.olegi.AnotherActivity} }<br />11-23 19:26:15.770: DEBUG/TestDB/Debug/AnotherActivity(6597): onCreate<br />11-23 19:26:16.440: INFO/ActivityManager(587): Displayed activity ru.olegi/.AnotherActivity: 1001 ms<br />11-23 19:26:17.860: ERROR/Cursor(6597): Invalid statement in fillWindow()<br />11-23 19:26:17.870: DEBUG/TestDB/Debug/MainActivity(6597): onStart<br />11-23 19:26:18.260: DEBUG/TestDB/Debug/MainActivity(6597): openDataBase<br />11-23 19:26:18.290: DEBUG/TestDB/Debug/MainActivity(6597): String[] from<br />11-23 19:26:18.310: DEBUG/TestDB/Debug/MainActivity(6597): SimpleCursorAdapter<br />11-23 19:26:18.670: DEBUG/TestDB/Debug/MainActivity(6597): myDbHelper.close<br />11-23 19:26:18.700: DEBUG/TestDB/Debug/MainActivity(6597): onResume</i></sub><br /></p><p>This code </p><pre><code>package ru.olegi;import java.io.IOException;import android.app.Activity;import android.content.Intent;import android.database.Cursor;import android.database.SQLException;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class MainActivity extends Activity {    /** Called when the activity is first created. */    private DatabaseHelper myDbHelper;      private ListView lv1;       @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Log.d(""TestDB/Debug/MainActivity"", ""onCreate"");                  setContentView(R.layout.main);            }    @Override    public void onStart() {        super.onStart();        Log.d(""TestDB/Debug/MainActivity"", ""onStart"");        // DATABASE OPEN - START        DatabaseHelper myDbHelper = new DatabaseHelper(this);        myDbHelper = new DatabaseHelper(this);        try {            myDbHelper.createDataBase();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }                  try {            myDbHelper.openDataBase();        }catch(SQLException sqle){            throw sqle;        }                Log.d(""TestDB/Debug/MainActivity"", ""openDataBase"");                // DATABASE OPEN - END        Cursor c = myDbHelper.fetchAllFoodname();        startManagingCursor(c);                               lv1 = (ListView) findViewById(R.id.ListView01);        String[] from = new String[] { DatabaseHelper.KEY_NAME };        int[] to = new int[] { android.R.id.text1};        Log.d(""TestDB/Debug/MainActivity"", ""String[] from"");        SimpleCursorAdapter notes =            new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, c, from, to);        Log.d(""TestDB/Debug/MainActivity"", ""SimpleCursorAdapter"");        lv1.setAdapter(notes);        lv1.setOnItemClickListener(new OnItemClickListener() {                  //@Override                 public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {                Intent intent = new Intent();                //getApplicationContext()                intent.setClass(MainActivity.this, AnotherActivity.class);                //intent.putExtra(AnotherActivity.EXT_ID, id);                              startActivity(intent);                //finish();             }            });           // DATABASE CLOSE - START               myDbHelper.close();        Log.d(""TestDB/Debug/MainActivity"", ""myDbHelper.close"");        // DATABASE CLOSE - END             }        @Override    public void onResume(){        super.onResume();        Log.d(""TestDB/Debug/MainActivity"", ""onResume"");     }    @Override    public void onDestroy(){        super.onDestroy();        Log.d(""TestDB/Debug/MainActivity"", ""onDestroy"");            }        }</code></pre><p>Here groups.google.com/group/android-developers/browse_thread/thread/8bec793c626fb405 i read, for fix fillwindow() error need</p><blockquote>  <p>Short answer; Your database object  (db) is in the wrong scope.  Longer  answer; By declaring db in the method  you're saying to the JVM  that when  the method finishes your database  connection (db) is no  longer useful.  What you should do is declare db at  the class level  instead of the method  level, create it in onCreate, and  close it in  onDestroy.</p></blockquote><p>Ok, i move sections // DATABASE OPEN - START and // DATABASE CLOSE - START to onCreate and to onDestory. And now i have exception on start<br /><sub><i>11-23 19:35:39.310: DEBUG/TestDB/Debug/MainActivity(8975): onCreate<br />11-23 19:35:40.050: DEBUG/TestDB/Debug/MainActivity(8975): openDataBase<br />11-23 19:35:40.050: DEBUG/TestDB/Debug/MainActivity(8975): onStart<br />11-23 19:35:40.090: DEBUG/AndroidRuntime(8975): Shutting down VM<br />11-23 19:35:40.100: WARN/dalvikvm(8975): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)<br />11-23 19:35:40.120: ERROR/AndroidRuntime(8975): Uncaught handler: thread main exiting due to uncaught exception<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975): java.lang.RuntimeException: Unable to start activity ComponentInfo{ru.olegi/ru.olegi.MainActivity}: java.lang.NullPointerException<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at android.os.Handler.dispatchMessage(Handler.java:99)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at android.os.Looper.loop(Looper.java:123)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at android.app.ActivityThread.main(ActivityThread.java:3948)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at java.lang.reflect.Method.invokeNative(Native Method)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at java.lang.reflect.Method.invoke(Method.java:521)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at dalvik.system.NativeStart.main(Native Method)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975): Caused by: java.lang.NullPointerException<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at ru.olegi.MainActivity.onStart(MainActivity.java:59)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1205)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at android.app.Activity.performStart(Activity.java:3490)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2240)<br />11-23 19:35:40.300: ERROR/AndroidRuntime(8975):     ... 11 more<br /></i></sub><br /></p><p>Here is code with moved db-sections:</p><pre><code>package ru.olegi;import java.io.IOException;import android.app.Activity;import android.content.Intent;import android.database.Cursor;import android.database.SQLException;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class MainActivity extends Activity {    /** Called when the activity is first created. */    private DatabaseHelper myDbHelper;      private ListView lv1;       @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Log.d(""TestDB/Debug/MainActivity"", ""onCreate"");                  setContentView(R.layout.main);        // DATABASE OPEN - START        DatabaseHelper myDbHelper = new DatabaseHelper(this);        myDbHelper = new DatabaseHelper(this);        try {            myDbHelper.createDataBase();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }                  try {            myDbHelper.openDataBase();        }catch(SQLException sqle){            throw sqle;        }                Log.d(""TestDB/Debug/MainActivity"", ""openDataBase"");                // DATABASE OPEN - END    }    @Override    public void onStart() {        super.onStart();        Log.d(""TestDB/Debug/MainActivity"", ""onStart"");        Cursor c = myDbHelper.fetchAllFoodname();        startManagingCursor(c);                               lv1 = (ListView) findViewById(R.id.ListView01);        String[] from = new String[] { DatabaseHelper.KEY_NAME };        int[] to = new int[] { android.R.id.text1};        Log.d(""TestDB/Debug/MainActivity"", ""String[] from"");        SimpleCursorAdapter notes =            new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, c, from, to);        Log.d(""TestDB/Debug/MainActivity"", ""SimpleCursorAdapter"");        lv1.setAdapter(notes);        lv1.setOnItemClickListener(new OnItemClickListener() {                  //@Override                 public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {                Intent intent = new Intent();                //getApplicationContext()                intent.setClass(MainActivity.this, AnotherActivity.class);                //intent.putExtra(AnotherActivity.EXT_ID, id);                              startActivity(intent);                //finish();             }            });       }        @Override    public void onResume(){        super.onResume();        Log.d(""TestDB/Debug/MainActivity"", ""onResume"");     }    @Override    public void onDestroy(){        super.onDestroy();        Log.d(""TestDB/Debug/MainActivity"", ""onDestroy"");        // DATABASE CLOSE - START               myDbHelper.close();        Log.d(""TestDB/Debug/MainActivity"", ""myDbHelper.close"");        // DATABASE CLOSE - END         }        }</code></pre><p>Please, help fix <strong>Invalid statement in fillWindow()</strong></p><p>AnotherActivity - is simple with TextView, MainActivity have only listview + onclick listener</p>","515837","","","","","2011-11-22 08:39:19","invalid statement in fillwindow() in Android","<android><sqlite><leak>","1","0","0","",""
"4258517","1","4258684","","2010-11-23 16:44:55","6","237","<p>I have an application that lets users create different forms (surveys) and then fill them. (so its a substitute for paper).</p><p>Here's the current model i'm using in the app:</p><pre><code> Table 1)+-------------------------+|      SURVEYS TABLE      |   +----+------+-------------+| ID | name | description |  +----+------+-------------+ Table 2)   +-----------------------------------+|       $[name_of_the_survey]       |+----+-------+------+-------+-------+| ID | field | type | value | items |+----+-------+------+-------+-------+ Table 3)+--------------------------------------+|    $[name_of_the_survey] _records    |+----+---------------------------------+| ID | columns specific to each survey |+----+---------------------------------+</code></pre><p>so basically when a user creates a survey, the programs inserts a record in Surveys Table and then creates 2 tables:</p><p>table (2) for the fields of the form table (3) for the records that will be stores, in which the columns correspond to table (2) rows.</p><p>It works but has some limitations. For instance, when you which to add a field to table (2), it has to read table (3) contents, save it to a virtual table, drop previous table (3) and create a new one. This can be a performance issue when the table(3) has a lot of records. </p><p>So my question is... Is there a better database design?</p>","295342","","","","","2010-11-23 17:51:33","What is best: 1 table per record or 1 table with all records linked with foreign keys?","<android><database><database-design><sqlite>","2","2","3","",""
"4258579","1","","","2010-11-23 16:52:03","2","2291","<p>When you normally want to add an AppWidget in Android there is a list where you need to pick one widget and it binds it to the home screen.</p><p>I'm trying to build an app which has its own <a href=""http://developer.android.com/intl/fr/reference/android/appwidget/AppWidgetHost.html"" rel=""nofollow"">appWidgetHost</a> and specific App Widgets that I built for it.</p><p>I have two problems:</p><ol><li>I would like to be able to automatically bind a widget to my AppWidgetsHost without the user picking from the list.</li><li>I want to make my own 'pick widgets list' and to load <strong>only</strong> widgets that I have created.</li></ol><p>To make it simple; There is my app with my AppWidgets and I want full control in terms of binding a appWidget to the appWidgetHost etc.</p><p>3 people asked similar questions in Google forums:</p><ol><li><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/f24e0f484a79d529"" rel=""nofollow"">Link 1</a></li><li><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/231245ba6d1e690f/047b9d3f776d7e54?lnk=gst&amp;q=bindAppWidgetId#047b9d3f776d7e54"" rel=""nofollow"">Link 2</a></li><li><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/e4a5b4a87afcf707"" rel=""nofollow"">Link 3</a></li></ol><p>The only answer I found to be a possibility is in link number 2. Paraneet (one of the repliers) said that you can install the app under /system/app instead of /data/app because some security issue. but I'm not sure if it is a reliable solution for production, and I would like to know more about the pros and cons of doing this.</p><p>Thanks, Shai.</p>","178016","","","","","2011-10-17 13:36:20","Binding AppWidgets to AppWidgetHost - Android","<android><android-widget><appwidget>","1","0","","",""
"4258623","1","","","2010-11-23 16:56:03","2","6960","<p>I am displaying a dialog with an edittext view. However, the softkeyboard will open only if the user presses inside the editview. So i tried calling an InputMethodManager with the following code</p><pre><code>InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);imm.showSoftInput(dialogField,0);</code></pre><p>The dialogField is the input field. However, when exactly am I supposed to do this? I tried it in the onStart() method of the dialog, but nothing happens. I also tried requesting the focus for the dialogField before, but that changes nothing.</p><p>I also tried this code</p><pre><code>  dialogField.setOnFocusChangeListener(new View.OnFocusChangeListener()  {   public void onFocusChange (View v, boolean hasFocus)   {    if (hasFocus)    {     Main.log(""here"");     dialogInput.getWindow().setSoftInputMode(       WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);     /*     InputMethodManager mgr =      (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);     mgr.showSoftInput(dialogField,0);      */    }   }  });</code></pre><p>in both versions. But no soft keyboard would like to appear. The Main.log is just a log, which shows me that the function is actually called. And yes, it is called.</p><p>I could get the keyboard with the SHOW_FORCED flag before the dialog opens. But then it will not close on exit. And I can only do that BEFORE I show the dialog. Inside any callbacks it does not work either.</p><p>Thanks for help, RG</p>","447111","","1765573","","2013-07-27 07:27:37","2013-10-24 17:53:28","show soft keyboard for dialog","<android><android-softkeyboard><android-sdk-2.1>","4","3","","",""
"4258845","1","4258880","","2010-11-23 17:18:08","0","933","<p>I have a listview with a custom adapter that uses an sql cursor.  When I add items to my listview, the item will be added to my sqlite3 database and the listview will refresh.</p><p>My one problem is that I am able to add duplicate items, and I do not want my application to allow duplicates to be added.</p><p>I have added a primary key to my database (on itemNumber), however the database does not seem to be enforcing this.  Here is how I create my database:</p><pre><code>private static final String DB_CREATE_MASTER = ""CREATE TABLE ""            + ""MyTable""            + "" (_id INTEGER, itemNumber TEXT,""
            + ""itemPlace TEXT,"" + ""itemTimeTEXT,""
            + ""itemCode INTEGER,""
            + ""dbdatestamp TEXT"" + ""PRIMARY KEY(itemNumber)"" +"");"";</code></pre><p>Does anyone know why I am able to add more than 1 duplicate itemNumber to my listview?</p><p>Thanks!</p><hr><p>EDIT:</p><pre><code>private static final String DB_CREATE_MASTER = ""CREATE TABLE ""            + ""MyTable""            + "" (_id INTEGER PRIMARY KEY, itemNumber TEXT,""
            + ""itemPlace TEXT,"" + ""itemTimeTEXT,""
            + ""itemCode INTEGER,""
            + ""dbdatestamp TEXT"" + ""UNIQUE(itemNumber)"" +"");"";</code></pre><p>EDIT:</p><hr><p>This is how I add the itemNumber to the database:</p><pre><code>values.put(""itemNumber"", myClass.itemNumber);values.put(""itemName"", myClass.itemName);values.put(""itemTime"", myClass.itemTime);values.put(""dbdatestamp"", ""03/01/1960 08:55"");this.db.insert(MY_TABLE, null, values);</code></pre>","123891","","123891","","2010-11-23 18:35:03","2011-04-05 07:44:10","Android SQLite3 problem enforcing primary key","<java><android><database><sqlite><primary-key>","1","0","","",""
"4258890","1","4354260","","2010-11-23 17:24:02","2","2700","<p>In the moment I am working with some ad hoc routing protocols (namely <a href=""http://olsr.org/"" rel=""nofollow"">OLSR</a> and <a href=""http://www.open-mesh.org/"" rel=""nofollow"">B.A.T.M.A.N.</a>) on rooted Android devices running <a href=""http://www.cyanogenmod.com/"" rel=""nofollow"">Cyanogenmod</a>. My tests are working pretty well. However, there is one thing which really is annoying: I can only connect to an existing ad hoc network, but not create one manually using only the phones. Right now I am using my laptop to set up an ad hoc network and to run a small DHCP server.</p><p>Do you know how to create an ad hoc network manually by using the shell on Android? I have found some methods how this should work, but none did work for me. I tried using <code>ifconfig</code>, <code>iwconfig</code>, <code>netcfg</code> and even <code>wpa_cli</code> (which seemed to be the best choice for this). But after any try the system fell back into ""no wifi connected"" state - even if the phone stayed in ad hoc mode for a couple of seconds while searching for an IP.</p><p>I will be so gladful if I can finally get around this problem because then I might actually use my laptop for Internet access (and therefore searching for online help during the tests) instead of using it to set up an ad hoc network. :-)</p>","446461","","","","","2012-02-27 16:55:22","How to set up an ad hoc network by using the shell on a rooted Android device?","<android><wifi><root><adhoc><cyanogenmod>","2","5","3","",""
"4258972","1","4259136","","2010-11-23 17:33:04","0","113","<p>I use a few small images on my app and I was wondering if (and how) I could ensure that the size of the image is relative to the size of the phone?</p><p>Also, is there a way to shrink my layout on smaller phones so each layout fits within the screen - like if a random string (longer than others) would downsize in font so the whole layout was ensured to fit on the screen?</p><p>Thanks!</p>","496686","","","","","2010-11-23 17:51:24","WIll images sized on my phone be the same size on another phone?","<android><layout><dimensions><clipping>","1","1","","",""
"4258976","1","4260861","","2010-11-23 17:33:28","0","199","<p>I have got a stupid question to ask. I created a custom ContextMenu. But when i call the menu, the menu displayed will also have the default menu added in. Is there anyway for the default ContextMenu not to appear as well?</p><p>Code requested:<br>    @Override    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo)    {        super.onCreateContextMenu(menu, v, menuInfo);        MenuInflater inflater = getMenuInflater();        menu.setHeaderTitle(""Recipients"");        inflater.inflate(R.menu.menu_contacts, menu);    }</p>","504864","","504864","","2010-11-24 13:26:04","2010-11-24 13:26:04","Question regarding ContextMenu","<android>","1","1","","",""
"4259128","1","4259200","","2010-11-23 17:49:58","14","17640","<p>I would like to create a multilingual android application.</p><p>Is there a way to detect what language the user prefers?</p><p>Is there a recommended way to manage multiple languages on Android or should I reinvent the wheel?</p>","97688","","467090","","2011-10-26 02:22:20","2013-12-19 11:16:37","How can I create a multilingual android application?","<android><internationalization>","1","0","7","",""
"4259156","1","","","2010-11-23 17:53:35","1","418","<p>Is there a liveperson agent for android? Specificly one which pushes notifications to your phone when people request a chat.</p>","517817","","","","","2013-01-03 08:49:48","Android LivePerson Agent?","<android>","2","2","","",""
"4259236","1","4260536","","2010-11-23 18:02:15","2","2255","<p>When I compile an Android project within Eclipse, it doesn't generate any Ant scripts or anything, so I assume it's using the Eclipse compiler to generate the .class files, and using <code>dx</code> to translate those into .dex.  So that's fine, and I'm aware that the Eclipse compiler is different from <code>javac</code> and can't be changed.</p><p>But when I use <code>android</code> to generate a <code>build.xml</code> file, I see that it references other Ant files, and eventually I am able to track down the actual invocation to <code>javac</code>.  So I have a few questions about this.</p><ol><li>I'm an Ant newbie.  Does the <code>&lt;javac&gt;</code> Ant command correspond to the <code>javac</code> referenced by my <code>JAVA_HOME</code> env variable?  Or is it something else?</li><li>When you use the 'Export Application' option in Eclipse, does it still use the Eclipse compiler?  Will I always be forced to use a different compiler in Ant vs. in Eclipse?</li><li>Can I specify any compiler I want if I alter the <code>build.xml</code> file and change the ""compile"" target?</li></ol><p>I don't really care that much what compiler I'm using, I'm just curious.  The main thing I'm after is to make sure that I'm using a modern compiler and I can expect all the usual optimizations (e.g. the interning of string literals).  <strong>Am I correct in assuming this?</strong></p><p>P.S.  Speaking of optimizations, does <code>dx</code> do anything more fancy than simply translating one bytecode to another?</p>","213525","","213525","","2010-12-02 15:36:58","2010-12-02 15:36:58","What compiler does Android use and can I change it?","<java><android><eclipse><compiler>","3","0","","",""
"4259276","1","4259527","","2010-11-23 18:07:31","0","275","<p>I have just started with android ...</p><p>I have to develop an android application which should sync with data on webserver..</p><p>User adds some data using website, then data should be pulled and synced with data on android device...I am not sure how to implement this...</p><p>Also I have to show map path only between two points (src,dest).. I have googled and it lloks like there is no built-in... only way is to use overlays and draw method.. is my understanding correct??</p><p>Please help..</p>","511280","","","","","2010-11-25 05:46:05","Android : sync and map","<android><android-emulator>","1","0","","",""
"4259281","1","","","2010-11-23 18:08:10","0","639","<p>If I was trying to format some text in a TextView like a dictionary, what are the best parameters to use?  Something like?</p><p>Android\n[and-r-oid]\nDefinition:(character to tab goes here)</p><p>etc...</p><p>Anyone know of a good method without it looking sloppy on my screen?</p>","496686","","","","","2013-01-03 03:15:58","Proper spacing technique in text view to give a dictionary style theme:","<android><screen><textview><wrap>","1","2","","",""
"4259295","1","4259359","","2010-11-23 18:09:51","2","7563","<p>I have these radio buttons and they need <code>android:width=""X""</code> and <code>android:height""X""</code> however, I do not know how to set these properties so that they adapt to a different screen size.</p><p>Here is the code I'm using for my buttons:</p><pre><code>    &lt;RadioGroup android:layout_width=""fill_parent""        android:layout_height=""50px"" android:orientation=""horizontal""        android:checkedButton=""@+id/first"" android:id=""@+id/states""&gt;                &lt;RadioButton android:id=""@+id/first""                    android:background=""@drawable/button_radio"" android:width=""50px""                    android:height=""50px"" /&gt;                &lt;RadioButton android:id=""@+id/second""                    android:background=""@drawable/button_radio"" android:width=""50px""                    android:height=""50px"" /&gt;                &lt;RadioButton android:id=""@+id/third""                    android:background=""@drawable/button_radio"" android:width=""50px""                    android:height=""50px"" /&gt;                &lt;RadioButton android:id=""@+id/fourth""                    android:background=""@drawable/button_radio"" android:width=""50px""                    android:height=""50px"" /&gt;                &lt;RadioButton android:id=""@+id/fifth""                    android:background=""@drawable/button_radio"" android:width=""50px""                    android:height=""50px"" /&gt;    &lt;/RadioGroup&gt;</code></pre><p>I have tried putting the Radio buttons in a table row, but then they don't operate properly. When I click one, it selected it, but didn't unselect it when I clicked another.</p><p>I have tried replacing the <code>android:width</code> with <code>android:layout_width</code> but then they don't show.</p><p>I have also tried using dip, but then the buttons didn't show up.</p><p>I should also add that I am using drawables instead of the stock radio buttons. I don't know if this would make a difference, but the drawables are all the same size (50px x 50px).</p><p>Does anyone know how I can set the height and width of these so they will adjust themselves to different screen sizes?</p>","348261","","348261","","2010-11-23 18:22:21","2010-11-24 05:33:44","How can I set the width of radio buttons to change with regards to screen size? (android)","<android><size><radio-button><screen><resolution>","2","0","1","",""
"4259312","1","4548946","","2010-11-23 18:11:46","0","626","<p>I found introducing a directory ""values-notlong-ldpi"" did not work out for me</p><p><strong>Solved it:</strong> using -notlong-ldpi DID work. The mistake was somewhere else (the child overwrote the style info)</p><p>However, if u find a better way to address those devices, feel free to post it.</p>","433718","","433718","","2010-11-24 10:18:35","2010-12-28 19:45:53","How to address QVGA (320x240) devices (HTC Wildfire, SE x10 mini, Motorola Flipout) in the xml files of Android?","<android-xml><android><android-resolution>","2","1","","",""
"4259332","1","4259374","","2010-11-23 18:13:06","0","2664","<p>We have an android app that currently sends data to a php script which writes to a mysql DB on the same server. We are thinking of using a scalable remote DB e.g. amazon RDS.</p><p>The question is how does our android app write to these remote DBs? Do they have some kind of rest API, or do we have to send the data to the same php script on our server but use that to post to the remote mysql DB?</p><p>Thanks</p>","435281","","","","","2011-02-09 07:49:16","Insert data into a remote mysql database","<php><mysql><android>","2","0","","",""
"4259349","1","","","2010-11-23 18:14:36","1","95","<p>It seems their displays dont have enough colors. Right?</p><p>Can I do smth. about it? What shall I tell my designer?</p>","433718","","","","","2010-11-23 18:25:12","How to make gradiants look smooth on older / cheap Androids like HTC Magic?","<android><android-layout>","1","1","","",""
"4259356","1","","","2010-11-23 18:15:10","0","2647","<p>Probably this question is answered. If it is, could you point me in the right direction then.I would like to add the smooth scrolling functionality into my application. i.e. I have a huge text and I want to scroll it automatically (like in book readers) Could anyone offer any examples of smooth scrolling?</p><p>Thanks</p>","517806","","","","","2013-05-31 22:27:24","smooth scrolling","<android><scrolling><smooth>","2","0","","",""
"4259455","1","4260796","","2010-11-23 18:29:10","2","805","<p>I am trying to use the camera in two different threads, in one thread i am displaying the preview and in the other thread i am getting the data from the preview for calculating the rgb values in each preview frame, when i am trying to use the camera in two threads its giving me an error "" attempt to use locked camera"", i tried by locking and unlocking the camera for two threads but i didn't work, Could anyone please help me out with this.</p>","431092","","","","","2011-02-22 06:39:03","Using a camera in two different threads in android","<android>","1","0","2","",""
"4259467","1","4259531","","2010-11-23 18:32:12","24","41373","<p>I am programatically adding custom views to a vertical LinearLayout, and I would like there to be some space between the views.  I have tried adding: setPadding(0, 1, 0, 1) to my CustomView constructor, but this doesn't seem to have any effect.  Any advice?</p><p>*It was pointed out that I should use margins.  Since I am dynamically adding views, I need to set the margins from code (not in xml).  I believe the way to do this is below, but it isn't working.</p><pre><code>public class MyView extends View{    public MyView (Context context)    {        super(context);        MarginLayoutParams params = new MarginLayoutParams(LayoutParams.WRAP_CONTENT,  LayoutParams.WRAP_CONTENT);        params.setMargins(0, 10, 0, 10);        setLayoutParams(params);</code></pre><p>*Edit.  I also tried using MarginLayoutParams as a parameter while adding the views to the Linear layout (as below).  This also did not work:</p><pre><code>MarginLayoutParams params = new MarginLayoutParams(linearLayout.getLayoutParams());linearLayout.setMargins(0, 10, 0, 10);linearLayout.addView(view, params);</code></pre><p>Thank you.</p>","426493","","426493","","2010-11-23 20:13:28","2013-12-04 11:39:47","In Android, how to make space between LinearLayout children?","<android>","6","2","4","",""
"4259559","1","4259626","","2010-11-23 18:45:00","0","424","<p>I have searched a long time and cannot find a solution to my problem. I am trying to create a Dialog with an AutoCompleteTextView. I followed the tutorial on the Android developer website, and it worked great. I have been successful using layouts on Dialogs before, so I thought this would be just as easy. I created a layout for my Dialog and I made sure that the AutoCompleteTextView has an ID. Here's where the interesting stuff happens...</p><pre><code> dialog.setContentView(R.layout.auto_layout);        AutoCompleteTextView auto_tv = (AutoCompleteTextView)findViewById(R.id.role_ac);</code></pre><p>Here is the layout as well.</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;TextView android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""Role"" /&gt;    &lt;AutoCompleteTextView android:id=""@+id/role_ac"" android:layout_width=""280dip"" android:layout_height=""wrap_content""/&gt;    &lt;Button android:layout_height=""wrap_content""        android:layout_width=""fill_parent"" android:text=""Done""        android:id=""@+id/auto_doneButton"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>For some reason, auto_tv is null even though it does exist in the layout auto_layout. The only way I have been able to get an AutoCompleteTextView in a Dialog is by building the layout programmatically. Why is the AutoCompletTextView null when I try to use it? Did I forget something in my layout or am I not constructing the object correctly? Any help on this would be greatly appreciated. Thanks.</p>","517866","","","","","2010-11-23 18:51:20","AutoCompleteTextView NullPointer Exception","<android>","2","2","","",""
"4259607","1","4260055","","2010-11-23 18:49:41","6","6372","<p>I have 3 text views in a layout, where the text clips a tad on the bottom on my droid 2...hhow can I ensure that the whole text is viewable and the user can scroll down (simply with their finger) to see the rest of my text?</p><p>Thanks! </p><p>EDIT:</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;ImageButton android:id=""@+id/ImageButton01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:background=""@drawable/def""     android:layout_gravity=""top|center""&gt;    &lt;/ImageButton&gt;&lt;TextView android:id=""@+id/oneView"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""@string/one_def"" android:layout_gravity=""left|center"" android:textSize=""13dip""&gt;&lt;/TextView&gt;&lt;TextView android:text=""@string/two_def"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left|center"" android:id=""@+id/twoView"" android:textSize=""13dip""&gt;&lt;/TextView&gt;&lt;TextView android:text=""@string/threedef_def"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left|center"" android:id=""@+id/threeView"" android:textSize=""13dip""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre>","496686","","496686","","2010-11-23 19:20:09","2011-02-17 20:03:50","If ScrollView only supports one direct child, how am I supposed to make a whole layout scrollable?","<android><xml><formatting><scrollview><dimensions>","3","0","","",""
"4259851","1","","","2010-11-23 19:16:38","0","1057","<p>I am working on a simple application that draws small bitmaps onto the screen, and have a little trouble clearing the screen. My bitmaps are stored in an ArrayList called _graphics, and I need to clear the screen, so I clear my ArrayList. This works fine in clearing the screen, however after a while my app force closes.</p><p>If I draw around 50 bitmaps on the screen, it will force close the first time I clear it, however if I only draw 5, I can get about 10 Clears before it crashes. I assume this is something to do with the GC not clearing the bitmaps correctly. Does anyone have an ideas on the subject?</p>","517922","","","","","2010-12-31 14:17:11","Error removing Bitmaps[Android]","<java><android><bitmap>","2","2","","",""
"4259858","1","4386498","","2010-11-23 19:17:07","4","2510","<p>I'm trying to write some strings to a canvas (live wallpaper) however long string don't get word-wraped is there any way to do it? <br>I think canvas is the only thing I can use for this, since it's a live wallpaper.</p>","517904","","372239","","2014-01-04 15:55:15","2014-02-14 01:35:41","word wraped tex on Android canvas","<android><text><canvas><word-wrap>","2","1","","",""
"4259884","1","4269700","","2010-11-23 19:20:26","0","817","<p>I am fetching a web page on Android using HTTPS (ignoring the certificate as it is both self-signed and outdated, as seen <a href=""http://stackoverflow.com/questions/1217141/self-signed-ssl-acceptance-android"">here</a> - don't ask, it's not my server :)).</p><p>I've defined my </p><pre><code>public class MyHttpClient extends DefaultHttpClient {    public MyHttpClient() {        super();        final HttpParams params = getParams();        HttpConnectionParams.setConnectionTimeout(params,                REGISTRATION_TIMEOUT);        HttpConnectionParams.setSoTimeout(params, REGISTRATION_TIMEOUT);        ConnManagerParams.setTimeout(params, REGISTRATION_TIMEOUT);    }    @Override    protected ClientConnectionManager createClientConnectionManager() {        SchemeRegistry registry = new SchemeRegistry();        registry.register(new Scheme(""http"", PlainSocketFactory                .getSocketFactory(), 80));        registry.register(new Scheme(""https"", new UnsecureSSLSocketFactory(), 443));        return new SingleClientConnManager(getParams(), registry);    }}</code></pre><p>where the UnsecureSSLSocketFactory mentioned is based on the suggestion given on the aforementioned <a href=""http://stackoverflow.com/questions/1217141/self-signed-ssl-acceptance-android"">topic</a>.</p><p>I'm then using this class to fecth a page</p><pre><code>public class HTTPHelper {    private final static String TAG = ""HTTPHelper"";    private final static String CHARSET = ""ISO-8859-1"";    public static final String USER_AGENT = ""Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729)"";    public static final String ACCEPT_CHARSET = ""ISO-8859-1,utf-8;q=0.7,*;q=0.7"";    public static final String ACCEPT = ""text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"";    /**     * Sends an HTTP request     * @param url     * @param post     * @return     */    public String sendRequest(String url, String post) throws ConnectionException {        MyHttpClient httpclient = new MyHttpClient();        HttpGet httpget = new HttpGet(url);        httpget.addHeader(""User-Agent"", USER_AGENT);        httpget.addHeader(""Accept"", ACCEPT);        httpget.addHeader(""Accept-Charset"", ACCEPT_CHARSET);        HttpResponse response;        try {            response = httpclient.execute(httpget);        } catch (Exception e) {            throw new ConnectionException(e.getMessage());        }        HttpEntity entity = response.getEntity();        try {            pageSource = convertStreamToString(entity.getContent());        } catch (Exception e) {            throw new ConnectionException(e.getMessage());        }        finally {            if (entity != null) {                try {                    entity.consumeContent();                } catch (IOException e) {                    throw new ConnectionException(e.getMessage());                }            }        }        httpclient.getConnectionManager().shutdown();        return pageSource;    }    /**     * Converts a stream to a string     * @param is     * @return     */    private static String convertStreamToString(InputStream is)     {        try {            BufferedReader reader = new BufferedReader(new InputStreamReader(is, CHARSET));            StringBuilder stringBuilder = new StringBuilder();            String line = null;            try {                while ((line = reader.readLine()) != null) {                    stringBuilder.append(line + ""\n"");                }            } catch (IOException e) {                Log.d(TAG, ""Exception in convertStreamToString"", e);            } finally {                try {                    is.close();                } catch (IOException e) {}            }            return stringBuilder.toString();        } catch (Exception e) {            throw new Error(""Unsupported charset"");        }    }}</code></pre><p>The page I get is truncated after about a hundred of lines. It's truncated at a precise point, where a '_' (underscore) char is followed by a 'r' char. It's not the first underscore in the page.</p><p>I thought it might have been an encoding issue, so I tried both UTF-8 and ISO-8859-1, but it's still truncated. If I open the page with Firefox, it reports the encoding being ISO-8851-1.</p><p>In case you are wondering, the webpage is <a href=""https://ricarichiamoci.dsu.pisa.it/"" rel=""nofollow"">https://ricarichiamoci.dsu.pisa.it/</a> and it gets truncated at line 169, </p><pre><code>function ChangeOffset(NewOffset) {  document.mainForm.last</code></pre><p>where it should instead be</p><pre><code>function ChangeOffset(NewOffset) {  document.mainForm.last_record.value = NewOffset;</code></pre><p>Does anyone have an idea of why the page is truncated?</p>","412927","","","","","2010-11-24 17:30:56","Android gets HTTPS page truncated","<android><http><truncated>","1","0","","",""
"4259985","1","","","2010-11-23 19:30:43","1","173","<p>I have a service that connects to a server (regular TCP socket) and receives data updates in a thread. I want to store this data (after a bit of processing) in a model that can be accessed by multiple activities (typically ListView with custom ArrayAdapters). In the activities I use bind to get a handle to the service so that it can access the model and register as a listener to get notifications when the model change.</p><p>The problem is that access to the model needs to be thread safe. First I thought I would call runOnUIThread with the incoming data inside the service for updating the model, but the service does not have that routine. Any other way to update the model inside service from the UI thread? Or is there a better architecture/pattern that I should use?</p>","247222","","","","","2010-11-28 21:16:12","Howto in Android: Model inside service, accessed by multiple acivities","<android><service><model>","1","0","","",""
"4260129","1","4260227","","2010-11-23 19:43:39","2","1001","<p>I'm having a big issue with a static HTTPS connection method. <em>Every second request fails</em> and <code>HttpsUrlConnection.getResponseCode()</code> returns <code>-1</code>. So every second call works well, returning data as expected. </p><p>It's the method of a static class I'm using in different corners of my application. I would guess there is anything I don't clean up correctly when the method returns the first time and that whatever causes a problem might get destroyed through a second call of the method. But I'm having a hard time finding any clues.   </p><p>I'm currently using this class to talk to hosts with invalid SSL certificates. Not going to use this in the final version of the app, but right now I need to save money. ;)</p><pre><code>public static String makeInvalidHTTPSRequest(String url, String[] postVars, String userName, String userPass, Context ctx) throws MalformedURLException, IOException, NoSuchAlgorithmException, KeyManagementException {    StringBuffer sb = new StringBuffer();    String serverAuth = null;    String serverAuthBase64 = null;    StringBuffer urlParameters = new StringBuffer();    InputStream rcvdInputStream = null;    if (checkNetworkAvailability(ctx) == false) {        GeneralMethods.writeLog(""Network unavailable"", 1, GeneralMethods.class);        return null;    }    SSLContext sc = null;    sc = SSLContext.getInstance(""TLS"");    sc.init(null, new TrustManager[] { new KTPTrustManager() }, new SecureRandom());    GeneralMethods.writeLog(""makeInvalidHTTPSRequest-&gt; "" + url + "", "" + userName + "", "" + userPass, 0, GeneralMethods.class);    HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());    HttpsURLConnection.setDefaultHostnameVerifier(new KTPHostnameVerifier());    HttpsURLConnection con = null;    con = (HttpsURLConnection) new URL(url).openConnection();    if (userName != null) {        serverAuth = userName + "":"" + userPass;        serverAuthBase64 = KTPBase64.encode(serverAuth.getBytes());    }    try {        String[] tmpPair = null;        con.setRequestMethod(""POST"");        if (serverAuthBase64 != null)            con.setRequestProperty(""Authorization"", ""Basic "" + serverAuthBase64);        con.setRequestProperty(""Content-Type"", ""application/x-www-form-urlencoded"");        if (postVars != null) {            for (int i = 0; i &lt; postVars.length; i++) {                tmpPair = postVars[i].toString().split(""="");                if (i &gt; 0)                    urlParameters.append(""&amp;"" + tmpPair[0] + ""="" + URLEncoder.encode(tmpPair[1], ""UTF-8""));                else                    urlParameters.append(tmpPair[0] + ""="" + URLEncoder.encode(tmpPair[1], ""UTF-8""));            }            con.setRequestProperty(""Content-Length"", """" + Integer.toString(urlParameters.toString().getBytes().length));        }        con.setUseCaches(false);        con.setDoOutput(true);        con.setDoInput(true);        DataOutputStream wr = new DataOutputStream (con.getOutputStream());        if (postVars != null)            wr.writeBytes (urlParameters.toString());        wr.flush();        wr.close();        if (con.getResponseCode() == 200) {            globalRetries = 0;            rcvdInputStream = con.getInputStream();        }        else if (con.getResponseCode() == 401) {            con.disconnect();            GeneralMethods.writeLog(""error 401"", 2, GeneralMethods.class);            con = null;            // SEND CONNECTION PROBLEM-INTENT            return null;        }        else {            GeneralMethods.writeLog(""error - connection response code "" + con.getResponseCode() + "": "" + con.getResponseMessage() + "" (length: ""+ con.getContentLength() +"")\n\n"", 1, GeneralMethods.class);            con.disconnect();             con = null;            // SEND CONNECTION PROBLEM-INTENT            return null;        }        BufferedReader br = new BufferedReader(new InputStreamReader(rcvdInputStream), 8192 );        String line;        while ( ( line = br.readLine() ) != null ) {                sb.append(line);        }        con.disconnect();        con = null;    }    catch(Exception e) {        handleException(e, 2, GeneralMethods.class);    }    GeneralMethods.writeLog(""makeInvalidHTTPSRequest: Response is \"""" + sb.toString() + ""\""\n\n"", 0, GeneralMethods.class);    if(con != null) {        con.disconnect();        con = null;    }    if (sb.toString().trim() == """")        return null;    else        return sb.toString();}</code></pre><p>Thanks a lot for your help!</p><p>Best regards<br>S.</p>","419501","","","","","2010-11-23 19:52:21","Every second HttpsUrlConnection request of my static method fails on Android","<android><static-methods><httpurlconnection>","1","0","1","",""
"4260194","1","4260427","","2010-11-23 19:49:31","3","1086","<p>What is the proper way of sizing the dimensions of an image in a hdpi screen vs a ldpi screen.  </p><p>For instance, an 89*80 png displays fine, with the text, on my droid 2....but how should I go about resizing the image to be smaller on a smaller screened droid?  Do I manually alter the image and place it in the ldpi folder or will it do that automatically?</p>","496686","","","","","2010-11-23 20:10:47","Proper way of resizing an image to put in a ldpi, hdpi screen","<android><resize><drawable>","1","0","1","",""
"4260221","1","4260666","","2010-11-23 19:51:54","2","3350","<p>I wouldn't say my app is text heavy...but it displays random strings sometimes that are longer than others.  They fit fine on my droid 2, but I know they won't display the same on smaller droids.  Does anyone know the proper way of formatting different sized text to ensure it will work on all androids? </p>","496686","","","","","2010-11-23 20:38:26","Should I use dip, dp, sip or sp for text formatting?","<android><text><formatting><size><dip>","2","1","","",""
"4260231","1","4260375","","2010-11-23 19:52:34","2","2189","<p>I would like to inject code in an android application at runtime. I have tried to use dx tool to generate a dexfile in the sdcard but when i want to instantiate, it fails. Are there any tools to inject code generating new dalvik bytecode? I am studing some libraries, aspecjt or guice for android. Is it better to work with a script language?</p><p>Thanks people :) </p>","517969","","","","","2013-08-08 13:55:04","Is it possible to inject code in an android application?","<android><bytecode><manipulation><dalvik>","5","3","3","",""
"4260243","1","","","2010-11-23 19:53:23","1","2238","<p>Here is the situation. I'm upgrading my database adding a single column. The upgrade appears to go fine. I can see the new column added but the problem is when upgrading my app from the older to the new version w/ new DB I get force close. The force close seems to occur when accessing the new column. If I do a fresh install however I get no force closes and app works as expected. </p><p>My on upUpgrade looks as such:</p><pre><code>  @Override   public void onUpgrade(SQLiteDatabase notes_db, int oldVersion, int newVersion) {    if (oldVersion == 29) {    notes_db.execSQL(""ALTER TABLE Notes ADD COLUMN Priority text"");    notes_db.execSQL(""ALTER TABLE Todo ADD COLUMN Priority text"");    notes_db.execSQL(""ALTER TABLE Todo_keys ADD COLUMN Priority text"");    } else {    notes_db.execSQL(""DROP TABLE IF EXISTS "" + NOTES_TABLE);    notes_db.execSQL(""DROP TABLE IF EXISTS "" + TODO_TABLE);    notes_db.execSQL(""DROP TABLE IF EXISTS "" + TODO_KEYS_TABLE);    onCreate(notes_db);    }      }</code></pre><p>Any ideas would be appreciated. </p><p>This is where I believe it fails...</p><pre><code>11-23 14:37:06.210: DEBUG/AndroidRuntime(1647): Shutting down VM11-23 14:37:06.210: WARN/dalvikvm(1647): threadid=1: thread exiting with uncaught exception (group=0x4001d7e8)11-23 14:37:06.210: ERROR/AndroidRuntime(1647): FATAL EXCEPTION: main11-23 14:37:06.210: ERROR/AndroidRuntime(1647): java.lang.NullPointerException11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at com.flufflydelusions.app.extensive_notes_donate.Notes$TaskSimpleCursorAdapter.getView(Notes.java:1065)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.widget.AbsListView.obtainView(AbsListView.java:1315)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1198)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.widget.ListView.onMeasure(ListView.java:1109)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.view.View.measure(View.java:8173)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.view.View.measure(View.java:8173)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.view.View.measure(View.java:8173)11-23 14:37:06.210: ERROR/AndroidRuntime(1647):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)</code></pre><p>Line 1065 is the catch statement and priority1 is the new column I added..</p><p>String priority1 = c.getString(c.getColumnIndex(databaseHelper.DB_COLUMN_PRIORITY));</p><pre><code>        if (priority1.equals(""Low"")) {            try {                String low_pref = preferences.getString(""low_priority_color"", ""Default"");                if (!low_pref.equals(""Default"")){                    priority_text.setBackgroundColor(Integer.parseInt(low_pref, 16)+0xFF000000);                    priority_text.setVisibility(View.VISIBLE);                } else {                    priority_text.setBackgroundColor(0xFFFFe640);                    priority_text.setVisibility(View.VISIBLE);                }} catch (Exception e) {                     errorText = e.getMessage();                    themeError();                }                               }   </code></pre>","427377","","427377","","2010-11-23 20:08:14","2010-12-15 17:31:42","Android SQLite onUpgrade = force close","<android><sqlite>","1","6","1","",""
"4260374","1","4261898","","2010-11-23 20:05:31","4","5220","<p>How can I create date and time settings dialog in Android? I want:</p><ul><li>3 fields - day, hours and minutes</li><li>it should look native to the system - that makes writing my own widget quite hard - how to make the plus/minus buttons above/below each field look like the standard buttons that are in TimePickerDialog? I mean even on HTC Sense.</li></ul>","243225","","","","","2010-11-24 04:50:07","Date AND time settings dialog in Android","<android>","1","0","2","",""
"4260409","1","4261271","","2010-11-23 20:08:56","1","1315","<p>i have a button to close my app with this code:</p><p>finish();</p><p>the problem is that this button doesn't exit of my app... it simply closes the current intent ant returns to the previous intent (window) of my app.... </p><p>how i can do a real exit/close button?</p><p>i tryed with this:</p><pre><code>Intent intent = new Intent(Intent.ACTION_MAIN);intent.addCategory(Intent.CATEGORY_HOME);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(intent);</code></pre><p>but it doesn't works, because when i turn back into my app, the app comes in the last opened window, and not in the first window of the app, how i can do that? i need that when i re-open my app it starts on the first window of my app </p>","479886","","479886","","2010-11-23 21:39:06","2011-12-15 00:24:22","How i can close/exit button on my app?","<android>","6","2","1","",""
"4260461","1","4260509","","2010-11-23 20:15:50","0","1310","<p>I am trying to get a video to pop up and play. I can get it to work when I use the first URI (that is commented out in the below code), but when I try to use the second URI (from the resource), I get the following error:</p><p><PRE>ERROR/AndroidRuntime(1052): android.content.ActivityNotFoundException: No Activity found to handle Intent { dat=android.resource://com.slamdunksoftware.presentation/2130968576 typ=video/* }</PRE></p><p>From researching the error, it looks like I might have to declare an activity in the manifest but I'm not sure if that applies here. Can someone point me in the right direction?</p><pre><code>Intent in = new Intent(Intent.ACTION_VIEW);//Uri uri = Uri.parse(Environment.getExternalStorageDirectory().toString() + ""/page4a.m4v"");        Uri uri = Uri.parse(""android.resource://com.slamdunksoftware.presentation/"" + R.raw.page4a);in.setDataAndType(uri, ""video/*"");startActivity(in);</code></pre>","454509","","5314","","2012-02-24 20:51:54","2012-02-24 20:51:54","How can I play a video file from a Resource?","<android>","1","1","","",""
"4260604","1","4260704","","2010-11-23 20:33:39","3","2096","<p>I have a layout that has a button I would like to always be on the bottom of the scree of my phone.  The problem is <code>android:layout_gravity=""bottom</code>"" only puts it at the below the rest of the layout, rather than the very bottom of the screen.  Is there a way around this?</p>","496686","","","","","2010-11-23 20:43:12","Forcing a button to stay at the bottom of a phone screen","<android><xml><layout><button>","1","1","","",""
"4260664","1","","","2010-11-23 20:38:23","0","715","<p>Working on an Android application, which needs to execute a google web search from within a ListView activity and display the results in that List View.</p><p>Such search would always be for the same ""static"" subject, such as ""...bowling alleys in Chicago..."", so, the user will not be entering any search criteria.</p><p>What is the proper way to accomplish this, please?</p>","518012","","229044","","2014-02-16 04:08:29","2014-02-16 04:08:29","What is the proper syntax to execute a google web search from my Android 2.2 application?","<android><search>","1","1","","",""
"4260776","1","4261415","","2010-11-23 20:50:06","0","165","<p>this problem has been bothering me for days and I cannot figure out why on earth it is happening.  I have a method that detects for a face, if a face is detected, the method will draw a rectangle on a canvas along the face.</p><p>That part works fine.</p><p>The problem is, when it displays to the image_view in my xml file, it will display on the far left middle of the image view, in a box, rather than in the center with the width as fill_parent.</p><p>I thought of a possible workaround : to set the bitmap as a bitmapdrawable, but canvas only draws to bitmaps, so I can get the bitmapdrawable in the middle, but with no red box around it.</p><p>I commented out my testing of bitmap drawable, and left it as what I have now...it only displays to my xml in the far left of the image_view.  Please take a look and help!</p><p>I posted to pastebin because the code is a bit long (I am also using a linear layout within a view flipper).</p><p>method:</p><p><a href=""http://pastebin.com/KQ5Pmx45"" rel=""nofollow"">http://pastebin.com/KQ5Pmx45</a></p><p>xml:</p><p><a href=""http://pastebin.com/jbt3j40h"" rel=""nofollow"">http://pastebin.com/jbt3j40h</a></p><p>Since I am able to get the faces to detect, and I can paste a bitmap drawable to an imagebutton and it centers just fine, is there a way to get the rectangle around the bitmapdrawable if my problem cannot be solved?</p><p>Thanks!</p><p>EDIT:  I tried to implement it into a RelativeLayout and still doing the same thing:</p><p><a href=""http://pastebin.com/daqMdXjB"" rel=""nofollow"">http://pastebin.com/daqMdXjB</a></p><pre><code>Could this code be getting my way of centering?    public void processCameraImage(Intent intent) {        mFlipper.setDisplayedChild(1); // 1 == your second layout        mThePicture = (ImageView) findViewById(R.id.image_view); //        cameraBitmap = (Bitmap) intent.getExtras().get(""data"");        mThePicture.setImageBitmap(cameraBitmap);        detectFaces();    }</code></pre>","496686","","881229","","2013-12-12 06:03:58","2013-12-12 06:03:58","Really need help figuring out why a bitmap is placed on an an image_view incorrectly","<android><xml><bitmap><formatting><android-canvas>","1","1","","",""
"4260794","1","","","2010-11-23 20:52:05","7","2885","<p>Here's my scenario. I have an app that is playing backgound sounds. Using the BroadcastReceiver I can tell when the display turns off, and then kill the sounds. I can also tell if the screen turns back on. However, if the device is in the lock state I don't want the audio to start. Therefore I wait for the ACTION_USER_PRESENT intent to signal. That all works, except that if the user turns the screen back on quickly after it was turned off, you don't get the lock screen or the ACTION_USER_PRESENT message. So, is there a way to tell, when the screen turns back on, if the device is locked or not, which I guess also means sleeping or not?</p>","515706","","","","","2013-05-28 05:05:19","How to tell if device is sleeping","<android>","3","3","2","",""
"4260827","1","","","2010-11-23 20:55:26","0","156","<p>The Android documentation is well written and easy to navigate. It feels like a structured wiki with links into tweaked version of Javadoc. My project struggles with documentation; do we present as .doc/.pdf as the managers want? or a more intuitive web-based format that our developers want (we write an SDK for our product)? I have within my power to argue the point and not simply bow to the will of managers who will never likely read the documentation.</p><p>Does anybody know if these docs are written on top of / with a known (hopefully OSS) application? Or some suite of scripts?</p>","287","","287","","2010-12-14 12:23:59","2010-12-14 12:23:59","In/on what platform are the Android SDK Docs written?","<android><documentation><documentation-generation>","0","2","","",""
"4260841","1","4261013","","2010-11-23 20:57:29","0","3782","<p>I'm trying to learn how to do live wallpapers for android. I've got it working and now I want to add a couple preferences. So, I've created a preference activity and followed all the examples I could find.</p><p>I can capture ListBoxPreferences just fine, but the 'onSharedPreferenceChanged' method is never called when a checkbox has been changed.</p><p>Is there extra code that has to be added for capturing checkbox changes? Is there a best practices way of doing check boxes in preferences?</p><p>I've been banging my head against this issue for two days, any help would be GREATLY appreciated!</p><p>Thanks!</p>","455637","","","","","2010-11-23 21:12:55","How do I capture changes of a CheckBoxPreference in android development?","<android><preferences><sharedpreferences>","2","0","","",""
"4260896","1","4261390","","2010-11-23 21:03:24","0","88","<p>Ultimately I wish to produce a compressive Contact Manager with some specific features.I thought it would be good to experiment by extending <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=summary"" rel=""nofollow"">Contact</a>.So using git I checked out froyo-release and tried to build it.That didn't work so well as it contains things like </p><blockquote>  <p>import  com.android.internal.telephony.CallerInfo;</p></blockquote><p>and friends.I'm considering the following two approaches:</p><ol><li>Suppress the internal stuff underthe assumption that I really don'tneed it.</li><li>Start with a toy Contact Manager and implement (reinvent) everything.</li></ol><p>My guess is that I am going about this incorrectly.""I want that third alternative"" --kirk. </p><p>Just for completeness, the new special behavior is to providean action list for a contact based on the types of that entities data.</p>","345427","","","","","2010-11-23 21:58:41","Extending / Reimplementing Applications","<android><contacts><manager><internal><contactscontract>","1","0","","",""
"4260964","1","4268725","","2010-11-23 21:09:07","9","8062","<p>I can't get adb to recognising my HTC Desire on my new upgrade of Ubuntu 10.10 Maverick Meerkat.</p><p>adb devices shows</p><pre><code>List of devices attached ????????????    no permissions</code></pre><p>Now, there are plenty of tutorials for changing rule files under /etc/udev/rules.d/.However, I cannot find one specific for 10.10.</p><p>Can anyone tell me whether the rule file name and content is the same as described at <a href=""http://forum.xda-developers.com/showthread.php?t=823956"">link text</a>, or are we looking at some new settings for this new release?</p><p>Many thanks</p>","84543","","21234","","2011-02-15 09:46:38","2013-06-21 15:54:44","Debugging in Eclipse with real Android phone on Ubuntu 10.10","<android><ubuntu><adb><ubuntu-10.10>","6","0","5","",""
"4261030","1","4261193","","2010-11-23 21:15:16","0","1168","<p>I have 4 Linear Layouts that I would like to convert into relative layouts.  Using my xml here, I have, as my preferred format:</p><pre><code>ImageButtonImageButtonTextViewButton</code></pre><p>How do I change to Relative Layout, to always display the 1st Image Button on the very top, always display the Button at the very bottm, and have the 2nd image button below the first Image button, with the textView between the 2nd Image Button and the regular button?</p><p>Thanks!</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:gravity=""center""&gt;    &lt;ImageView android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:id=""@+id/image_view"" /&gt;        &lt;TextView android:text=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/message""&gt;&lt;/TextView&gt;    &lt;Button            android:layout_gravity=""center_horizontal""    android:layout_width=""fill_parent""    android:textStyle=""bold"" android:id=""@+id/action_button"" android:selectAllOnFocus=""false"" android:layout_height=""100dip"" android:text=""Click here to Crop""/&gt;&lt;/LinearLayout&gt;</code></pre>","496686","","234039","","2010-11-23 21:34:29","2010-11-23 21:48:18","How to easily convert my LinearLayouts into RelativeLayouts","<android><xml><android-linearlayout><relativelayout>","2","3","","",""
"4261118","1","4261197","","2010-11-23 21:25:24","0","2116","<p>If there is a image on my phone that I want to send up to a server thats 1mb or higher I want to take that image and shrink it to a smaller size without messing with original image in anyway. I know how to get a from the phone and I also know how to send it up to a server, I just need to know how to make the image smaller because large files higher than 1mb are giving me issues.</p>","516883","","","","","2010-11-30 14:08:04","Android shrink large image size","<android><image>","2","0","","",""
"4261203","1","4261377","","2010-11-23 21:36:31","0","765","<p>I'm using a Motorola Backflip running Android 2.1.  Every contact in my phone has a History tab which shows recent history such as recent texts, calls, and facebook messages for that person (facebook is linked through motoblur).  My questions are:1) Is the history tab on every Android Device or is it only from Motoblur?2) If it is an Android entity, is it possible to query this information using the new ContactsContract and SQLite calls, if so, how?If it's only a motoblur entity, how does motoblur query that information to provide? (ie. how would you pull all contact history from calls, texts, and facebook because a linear search would be far inefficient.Thanks in advance.</p>","518060","","518060","","2010-11-23 21:51:12","2010-11-23 21:57:01","How to Query Contact History in Android","<android><android-contacts>","1","0","","",""
"4261294","1","4261318","","2010-11-23 21:47:00","1","1004","<p><code>android:layout_gravity=""center""</code> doesn't seem to work the same in a <code>RelativeLayout</code> as it does in a <code>LinearLayout</code>.</p><p>I would like both an <code>ImageButton</code> and a <code>TextView</code> to be centered in a <code>RelativeLayout</code> - is there a basic xml code for this?</p>","496686","","","user1370109","2012-05-15 08:33:20","2012-05-15 08:33:20","Centering an ImageButton and a TextView in a relative layout","<android><textview><relativelayout><imagebutton>","1","0","","",""
"4261527","1","4261602","","2010-11-23 22:14:40","2","4627","<p>I'm not sure if this is possible, and I couldn't find a topic based on it, but if it's been answered before drop me a link and that will be that.</p><p>What I'm looking to do right now is resize some of the default Android widgets, specifically DatePicker and TimePicker, to use in an Activity.  But as far as I can see the only result of modifying the width or height of either Picker (in a negative direction) results in a cropped view, rather than a scaled/stretched view of the widget.</p><p>I am open to my own custom widgets of my own, but I would really prefer to keep this project as simple and clean as possible, matching the Android OS UI as much as possible, so using the native DatePicker and TimePicker seems like a logical choice to me.  If anyone knows how to scale these widgets down rather than cropping them, I'd really appreciate it.</p><p>Thanks.</p>","313141","","","","","2010-11-23 22:45:11","Resizing/Scaling Down Android Widgets (DatePicker and TimePicker)","<android><android-widget><widget>","1","0","5","",""
"4261655","1","4261714","","2010-11-23 22:31:11","0","1041","<p>For one of my clients they want to redirect customers who are viewing their mobile site from their android to the android market. The url is something like <a href=""http://market.android.com/search?q=com.company_name"" rel=""nofollow"">http://market.android.com/search?q=com.company_name</a> , which when clicked on as a link functions correctly but if done as a redirect via php header('location : <a href=""http://market.android.com/search?q=com.company_name"" rel=""nofollow"">http://market.android.com/search?q=com.company_name</a>'); will resolve to 404 page not found. </p><p>From a pc the link will never resolved, it will only work from an Android phone and only when the link is clicked on via an a href. </p><p>Summary</p><p>a href='http://market.android.com/search?q=com.company_name' - Works when clicked</p><p>header('location: <a href=""http://market.android.com/search?q=com.company_name"" rel=""nofollow"">http://market.android.com/search?q=com.company_name</a>'); - Does not work: 404 error</p>","284821","","1104926","","2011-12-19 13:43:03","2011-12-19 13:43:03","Android redirect to the Android Market is causing a 404 error","<php><android><redirect>","1","0","","",""
"4261762","1","4262095","","2010-11-23 22:42:40","2","1619","<p>Anyone know where I can find what Android APIs are supported in the latest Flex AIR SDK (Hero). In particular is the speech to Text API supported?</p>","517733","","773263","","2012-05-14 00:47:39","2012-05-14 00:47:39","Which Android APIs are supported in Flex Air?","<android><flex><api><air><air-android>","2","0","","",""
"4261797","1","4261830","","2010-11-23 22:46:47","0","525","<p>I have a button on a relative layout that hugs the buttom of the parent, but since there is not much above the button, the height of it is massive and extends to the object above it.  What kind of code can I use to make sure the button stays at a normal height while still hugging the bottom of the parent?</p>","496686","","","","","2010-11-23 22:51:11","How to define the height of a button in a relative layout?","<android><button><height><relativelayout>","1","3","","",""
"4261799","1","4262028","","2010-11-23 22:47:09","2","5616","<p>this is the class. i want to add context menu to it on longpress but as a newbie i find i difficult.  Please help.</p><pre><code> private ListView lvUsers; private ArrayList&lt;UserBO&gt; mListUsers;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.select);        mListUsers = getUsers();        lvUsers = (ListView) findViewById(R.id.lv_user);        lvUsers.setAdapter(new ListAdapter(this, R.id.lv_user, mListUsers));                    }    public ArrayList&lt;UserBO&gt; getUsers(){            DBAdapter dbAdapter=DBAdapter.getDBAdapterInstance(this);  try {   dbAdapter.createDataBase();  } catch (IOException e) {   Log.i(""*** select "",e.getMessage());  }     dbAdapter.openDataBase();    String query=""SELECT * FROM user;"";  ArrayList&lt;ArrayList&lt;String&gt;&gt; stringList = dbAdapter.selectRecordsFromDBList(query, null);  dbAdapter.close();  ArrayList&lt;UserBO&gt; usersList = new ArrayList&lt;UserBO&gt;();  for (int i = 0; i &lt; stringList.size(); i++) {   ArrayList&lt;String&gt; list = stringList.get(i);   UserBO user = new UserBO();   try {    user.id = Integer.parseInt(list.get(0));    user.name = list.get(1);    user.age = list.get(2);   } catch (Exception e) {    Log.i(""***"" + Select.class.toString(), e.getMessage());   }   usersList.add(user);  }  return usersList; } // ***ListAdapter*** private class ListAdapter extends ArrayAdapter&lt;UserBO&gt; {  // --CloneChangeRequired  private ArrayList&lt;UserBO&gt; mList;  // --CloneChangeRequired  private Context mContext;  public ListAdapter(Context context, int textViewResourceId,ArrayList&lt;UserBO&gt; list) { // --CloneChangeRequired   super(context, textViewResourceId, list);   this.mList = list;   this.mContext = context;  }  public View getView(int position, View convertView, ViewGroup parent){   View view = convertView;   try{   if (view == null) {    LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);    view = vi.inflate(R.layout.list_item, null);  // --CloneChangeRequired(list_item)   }   final UserBO listItem = mList.get(position);  // --CloneChangeRequired       if (listItem != null) {    // setting list_item views          ( (TextView) view.findViewById(R.id.tv_id) ).setText( listItem.getId()+"""");    ( (TextView) view.findViewById(R.id.tv_name) ).setText( listItem.getName() );    ( (TextView) view.findViewById(R.id.tv_age) ).setText( listItem.getAge()+"""" );   }}catch(Exception e){    Log.i(Select.ListAdapter.class.toString(), e.getMessage());       }   return view;  } }</code></pre>","513407","","330180","","2010-11-23 22:53:51","2010-11-24 15:53:53","Android: help create Context menu from listview","<android><listview><contextmenu>","2","2","1","",""
"4261937","1","4261998","","2010-11-23 23:05:33","2","4175","<p>i have an app that haves a lot of activitys, all created with ONACTIVITYRESULT</p><p>wich method is called when i press back key?</p><p>i need to know it because i have to override/implement code on it</p>","479886","","","","","2012-12-08 07:21:48","Wich method is called when i press back key on my phone?","<android>","2","3","","",""
"4261958","1","4261992","","2010-11-23 23:08:00","1","2804","<p>all,I have some problem installing my apk file in code. Wondering if anyone could find out what I did wrong.What I was trying to do is put a Check Upgrade function in our program. When user clicks it, it will send request to our web server and find out what is the latest version. I use app versionName to stamp a version, something like 2010.11.23. I don't use the version code in Manifest.xml file. So our program sees the latest VersionName is later than itself, it will download the latest one, and then use the following code to install the new apk file:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(strNewAPKFile),""application/vnd.android.package-archive"");this.startActivity(intent);</code></pre><p>Now looks like, everytime when I changed the VersionName, it will fail to install the apk file. It downloads the file fine. I don't know exactly why. Sometimes, in Eclips, when I hit debug, I got error saying ""Re-installation failed due to different application signatures"". I don't know if this is the same error caused the installation failed.</p><p>So, looks like my questions are:</p><ol><li>Should that upgrade logic work? I am wondering if it has something to do with the VersoinName.</li><li>What could cause the application signature change? (I did sign our program before I put it on our server, but I always use the same key file for different versionName. )</li></ol><p>Any input are welcome.</p>","518138","","345717","","2010-11-23 23:10:40","2010-11-23 23:11:54","Failed to install apk file by Package Installer in Android?","<android>","1","0","","",""
"4262052","1","4262781","","2010-11-23 23:20:39","1","539","<p>I am looking into having a basic red-bar scan across an image displayed on an image view a vew times, back and forth, as to make it seem like a picture is being scanned.  Has anyone ever done this, know how easy it is or could they point me in the right direction on how to do this?</p><p>Thanks!</p>","496686","","","","","2010-11-24 01:41:41","Anyone ever done a basic 'scan-animation' on an image?","<android><image><animation><scanning>","1","0","2","",""
"4262144","1","4356558","","2010-11-23 23:35:12","1","3078","<p>I am using a shape defined as a drawable as background for a TextView. This allows me to add rounded corners and other other effects.The shape is defined like this:</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;corners android:topLeftRadius=""8dp"" /&gt;&lt;/shape&gt;</code></pre><p>and I am using it like this:</p><pre><code>&lt;TextView    android:id=""@+id/project""    style=""@style/textView""    android:background=""@drawable/project_textview_background""/&gt;</code></pre><p>Now, I need to change the color of that TextView programmatically depending on some conditions. I have not been able to do that.</p><ul><li>I tried to do setBackgroundColor but that seems to overwrite the background I previously defined so it doesn't show the rounded corners anymore.</li><li>I looked at a bunch of other API methods but got nowhere</li></ul><p>Any help would be very much appreciated. Thank youAny ideas?</p>","59201","","","","","2011-11-10 08:37:38","Set color of a shape drawable used as a TextView background in Android","<android><user-interface>","2","1","","",""
"4262214","1","4263264","","2010-11-23 23:45:57","0","161","<p>I'm not really sure what tools I should be using to create a desired outcome...</p><p>At the bottom of the screen I would like to have three buttons, something like what is at the bottom of this screen except only using text instead of icons, and only having three options, not four.</p><p><img src=""http://i.stack.imgur.com/72NpM.png"" alt=""alt text""></p><p>Is this a tab view?  I don't need a tab view because I don't need the tabs to stay on screen after one is clicked.</p>","487840","","","","","2010-11-24 03:39:44","Making tabs, buttons, or neither?","<android><button><android-tabhost>","1","4","1","",""
"4262499","1","4262536","","2010-11-24 00:40:01","0","91","<p>So I've got the following:</p><pre><code>NodeList nodeList = element.getElementsByTagName(""rowset"");    if (nodeList.getLength() &gt; 0) {     for (int i = 0; i &lt; nodeList.getLength(); i++) {      Element entry = (Element) nodeList.item(i);       Element _titleE = (Element) entry.getElementsByTagName(""row"").item(0);        Node _title = _titleE.getAttributes().getNamedItem(""name"");      t1.setText(_title.getNodeValue());     }    }</code></pre><p>I've got the following XML layout:</p><pre><code>&lt;row name="""" characterID="""" corporationName="""" corporationID="""" /&gt;</code></pre><p>(couple of lines of these)</p><p>the ideal way would be to create an array right? and then call the data from the array?</p><p>EDIT:What I'm trying to do is read an XML File and store the values so that they can be accessed later so I'm assuming the ideal way would be to use an array?</p>","508902","","508902","","2010-11-24 01:07:42","2010-11-24 01:07:42","submitting data to an array to be pulled later","<android><arrays><getelementsbytagname>","1","1","","",""
"4262542","1","4465627","","2010-11-24 00:52:20","2","3066","<p>I am trying to test an Android application. I need to send mock location to test this. I have registered for requestlocation updates(..)method (as follows) </p><blockquote>  <p>locationManager.requestLocationUpdates(bestProvider,  20000, 0, this);</p></blockquote><p>Tried sending mock locations through Eclipse DDMS tab as well as telnet-ing from command prompt. telnet commands as follows</p><blockquote>  <p>telnet localhost 5554<br>   geo fix 1 1</p></blockquote><p>The application <strong>works</strong> fine (i.e. receives the location changed event) if I run using AVD Emulator using <strong>1.6 to 2.1</strong>. However, it is <strong>not working</strong> for <strong>AVD Emulator 2.2</strong>. I am using SDK platform Android 2.2 revision 2.   </p><p>Does anyone come across similar issue? How did you resolve this?  </p><p>PS. Extra Information. I have selected 'Allow Mock Locations' in all emulators (1.6 to 2.2).<br>Also, the following line is added in Android Manifest</p><blockquote>  <p>uses-permission android:name=""android.permission.ACCESS_MOCK_LOCATION""</p></blockquote><p>Issue still persists. Please help</p>","518219","","","","","2010-12-16 21:40:37","Geo Fix not working in Android SDK 2.2","<android><android-emulator>","1","0","","",""
"4262702","1","4306476","","2010-11-24 01:26:22","0","699","<p>I'm just trying to make sense of a basic Android navigation-related question, namely ""How can I display the current location"". I've used a bit of code from articles and tutorials from my long googling sessions. The display of a simple overlay (circle + text message) is works, yet at a wrong on-screen position (on the Equator apparently).</p><p>My code setup includes a small inner class that <code>implements LocationListener</code>, and its <code>onLocationChanged</code> event handler calls this method :</p><pre><code>protected void createAndShowCustomOverlay(Location newLocation) {  double lat = newLocation.getLatitude();  double lng = newLocation.getLongitude();  // geoPointFromLatLng is an E6 converter :  // return new GeoPoint((int) (pLat * 1E6), (int) (pLng * 1E6));    GeoPoint geopoint = GeoFunctions.geoPointFromLatLng(lat, lng);  CustomOverlay overlay = new CustomOverlay(geopoint);  mapView.getOverlays().add(overlay);  mapView.getController().animateTo(geopoint);  mapView.postInvalidate();} </code></pre><p>Up to this point, it all looks ok, I've debugged around and the non-transformed lat/lng pair is ok, the E6 variant thereof ok as well. Here is the CustomOverlay class :</p><pre><code>public class CustomOverlay extends Overlay {  private static final int CIRCLERADIUS = 2;  private GeoPoint geopoint;  public CustomOverlay(GeoPoint point)   {    geopoint = point;  }  @Override  public void draw(Canvas canvas, MapView mapView, boolean shadow)   {    // Transfrom geoposition to Point on canvas    Projection projection = mapView.getProjection();    Point point = new Point();    projection.toPixels(geopoint, point);    // background    Paint background = new Paint();    background.setColor(Color.WHITE);    RectF rect = new RectF();    rect.set(point.x + 2 * CIRCLERADIUS, point.y - 4 * CIRCLERADIUS,       point.x + 90, point.y + 12);    // text ""My Location""    Paint text = new Paint();    text.setAntiAlias(true);    text.setColor(Color.BLUE);    text.setTextSize(12);    text.setTypeface(Typeface.MONOSPACE);     // the circle to mark the spot     Paint circle = new Paint();     circle.setColor(Color.BLUE);     circle.setAntiAlias(true);     canvas.drawRoundRect(rect, 2, 2, background);     canvas.drawCircle(point.x, point.y, CIRCLERADIUS, circle);     canvas.drawText(""My Location"", point.x + 3 * CIRCLERADIUS, point.y + 3                     * CIRCLERADIUS, text);   }}</code></pre><p>It's most definitely a projection error of sorts, since all my geo fix'd coords end up on the Equator, so there are some 0.0 values getting thrown around.</p><p>I can provide other details if needed, I'm running the code on the emulator, Maps API Level 8 (Android 2.2) and I get tiles and the CustomOverlay (circle + text) gets displayed, only at a really false position (coords such as 54.foo and 8.bar are way off).</p><p>The codebase could be a bit older, then perhaps a projection such as <code>toPixels</code> isn't required anymore ? No idea.</p><p>Thanks in advance !</p>","132735","","132735","","2010-11-24 01:31:27","2010-11-29 17:45:33","Current Location displayed at false on-screen coordinates","<android><google-maps>","2","0","","",""
"4262753","1","4263065","","2010-11-24 01:37:05","2","4649","<p>I've been using my Activity class to access my DB which made my program freeze sometimes.</p><p>So I decided to use AsyncTask instead to handle the DB.</p><p>My problem is I don't know how to instantiate my SQLite DB ""TheDB"" from AsyncTask's class</p><pre><code>public class myClass extends AsyncTask&lt;Void, Void, Void&gt;{private TheDB db;any method() {    this.db = new TheDB(this);  //&lt;-- Error here}</code></pre><p>this worked fine on the Activity class, but it I dont know how to use it here</p><p>TheDB's constructor is TheDB(Context context) but this class is not a ""context"" so how can i use my DB here?</p><p>please provide examples if you can</p><p>and please do not give me links to google's references, am a newbie and i find them hard to follow</p>","512974","","512974","","2010-11-24 02:39:52","2011-07-11 20:40:11","How to use SQLite DB from AsyncTask?","<android><sqlite><asynchronous><activity><android-asynctask>","3","0","","",""
"4262773","1","4262978","","2010-11-24 01:40:19","10","46479","<p>I am trying to sign the release version of my Android app (debug was signed fine) for the Google Maps API:    </p><pre><code>keytool -list -alias cancertrials -keystore /Users/syalam/Documents/workspace/Cancer_Trials/keys/release -storepass android -keypass cancertrials</code></pre><p>But I get the error:</p><pre><code>java.io.IOException: Keystore was tampered with, or password was incorrect</code></pre><p>I am positive the password is correct, because when I try to export my app in Eclipse, it asks for the keystore and the password, and I am entering it in correctly.</p><p>Not sure why I can't sign this? I need to display Google Maps in release mode (working in debug mode).</p>","19875","","","","","2013-04-30 02:51:09","Keytool Signing Problem: Keystore was tampered with, or password was incorrect","<java><android><google-maps><keystore><keytool>","3","0","2","",""
"4262823","1","","","2010-11-24 01:50:20","2","400","<p>I am looking for a Android tablet device that will permit me to modify, rebuild and reload the Android operating system in a fashion similar to what Google provides developers with the Nexus One phone.  Are there any tablets out there that officially support this kind of development cycle?</p><p>Thanks for your help,</p><p>Patrick Keith-Hynes</p>","320736","","","","","2011-03-02 18:06:14","Android Tablet Devices for development that support os rebuilding and loading","<android><operating-system><tablet><rebuild>","1","0","2","",""
"4262989","1","4263222","","2010-11-24 02:32:28","2","4595","<p>I can't find a tutorial online that gives me the step by step process on how to generate a suitable key using the keytool in the JDK.  </p><p>This:</p><p><a href=""http://developer.android.com/guide/publishing/app-signing.html"" rel=""nofollow"">http://developer.android.com/guide/publishing/app-signing.html</a></p><p>talks about it and gives commands, but it doesn't actually say where and in what folder to key in the commands.  I am sure I am missing something easy here, but could anyone guide me to where I need to start with this?</p><p>Thanks!</p>","496686","","","","","2010-11-24 03:26:24","Obtaining a private key through the keytool for app release","<android><key><jdk><generate><signing>","1","0","1","",""
"4263002","1","","","2010-11-24 02:35:10","4","6305","<p>HelloI am develop video player with android gallery.I receive URI from gallry. and I need to display video title, when play video.so if content has not title meta data. I need to disaplay video file name.How to get video content file name?</p><p>thank you</p>","510250","","","","","2013-04-09 07:31:06","how to get file name from URI","<android><media-player>","2","3","","",""
"4263053","1","4263295","","2010-11-24 02:48:38","6","19424","<p>I have a fixed content in my text view inside a scroll view. When the user scrolls to a certain position, I would like to start an activity or trigger a toast.</p><p></p><pre><code>&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:id=""@+id/scroller""&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:id=""@+id/story""   android:layout_height=""wrap_content"" android:text=""@string/lorem""   android:gravity=""fill"" /&gt; &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>My problem is in implementing the protected method <code>onScrollChanged</code> to find out the position of the scroll view.</p><p>I have found <a href=""http://stackoverflow.com/questions/3948934/synchronise-scrollview-scroll-positions-android"">this</a> answer, is there an easier solution to this rather than declaring an interface, over ride the scrollview etc as seen on the link I posted?</p>","71724","","","","","2013-07-04 00:20:41","Android scrollview onScrollChanged","<android>","3","1","5","",""
"4263101","1","","","2010-11-24 03:00:24","4","3496","<p>I've written an Android app that connects to a Bluetooth keyboard. It connects through a BT socket to the keyboard and acquires the socket's input stream.</p><pre><code>InputStream inStrm = socket.getInputStream();</code></pre><p>Next I tried to read the input stream, but it says there are no bytes available.</p><pre><code>int nBytesAvail = inStrm.available(); // always gives me 0</code></pre><p>Or</p><pre><code>int  dataByte = inStrm.read(); // always generates IOException</code></pre><p>The exception says: Software caused connection to abort</p><p>If I try to write to the stream, I get another exception: Transport endpoint is not connected.</p><p>One of two things can be happening.</p><ol><li><p>My first fear is that there is the HID protocol to be spoken to the keyboard, and it will not divulge its secrets until I utter the proper incantation. Is that correct? Or should that be taken care of by the BT socket stack automatically? The socket stream seems to be a standard serial stream, and I'm not sure that's correct.</p></li><li><p>My second fear is that since this is a Galaxy Tab, my problem might simply be that that particular part of the OS has been removed by Samsung (but would I still get a valid input stream from the socket connection?). It is widely reported that the US versions of the Tab simply will not connect to any BT HID using the standard Android BT utilities, although BT file transfers do work fine.</p></li></ol><p>I suppose a third possibility is that I'm simply missing the keystrokes as they happen. I don't know how much buffering Java does of BT data coming in from a HID, but if the socket connection is made, the data should appear in the input stream, no?</p><p>I'm reluctant to put in much more time into this in case I'm going about it completely the wrong way (see #1), or it is doomed to fail (see #2).</p>","518277","","168868","","2013-12-25 07:01:09","2013-12-25 07:01:09","How to talk to a Bluetooth keyboard?","<android><bluetooth><keyboard><hid>","3","0","5","",""
"4263140","1","6062861","","2010-11-24 03:09:17","2","531","<p>I am testing my Android application using ActivityInstrumentationTestCase2, and I need to test that the screen orientation change works correctly. However, I cannot find any way to cause an orientation to occur. What am I missing?</p>","355039","","","","","2011-07-28 14:10:54","How to change the screen orientation during automated testing?","<android><orientation>","1","0","1","",""
"4263157","1","","","2010-11-24 03:14:32","0","163","<p>i have developed an application for 1.5 and above which uses expandable list ,but when i test it on 2.1 QVGA emulator expandable list dosent look proper .Also i have tried running sample Expandablelist1 ,but it also has same issue.so can anyone tell me is this issue with emulator only?if yes how to resolve it?</p><p>Thanks in advance</p>","518282","","","","","2011-02-06 04:10:43","expandable list not looking properly in 2.1 QVGA","<android>","1","0","","",""
"4263259","1","4383517","","2010-11-24 03:37:57","5","4066","<p>I've been trying to make an android library project, and while the build process works fine, I've been running into some trouble with replacing a resource in the project which uses the library.</p><p>In my library I have:</p><ol><li><p>A <code>library_layout.xml</code> containing</p><p>&lt;TextView<br>    android:id=""@+id/str_my_string""<br>    android:layout_width=""wrap_content""<br>    android:layout_text=""wrap_content""<br>    &gt;</p></li><li><p>A java file which calls</p><p>((TextView)this.findViewById(R.id.str_my_string)).setText(R.string.my_string);</p></li><li><p>A resource <code>strings.xml</code> containing</p><p>&lt;string name=""my_string""&gt;Placeholder&lt;/string&gt;</p></li></ol><p>In the project using the library I have</p><ol><li><p>A resource <code>strings.xml</code> containing</p><p>&lt;string name=""my_string""&gt;Actual string content&lt;/string&gt;</p></li></ol><p>The behavior I expect is that when I run the project using the library, the text view displays <strong>Actual string content</strong>, but it actually contains <strong>false</strong>.</p><p>Looking in the app which uses the library, I <em>do</em> see two <code>R</code> files, and both of them have <code>R.string.my_string</code> and both of those are equal to the same numeric value.</p>","353184","","","","","2010-12-08 01:56:31","Replace (or ""Override"") String in Android Library Project","<android><android-layout><eclipse-adt><android-library>","1","0","1","",""
"4263280","1","4263631","","2010-11-24 03:43:50","-4","2383","<p>How do you use ""Thread"" classes? A most basic example would be great!</p>","512974","","651104","","2012-04-16 02:54:22","2012-07-31 02:10:38","How to use ""Thread"" classes?","<android><multithreading>","2","2","","",""
"4263308","1","4263321","","2010-11-24 03:51:08","1","146","<p>Should I always release at the highest level (8 at the current moment) or should I backtrack as far back as possible?  Or does it matter?</p>","496686","","","","","2010-11-24 03:56:41","What API should I release my app in?","<android><api><sdk><release>","1","0","2","",""
"4263329","1","","","2010-11-24 04:00:01","0","1020","<p>HI</p><p>I am New To android, my problem is when iam capturing image programetically the camera is opening in landscape mode..Than How to Avoid it?</p><p>Can anyone help me</p><p>Thanks in advance</p>","486291","","","","","2012-04-21 14:05:21","how to avoid camera landscape mode in android?","<android>","2","0","1","",""
"4263339","1","4755642","","2010-11-24 04:01:17","10","14545","<p>Hi Guys i want to install android Market App on Emulator,so that i can browse and install various free apps on emulators.Can you guide me how to do this?</p>","395661","","","","","2014-03-29 21:10:12","Installing Android Market App on Emulator","<android>","5","2","9","",""
"4263359","1","4263366","","2010-11-24 04:05:46","4","354","<p>We are going to make the app available for .99 on the market, but is licensing it a must?  We are worried about the license query bugging the user/always requiring network access.  Should we definitely license regardless of our worries?</p>","496686","","","","","2010-11-24 04:08:05","Is it a good idea to license my app on the Android Licensing Service?","<android><google-play><license-key>","1","0","","",""
"4263375","1","4264989","","2010-11-24 04:09:40","13","50242","<p>I created a bitmap and now i want to save that bitmap to a directory somewhere. Can anyone show me how this is done. Thanks</p><pre><code>FileInputStream in;          BufferedInputStream buf;           try {                  in = new FileInputStream(""/mnt/sdcard/dcim/Camera/2010-11-16_18-57-18_989.jpg"");                  buf = new BufferedInputStream(in);                  Bitmap _bitmapPreScale = BitmapFactory.decodeStream(buf);                  int oldWidth = _bitmapPreScale.getWidth();                  int oldHeight = _bitmapPreScale.getHeight();                  int newWidth = 2592;                   int newHeight = 1936;                  float scaleWidth = ((float) newWidth) / oldWidth;                  float scaleHeight = ((float) newHeight) / oldHeight;                  Matrix matrix = new Matrix();               // resize the bit map                  matrix.postScale(scaleWidth, scaleHeight);                  Bitmap _bitmapScaled = Bitmap.createBitmap(_bitmapPreScale, 0, 0,  oldWidth, oldHeight, matrix, true);</code></pre><p>WANT TO SAVE _bitmapScaled to a folder on my SD card</p>","516883","","345717","","2010-11-24 04:11:48","2013-04-27 00:10:31","Android Saving created bitmap to directory on sd card","<android><image><save>","4","0","13","",""
"4263565","1","4279861","","2010-11-24 04:49:55","3","820","<p>I have created a release keystore using the Eclipse IDE. I signed it using keytool and registered on Google Maps. I plugged in the key but my map doesn't show up.</p><pre><code>Maps show up properly when I use the key associated with my debug keystore.</code></pre><p>How can I diagnose this? I followed the same steps as i did with debug, for release.</p><p><strong>UPDATE:</strong></p><p>Here 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.android.cancertrials"" android:versionCode=""1""    android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.CALL_PHONE""/&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;        &lt;activity android:label=""@string/app_name"" android:name=""splash""&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="".HomeActivity"" android:label=""@string/app_name"" android:windowSoftInputMode=""stateHidden""&gt;        &lt;/activity&gt;        &lt;activity android:name="".moreactivity"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;        &lt;activity android:name="".aboutmedtrust"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;        &lt;activity android:name="".aboutclinical"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;        &lt;activity android:name="".aboutglaxosmith"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;        &lt;activity android:name="".termsofuse"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;        &lt;activity android:name="".privacy"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;        &lt;activity android:name="".feedback"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;        &lt;activity android:name="".informationcancer"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;        &lt;activity android:name=""AdvanceSearchActivity"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;        &lt;activity android:name=""SearchingActivity""&gt;&lt;/activity&gt;        &lt;activity android:name=""AdvanceSearchTab1""&gt;&lt;/activity&gt;        &lt;activity android:name=""AdvanceSearchTab2""&gt;&lt;/activity&gt;        &lt;activity android:name=""DetailedActivity""&gt;&lt;/activity&gt;        &lt;activity android:name=""summary""&gt;&lt;/activity&gt;        &lt;activity android:name=""conditions""&gt;&lt;/activity&gt;        &lt;activity android:name=""description""&gt;&lt;/activity&gt;        &lt;activity android:name=""inclusion""&gt;&lt;/activity&gt;        &lt;activity android:name=""exclusion""&gt;&lt;/activity&gt;        &lt;activity android:name=""BookmarkActivity""&gt;&lt;/activity&gt;        &lt;activity android:name=""RecentActivity""&gt;&lt;/activity&gt;        &lt;activity android:name=""information""&gt;&lt;/activity&gt;    &lt;uses-library android:name=""com.google.android.maps""&gt;&lt;/uses-library&gt;    &lt;activity android:name=""Mapsactivity""&gt;    &lt;/activity&gt;    &lt;activity android:name=""mapView""&gt;&lt;/activity&gt;&lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt; </code></pre>","19875","","19875","","2010-11-25 17:43:14","2012-11-29 12:38:53","Google Map not appearing in my MapActivity","<java><android><google-maps><keytool><mapactivity>","3","4","","",""
"4263598","1","4703929","","2010-11-24 04:58:16","2","460","<p>Is it possible to add an activity indicator as a part of an alert. i need this bcos it is difficult to show alert view in white baackground. Please suggest ideas. </p>","450487","","","","","2011-01-16 05:10:23","Activity indicator inside an alert","<android><alertdialog>","1","0","","",""
"4263756","1","","","2010-11-24 05:31:57","1","950","<p>Can you include a jar file with a Flex Air App? (the case of using Merapi - allows you to connect Flex to Java classes directly). Can you export the Flex project as a apk file and then pacakge up the java app as Android compatible then upload both? </p>","517733","","773263","","2012-05-14 16:09:03","2013-08-14 16:05:16","Flex AIR with Jar file on Android","<java><android><air><jar><air-android>","1","1","","",""
"4263818","1","4263954","","2010-11-24 05:44:16","0","1142","<p>I need to select emails from contact... I find android have a build-in phone number picker as seen on image bellow. </p><p>img : <a href=""http://i1108.photobucket.com/albums/h412/Tek_Yin/selectphone.jpg"" rel=""nofollow"">http://i1108.photobucket.com/albums/h412/Tek_Yin/selectphone.jpg</a></p><p>in 1.5 &amp; 1.6 I can use this : </p><p><code>Intent i = new Intent(Intent.ACTION_PICK, Contacts.Phones.CONTENT_URI);</code></p><p>the question is  : </p><ul><li>can it show email instead of phone number? </li><li>I need it to adapt on 2.0 or higher</li><li>I read 2.0 or higher is using <code>ContactsContract</code>, but how?</li></ul><p>Thanks in advance.</p>","453407","","","","","2010-11-24 06:15:03","Android contact picker that show email","<android><android-intent><contact>","1","1","2","",""
"4263830","1","4263867","","2010-11-24 05:48:13","0","1087","<p>I am using a menu in my application same as this post... I am using a gallery view for display my menu items.</p><p><a href=""http://stackoverflow.com/questions/3237566/text-gallery-on-android"">Text Gallery on Android?</a></p><p>Problem is that, i implement <code>onItemSelected</code> listener for gallery, so that when new item is selected data related to that topic loaded. <strong>But i also want to allow user to scroll the gallery fully</strong>. But each time when user move to next item <code>onItemSelected()</code> function called and it start loading data. </p><p>All i want to do is to put some delay in <code>onItemSelected()</code> function, so that if in between that delay user scroll next item than there is no need to load data of previous but for the current. Time may be 1 second. If user dose not go for next item in 1 second, that data of that item must be loaded. </p><p>Can anyone help? I thought to start a thread, but each time for <code>onItemSelected()</code> there will be new thread... </p><p><strong>I tried this too</strong></p><pre><code>public class TimerThreadForCategoriesMenu extends Thread{int old = -1;int cur = -1;CategoriesActivity catAct = null;public TimerThreadForCategoriesMenu(CategoriesActivity act , int cu) {    this.cur = cu;    old = cu;    this.catAct = act;}@Overridepublic void run() {    Looper.prepare();    do{        old = this.cur;        for(int i = 0; i&lt;15; i++){            try{                Thread.sleep(100);            }catch (Exception e) {                e.printStackTrace();            }        }    }while(cur != old);    catAct.performTask();    Looper.loop();  }public void setCur (int curr){    this.cur = curr;}}</code></pre><p>And in <code>OnItemSelected()</code></p><pre><code>      if(timer == null){          timer = new TimerThreadForCategoriesMenu(this, arg2);        timer.start();    }    timer.setCur(curInd);</code></pre><p>Found Exception:</p><blockquote>  <p>11-24 16:48:50.046: ERROR/AndroidRuntime(8049): Uncaught handler: thread Thread-8 exiting due to uncaught exception<br>  11-24 16:48:50.126: ERROR/AndroidRuntime(8049): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.<br>  11-24 16:48:50.126: ERROR/AndroidRuntime(8049):     at android.view.ViewRoot.checkThread(ViewRoot.java:2683)<br>  11-24 16:48:50.126: ERROR/AndroidRuntime(8049):     at android.view.ViewRoot.invalidateChild(ViewRoot.java:570)<br>  11-24 16:48:50.126: ERROR/AndroidRuntime(8049):     at android.view.ViewRoot.invalidateChildInParent(ViewRoot.java:596)<br>  11-24 16:48:50.126: ERROR/AndroidRuntime(8049):     at android.view.ViewGroup.invalidateChild(ViewGroup.java:2396)<br>  11-24 16:48:50.126: ERROR/AndroidRuntime(8049):     at android.view.View.invalidate(View.java:4945)<br>  11-24 16:48:50.126: ERROR/AndroidRuntime(8049):     at </p></blockquote>","486139","","2691847","","2014-01-29 13:42:43","2014-01-29 13:42:43","How to set delay in ""onItemSelected()"" function in android?","<java><android><activity>","2","6","","",""
"4263831","1","4263853","","2010-11-24 05:48:15","2","1079","<p>In onCreate method of Activity, it binds to a remote service and makes use of AIDL intefaces. Is it required to unbind from the remote service when onDestroy is called on screen orientation change.?</p><p>If the activity un-bounded from the remote service in onDestroy and if no other contexts are bound to remote service, is remote service likely to get stopped losing the state that it maintains.?</p>","110024","","","","","2010-11-24 05:52:41","unbind remote service in onDestroy of activity on screen orientation change","<android>","1","0","","",""
"4263868","1","4263881","","2010-11-24 05:55:56","8","7462","<p>Can you please tell me how to prevent the Android Activity from sleep mode programatically.Or can we declare something related to this in Android Manifest file.</p>","493193","","","","","2010-11-24 05:59:25","Disabling screen sleep Programatically in Android?","<android>","2","0","","",""
"4263901","1","5085189","","2010-11-24 06:03:07","0","3496","<p>hi my application contains SQLite .My application some time getting the following error </p><pre><code>java.lang.RuntimeException: Unable to destroy activity {com.fitzsoftware.grocessaryList/com.fitzsoftware.grocessaryList.GrocessaryList}: android.database.sqlite.SQLiteException: unable to close due to unfinalised statementsat android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3655)at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3673)at android.app.ActivityThread.access$2900(ActivityThread.java:125)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4627)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)Caused by: android.database.sqlite.SQLiteException: unable to close due to unfinalised statementsat android.database.sqlite.SQLiteDatabase.dbclose(Native Method)at android.database.sqlite.SQLiteDatabase.onAllReferencesReleased(SQLiteDatabase.java:320)at android.database.sqlite.SQLiteDatabase.close(SQLiteDatabase.java:881)at com.fitzsoftware.grocessaryList.GrocessaryList.onDestroy(GrocessaryList.java:103)at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3642)</code></pre><p>I am closing the db in Destroy() using  DataClass.dh.db.close();Why this Error occured.Give me the solutions for this.Thanks in advance.</p>","479027","","479027","","2010-11-24 06:18:41","2012-06-15 15:28:21","SQLite Exception in android","<android>","2","1","1","",""
"4264057","1","","","2010-11-24 06:33:09","3","4178","<p>I am running Android CTS Android Test Plan on an emulator running on Android 2.2. </p><p>But most of the test cases are showing timeout and the error shows com.android.ddmlib.ShellCommandUnresponsiveException.</p><p>Is there any way to solve this issue ?</p>","373049","","","","","2012-11-11 21:13:04","Android CTS is showing ShellCommandUnresponsiveException on emulator","<android><android-emulator><cts>","2","0","1","",""
"4264083","1","4264271","","2010-11-24 06:36:58","2","914","<p>I want to share an app to another person through mail or sms. For example if I am downloading one app from android market and I want to send that app link to other person, how can i send the link to that person through mail or sms?</p>","479027","","592025","","2012-10-17 13:11:37","2012-10-17 13:11:37","send an email and sms of application to another user","<android>","2","2","1","",""
"4264094","1","","","2010-11-24 06:39:22","2","1044","<p>I am developing app which has bluetooth communication involved. The bluetooth communication should go on even if the Activity that sets up the connection closes down. First, I have thought of using Service for this and that seemed to be right way. But, in Bluetooth chat example the communication happens in another thread and not in Service. I have used that code in my app and its working properly. Is using Thread for bluetooth communication proper or do I need to make use of Service only? The bluetooth communication should be active till my app is in RAM and it should not matter if I switch between activities.</p>","261566","","","","","2010-12-03 11:31:29","Bluetooth Communication in thread or Service in Android?","<android><multithreading><service><bluetooth>","1","1","","",""
"4264123","1","","","2010-11-24 06:44:50","0","696","<p>i have one listview contain menu based on the selected item in listview i want to display new view(add or edit or delete) that is defferent add.xml or edit.xml or delete.xml file.I want to show below like this.Also how to back in to main menu from child view. </p><p>i tried using  tag using ViewFlipper.showNext() but it display only add view all the time. </p><p>Thanks in advance..</p><p><img src=""http://i.stack.imgur.com/Xk4YA.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/cL6Nn.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/Yn1nt.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/QL3Vq.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/me588.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/5ELeN.png"" alt=""alt text""></p>","489902","","","","","2010-11-24 07:27:48","Menu Navigation using ViewFlipper in android?","<android><viewflipper>","1","3","","",""
"4264166","1","4264473","","2010-11-24 06:52:46","0","359","<p>i need to launch a service running in the background,that should record what's on the current screen for say about 10 sec.. i should able to save it in a file or on any storage device and later i should able to retrieve it also..</p><p>plz plz anyone help me, i am running out of my time deadline..</p><p>thanks in advance  Manju</p>","505580","","505580","","2010-11-24 06:58:08","2010-11-24 07:42:34","launching a service to record current screen in android","<java><android><service><emulator>","2","0","","",""
"4264220","1","4264282","","2010-11-24 07:01:23","0","728","<p>when I call web service from my machine using 'localhost' or 127.0.0.1 , I got exception. But if I give the public IP, it works fine. Why it is happening? </p><p>And also, If I use my public IP, I can't access web service. But If I put the same code in another machine, and call that web service using the IP address of that machine, It works fine.</p><pre><code> //working fine url = new URL(""http://192.168.50.122/NewsLetter/subscribing.php?register=""+xmlString); //got Exception url = new URL(""http://localhost/NewsLetter/subscribing.php?register=""+xmlString);//got Exception url = new URL(""http://127.0.0.1/NewsLetter/subscribing.php?register=""+xmlString); //got Exception with my public IP - 192.168.50.117 url = new URL(""http://192.168.50.117/NewsLetter/subscribing.php?register=""+xmlString);</code></pre><p>Please help me... I was trying a lot, but could not solve it.</p><p>Thank you....</p>","504117","","","","","2010-11-24 07:23:00","Exceptions with calling web service using IP","<android><service>","2","0","","",""
"4264249","1","","","2010-11-24 07:05:57","2","749","<p>I have SurfaceView where I draw some sketches. But I don't use xml layout...Am I abble to add AdView into SurfaceView in Java Android? Is it possible?</p><p>For example, in ActionScript it will be like that:surfaceView.addChild(adView);</p><p>Is there something similar in java?</p><p>Thanks for any help!</p>","518421","","","","","2012-10-09 01:15:20","How to add admob ads into the app?","<java><android><android-layout><admob><surfaceview>","2","0","1","",""
"4264363","1","4264450","","2010-11-24 07:26:16","2","3811","<p>I am new to Android and i have create some navigation base Application. now i Want to make some simple racing game so can anybody provide me tutorials for how to start developing?</p><p>Thanks.</p>","472882","","","","","2013-10-16 10:45:06","Start to Developing Racing Game","<android>","3","0","5","2013-10-16 12:42:09",""
"4264370","1","","","2010-11-24 07:27:18","1","178","<p>When binding a service <code>onServiceConnected</code> is called asynchronously As far as I can tell, it is possible that the activity that bound the service might be paused before the service is connected. How should this situation be handled in terms of <code>unbindService</code>?</p><p><code>unbindService</code> requires a reference to the ServiceConnection, which was passed to <code>bindService</code> so it can be called immediately after <code>bindService</code>. Are there any ordering issues? In general I don't believe Android has many guarantees for the execution order of asynchronous calls.</p>","95157","","95157","","2010-11-24 07:34:26","2010-11-24 07:34:26","How to handle onServiceConnected after onPause?","<android><service>","0","0","","",""
"4264484","1","4264819","","2010-11-24 07:44:50","2","1161","<p>how to update an android third party application on mobile with user permission?<br>We are developing one product.client installed it from our company website.<br>How to update it remotely?</p><p>Thanks in advance</p>","1746300","","52444","","2012-08-17 08:29:23","2012-08-17 08:29:23","Update android application remotely","<android>","3","0","","",""
"4264507","1","4264813","","2010-11-24 07:50:58","2","316","<pre><code>view.setText(""hello"");wait(1000);view.setText(""world"");</code></pre><p>When I call the above function the view doesn't show ""hello"" at all. The text only updates when the complete function is finished. What do I have to call to see ""hello""?</p>","25282","","25282","","2010-11-24 16:29:39","2012-10-10 20:42:47","Updates TextView in Android","<android><android-ui>","3","1","1","",""
"4264552","1","4264609","","2010-11-24 07:58:31","1","86","<p>I am trying to submit an app, and when I spot the .apk it tells me this:</p><p>This apk requests 0 permissions that users will be warned about</p><p>but, in the Manifest, I made a note to include:</p><pre><code> &lt;uses-permission android:name=""android.permission.CAMERA"" /&gt;  &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;</code></pre><p>Is this simply because I launch my camera in an Intent, rather than a contentView, etc...?  Or is this a problem I need to look into before I submit?</p><p>THanks</p><p>Edit  -- </p><p>The app works on my phone when I remove them, so maybe they aren't needed?  I was told a while back that launching the camera with an intent did not require a permission in the manifest, but I wanted to double check.  I feel like the permission tags are correct, and I placed them in different parts of the manifest, and deleted them, but the app still ran - is it an issue I don't need to worry about then?</p>","496686","","496686","","2010-11-24 16:12:17","2010-11-24 16:12:17","Do Intents supersede permissions when it comes access?","<android><permissions><android-intent><launch>","1","2","","",""
"4264589","1","4266967","","2010-11-24 08:04:17","9","2084","<p>I'm building the search in an application and need to have a way of putting the suggestions which I get from my server as a JSON-array into the list of suggestions which is displayed below the Quick Search Box.</p><p>Is there an easy way to have the quick search box read such resources?</p><p>Currently I am trying to use a ContentProvider, but the interface methods clearly indicate one is supposed to be querying a database to get the suggestions. I guess using a ContentProvider is the correct way if you are searching the data which is stored inside the application. I am not so sure however, that it is the right way if you need to query a network resource. </p><p>It makes no sense for me to save the suggestions I get from the network to a local database, as the suggestions and their hit rate will vary from time to time.</p><p>Anyone had this issue? Or can point me in the direction of a similar question? I could not find questions here on stack that mentioned network suggestions.</p>","217283","","1228","","2013-06-07 14:46:11","2013-06-07 14:46:11","Search suggestions from network resource into Quick Search box","<android><json><networking><quick-search>","1","2","5","",""
"4264725","1","","","2010-11-24 08:25:17","1","405","<p>I know that an appwidget cannot refresh it with an interval minor of 30 minutes.But in internet I have read something about a workaround using a system timer.Someone know this workaround? Or someone know how can I do to set a refresh rate minor?I'm developing a kind of clock. There are many clock widget in the market, and I think that there is a solution otherwise this kind of widget would not exist because they need a refresh rate of at least 1 minute.Thanks</p>","516130","","1073832","","2012-01-09 23:00:07","2012-01-09 23:00:07","AppWidget refresh rate","<android><appwidget>","1","0","","",""
"4264748","1","","","2010-11-24 08:28:55","0","288","<p>Is there a way to interconnect 2 emulator instances running on different machines? One of them is acting as a client and other as a server, hence 2-way interaction is required.</p>","235246","","","","","2010-11-24 08:43:58","interconnecting 2 android emulators on different machines","<android><android-emulator>","1","0","","",""
"4264779","1","5049194","","2010-11-24 08:32:46","2","3280","<p>My app is a simple booking system which enables users to pay from their credit cards. (This app is a module of a already finished web application) </p><p>Question is How to call a payment gateway within the app? </p><p>Is it possible to access the services from the existing web application and proceed with the payment?ORIs is advisable to use a webview with the URL of the existing web application?</p>","274107","","","","","2011-02-19 06:05:30","How to call a payment gateway within the app?","<android><payment-gateway><android-webview>","1","0","2","",""
"4264841","1","","","2010-11-24 08:44:04","0","222","<p>As I understand the best place is to persist data or release resources in android is inside the onPause() call. In case if we have multiple activities and every persist and release calls are expensive we don't want to call that on each onPause call. Specially while moving around our application we don't need to do so. To verify these different onPause calls there is only isFinishing() API. But that is not enough. Is there any other API?I have explain the problem in this post <a href=""http://sudarnimalan.blogspot.com/2010/11/android-when-to-persist-data-or-release.html"" rel=""nofollow"">http://sudarnimalan.blogspot.com/2010/11/android-when-to-persist-data-or-release.html</a>, and a solution for this. Could you please check and let me know if there is any other correct way to do this? </p>","518504","","","","","2010-11-24 08:44:04","Android: When to persist data or release resources if that is expensive?","<android><resources><persistence>","0","2","","",""
"4264851","1","4264875","","2010-11-24 08:45:26","7","3060","<p>i have a button with two states(selected and unselected). the image of button is different for the states. Which one should I use? How do i set images and states? Please give suggestions(i am new to android). </p>","450487","","","","","2010-11-24 08:55:56","What should I use ImageButton or Button?","<android><button><imagebutton>","1","0","3","",""
"4264924","1","","","2010-11-24 08:54:51","3","977","<p>I have a problem on my Android app. I'm using MediaStore.ACTION_IMAGE_CAPTURE intent to take picture from camera. It worked all most of devices but I got the following crash errors on DroidX device from android market. </p><p>I think imageCaptureUri CANNOT be null in this case. So it is not the cause.</p><p>Do you have any ideas? Is it a firmware error?</p><pre>java.lang.NullPointerExceptionat android.content.ContentResolver.openInputStream(ContentResolver.java:286)at com.eb.android.activity.AddActivity.getBase64Receipt(AddActivity.java:193)at com.eb.android.activity.AddActivity.publishReceipt(AddActivity.java:204)at com.eb.android.activity.AddActivity.access$0(AddActivity.java:203)at com.eb.android.activity.AddActivity$1.run(AddActivity.java:50)at java.lang.Thread.run(Thread.java:1102)-------------java.lang.NullPointerExceptionat android.content.ContentResolver.openInputStream(ContentResolver.java:288)at com.eb.android.activity.AddActivity.getBase64Receipt(AddActivity.java:193)at com.eb.android.activity.AddActivity.publishReceipt(AddActivity.java:204)at com.eb.android.activity.AddActivity.access$0(AddActivity.java:203)at com.eb.android.activity.AddActivity$1.run(AddActivity.java:50)at java.lang.Thread.run(Thread.java:1096)</pre><p>This is my implementation:</p><pre>public class AddActivity extends Activity {    public static final int TAKE_RECEIPT = 2;    private Uri imageCaptureUri;    private Runnable submitReceiptRunnable = new Runnable() {        public void run() {            publishReceipt();        }    };    private ProgressDialog progressDialog;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.add);        registerListeners();    }    public void onActivityResult(int reqCode, int resultCode, Intent data) {        super.onActivityResult(reqCode, resultCode, data);        switch (reqCode) {        case (TAKE_RECEIPT):            takeReceiptCallback(resultCode, data);            break;        }    }    private void registerListeners() {        ImageView addReceiptButton = (ImageView) findViewById(R.id.AddReceiptButton);        addReceiptButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                takePictureFromCamera();            }        });    }    private void takePictureFromCamera() {        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);        imageCaptureUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(), ""tmp_receipt_""                + String.valueOf(System.currentTimeMillis()) + "".jpg""));        intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageCaptureUri);        intent.putExtra(""return-data"", true);         startActivityForResult(intent, TAKE_RECEIPT);    }    private void takeReceiptCallback(int resultCode, Intent data) {        if (resultCode == Activity.RESULT_OK) {            submitReceipt();        }    }    private void submitReceipt() {        Thread thread = new Thread(null, submitReceiptRunnable);        thread.start();        progressDialog = ProgressDialog.show(this, ""Please wait..."", ""Publishing receipt ..."", true);    }    private String getBase64Receipt() {        try {            InputStream inputStream = getContentResolver().openInputStream(imageCaptureUri);            byte[] bytes = CommonUtil.getBytesFromInputStream(inputStream);            return Base64.encodeBytes(bytes);        } catch (IOException e) {            Log.e(TAG, e.getMessage(), e);        }        return null;    }    private void publishReceipt() {        String receipt = getBase64Receipt();        ...    }}</pre>","423715","","","","","2011-02-23 13:47:49","Android: NPE happens when getting picture from camera","<android><camera>","1","0","","",""
"4264981","1","4265723","","2010-11-24 09:02:17","10","5889","<p>Can somebody explain to me what are the benefits of Android System App over a ""normal"" app (besides that fact that a system app cannot be uninstalled)?Special permissions?</p>","517329","","114066","","2010-11-24 09:20:15","2010-11-24 10:25:47","Android System App 101","<android><security>","3","0","3","",""
"4264990","1","","","2010-11-24 09:03:05","5","9079","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2801116/converting-a-view-to-bitmap-without-displaying-it-in-android"">Converting a view to Bitmap without displaying it in Android?</a>  </p></blockquote><p>I am trying to convert the view into bitmap from following reference link</p><p><a href=""http://www.brighthub.com/mobile/google-android/articles/30676.aspx"" rel=""nofollow"">link text</a></p><p>Now the problem is how can i get the bitmap that is being converted from view only. in the example author has used relativelayout.dispatchDraw(c) but this line is giving me compile time error i.e.</p><blockquote>  <p>The method dispatchDraw(Canvas) from  the type ViewGroup is not visible</p></blockquote><p>Here is my code and i have written the following code inside onCreate function</p><pre><code>    Canvas c=null;    //Create Layout    RelativeLayout relativeView ;               RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(    RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT    );    relativeView = new RelativeLayout(this);                relativeView.setLayoutParams(lp);    //Background of Layout    Bitmap viewBgrnd  = BitmapFactory.decodeResource(getResources(),R.drawable.bgblack);    relativeView.setBackgroundDrawable(new BitmapDrawable(viewBgrnd));    //associated with canvas     Bitmap returnedBitmap =               Bitmap.createBitmap(320,480,Bitmap.Config.ARGB_8888);         c = new Canvas(returnedBitmap);    Paint paint = new Paint();    //Create Imageview that holds image                 ImageView newImage = new ImageView(this);    Bitmap srcBitmap = BitmapFactory.decodeResource(getResources(),R.drawable.bgpink);    newImage.setImageBitmap(srcBitmap);    TextView newText = new  TextView(this);    newText.setText(""This is the text that its going to appear"");           c.drawBitmap(viewBgrnd, 0, 0, paint);            relativeView.layout(100, 0, 256, 256);      relativeView.addView(newImage);    relativeView.addView(newText);        // here i am getting compile time error so for timing i have replaced this line        // with relativeView.draw(c);    relativeView.dispatchDraw(c);</code></pre><p>Here the returnedBitmap should contain the image of (ImageView and TextView) but this bitmap contains only bacground bitmap of relativeView i.e. bgblack</p>","405383","","405383","","2010-11-24 13:46:43","2012-03-07 08:13:11","convert view into bitmap","<android><canvas><bitmap>","2","5","5","2012-03-07 16:56:25",""
"4265035","1","","","2010-11-24 09:08:23","0","937","<p>I need a tabview , but i has to be at bottom , am having a custom title , it covers most of topview . So i want to go v with bottom tab view . Other question is that , can i add Tabview in a tabview.</p><p>Thanking you ,</p><p>Srinivas</p>","414777","","","","","2010-11-24 09:15:18","Is it possible Bottom Tabview like iphone in android?","<android><uitabview>","1","0","","",""
"4265066","1","","","2010-11-24 09:11:04","1","30","<p>hai every one....i am using tinyline in my android project.i am able to render,display only up to  20KB file in  the canvas . i cannot display more than 20KB size of svg files.can any one suggest how to solve the issue.......? thank you in advance.</p>","493244","","493244","","2010-11-29 07:03:39","2010-11-29 07:03:39","displaying largesvgfiles","<android>","0","0","","",""
"4265108","1","4265458","","2010-11-24 09:16:20","3","4690","<p>I try to test c2dm app. I have sign up for Android Cloud to Device Messaging.<a href=""http://code.google.com/android/c2dm/signup.html"" rel=""nofollow"">http://code.google.com/android/c2dm/signup.html</a></p><p>For example:</p><p>Contact email *Email address we should contact when you've been whitelisted:aaa@gmail.com</p><p>Role account email *Google Account ID that will be used for sending messages to C2DM:bbb@gmail.com</p><p>I register from my app and sender id (bbb@gmail.com) to c2dm service and i get registration_id.</p><p>After that my third party server must get ClientLogin authentication using email and password. From which email? The whitelisted email (aaa@gmail.com) or sender id (bbb@gmail.com)?? I try both email and from this process i got authorization_id. </p><p>But when i use the registration_id and authorization_id to send message to C2DM Server, i got response codes 401 Unauthorize. I use authorization_id from whitelisted email (aaa@gmail.com) and sender id (bbb@gmail.com) but none worked.</p><p>What could be the problem?Thanks you.</p>","430926","","430926","","2010-11-24 09:22:04","2010-11-24 09:55:10","Android C2DM server send message","<android><android-c2dm>","1","0","2","",""
"4265113","1","","","2010-11-24 09:16:52","4","1527","<p>I'm testing Flurry on a simple Android app that has just a single Activity.</p><p>I call the <code>FlurryAgent.onPageView();</code> from the Activity's <code>onCreate</code> method.</p><p>Is this the correct way to count page views?</p><p>Also, I can't find the PageView report on <a href=""http://dev.flurry.com/"" rel=""nofollow"">http://dev.flurry.com/</a>, where is it?</p><p>Thanks,Giacomo</p>","54967","","","","","2012-12-25 10:46:42","How FlurryAgent.onPageView() works?","<android><analytics><flurry>","2","3","","",""
"4265114","1","","","2010-11-24 09:16:54","2","490","<p>I am using ZXing api to read barcode from a image and i can read barcode using below code but i want also image of barcode which capture by api please let me know how to get it. </p><p>IntentIntegrator.initiateScan(Activity);</p><p>Thanks</p>","516061","","","","","2011-12-05 21:40:42","How to get image of barcode?","<android>","1","0","1","",""
"4265199","1","4265469","","2010-11-24 09:26:57","0","2908","<p>Here I am using XmlPullParser to parse the document below.  It does not work because of the namespaces, how do I parse with namespaces?</p><pre><code>                    XmlPullParserFactory factory = XmlPullParserFactory.newInstance();                    factory.setNamespaceAware(true);                    factory.setValidating(true);                    XmlPullParser xpp = factory.newPullParser();                    xpp.setInput(in, HTTP.UTF_8);                    String namespace = xpp.getNamespace();                    boolean inMessage = false;                    int eventType = xpp.getEventType();                    while (eventType != XmlPullParser.END_DOCUMENT) {                        //START TAGS                        if(eventType == XmlPullParser.START_TAG) {                            if(xpp.getName().equals(namespace+""resource"")) {                                httpCode = Integer.valueOf( xpp.getAttributeValue(null, ""code"").trim() );                                type = xpp.getAttributeValue(null, ""type"").trim();                            } else if(xpp.getName().equals(namespace+""message"")) {                                inMessage = true;                            }                        //TAG TEXT                        } else if(eventType == XmlPullParser.TEXT) {                            if(inMessage) {                                message = xpp.getText().trim();                                break; //CANCEL the iteration                            }                        } else if(eventType == XmlPullParser.END_TAG) {                            if(inMessage) {                                inMessage = false;                            }                        }                        eventType = xpp.next();                    }</code></pre><p>Here is an example of the sort of document I want to parse</p><p></p><pre><code>&lt;res:resource     xmlns:res=""http://www.mysite.com/ns/server/resource""    xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""     xsi:schemaLocation=""http://www.mysite.com/ns/server/resource resource.xsd ""    version=""1""     &gt;    &lt;res:message httpCode=""200"" type=""ok"" &gt;        &lt;![CDATA[Sample Success Response]]&gt;    &lt;/res:message&gt;    &lt;dif:person         xmlns:dif=""http://www.mysite.com/ns/server/resource""        xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""         xsi:schemaLocation=""http://www.mysite.com/ns/server/person person.xsd ""        version=""1""         &gt;        &lt;dif:name&gt;test name&lt;/dif:name&gt;        &lt;dif:description lang=""en""&gt;test description&lt;/dif:description&gt;    &lt;/dif:person &gt;&lt;/res:resource&gt;</code></pre><p>I want to parse <code>res</code> and <code>dif</code> separately</p>","248521","","248521","","2010-11-24 09:44:04","2010-11-24 09:56:32","Handling Xml namespaces with XmlPullParser","<java><android><xml><xml-parsing>","1","0","","",""
"4265228","1","4265324","","2010-11-24 09:29:41","33","38037","<p>I am developing an application,In my application,I am using Listview for displaying data using dom parsing,I want to footer in listview,when i click footer additional more data add to list view,I attached image,i would like that design and process,please refer image1 and imgae2.I mention footer in red rectangle</p><p><strong>Fig1-Footer like ""More News""</strong><br><img src=""http://i.stack.imgur.com/HeZb0.jpg"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/czqMa.jpg"" alt=""alt text""></p><p>Fig2-Add additional 10 record added in listview</p>","500595","","56285","","2013-12-17 11:50:19","2014-04-15 10:27:20","How to add a footer in ListView?","<android><android-listview><footer>","3","0","10","",""
"4265261","1","4265456","","2010-11-24 09:32:40","0","1486","<p>I have this .xml file with countries and their countrycodes in them. This is how it looks like:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;landen&gt;&lt;land&gt;   &lt;naam&gt;Afghanistan&lt;/naam&gt;   &lt;code&gt;AF&lt;/code&gt;&lt;/land&gt;&lt;land&gt;   &lt;naam&gt;Albani?&lt;/naam&gt;   &lt;code&gt;AL&lt;/code&gt;&lt;/land&gt;&lt;land&gt;   &lt;naam&gt;Algerije&lt;/naam&gt;   &lt;code&gt;DZ&lt;/code&gt;&lt;/land&gt;&lt;land&gt;&lt;/landen&gt;</code></pre><p>Now I want people to choose one country out of an list. I though an AlertDialog would be nice to display everything.</p><p>The way i get the values out of my xml-file is like this:</p><pre><code>protected ArrayList&lt;Land&gt; getLanden() {    ArrayList&lt;Land&gt; lijst = new ArrayList&lt;Land&gt;();    try {        DocumentBuilder builder =DocumentBuilderFactory.newInstance().newDocumentBuilder();        Document doc = builder.parse(getAssets().open(""landenlijst.xml""));        NodeList nl = doc.getElementsByTagName(""land"");        for (int i=0;i&lt;nl.getLength();i++) {            Node node = nl.item(i);            Land land = new Land();            land.land = Xml.innerHtml(Xml.getChildByTagName(node, ""naam""));            land.landcode = Xml.innerHtml(Xml.getChildByTagName(node, ""code""));            lijst.add(land);        }        Log.d(""Gabug"",""Klaar met parsen"");        Log.d(""Gabug"",""Landen: "" + lijst);    } catch (Exception e) {        e.printStackTrace();    }    return lijst;}</code></pre><p>And I use this to make my AlertDialog:</p><pre><code>public void KiesLandMenu(){        ArrayList&lt;Land&gt; alleLanden = getLanden();        final CharSequence[] items = alleLanden.toArray(new CharSequence[alleLanden.size()]);        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setTitle(""Kies land"");        builder.setItems(items, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int item) {                switch (item){                    case 0:                        break;                    case 1:                        break;                    case 2:                        break;                }            }        });        AlertDialog alert = builder.create();        alert.show();    }</code></pre><p>I don't know if this works as DDMS returns some bytecode or something when i Log it. And after that it Force Closes because of ArrayStoreException..</p><p>Now my question is; is this the best way to do this? if yes, how can I fix the ArrayStoreException? If no, what are better ways to let my user choose a country (a whole new view maybe)?Furthermore, how can I register what country someone tapped?</p><p>EDIT:</p><p>I slightly changed the sample code below and I get an NullPointerException now..</p><pre><code>public void KiesLandMenu(){    ArrayAdapter&lt;Land&gt; arrAdapter;    ArrayList&lt;Land&gt; alleLanden = getLanden();    arrAdapter = new ArrayAdapter&lt;Land&gt;(this, android.R.layout.simple_list_item_single_choice, alleLanden);    ListView list = (ListView)findViewById(R.layout.lijstview);    list.setAdapter(arrAdapter);    list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);    list.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; list, View view, int position,                long id) {            Log.e(""item clicked"", String.valueOf(position));        }    });}</code></pre><p>The NullPointerException is at <code>list.setAdapter(arrAdapter);</code></p>","517460","","517460","","2010-11-24 10:19:45","2010-11-24 13:18:05","Parse XML and display it in an AlertDialog in Android","<java><android><xml><alertdialog>","3","5","1","",""
"4265297","1","4265743","","2010-11-24 09:36:35","0","2125","<p>does anybody knows how to launch a new activity with rotation animation?</p><p>I'll try to explain what i want to do:</p><p>For instance i've looked for android app exemple in skd sample ""apidemos"" and i've found a class named <code>com.exemple.android.apis.animation.Rotate3dAnimation.java</code> and <code>com.exemple.android.apis.animation.Transition3d.java</code>. These classes allow me to switch between image with rotation effect. </p><p>That I would like to know if there is a way to do the same but instead of image, i will be activity (whith new layout).</p>","518548","","271357","","2010-11-24 09:41:26","2012-06-16 19:40:00","switch between activity with rotation animation","<java><android><animation><activity>","2","1","","",""
"4265363","1","4271362","","2010-11-24 09:44:03","4","1542","<p>I have a small problem with OrmLite on Android.</p><p>When I increment the database version, the <code>onUpgrade</code> method is called as expected in my OrmLite Helper. After the upgrade, the <code>onCreate</code> method is called and I get this exception:</p><pre><code>11-24 10:09:45.720: ERROR/AndroidConnectionSource(390): connection saved    com.j256.ormlite.android.AndroidDatabaseConnection@44f0f478 is not the one    being cleared com.j256.ormlite.android.AndroidDatabaseConnection@44f5d310</code></pre><p>I have no clue why the cleared connection is not the same as the saved one.</p><p>I've put also my database functions (insert...) into the OrmLite Helper class. Maybe this could be a problem?!?</p><p>A snippet from my helper class:</p><pre><code>public class OrmLiteDBProvider extends OrmLiteSqliteOpenHelper    implements IEntityProvider, IDBProvider {//snip@Overridepublic void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {    try {        Log.i(OrmLiteDBProvider.class.getName(), ""Creating database and tables"");        TableUtils.createTable(connectionSource, OrgManaged.class);    } catch (SQLException e) {        Log.e(OrmLiteDBProvider.class.getName(),            ""Can't create database and tables"", e);        throw new RuntimeException(e);    }}@Overridepublic void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource,   int oldVersion, int newVersion) {    try {        Log.i(OrmLiteDBProvider.class.getName(),            ""Database version changed. Dropping database."");        TableUtils.dropTable(connectionSource, OrgManaged.class, true);        // after we drop the old databases, we create the new ones        onCreate(db);    } catch (SQLException e) {        Log.e(OrmLiteDBProvider.class.getName(), ""Can't drop databases"", e);        throw new RuntimeException(e);    }}</code></pre><p>I think it's something simple I'm missing.</p><p>Thanks in advance for your effort.</p>","472058","","179850","","2011-08-30 18:26:33","2011-08-30 18:26:33","Android & OrmLite: OnUpgrade fails","<android><ormlite>","1","2","2","",""
"4265377","1","","","2010-11-24 09:46:01","1","2891","<p>I want to restric user from entering any special character or number into edit text, but programmatically it should allow.</p><p>I know I can make <code>inputType=""text""</code> but it deals only with the softkeyboard. I think it can be achived with TextWatcher, but I am not able to gel evrything. Can anyone help ?</p>","447238","","","","","2010-11-24 11:11:30","Text Only Input EditText android","<android><validation><edittext><restriction>","1","1","","",""
"4265400","1","4396175","","2010-11-24 09:48:42","7","7880","<p>I want to transfer messages from the android device to desktop application. My question is that can i connect the android WiFi device with the desktop WiFi device without any use of internet connection. I want to use it just like the Bluetooth. is this possible or not? if it is possible then how can i implement it?</p><p>Thanks and RegardsAmit Thaper</p>","339116","","104117","","2010-12-09 08:22:04","2013-05-08 14:12:32","WIFI to WIFI Connectivity using Android","<android><android-wifi>","3","1","14","",""
"4265403","1","4266587","","2010-11-24 09:49:07","0","183","<p>I did quite a reading about Android recently and I came across something that confuses me.The problem is in what occasions it is appropriate to instantiate the IntentFilter class?</p><p>I'm aware of the the model that Android uses AndroidManifest.xml and how Android matches intents against the declared filters, but I still cannot figure out what would be a proper usage of IntentFilter class?</p><p>I doubt that it is for dynamic declaration of filter in run-time..</p><p>Can you, palls, help me figure out what would be a proper usage of an IntentFilter instance in an application?</p><p>Thanks!</p>","481828","","","","","2010-11-24 12:09:14","What is a proper usage IntentFilter class/object?","<android><usage><intentfilter><clearance>","1","0","","",""
"4265425","1","7921390","","2010-11-24 09:51:30","0","892","<p>If I want all my POIs to be visible in the Map, then I need to adjust two parameters dynamically:</p><ul><li>Center-Focus of the Map</li><li>Zoom step</li></ul><p>I am wondering if there is such a behavior already built into the MapActivity? If not, could you provide me sample code?</p>","433718","","433718","","2010-11-24 14:38:28","2011-10-27 19:38:31","Zoom into group of points in the MapActivity (ItemizedOverlay) in Android","<android><overlay><zoom><android-mapview><itemizedoverlay>","2","0","","",""
"4265514","1","4494788","","2010-11-24 10:01:35","7","5003","<p>I read in the explanation in Android Cloud to Device Messaging Framework.After our app register successfully to C2DM server, we receive a registration ID. The registration ID lasts until the application explicitly unregisters itself, or until Google refreshes the registration ID for your application. When is exactly Google refreshes the registration ID for your application?? How do we know it so we can register again and send our new registration ID to our server.</p><p>Thank you.</p>","430926","","","","","2010-12-20 22:52:59","android c2dm registration ID","<android><android-c2dm>","1","4","5","",""
"4265532","1","10409279","","2010-11-24 10:03:29","6","1324","<p>I have a set of custom Android layout parameters defined in attrs.xml. Now I would like to use some tags in my styles.xml file.</p><p>At the moment I get this error:</p><pre><code>error: Error: No resource found that matches the given name: attr 'custom:tag'</code></pre><p>I have tried declaring custom XML namespace as follows:</p><pre><code>&lt;resources    xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:custom=""http://schemas.android.com/apk/res/com.my.project""&gt;</code></pre><p>hoping, that the same logic used in every layout declaration can be applied here, but with no success.</p>","235910","","","","","2012-05-02 09:00:22","Custom attrs parameter used in styles.xml","<android>","1","2","3","",""
"4265588","1","4388164","","2010-11-24 10:10:08","3","85","<p>I'm experiencing issues with both this dialog and another Activity - where it's an EditText control that looks wrong - and in both cases it seems that the center of the control is shifted up by one pixel, or the sides down by one. I'm guessing that the regions in question are defined by a 9-patch.</p><p>Has anyone else experienced this, and knows how it might be resolved? Could it be something to do with sub-pixel rendering - as with the iPhone, where non-integer positioning of UI controls causes blurriness? I've also noticed issues with table dividers disappearing at certain offsets (surely a subpixel issue) - but on both this phone and an HTC device.</p><p><img src=""http://i.stack.imgur.com/oKFuu.png"" alt=""Button at the bottom of the screen is deformed""></p>","148206","","","","","2010-12-08 13:46:59","Why do these Android controls look peculiar on Galaxy S?","<android><views><activity><rendering>","1","0","","",""
"4265595","1","4356287","","2010-11-24 10:11:01","19","10314","<p>According to android icon design guidelines (<a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design.html"">here</a>, see table #1), developer needs to provide status bar icons of next sizes:</p><pre><code>Status Bar  24 x 24 px (LDPI)  32 x 32 px (MDPI)  48 x 48 px (HDPI)</code></pre><p>While my measurements show that status bar always has 25 dp in height and expects icons of 25x25dp. This translates to these sizes:</p><pre><code>Status Bar  19 x 19 px (LDPI) 25 x 25 px (MDPI)  38 x 38 px (HDPI)</code></pre><p>Here is how I get those size: </p><pre><code>25dp * 0.75 = 18.75 =&gt; 19px (LDPI)25dp *  1   = 25    =&gt; 25px (MDPI)25dp *  1.5 = 37.5  =&gt; 38px (HDPI)</code></pre><p>I have confirmed calculated sizes on several Android phones and on emulators. </p><p>The question basically is: why guidelines use sizes different from what is really used by status bar? </p><p>P.S. I actually need to break guidelines due to precise pixel control requirements. And I just was confused by this state of affairs. So explanation of why this the way it is would really help me.</p>","69802","","69802","","2010-11-24 10:34:10","2012-10-11 16:06:32","Android status bar expects icons of size 25x25dp while guidelines recommend 32x32dp. Who is wrong?","<android><icons><size><guidelines>","2","2","6","",""
"4265804","1","4266088","","2010-11-24 10:35:46","8","13807","<p>I have an ImageView that is defined in the following way: </p><pre><code> &lt;ImageView  android:id=""@+id/cover_view""  android:layout_width=""wrap_content""  android:layout_height=""match_parent""  android:layout_below=""@id/title""  android:layout_above=""@id/divider""  android:adjustViewBounds=""true""  android:src=""@drawable/image_placeholder""  android:scaleType=""fitStart""/&gt;</code></pre><p>Now after downloading a new bitmap I change the drawable. The image now appears in the top left corner of the ImageView. Is there a way to have the image fill up the whole height that is possible and then adjust the width of the view to enable scaling the image without changing the ascpect ratio? </p><p>The image fills up all the space on a standard screen but on a WVGA Resolution the image takes only about half of the actual height of the ImageView.</p>","114066","","","","","2013-04-18 08:15:27","How to create an ImageView that fills the parent height and displays an Image as big as possible?","<android><layout><scaling><imageview>","3","0","3","",""
"4265909","1","4266618","","2010-11-24 10:46:29","6","2897","<p>I'm trying to get my main activity to be the launcher activity and also receive send events. Somehow I can't seem to make both work same time. Either I have the launcher icon in the app tray but then not in image share menu in from gallery for example. How can I make both work at the same time.</p><p>With this intent filter the icon is in app tray but not in share menu.</p><pre><code>         &lt;intent-filter&gt;            &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;            &lt;action android:name=""android.intent.action.MAIN""/&gt;            &lt;action android:name=""android.intent.action.SEND"" /&gt;        &lt;/intent-filter&gt;</code></pre><p>With this one I have it in the share but not in app tray</p><pre><code>        &lt;intent-filter&gt;            &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;            &lt;action android:name=""android.intent.action.MAIN""/&gt;            &lt;action android:name=""android.intent.action.SEND"" /&gt;            &lt;data android:mimeType=""image/*"" /&gt;        &lt;/intent-filter&gt;</code></pre><p>I suspect it has something to do with the data element and I tried this but it didn't work</p><pre><code>        &lt;intent-filter&gt;            &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;            &lt;action android:name=""android.intent.action.MAIN""/&gt;            &lt;action android:name=""android.intent.action.SEND"" /&gt;               &lt;data android:mimeType=""image/*""&gt;            &lt;/action&gt;          &lt;/intent-filter&gt;</code></pre><p>Any help much appreciated, thank you!</p>","422863","","","","","2014-01-11 17:47:45","Intent filter for launcher and send activity","<android><filter><android-intent>","1","0","1","",""
"4266048","1","","","2010-11-24 11:04:59","1","327","<p>In my company we are trying to use the official bluetooth api of Android to switch on the bluetooth and use it. But we have found several problems with different phones. </p><p>The thing is that in some of them it works perfectly and in some others it doesn't work at all. For example:</p><ul><li>HTC MAGIC 2.1 Works</li><li>HTC LEGEND 2.1 Doesn't work.</li><li>HTC LEGEND 2.2 Doesn't work</li><li>NEXUS ONE 2.2 Works</li><li>T-mobile myTouch 3G Slide 2.1 Doesn't Works</li></ul><p>So my questions are:</p><p>There is any way to make it work in any device? A software solution.</p><p>Is a hardware related problem? We can't do anything about it.</p><p>How this people (Bluetooth File Transfer) make it work in any device? (at least the ones we tested) Could be them using some low level calls or something similar?</p><p>I've been researching in the web  but I didn't find anything conclusive. We are using the api like the boys of Android says <a href=""http://developer.android.com/guide/topics/wireless/bluetooth.html"" rel=""nofollow"">here</a> </p><p>I hope somebody give us some help on this.</p>","338300","","116923","","2010-11-24 11:27:08","2011-01-13 03:30:32","There is any bug in the bluetooth android api?","<java><android><bluetooth>","1","0","","",""
"4266065","1","4266211","","2010-11-24 11:07:24","1","1259","<p>I am working on an application where I have to display the list of songs in an Activity. I know I can do that using the ListView but actually the problem is that I want to display them in a Particular Manner. </p><p>I want to display them AS PER THE ARTISTS NAME. i.e. I WANT TO DISPLAY THE MULTIPLE SONGS OF A PARTICULAR ARTIST IN ONE ROW AND SIMILARLY THE OTHER BELOW THE ONE.</p><p>IN THE LIST VIEW FIRST NAME IS SUPPOSED TO BE THE NAME OF THE ARTIST THEN THE LIST OF HIS SONGS, AGAIN THE NAME OF THE SECOND ARTIST AND HIS LIST OF SONGS BELOW HIS NAME AND SO ON.</p><p>Can anyone please help me on this.</p><p>Thanks,david</p>","422859","","","","","2010-11-24 16:08:47","Multiple ListView Example","<android><listview>","2","2","","",""
"4266075","1","","","2010-11-24 11:08:31","0","1986","<p>when the user click the editText Field I need to show spinner(dynamic) from that user select any of the item i need to set the Text for Edit text .How to do this?</p>","512192","","","","","2013-02-13 03:30:59","show spinner at the time of clicking edit text in Android?","<android>","2","2","","",""
"4266095","1","4266131","","2010-11-24 11:11:16","3","4735","<p>When you call <a href=""http://developer.android.com/reference/android/app/Activity.html#startActivityForResult%28android.content.Intent,%20int%29"" rel=""nofollow"">startActivityForResult()</a>, you also provide ""int requestCode"". How can you get that parameter in the started activity (to alter some initialization there)? </p><p>Or am I understanding the purpose of this parameter wrong and it only used to differentiate  calls in onActivityResult(), and started activity should be initialized based on Intents' action and extra bundle? I wonder where is it kept then, I suppose, it's still in Activity but private.</p>","490114","","79125","","2011-04-02 18:32:43","2011-04-02 18:32:43","requestCode parameter in startActivityForResult","<android><activity>","2","0","","",""
"4266146","1","","","2010-11-24 11:17:18","4","1402","<p>I'm working on a school project and I'm researching testing possibilities for Android applications.</p><p>On this page: <a href=""http://developer.android.com/resources/tutorials/testing/helloandroid_test.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/testing/helloandroid_test.html</a> Google writes about unit testing.Is this really a unit test? A Unit test will not integrate all classes and will not test in this context. </p><p>So my opinion is, it is not a Unit Test but an Integration Test.What do you think?</p>","518663","","42303","","2010-11-24 11:59:28","2011-12-15 15:26:59","Is it a UNIT Test or an Integration test?","<android><unit-testing><tdd>","3","4","2","2012-11-06 02:28:56",""
"4266170","1","4519140","","2010-11-24 11:20:08","1","2361","<p>I have a tab view and it works fine, but I would like to open new intents in a tab. At the moment when I open a new intent, it replaces the entire screen, tab included. What modifications are needed to make this open in the same tab?</p><p>Here's the code for opening a new intent:</p><pre><code>            Intent i = new Intent();            i = new Intent();            i.setClassName(""my.massive.package"",                    ""my.massive.package.SecondIntent"");            startActivity(i);</code></pre><p>And here's the code for a new tab:</p><pre><code>TabHost tabHost = getTabHost();    tabHost.addTab(tabHost.newTabSpec(""first"").setIndicator(""First"")            .setContent(new Intent().setClass(this, FirstIntent.class)));</code></pre>","348261","","","","","2013-04-04 13:05:52","Is is possible to open new intents in the same tab in android?","<android><tabs><android-intent><screen><new-operator>","4","0","","",""
"4266185","1","","","2010-11-24 11:21:53","3","895","<p>I am trying to change default style of KeyboardView by applying theme with no success. My target SDK is 1.6 and Xperia X10. Can someone help?</p><p><strong>/res/vaules/style.xml:</strong></p><pre><code>&lt;style name=""myTheme"" parent=""android:Theme""&gt;  &lt;item name=""android:keyboardViewStyle""&gt;@style/aa&lt;/item&gt;&lt;/style&gt;&lt;style name=""aa"" parent=""android:Widget.KeyboardView""&gt;  &lt;item name=""android:keyTextSize""&gt;50sp&lt;/item&gt;  &lt;item name=""android:keyTextColor""&gt;#FF123456&lt;/item&gt;  &lt;item name=""android:keyPreviewHeight""&gt;150dp&lt;/item&gt;  &lt;item name=""android:labelTextSize""&gt;25sp&lt;/item&gt;&lt;/style&gt;</code></pre><p><strong>Manifest.xml:</strong></p><pre><code>&lt;application android:theme=""@style/myTheme""..</code></pre><p>Strange thing is that when I apply the style manually in layout, it works.</p>","370982","","370982","","2010-11-24 12:33:16","2010-11-24 12:33:16","Applying theme for KeyboardView","<android><android-theme>","0","0","1","",""
"4266212","1","4266230","","2010-11-24 11:24:54","3","1059","<p>1 - From a webservice. NET 2008 (vb), I have a method that returns an array of bytes, the byte array is actually a string ""Hola Mundo"" (""Hello World"" in English) compressed with the Class of System.IO.Compression GZipStream.</p><p>2 - The method returns the string ""Hola Mundo"" compressed, and this is what the webservice returns:</p><pre><code>&lt;base64Binary&gt;H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Ir5dlVn6xXo5q/4f0m5DIgoAAAA=&lt;/base64Binary&gt;</code></pre><p>3 - if I do a test from a windows application from Visual Basic. NET to run this method returns me this string and Unzip with another function I have, it brings me the ""Hola Mundo"" ....</p><p>4 - On Android (Eclipse) and I managed to make the request and bring me the previous string ... but do not know how to decompress and show me ""Hola Mundo"" ...</p><p>5 - I have tried several codes from the web, but none work.</p><p>anyone know anything about this? thank you very much from now.</p><p>Greetings.</p>","518657","","518657","","2010-11-24 11:30:51","2011-01-19 15:04:58","Compressed Array Bytes Java from .NET Webservice","<java><.net><android><visual-studio-2008><eclipse>","4","3","","",""
"4266238","1","","","2010-11-24 11:27:39","2","2029","<p>this is the first class, displays listview from sql and pops up a option on longpress.  I wanted to pass the ID number of the current select row to be processed on another class.</p><p>Please help. thanks.</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.select);    mListUsers = getUsers();    lvUsers = (ListView) findViewById(R.id.lv_user);    lvUsers.setAdapter(new ListAdapter(this, R.id.lv_user, mListUsers));      // needed for longpress thing    registerForContextMenu(lvUsers);}/** * all for long press thingy */@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {  super.onCreateContextMenu(menu, v, menuInfo);  MenuInflater inflater = getMenuInflater();  menu.setHeaderTitle(""Selection"");  inflater.inflate(R.layout.list_menu, menu);}@Overridepublic boolean onContextItemSelected(MenuItem item) {  AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();  switch (item.getItemId()) {  case R.id.edit:   Intent intent = new Intent(Select.this, Update.class);   startActivity(intent);    return true;  case R.id.delete:    return true;  default:    return super.onContextItemSelected(item);  }}/** * end of long press thingy *  */</code></pre>","518679","","21234","","2010-11-24 11:29:41","2013-03-08 09:13:10","Android: help pass value from one class to another","<android>","4","0","","",""
"4266263","1","4266345","","2010-11-24 11:30:32","1","3365","<p>How do I use an SQL statement on an sqllite database to insert the current date in UTC.  I found the <code>NOW</code> function but what format is that in?  This will be on mobile devices so everyone will have a different locale, however, I need a standard time format because the device will compare the dates with my server.</p><p>Also, is there a way to automatically update a 'modified' field when the data in the row is changed like you can in MySQL?</p>","248521","","363132","","2010-11-24 11:43:52","2010-11-24 11:51:34","SQLite and inserting the current date in UTC format","<sql><android><sqlite>","2","1","","",""
"4266433","1","","","2010-11-24 11:54:25","0","385","<p>I am developing android application but i don't know how to integrate two activity files(two java classes) with one-onether like we are doing in java?If u have solution please tell me how to do it? -Thanks in advance.</p>","274097","","","","","2010-11-24 13:26:29","how to integrate two java classes and use it in android?","<android>","2","2","","",""
"4266484","1","4266535","","2010-11-24 11:59:16","1","2906","<p>I am trying to write an Activity that has some views, a fillView() method that sets the views (which is not static because it must utilize getContentResolver), and a static method that makes a random choice from a cursor and then runs the fillView() method.</p><p>I had problems with this due to fillView not being static and pickRandom being static, so I tried to initialzize an instance of the class, but now it crashes on the line instance.fillView();</p><p>Sample code below.   Any help would be appreciated.  Perhaps there is a much easier way to accomplish what I am trying to do.</p><p>Thanks,Josh</p><pre><code>public class myView extends Activity implements OnClickListener {@Override    public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    setContentView(R.layout.myView);fillView();    }public void fillView(){    //creates views, runs cursor and applies results to the view created}public static void pickRandom() {             // runs cursor, picks random entry, next I want to apply the result to           //  view, so I run...        myView v = new myView();        v.fillView();        }</code></pre>","453305","","","","","2010-11-24 12:03:38","Another ""Cannot make static reference..."" Question","<android><static>","2","3","1","",""
"4266544","1","4267110","","2010-11-24 12:04:24","1","3895","<p>I have the following json response from a url:</p><pre><code>stdClass Object(    [uname] =&gt; Eamorr    [phoneNumber] =&gt; 082732938293    [fname] =&gt; Steve    [lname] =&gt; Hearst    [sex] =&gt; M    [roofSignNumber] =&gt; 230948    [vehicleReg] =&gt; 07D2892    [vehicleMake] =&gt; Toyota    [vehicleModel] =&gt; Avensis    [vehicleNumPassengers] =&gt; 4    [profilePic] =&gt; -1    [online] =&gt; 1    [status] =&gt;     [picList] =&gt; Array        (        )    [lat] =&gt;     [lng] =&gt;     [reputation] =&gt; 0.63    [numPagesComments] =&gt; 1    [last5comments] =&gt; Array        (            [0] =&gt; stdClass Object                (                    [comment] =&gt; hello5                    [fromUname] =&gt; Eamorr                    [profilePic] =&gt; -1                    [time] =&gt; 1290254763                    [id] =&gt; 23628mr28018onm647z2                )        ))</code></pre><p>And here's how I'm doing the parse:</p><pre><code>                      Gson json=new Gson();                      try{                          Driver driver=json.fromJson(response,Driver.class);                          Log.i(""json"",driver.profilePic);                      }catch(JsonParseException e){                          Log.i(""error"",""JsonParseException"");                      }</code></pre><p>When I run the code, I get this error:ERROR/AndroidRuntime(823): java.lang.RuntimeException: No-args constructor for class com.project.driver.Driver$Post does not exist. Register an InstanceCreator with Gson for this type to fix this problem.</p><p>I'm having trouble with defining a suitable Driver.java for the parse. When I omit the 'last5comments' field, everything works fine, it's just the 'last5comments' bit I'm having trouble with...</p><p>Here is Driver.java:</p><pre><code>public class Driver {    public String uname="""";    public String phoneNumber="""";    public String fname="""";    public String lname="""";    public String sex="""";    public String roofSignNumber="""";    public String vehicleReg="""";    public String vehicleMake="""";    public String vehicleModel="""";    public String vehicleNumPassengers="""";    public String profilePic="""";    public String online="""";    public String status="""";    public String[] picList;    public String lat="""";    public String lng="""";    public String reputation="""";    public String numPagesComments="""";    //having problems below this line     public Post[] last5comments;    public class Post{        public String comment="""";        public String fromUname="""";        public String profilePic="""";        public String time="""";        public String id="""";    }}</code></pre><p>Any help with defining a suitable Driver.java is much appreciated.</p><p>Thanks in advance,</p>","395974","","395974","","2010-11-24 12:14:26","2013-10-08 14:58:23","JSON deserialization using GSON","<android><json><parsing><gson>","2","0","2","",""
"4266603","1","4267190","","2010-11-24 12:10:48","0","1308","<p>I am looking to create an Android application that uses Tabs.</p><h2>Requirements</h2><blockquote>  <p>When a user selects a tab and gets back to the same tab, there shouldn't be a loading period (preferably).</p>    <p>Each tab will contain a listview.</p>    <p>In one of the tabs, I will have to use subtabs.</p></blockquote><p>And that's it.</p><p>One great example I really liked (although I didn't try the app) is <a href=""http://www.usatoday.com/android/"" rel=""nofollow"">http://www.usatoday.com/android/</a>.</p>","169034","","","","","2010-11-25 12:35:07","How to approach Android tabs and subtabs","<android><tabs>","2","0","","",""
"4266633","1","4266797","","2010-11-24 12:14:09","0","299","<p>i have used absolute layout in order to display image buttons in my application's main.xml.   how exactly it affects to using my app on different density screens.. </p>","505580","","","","","2010-11-24 12:33:13","Does use of absolute layout in xml file really makes problem for using on different density emulator","<android><layout><emulator>","2","0","","",""
"4266872","1","","","2010-11-24 12:39:16","1","626","<p>I have created a table named train_table in SQLite database with 3 columns. they are train_id, train_no and train_name. Now, i wrote a class in which i displayed the train_name in a list view. how do i get the related train_no in the next page? can anyone help me in sorting this problem.?Thanks in advance</p>","518783","","","","","2010-11-24 12:57:20","how to get the respective value from a database table where one of the column values are displayed in a list view","<android>","2","0","","",""
"4266982","1","","","2010-11-24 12:51:37","0","373","<p>Hi I'm using db4o in an android application.I want to store multiple objects in a database so I have a loop that adds my objects in the db but if I don't put the close() IN the loop (after each store()), all the objects won't persist the next time I open the db. How is this possible? And how can I put only one close() AFTER the loop without having that problem?</p><p>I want to do only one close() because this is expensive in IO and it slows down the application initialization on the phone.</p><p>Thanks!</p>","507323","","","","","2010-11-25 13:58:38","db4o multiple store() and one close() doesn't work?","<android><db4o><object-persistence>","1","0","","",""
"4267029","1","4267108","","2010-11-24 12:57:38","4","1854","<p>Is there any API in Android that measures the Bluetooth signal strength?</p>","518812","","2153784","","2011-08-31 16:45:45","2011-08-31 16:45:45","Is there any API in Android that measures the Bluetooth signal strength?","<android><bluetooth><signal-strength>","1","0","1","",""
"4267166","1","4268199","","2010-11-24 13:14:03","0","501","<p>is it possible to set a delay at which the scroll bar at the right side appears? The idea is that when the user begins to scroll, the scroll bar does not show up immediately, but if the user scrolls long enough. </p><p>I was looking for some time now and found just a getter method getScrollDefaultDelay (), which gets the time in ms when the scroll bar dissapears. How could I control the delay in my case?</p><p>best regards</p>","504728","","","","","2010-11-24 15:03:55","Show scrollbar after given delay","<android><view><scrollbar>","1","0","","",""
"4267173","1","4267328","","2010-11-24 13:15:26","1","2865","<p>I'm trying to find out, how to override standard onClick color (yellow) for <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/Button.java;h=5e692d4fbbe1598ea07f78b736446285564283dc;hb=HEAD"" rel=""nofollow"">Button</a> with orange color?! (<strong><em>during writing this question I've seen, that these are no colors, but images</em></strong>)</p><p>Is there the easy way to do that? Or should I write a new style in that case?</p><p>I found in GIT, how com.android.internal.R.attr.buttonStyle looks like. And I would like just copy and modify that button style a bit. But if I do it on that way, I get XML-Errors</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector&gt;    &lt;item         android:state_window_focused=""false""         android:state_enabled=""true""        android:drawable=""@drawable/btn_default_normal""/&gt;    &lt;item         android:state_window_focused=""false""         android:state_enabled=""false""        android:drawable=""@drawable/btn_default_normal_disable"" /&gt;    &lt;!-- Modified item --&gt;    &lt;item         android:state_pressed=""true""         android:drawable=""@drawable/btn_default_selected"" /&gt;    &lt;item         android:state_focused=""true"" android:state_enabled=""true""        android:drawable=""@drawable/btn_default_selected"" /&gt;    &lt;item         android:state_enabled=""true""         android:drawable=""@drawable/btn_default_normal"" /&gt;    &lt;item         android:state_focused=""true""        android:drawable=""@drawable/btn_default_normal_disable_focused"" /&gt;    &lt;item         android:drawable=""@drawable/btn_default_normal_disable"" /&gt;&lt;/selector&gt;</code></pre><p>Ok, I guess, I must fill selector's attribute  xmlns:android. If I fill it with ""http://schemas.android.com/apk/res/android"", I get other errors. This time, because the android's drawable resources cann't be found.</p><p>Any suggestions?!</p><p>Thank you,</p><p>Mur</p>","408780","","","","","2010-11-24 13:35:05","Override onClick color / drawable","<android><button><coding-style>","2","0","0","",""
"4267286","1","","","2010-11-24 13:27:59","0","204","<p>I can use <code>SimpleCursorTreeAdapter</code> to create <code>ExpandableListView</code> with correct groupcursors and childcursors. For my program, each child contains three <code>TextView</code>s. When I expand group and click on child, I use custom dialog to show the three values in <code>EditText</code> view. </p><p>The program is ok if I only open ""ONE"" group at a time. I can get correct child values if clicked. But if I expand several groups at the same time. It only shows the latest children under latest group. </p><p>For example: Group A has 3 items, Group B has 5 items, Group C has 2 items. First I clicked on children under Group A, no problem, then children under Group B, no problem, but if I go back to click children under Group A, it still shows child under Group B. I don't know how can show correct children. If I use Toast to display, all children are correct, so strange. What can I do in this methods ?</p><pre><code>epView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener()         {            @Override            public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long row)             {              return false;              }            });        epView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {        @Override        public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id)         {         int tempid = childcursor.getInt(0);         String temp1 = childcursor.getString(1);            String temp2 = childcursor.getString(2);            String temp3 = childcursor.getString(3);            CustomDialog custom = new CustomDialog(ListCateActivity.this,catecursor,childcursor,temp1,temp2,temp3,tempid);            custom.setTitle(""Record Information"");            custom.show();            Toast.makeText(ListCateActivity.this, ""Group:""+String.valueOf(groupPosition).toString()+"" Child: ""+String.valueOf(childPosition).toString()+temp1+"" ""+temp2+"" ""+temp3, Toast.LENGTH_SHORT).show();            return true;        }        });</code></pre><p>thanks !!</p>","471567","","418183","","2010-11-24 14:22:47","2010-11-25 23:24:09","get correct values in childcursor for clicked group","<android><expandablelistview>","1","1","","",""
"4267409","1","4267447","","2010-11-24 13:43:36","4","3119","<p>Hi i'm getting an annoyig error when trying to query some data in SQLite here's is my code:</p><pre><code>Cursor cursor= db.query(TABLE_IMAGES, new String[]{""_id""}, ""name"" +"" = ""+compareToThis, null, null, null, null);</code></pre><p>I'm just returning the cursor as a String.</p><p>The error is saying: ""no such column: compareToThis: while compiling.....the statement""</p><p>My question is: why is SQLite setting the compareToThis attribut as a culumn when it's just a value?How can i fix this?</p><p>Thanks in advance.</p>","499488","","","","","2010-11-24 13:47:40","where clause in SQLite not working in android :(","<android><sqlite>","1","0","","",""
"4267519","1","","","2010-11-24 13:53:55","3","327","<p>i m inserting one video in sdcard to show the video in emulator..</p><p>but showing error:</p><p>[2010-11-24 19:21:22] Failed to push sample.mov on emulator-5554: Read-only file system</p><p>pls help me how can i do that?</p>","383597","","199972","","2012-06-12 21:40:17","2012-07-25 06:24:48","Android emulator SD card problem","<android><android-emulator>","1","0","1","",""
"4267521","1","","","2010-11-24 13:54:25","2","4168","<p>In my android app development, I have one button, the button text is not a single color text, it is two lines text, with each line uses different color for line text. How to implement this? ""Two lines"" can be simply implemented by adding ""\n"" in the text, I don know how to set different colors for each line text on the button. Anyone can help?</p>","475850","","424413","","2010-11-24 14:04:05","2011-11-29 11:45:26","(Android button) how to implement Two line text with different colors on one button","<android><button>","1","0","2","",""
"4267766","1","","","2010-11-24 14:17:09","8","2205","<p>i have a multilingual android app, where i have put the different translations in the strings.xml in the respective directory.</p><p>now i also have a custom xml file, where i would like to reference texts like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;rooms&gt;    &lt;room title=""@+string/localizedtext"" /&gt;&lt;/rooms&gt;</code></pre><p>now when i read the title attribute in my code, i obviously get the unresolved string ""@+string/localizedtext"" like it is. is it possible to somehow resolve this link to the localized text automatically?</p><p>thanks!</p>","97688","","","","","2013-04-23 21:16:01","android: referring to ressources in custom xml","<android><resources><localization>","5","2","","",""
"4267897","1","4268025","","2010-11-24 14:31:16","7","3588","<p>What happens to android application and activities and services that belongs to application when the phone/AP goes to sleep mode?Will the framework destroy Activities and Services and OS kills the process?</p>","110024","","","","","2011-07-27 15:18:07","What happens to Activities/Services when phone goes to sleep/standby mode?","<android>","4","0","2","",""
"4267939","1","4268968","","2010-11-24 14:36:36","2","1584","<p>I'm writing a preference screen in in xml for my Android application. My issue is that some of the titles of the preferences are too long and will not wrap the page. Consider my example:</p><pre><code> &lt;CheckBoxPreference                android:title=""Language Detection (BETA)""                android:defaultValue=""false""                android:summary=""Automatically decide which language to use""                android:key=""lan_det_pref""                android:textSize=""15px""                android:lines=""4""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;</code></pre><p>Maybe I'm missing something but I have tried using number of other properties with no positive results. I have tried android:singleLine, android:lines, etc., and none of these seem to effect the title of the preference. Also is there a way to scale down the size of a CheckBox title?</p><p>Any help would be greatly appreciated.</p><p>Thanks :)</p>","468514","","2225646","","2013-04-17 15:33:19","2013-05-30 07:27:38","How do i change the size of a CheckBox Title or make it Wrap in a PreferenceScreen xml?","<android><xml><checkbox><title><android-preferences>","3","0","5","",""
"4267991","1","","","2010-11-24 14:42:05","0","216","<p>i need to retrieve the images from sdcard,i used the following code.</p><pre><code>String[] projection = {MediaStore.Images.Thumbnails._ID};    cursor = managedQuery( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,            projection,             null,                   null,            MediaStore.Images.Thumbnails.IMAGE_ID);    columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);    int size = cursor.getCount();</code></pre><p>but the cursor always returns Zero.so i cann't get image from sdcard .whats the solution.</p>","461972","","","","","2013-01-29 07:08:24","issue on sdcard in sdcard","<android>","1","2","","",""
"4268178","1","","","2010-11-24 15:01:38","9","5553","<p>I can't seem to get ANY result when trying to start an activity from an activitygroup.  I've put an onactivityresult in the activity and activitygroup?  Specifically I'm trying to let the user choose a photo/video from the Intent.ACTION_GET_CONTENT, but I never get anything back?  What am I doing wrong?</p><p>Here is how I call the code:</p><pre><code>Intent pickMedia = new Intent(Intent.ACTION_GET_CONTENT);   pickMedia.setType(""video/*"");   startActivityForResult(pickMedia,12345);</code></pre><p>Any ideas? </p>","518970","","1288","","2011-07-06 03:08:55","2013-02-24 00:55:37","startActivityForResult from ActivityGroup?","<android><activitygroup>","2","2","5","",""
"4268213","1","4268545","","2010-11-24 15:05:33","0","261","<p>I have an object instance called myClass and i need to set the value of about 30 variables in the object, and I need to do it about 30 times (in 30 methods) in my class.</p><pre><code>myClass.vOnemyClass.vTwo...myClass.vThirty</code></pre><p>Is there some way I can save myself from having to type ""myClass."" 900 times?</p>","353674","","","","","2010-11-24 15:35:57","Android, avoid typing the object name for each of its properties in a method?","<java><android><object><instance>","3","0","","",""
"4268293","1","4268358","","2010-11-24 15:11:53","0","274","<p>I have a simple Android application that loads a page in a WebView, then most of the real work is done by the server-side scripts. Everything is working great, except that I currently have the page URL hard-coded in the Android application, sort of like this:</p><pre><code>mWebView.loadUrl(""https://www.my-application-url.com"");</code></pre><p>This was fine until this morning when I was asked to to make it so that the user is prompted to enter the URL the first time the application run, and the URL that is entered by the user is then saved and used automatically by the application from that point onward. I was also asked to make it so that the user can change the URL if they choose to do so. </p><p>The reason I was asked to do this is so that users can install the server side of the application on their own servers and my Android application will be able to connect without me having to write a custom version for each user, with their URL hard-coded into the application.</p><p>I am unsure what is the best way to handle this in Android. It seems that I probably need to add some type of configuration interface to the application that is shown by default on the first run, then only when the Menu button is pressed on the following runs. From this configuration interface I guess I would then get the URL from the user and serialize it for future use.</p><p>I'm just guessing here. I really don't know how to best accomplish this in Android, and that is my question. What is the best way to accomplish this?</p><p>Thanks!</p>","448887","","","","","2010-11-24 15:18:08","What is the best way to add a configuration UI to my Android application?","<android>","2","0","","",""
"4268426","1","4268508","","2010-11-24 15:23:54","10","11864","<p>from the android doc alone i dont really understand the difference between ACTION_UP and ACTION_POINTER_UP.<a href=""http://developer.android.com/reference/android/view/MotionEvent.html#ACTION_DOWN"">http://developer.android.com/reference/android/view/MotionEvent.html#ACTION_DOWN</a></p><p>basically i want to capture the event when one finger is released from the screen (even if another one may still be touching it)</p><p>thanks!</p>","97688","","","","","2010-11-24 17:20:58","android: difference between ACTION_UP and ACTION_POINTER_UP","<android><multi-touch>","2","0","5","",""
"4268471","1","","","2010-11-24 15:28:12","5","11925","<pre><code>11-24 23:19:18.434: ERROR/AndroidRuntime(12660): Uncaught handler: thread main exiting due to uncaught exception11-24 23:19:18.684: ERROR/AndroidRuntime(12660): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@4384c21811-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.graphics.Canvas.throwIfRecycled(Canvas.java:955)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.graphics.Canvas.drawBitmap(Canvas.java:1044)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:291)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.widget.ImageView.onDraw(ImageView.java:908)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.View.draw(View.java:6283)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.drawChild(ViewGroup.java:1581)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1311)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.drawChild(ViewGroup.java:1579)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1311)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.View.draw(View.java:6286)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.drawChild(ViewGroup.java:1581)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1311)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.widget.AbsListView.dispatchDraw(AbsListView.java:1323)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.widget.ListView.dispatchDraw(ListView.java:2933)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.View.draw(View.java:6389)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at         android.widget.AbsListView.draw(AbsListView.java:2142)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.drawChild(ViewGroup.java:1581)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1311)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.drawChild(ViewGroup.java:1579)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1311)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at     android.view.View.draw(View.java:6286)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.drawChild(ViewGroup.java:1581)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1311)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.View.draw(View.java:6286)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.widget.FrameLayout.draw(FrameLayout.java:352)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewGroup.drawChild(ViewGroup.java:1581)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at     android.view.ViewGroup.dispatchDraw(ViewGroup.java:1311)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.View.draw(View.java:6286)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.widget.FrameLayout.draw(FrameLayout.java:352)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1928)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewRoot.draw(ViewRoot.java:1454)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1174)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1774)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.os.Handler.dispatchMessage(Handler.java:99)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.os.Looper.loop(Looper.java:123)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at android.app.ActivityThread.main(ActivityThread.java:4321)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at java.lang.reflect.Method.invokeNative(Native Method)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at java.lang.reflect.Method.invoke(Method.java:521)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)11-24 23:19:18.684: ERROR/AndroidRuntime(12660):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I implemented an image cache with SoftReference and set an ImageView with a Bitmap from the image cache.</p><p>I do not use Bitmap.recycle() and check the Bitmap.isRcycled() before setting the bitmap to an ImageView.</p><p>I can not figure out why the canvas is drawing with a recycled bitmap.It happens rarely but it does happened.</p><p>Any suggestion?Thanks!</p>","428022","","428022","","2010-11-28 13:48:38","2013-03-25 08:42:36","Canvas: trying to use a recycled bitmap android.graphics.Bitmap","<android><garbage-collection><bitmap>","3","2","","",""
"4268476","1","4292376","","2010-11-24 15:28:56","0","196","<p>I have a situation in which the same activity class is being created by the creation of tabs in a tabhost control. Subsequently, each instance of the activity will want to inform a select group of its peers of some user action. Conversely, each activity, when it's constructed/created, knows which activity[only one] to accept broadcast messages from.</p><p>My thought is to define programmatically an IntentFilter for each registered receiver which would hold the identifying string of the broadcaster it wishes to hear from.</p><p>Will this work and, if so, how would I define the IntentFilter in code?</p>","353616","","","","","2010-11-27 15:32:28","Will an IntentFilter work for this?","<android><intentfilter>","1","0","","",""
"4268701","1","4269422","","2010-11-24 15:52:00","2","6004","<p>So, here I am again.</p><p>I have a <code>LineraLayout</code> that contains some other views and among those a <code>ListView</code>.This view is loaded from another one by clicking a button.</p><p>This button somehow specify what element in the ListView needs to be the first visible one in the list. The elements that populates the list are retrieved via HTTP from an external server.</p><p>The problem is that I can get the Nth element to be the first in the list.Please note, I do not want to move it form it current position to a new one, I want the list to scroll.</p><p>I have tried with <code>setSelected()</code> and <code>scrollTo(x,y)</code> and <code>scrollBy(x,y)</code> but with no luck.</p><p>I have also gave a try to this pice of code, as ugly as it is, but I just wanted to try f it was working:</p><pre><code>ListView categoryList = (ListView)findViewById(R.id.category_list);        categoryList.post(new Runnable() {            @Override            public void run() {                Log.d(this.getClass().getName(), ""CategoryActivity.scrollToIndex: "" + CategoryActivity.scrollToIndex);                if(CategoryActivity.scrollToIndex&gt;0){                    ListView categoryList = (ListView)findViewById(R.id.category_list);                    categoryList.setScrollContainer(true);                    categoryList.scrollTo(4, CategoryActivity.scrollToIndex * 50);                    categoryList.requestLayout();                }            }        });</code></pre><p>And this gave me some success, but the ListView was then behavin <em>crazy</em> in a way I am mnot even able to describe....</p><p>Any idea?</p>","448660","","","","","2012-11-16 03:03:16","Android ListView scrollTo","<android><listview><scrollto>","2","0","1","",""
"4268720","1","4273548","","2010-11-24 15:53:55","3","4072","<p>I am developing an application in Android and have an issue where Android framework throws java.lang.InstantiationException upon trying to instantiate a nested class. Here is the scenario.</p><ol><li><p>Class A extending Activity with nested class B which extends BroadcastReceiver: </p><pre><code>public class A extends Activity{    public void onCreate(){    ....};    //Class B    public class B extends BroadcastReceiver    {        public void onReceive(...)    }}</code></pre></li><li><p>Class declarations in manifest file :            ....                                 </p></li></ol><p>Sorry for the bad indentation. Just couldn't find a way of properly indenting the code with so many tags. </p><ol><li>Broadcast from a service :</li></ol><pre><code>    Intent updateIntent = new Intent();    updateIntent.setAction(""desired_action"");    sendBroadcast(accountPropertyUpdateIntent);</code></pre><p>With all the above given things, the code gets compiled, but when run on the device, after the broadcast is called, i get a InstantiationException saying cannot instantiate pacakage.A$B, and dalvik says no  found.</p><p>Now this whole scenario works on Android 2.2, but somehow this fails on 2.1.</p><p>I don't know exactly what is happening. Am in need of help. Maybe something basic is missing by me.</p><p>Can anyone please help me? Thanks in advance.    </p>","473184","","248432","","2010-11-24 17:04:49","2011-11-08 18:16:44","Unable to instantiate a nested class ( extends broadcastReceiver ) when a sendBroadcast is made","<android>","2","2","1","",""
"4268820","1","","","2010-11-24 16:05:39","5","2262","<p>I'd like to hook to an event that fires when android's on screen keyboard appears. For example when user taps EditText to bring up the keyboard. Anyone know which event (or listener) to use?</p><p>Timo</p>","54155","","","","","2012-05-25 15:25:13","Android: which event fires when on screen keyboard appears?","<android>","2","1","2","",""
"4268862","1","4269088","","2010-11-24 16:09:20","0","65","<p>When creating images to place as ImageButtons in my app, what is the staple rule to go by in terms of width?  I know each phone will resize accordingly with a wrap_content parameter, but what is the universal width I should be using?  These are basic titles for each layout I am using, as reference.</p><p>Thanks!</p>","496686","","","","","2010-11-24 16:30:18","Creating photos to use as ImageButtons in my app - regarding size","<android><image><layout><dimension>","1","0","","",""
"4268957","1","4269324","","2010-11-24 16:16:28","5","12195","<p>I have a problem regarding my intent. It seems that my app crashes when i select the intent. I found the line of error code due to the stack trace. But i couldn't find anything wrong with it. Hope anyone can help me with this.</p><p>This is the java code in line 121:<br>startActivity(new Intent(Intent.ACTION_INSERT, getIntent().getData()));</p><p>This is the stack trace:  </p><pre><code>11-24 16:09:24.634: ERROR/AndroidRuntime(222): Uncaught handler: thread main exiting due to uncaught exception11-24 16:09:24.834: ERROR/AndroidRuntime(222): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.INSERT dat=content://joel.google.provider.TemplatePad/templates }11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.app.Activity.startActivityForResult(Activity.java:2749)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.app.Activity.startActivity(Activity.java:2855)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at joel.AndroidGroupSMS.TemplatesList.onOptionsItemSelected(TemplatesList.java:121)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.app.Activity.onMenuItemSelected(Activity.java:2170)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:730)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:525)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.view.View.onTouchEvent(View.java:4179)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.widget.TextView.onTouchEvent(TextView.java:6541)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.view.View.dispatchTouchEvent(View.java:3709)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.os.Handler.dispatchMessage(Handler.java:99)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.os.Looper.loop(Looper.java:123)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at android.app.ActivityThread.main(ActivityThread.java:4363)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at java.lang.reflect.Method.invokeNative(Native Method)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at java.lang.reflect.Method.invoke(Method.java:521)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)11-24 16:09:24.834: ERROR/AndroidRuntime(222):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","504864","","59058","","2010-11-24 16:46:33","2010-11-24 16:56:24","activity not found to handle intent","<android>","2","0","1","",""
"4268958","1","4270098","","2010-11-24 16:16:30","1","1141","<p>I've just started going through the tutorials but seem to be having some trouble with the following portion:</p><p>""Run > Debug History > Hello, Android from the menu to enter debug mode. Your app will restart in the emulator, but this time it will suspend when it reaches the breakpoint you set. You can then step through the code in Eclipse's Debug Perspective, just as you would for any other application.""</p><p>when I follow these instructions I see a list of warnings like this...</p><p>[2010-11-24 15:39:43 - ddms]Can't bind to local 8617 for debugger</p><p>and finally this...</p><p>[2010-11-24 16:08:25 - HelloAndroidWeb] Launch error: Failed to connect to remote VM. Connection refused.</p><p>I've never used a debugger before but from reading the tutorail I expect a new window to open (the Debug Perspective), but this is not the case. Have I dont something wrong in during installation/setup.</p><p>Thanks</p>","519064","","519064","","2010-12-30 15:45:19","2010-12-30 15:45:19","Hello World Tutorial - Using the Debug Perspective","<android><installation><debugging>","2","0","","",""
"4268982","1","","","2010-11-24 16:19:21","2","655","<p>I have a menu in my webpage that drops down on Mouseover() event but this thing is not working on android browser? What may be the reason?</p>","417266","","","","","2010-11-24 16:30:40","javascript on android","<javascript><android><android-emulator>","4","0","","",""
"4269171","1","4269278","","2010-11-24 16:37:32","2","2616","<p>I have a problem with my app. It has a lot of activities. Two of them have google map views. My A activity has a full MapView and my B activity has a small MapView. OK, when I am on the B activity and press back key sometimes until I return to my A activity, the map of my A activity shows with errors, with a black zone on the bottom of the screen. This only happens when I press back from the B activity.</p><p>Because of this I need to know which method is called in A when it gets the focus, because I need to implement/override it to REPAINT ALL THE WINDOW AGAIN FROM SCRATCH.</p><p>Also which code I have to put to repaint all the window from scratch?</p>","479886","","1726308","","2012-12-05 13:30:27","2013-09-17 10:15:59","Which method is called when my activity gets the focus? (after a phone call, back key, home key, etc...)","<android><google-maps><application-lifecycle>","1","0","1","",""
"4269175","1","4269250","","2010-11-24 16:37:50","-5","1818","<p>I'm trying to analyze my database from Androids adb shell in OS X terminal, but I don't know how to get it to work. I'm pretty sure I have to do some type of 'install' to be able to access it but a not sure how to go about this.</p>","365491","","","","","2010-11-24 17:46:57","Using Android's adb shell in OS X","<android><sqlite>","2","2","","2012-08-26 16:19:18",""
"4269197","1","","","2010-11-24 16:39:18","2","591","<p>I am using a ScrollView to scroll on a vertical LinearLayout.  The LinearLayout resizes itself on user input.  When a resize occurs, I want to reposition the scroll location so that the same area of the LinearLayout is viewed.  This works fine, except for when the scroll is near the bottom of the page. When this happens, my svVerticalScroll.scrollTo(...) call seems to be ignored (I can tell based on debugging, that in this case svVerticalScroll.getScrollY() remains the same after the call).  I assume this is being ignored because the scrollTo(...) parameter is greater than the maximum scroll range, because scrollView has not resized.  So... How do I force the ScrollView to resize?</p><pre><code>float centerY = svVerticalScroll.getScrollY() + m_ScreenHeight / 2;m_CurrentScale = m_CurrentScale * delta;myLinearLayout.doResize(m_CurrentScale);    myLinearLayout.requestLayout();svVerticalScroll.invalidate();svVerticalScroll.requestLayout();float newcenterY = centerY * delta;svVerticalScroll.scrollTo(0, (int) (newcenterY - m_ScreenHeight / 2));</code></pre>","426493","","","","","2010-11-24 16:39:18","In Android, how to force resize of ScrollView?","<android>","0","1","2","",""
"4269508","1","4381293","","2010-11-24 17:10:30","1","1478","<p>Is there a way to programmatically set a proxy server in my Android App?I'm writing an Android App that uses some WebViews. Is there a way to set a proxy server for all network connections in my app, i.e. all content that is shown in the WebViews should be routed through the proxy?All other Apps on the device should not be affected by this proxy settings.</p>","516472","","","","","2012-05-08 11:54:48","Is there a way to programmatically set a proxy server in my Android app?","<android><proxy><webview>","3","0","","",""
"4269562","1","4271165","","2010-11-24 17:17:27","0","459","<p>I compiled my application, and then reran it, and all of a sudden my graphics have all resized to much smaller versions of themselves...be it ImageViews, ImageButtons, etc...</p><p>I did place a small icon in ldpi, a medium one in mdpi and a high one in hdpi - could that be what triggered the issue?  I didn't change my code, so all of my ImageViews I am using as titles for layouts are still set to wrap_content, everything just got smaller.</p><p>Any idea why this may be, or are there workarounds?</p><p>I test on a Motorola Droid 2, btw </p>","496686","","","","","2010-11-24 21:14:56","ImageButtons/ImageViews and graphics resized themselves on my app","<android><image><imagebutton><autoresize>","1","0","","",""
"4269566","1","4271915","","2010-11-24 17:17:55","1","1180","<p>How do you access a <code>SQLiteDatabase</code> database in a separate thread (ie: an <code>AsyncTask</code>) of an <code>Activity</code> and make sure that you always leave it in a legal state?</p><p>If I understand correctly, the thread can be killed at any moment and the database might remain open, potentially giving an <code>IllegalStateException</code> (<em>SQLiteDatabase created and never closed</em>) at a latter time.</p><p>How do you deal with this?</p>","143378","","","","","2010-11-24 22:00:01","Accessing a database in a separate thread in Android","<android><multithreading><sqlite><activity><android-asynctask>","2","0","1","",""
"4269591","1","4271117","","2010-11-24 17:20:55","1","3502","<p>i have a 7x6 grid.here i have to populate the calendar for the selected month.i have date,month and year.with the help of these value is it possible to populate my grid view with the help of any algorithm? same like this<img src=""http://i.stack.imgur.com/jBR4I.jpg"" alt=""alt text""></p>","430652","","","","","2010-12-14 09:13:59","how to populate a gridview for a calendar?","<android><algorithm><gridview><calendar><populate>","1","2","3","",""
"4269601","1","","","2010-11-24 17:21:35","1","1410","<p>I am new in android programming. And recently i am trying to socket programming in android emulator. Basically I want to send and receive data using socket connection through TCP/UDP protocol between two emulator and the two emulator are running on the same PC.</p><p>Please give me instruction how to do that and if there is any proven example please give the links.</p><p>Thanks to all in advance.</p><p>BR,gsmaker</p>","424854","","","","","2012-08-19 18:46:05","Socket programming between two android emulator","<android>","1","0","1","",""
"4269660","1","4269799","","2010-11-24 17:27:25","3","13658","<p>Since I'm still just learning Android (and it appears Amazon says it'll be 2 months till I get the Hello, Android book) I'm still playing around with doing simple things.  I have no problem getting an icon to display with the click of a button on my RelativeLayout using <a href=""http://developer.android.com/reference/android/widget/ImageView.html"" rel=""nofollow"">ImageView</a>.  The code for creating it is as follows:</p><pre><code>private int mIconIdCounter = 1;private ImageView addIcon(){    ImageView item = new ImageView(this);    item.setImageResource( R.drawable.tiles );    item.setAdjustViewBounds(true);    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT );    if( mIconIdCounter != 1 ){        params.addRule(RelativeLayout.RIGHT_OF, 1 );    }    item.setLayoutParams( params );    item.setId( mIconIdCounter );    ++m_IconIdCounter;    return item;}</code></pre><p>and the code to add the item is:</p><pre><code>Button addButton = (Button)findViewById(R.id.add_new);addButton.setOnClickListener( new OnClickListener(){    @Override    public void onClick(View view) {        addContentView( addIcon(), new RelativeLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT ) );    }});</code></pre><p>When I click my button what happens is all the newly created views are placed atop one another.  I'd like them to be placed to the right of the next element.  I did a quick search on SO for articles relating to RelativeLayout and found some that were similar (<a href=""http://stackoverflow.com/questions/2963414/help-with-android-linearlayout-or-relativelayout"">here</a>, <a href=""http://stackoverflow.com/questions/4231797/how-to-load-layout-dynamically-at-runtime-in-android"">here</a>, <a href=""http://stackoverflow.com/questions/3961022/problem-adding-textboxes-dynamiclly-in-a-relative-layout"">here</a>, and <a href=""http://stackoverflow.com/questions/3515759/dynamically-adding-a-view-to-activity-layout"">here</a>) but while these addressed getting the content into the RelativeView they didn't seem to address the positioning aspect.</p><p>What am I doing wrong?</p><p>EDIT:</p><p>My main xml looks like:</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;Button        android:id=""@+id/add_new""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/add_new""        android:layout_alignParentBottom=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre>","178060","","178060","","2010-11-24 19:08:43","2010-11-24 19:08:43","Dynamically adding content to RelativeLayout","<android><relativelayout>","2","0","2","",""
"4269681","1","4270314","","2010-11-24 17:29:11","1","658","<p>i have a problem with my app, it haves a lot of activitys, two of them haves googlemap views. My A activity haves a full mapview and my B activity haves a small map view. OK, when i am on the B activity and press back key somethimes until i return to my A activity, the map of my A activity shows with errors, with a black zone in the down part of the window. THis only happens when i press back from the B activity.</p><p>Because this, i need to implement/override onResume() method of A to RESTART THE ACTIVITY TO REPAINT ALL FROM SRATCH.... LIKE TO DO AGAIN ONCREATE METHOD, but i think i can't call it again... or i can?</p><p>wich code i have to put to repaint all the window from scratch ?</p><p>i tryed with all this:</p><p>-<code>mapView.requestLayout()</code>  --> it works a little, repaints the map but with the zoom and showing the last map showed on B activity... no sense :S i dont want that. Are different maps, not have to show the same coordinates and zoom, each one have his own.</p><p>-<code>mapView.invalidate()</code> --> doesn't works</p><p>-<code>mapView.postInvaldiate()</code> --> doesn't works</p>","479886","","479886","","2010-11-24 18:00:07","2011-08-09 08:25:07","Problems when my googlemaps view activity regain the focus (map with black zone in down part of the window)","<android><google-maps><android-mapview>","1","5","","",""
"4269854","1","4273070","","2010-11-24 17:45:42","6","2781","<p>I'm trying to connect to a Rails Application Server that requires authentication. I am using the Jakarta HTTP Client for Java on a Desktop application and it works 100%. But when the exact same code is executed on the Android Emulator I get an IOException.</p><p>Here is the code, and if anyone could help me figure out why it throws the IOException that would be greatly appreciated!</p><pre><code>private boolean login(){    String username, password;    DefaultHttpClient client;    AuthScope scope;    Credentials myCredentials;    CredentialsProvider provider;    HttpEntity entity;    String line;    BufferedReader reader;    InputStream instream;    //Declare &amp; Create the HTTP Client      client = new DefaultHttpClient();    //Create our AuthScope    scope = new AuthScope(""10.19.9.33"", 3000);    username = ""admin""            password = ""pass""    //Set Credentials    myCredentials = new UsernamePasswordCredentials( username, password );    //Set Provider    provider = new BasicCredentialsProvider();    provider.setCredentials(scope, myCredentials);    //Set Credentials    client.setCredentialsProvider( provider );    String url = ""http://10.19.9.33:3000/users/show/2"";    HttpGet get;    //Tell where to get    get = new HttpGet( url );    HttpResponse response;    try    {        response = client.execute( get );        entity = response.getEntity();        /* Check to see if it exists */        if( entity != null )        {            instream = entity.getContent();            try {                reader = new BufferedReader(new InputStreamReader(instream));                line = reader.readLine();                if( line.equals( ""HTTP Basic: Access denied."") )                    return false;                while ( line != null )                {                    // do something useful with the response                    System.out.println(line);                    line = reader.readLine();                }                return true;            }             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 and release it back to the connection manager.                get.abort();                throw ex;                           }             finally            {                // Closing the input stream will trigger connection release                instream.close();                           }        }    }    catch( ClientProtocolException cp_ex )    {    }    catch( IOException io_ex )    {    }    return false;}</code></pre>","519173","","213269","","2010-11-24 18:08:38","2011-04-12 06:29:43","Basic HTTP Authentication on Android Phones to Rails Server","<java><android><http-authentication><http-basic-authentication>","2","3","1","",""
"4269949","1","4270051","","2010-11-24 17:53:34","0","3213","<p>I want to implement an Android Service that periodically downloads data and notifies various listener activities that the data has been updated. </p><p>There seems to be various way of communicating with a Service. What's the simplest and best way to do the above? A code example or a tutorial will be greatly appreciated.</p>","143378","","","","","2010-11-24 18:04:12","Service with listeners in Android","<android><service><activity>","1","1","","",""
"4270033","1","","","2010-11-24 18:02:25","1","310","<p>I have completed my first android app and am trying to test it on 'perfectomobile' web site which allows download to actual phones.   I have selected the HTC Wildfire which is said to haqve Android 2.1 (Eclair) os.   I am using Eclipse and have exported the app which is targeted to Android 2.1 update 1.  Downloaded it to the sd card on the Wildfire and when I click on it in the Anddev list on the phone screen I get the 'Parse error' message.</p><p>The app runs fine on the emulator on my pc?   Is the parse error referring to something in the XML files or might it be in the code?</p><p>I've done a lot of googling re parse error without enlightment so I am wondering if anyone on here can suggest how to track down the item causing the error.ThanksRon</p>","479505","","","","","2013-02-01 04:00:35","anyone using perfectomobile for testing?","<android>","2","0","","",""
"4270208","1","5857896","","2010-11-24 18:23:09","9","10640","<p>I did some research on Android about CSS3 animation (transformation with webkit-transition).The CSS3 animation is still an experimental feature in Webkit. If you try to do translation and scaling at the same time, you'll find a few glitches and/or bugs in the CSS Animation (for example, see <a href=""http://www.youtube.com/watch?v=vZdBVzN1B8Y"">http://www.youtube.com/watch?v=vZdBVzN1B8Y</a> ). In other words, in many versions of Android the property <em>-webkit-transform:matrix(...)</em> does not work correctly. The only correct way to get scaling and translation at the same time is to set <em>""-webkit-transform:scale(...) translate(...)""</em> <strong>in this order</strong>.I'll shere my results at the bottom of this post.</p><p>As you can see in it, I have overcome most of them. However, there's still some `flicker' in some transition on Android 2.2 (Froyo).</p><p>Now my question: is there any way to do scaling and translation at the same time without flicker on Android 2.2?</p><p>I've also tried  <em>-webkit-backface-visibility:hidden;</em>, <em>-webkit-perspective:1000;</em> and <em>-webkit-transform:translate3d(..,0)</em> but these properties introduce some glitch in the transition. You can see it in the following video: <a href=""http://www.youtube.com/watch?v=Aplk-m8WRUE"">http://www.youtube.com/watch?v=Aplk-m8WRUE</a>The scaling is canceled after the transition stops.</p><p>Is there any other workaround to suppress flicker?Any ideas?</p><hr><p>The below is my results about CSS3 transition on Android (1.5 &lt;= ver &lt;= 2.2).It employs scaling and translation at the same time on the blue box.</p><pre><code>&lt;html&gt;&lt;head&gt; &lt;title&gt;css3test&lt;/title&gt; &lt;meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" /&gt;   &lt;meta name=""viewport"" content=""width=device-width""&gt;&lt;/head&gt;&lt;body&gt;&lt;div id='log'&gt;&lt;/div&gt;&lt;div id='box' style=""background-color: blue; width:100; height:100;""&gt;&lt;/div&gt;&lt;script language='JavaScript'&gt;function mesg(str) {  document.getElementById('log').innerHTML = str;}var e = document.getElementById('box');e.style['-webkit-transition-property'] = '-webkit-transform';e.style['-webkit-transform-origin'] = ""0 0"";e.style['-webkit-transition-duration'] = '350ms';e.style['-webkit-transition-timing-function'] = 'linear';// These properties will suppress flicker, but spoiles scaling on Android 2.2 ...// see http://www.youtube.com/watch?v=Aplk-m8WRUEe.style['-webkit-backface-visibility'] = 'hidden'; e.style['-webkit-perspective'] = '1000';var b = 0;function doAnim() {  var trans;  switch(b){  case 0: // step 0. translate and scale at the same time    // 1) matrix    // On Android 1.5, we get no translation, but the box is only enlarged. Broken.    // On Android 2.2, the transition does not occur but the box moves instantly.    //trans = 'matrix(2,0,0,2,100,100)';    // 2) scale first, then translate    // On Androi2.2, there's some glitches.    //trans = 'scale(2,2) translate(50px,50px)';     // 3) tranlate first, then scale -- CORRECT     trans = 'translate(100px,100px) scale(2,2)';    break;  case 1: // step 1. translate    // 1) matrix     //trans = 'matrix(1,0,0,1,35,35)';    // 2) translate only -- will spoil transition --     // On Android 1.5, the transition corrupts and the box repeatedly moves in a wrong direction. Bug?    // see http://www.youtube.com/watch?v=vZdBVzN1B8Y    //trans = 'translate(35px,35px)';    // 3) tranlate first, then scale with (1,1) -- CORRECT     trans = 'translate(35px,35px) scale(1,1)';    break;  case 2: // step 2. scaling    // 1) matrix -- nope.    //trans = 'matrix(1.4,0,0,1.4,0,0)';    // 2) scale only -- will spoil transition --    //trans = 'scale(1.4,1.4)';    // 3) tranlate with (0px,0ox), then scale -- CORRECT     trans = 'translate(0px,0px) scale(1.4,1.4)';    break;  case 3: // step 3. again, translate and scale at the same time    // 1) matrix -- nope.    //trans = 'matrix(1.2,0,0,1.2,100,100)';    // 2) scale then translate -- will spoil transition --    //trans = 'scale(1.2,1.2) translate(83.33px,83.33px)';    // 3) tranlate first, then scale -- CORRECT     trans = 'translate(100px,100px) scale(1.2,1.2)';    break;  }  e.style['-webkit-transform'] = trans;  mesg('move '+b+'&lt;br/&gt;transform:'+trans);  b=(b+1)%4;}var isAndroid = (new RegExp(""android"",""gi"")).test(navigator.appVersion);if(isAndroid) {  e.addEventListener('touchstart', doAnim, false);} else {  e.addEventListener('mousedown', doAnim, false);}document.addEventListener('touchmove', function(e){ e.preventDefault(); }, false);&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;</code></pre>","515485","","515485","","2010-12-02 16:03:49","2013-05-22 16:30:30","CSS3 animation flicker on Android 2.2 (webkit-transform:translate(..) scale(..) at the same time)","<android><animation><webkit><css3>","3","0","3","",""
"4270278","1","4271930","","2010-11-24 18:32:43","4","2971","<p>Ok so I encountered an issue with the attribut layout_width of a listView.</p><p>In my project I had a background image for my listview that didn't fit the width of the screen. So I set the layout_width on wrap_content, and I centered horizontally the listView.</p><p>It seems that this was a bad idea, because in the adapter the GetView method was called more than 3 times the number of cell displayed. If I set the layout_width on fill_parent the problem is resolved. I created a simple project that shows the problem.</p><p>Here is the xml of 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=""@android:id/list""    android:layout_width=""wrap_content""    android:layout_height=""fill_parent""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>The item_list 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:padding=""10dp""    android:textSize=""16sp"" &gt;&lt;/TextView&gt;</code></pre><p>And finally the Activity : </p><pre><code>package fr.example.android.listviewbug;import android.app.ListActivity;import android.content.Context;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;public class ExampleListViewBugActivity extends ListActivity{    public static int cpt;    public static final String[] COUNTRIES = new String[] {        ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra"",        ""Angola"", ""Anguilla"", ""Antarctica"", ""Antigua and Barbuda"", ""Argentina"",        ""Armenia"", ""Aruba"", ""Australia"", ""Austria"", ""Azerbaijan"",        ""Bahrain"", ""Bangladesh"", ""Barbados"", ""Belarus"", ""Belgium"",        ""Belize"", ""Benin"", ""Bermuda"", ""Bhutan"", ""Bolivia"",        ""Bosnia and Herzegovina"", ""Botswana"", ""Bouvet Island"", ""Brazil"", ""British Indian Ocean Territory"",        ""British Virgin Islands"", ""Brunei"", ""Bulgaria"", ""Burkina Faso"", ""Burundi"",        ""Cote d'Ivoire"", ""Cambodia"", ""Cameroon"", ""Canada"", ""Cape Verde"",        ""Cayman Islands"", ""Central African Republic"", ""Chad"", ""Chile""};    @Override    public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      cpt = 0;      setListAdapter(new CustomArrayAdapter(this, R.layout.list_item, COUNTRIES));      }    @Override    public void onDestroy() {        super.onDestroy();        Log.d(""AdapterTest"", ""onDestroy()"");    }    private class CustomArrayAdapter extends ArrayAdapter&lt;String&gt;{        public CustomArrayAdapter(Context context, int textViewResourceId, String[] countries) {            super(context, textViewResourceId, countries);        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            Log.d(""AdapterTest"", "" cpt:""+ ++cpt);            return super.getView(position, convertView, parent);        }}}</code></pre><p>So my solution is to simply set the layout_width on fill_parent, and modify the image of the listview background to add some transparent borders to fit the screen size.</p><p>But I'd like to know why this issue appears with wrap_content on a listview, and why it's not in the doc if it's a known problem...</p>","386745","","","","","2010-11-24 22:01:56","Layout_width of a ListView","<android><listview>","2","0","1","",""
"4270293","1","","","2010-11-24 18:34:41","2","1783","<p>I am making a basic WebView app that will load a web page.  This web page requires log in information.  When I navigate out or refresh the page it logs me out.  How do I stay logged in? The following code is my attempt based on some research but apparently I am not understanding the concept. And so I can kill two bird with one stone, can someone let me know how to prevent a refresh of the page when you rotate your phone? is this possible?  Thanks for any help in advanced.  </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(""www.randomurl.com"");  mWebView.setWebViewClient(new HelloWebViewClient());  CookieSyncManager.createInstance(this);  CookieSyncManager.getInstance().startSync();  CookieManager.getInstance(); }</code></pre>","519235","","","","","2010-11-24 20:00:07","Android WebView- remember username and password","<android><cookies><android-webview>","1","1","1","",""
"4270394","1","4271177","","2010-11-24 18:49:38","18","28440","<p>So I have an ImageView set with </p><pre><code>android:maxHeight=""100px""android:maxWidth=""250px""android:minHeight=""100px""android:minWidth=""250px""android:scaleType=""centerInside""</code></pre><p>This image view is used to show a picture that is obtained from the gallery or camera. In both cases, the image is not resized to fit inside the imageview, it just stretches its space as much as it needs.</p><p>Any idea how to make it stay inside those bounds?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView android:id=""@+id/ScrollView01""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;EditText android:layout_height=""wrap_content""        android:layout_width=""fill_parent"" android:id=""@+id/txtDescription""        android:layout_below=""@+id/txtSubject"" android:inputType=""textMultiLine"" android:height=""80px"" android:hint=""@string/description""&gt;&lt;/EditText&gt;    &lt;EditText android:layout_height=""wrap_content"" android:layout_below=""@+id/txtDescription""        android:layout_width=""fill_parent"" android:id=""@+id/txtMorada"" android:hint=""@string/address""/&gt;        &lt;ImageButton android:layout_height=""wrap_content""            android:layout_width=""wrap_content"" android:layout_below=""@+id/txtMorada""            android:id=""@+id/btGPS"" android:layout_alignParentLeft=""true""            android:src=""@drawable/ic_menu_compass""&gt;&lt;/ImageButton&gt;        &lt;ImageView android:layout_height=""wrap_content""            android:layout_width=""wrap_content"" android:layout_below=""@+id/btGPS""            android:layout_marginTop=""25px"" android:id=""@+id/imgPoint""            android:src=""@drawable/google_logo_small"" android:maxHeight=""100px"" android:maxWidth=""250px"" android:minHeight=""100px"" android:minWidth=""250px"" android:scaleType=""centerInside""&gt;&lt;/ImageView&gt;        &lt;ImageButton android:layout_height=""wrap_content""            android:layout_width=""wrap_content"" android:layout_toRightOf=""@+id/imgPoint""            android:id=""@+id/btGallery"" android:layout_below=""@+id/btCamera""            android:src=""@drawable/ic_menu_gallery""            android:layout_alignParentRight=""true""&gt;&lt;/ImageButton&gt;        &lt;Button android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:layout_marginTop=""10px""            android:id=""@+id/btSubmit"" android:layout_below=""@+id/btGallery"" android:text=""@string/submit""&gt;&lt;/Button&gt;        &lt;ImageButton android:layout_height=""wrap_content""            android:id=""@+id/btMap"" android:layout_below=""@+id/txtMorada"" android:layout_width=""wrap_content""            android:layout_alignParentRight=""true"" android:src=""@drawable/ic_menu_mapmode""&gt;&lt;/ImageButton&gt;        &lt;TextView android:layout_below=""@+id/txtMorada"" android:layout_width=""wrap_content"" android:layout_toLeftOf=""@+id/btMap"" android:layout_height=""wrap_content"" android:id=""@+id/lblNewPointLatitude"" android:text=""Latitude""&gt;&lt;/TextView&gt;&lt;TextView android:layout_width=""wrap_content"" android:layout_toLeftOf=""@+id/btMap"" android:layout_height=""wrap_content"" android:id=""@+id/lblNewPointLongitude"" android:layout_below=""@+id/lblNewPointLatitude"" android:text=""Longitude""&gt;&lt;/TextView&gt;&lt;ImageButton android:layout_below=""@+id/btMap""            android:layout_height=""wrap_content"" android:layout_width=""wrap_content""            android:layout_toRightOf=""@+is/imgPoint"" android:id=""@+id/btCamera""            android:layout_marginTop=""25px"" android:src=""@drawable/ic_menu_camera""            android:layout_alignParentRight=""true""&gt;&lt;/ImageButton&gt;        &lt;Spinner android:layout_height=""wrap_content"" android:id=""@+id/spCategoria""            android:layout_width=""fill_parent"" android:prompt=""@string/spCategoriaPrompt""&gt;&lt;/Spinner&gt;        &lt;Spinner android:layout_height=""wrap_content"" android:id=""@+id/spSubcategoria""            android:layout_below=""@+id/spCategoria"" android:layout_width=""fill_parent"" android:prompt=""@string/spSubcategoriaPrompt""&gt;&lt;/Spinner&gt;        &lt;EditText android:layout_height=""wrap_content""            android:layout_below=""@+id/spSubcategoria"" android:layout_width=""fill_parent""            android:id=""@+id/txtSubject"" android:hint=""@string/subject""&gt;&lt;/EditText&gt;&lt;/RelativeLayout&gt;&lt;/ScrollView&gt;</code></pre>","320586","","320586","","2010-11-24 19:03:53","2012-09-04 16:48:31","Maximum width and height for ImageView in Android","<android><resize><rendering><imageview><stretch>","3","2","3","",""
"4270618","1","4271742","","2010-11-24 19:15:41","0","1195","<p>I am trying to create an expandable listview similar to the expandable list shown <a href=""http://www.google.co.in/imgres?imgurl=http://blogimg.chinaunix.net/blog/upfile2/100902103610.jpg&amp;imgrefurl=http://blog.chinaunix.net/u3/118340/showart_2316211.html&amp;h=450&amp;w=306&amp;sz=35&amp;tbnid=cPbVCb2O8UfoNM%3a&amp;tbnh=127&amp;tbnw=86&amp;prev=/images%3Fq%3Dexpandablelistview&amp;zoom=1&amp;q=expandablelistview&amp;usg=__CHWBwdQ5oHx6KYBKd38RU3--yg8=&amp;sa=X&amp;ei=OlTtTL2TFoSqvQPDwcH-AQ&amp;ved=0CCwQ9QEwBA"" rel=""nofollow"">here</a></p><p>Are there any examples which would help me achieve this.</p><p>Thr parent and child data I have would be static always.</p><p>I use <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList1.html"" rel=""nofollow"">this</a> as my reference. Can any expert kindly guide me as to what code snippet I need to add to this, so that I can set icons for both parent and child.</p><p>Any help in this regard will be well appreciated.</p><p>Regards,Rony</p>","264953","","","","","2010-11-28 03:05:22","Expandable Listview with icons for parent and child","<android><android-widget>","1","0","1","",""
"4270639","1","4270714","","2010-11-24 19:17:10","2","875","<p>I am trying to find a way that allows you to scan one of those online barcodes and have it link up to my droid app - anyone have any idea how to get one? </p>","496686","","418183","","2010-11-24 19:58:55","2010-11-24 19:59:41","Is there a way to create a scannable barcode that links to your app on marketplace?","<android><google-play><qr-code>","2","0","1","",""
"4270947","1","4271949","","2010-11-24 19:57:07","1","912","<p>I have an application which gets some data from a remote database.I use PHP with the following code to connect to the data base.</p><pre><code>mysql_connect($host,$username,$password) or die( ""no connection"");@mysql_select_db($database) or die( ""Unable to select database"");$query = $_REQUEST['query'];$q=mysql_query($query);while($e=mysql_fetch_assoc($q)) {    $output[]=$e;}print(json_encode($output));mysql_close();</code></pre><p>I then connect via following java code</p><pre><code>public void connect(ArrayList&lt;NameValuePair&gt; nameValuePairs) {        result = """";        InputStream is = null;        String url = ""http://'ipadress'/PhpProject1/EmptyPHP.php"";        //Get the content        try {            HttpClient httpClient = new DefaultHttpClient();            HttpPost httpPost = new HttpPost(url);            httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));            HttpResponse httpResponse = httpClient.execute(httpPost);            HttpEntity httpEntity = httpResponse.getEntity();            is = httpEntity.getContent();        } catch (Exception e) {            Log.e(""Connect"", ""Error in http connection "" + e.toString());        }        //Convert content toString        try {            BufferedReader reader = new BufferedReader(new InputStreamReader(is, HTTP.UTF_8), 8);            StringBuilder sb = new StringBuilder();            String line = null;            while ((line = reader.readLine()) != null) {                sb.append(line + ""\n"");            }            is.close();            result = sb.toString();            //result = replaceString(sb.toString());        } catch (Exception e) {            Log.e(""Connect"", ""Error converting result "" + e.toString());        }    }</code></pre><p>When i have done that I make a query through</p><pre><code>public void query(String query){        ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();        nameValuePairs.add(new BasicNameValuePair(""query"", query));        connect(nameValuePairs);    } </code></pre><p>While this works great with the emulator there is a problem when using it on the phone.</p><p>Anyone has a clue why this is?</p><p>Thank you in advance</p>","449649","","","","","2010-11-24 22:05:56","Android mysql php problem","<php><mysql><android>","1","10","3","",""
"4271041","1","","","2010-11-24 20:07:32","7","7123","<p>I've created a Service and grabs location data about the user so I can show my users nearby places.  I want this Service to track by network in addition to GPS for 2 reasons: 1) GPS may not be enabled. 2) GPS takes quite a bit of time to lock on with my test phone.</p><p>When my Service executes the following line:</p><pre><code>mNETEnabled = mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);</code></pre><p>I get the following error:</p><pre><code>11-24 14:00:41.693: ERROR/LocationManagerService(51): isProviderEnabled got exception:11-24 14:00:41.693: ERROR/LocationManagerService(51): java.lang.IllegalArgumentException: provider=network11-24 14:00:41.693: ERROR/LocationManagerService(51):     at com.android.server.LocationManagerService._isProviderEnabledLocked(LocationManagerService.java:1385)11-24 14:00:41.693: ERROR/LocationManagerService(51):     at com.android.server.LocationManagerService.isProviderEnabled(LocationManagerService.java:1359)</code></pre><p>Why is this?  Am I missing a permission from the Manifest?  I have ACCESS_COARSE_LOCATION in my manifest.</p>","406790","","406790","","2010-11-24 20:30:46","2012-03-07 17:04:06","Problem requesting location updates by network","<android><permissions><locationmanager>","3","0","1","",""
"4271099","1","4271634","","2010-11-24 20:14:14","2","810","<p>When I play certain MP3 files (such as lessons from <a href=""http://www.japanesepod101.com"" rel=""nofollow"">JapanesePod101.com</a>) on my iPod Touch, lyrics or transcripts that are embedded in the MP3 files are displayed in the media player. The lyrics are, I believe, stored as ID3/ID4 tags in the MP3 metadata.</p><p>I find this to be an extremely useful feature, and I believe I'm not alone. Despite that, neither the stock Android media player nor any other media player I've downloaded from the Market seems to support this. I just have not been able to find any way to get feature on my Nexus One.</p><p>This feature is important enough to me that I'm considering learning Android development just so I can write a simple media player that displays embedded lyrics or notes. However, the fact that nobody else seems to have done this makes me wonder - is it even possible? <b>Is there something in the Android architecture or APIs that make it difficult or impossible to read and display lyrics information from MP3 files?</b> I'd hate to get deep into the learning process and find out what I'm aiming for can't easily be done. (I mean, if all else fails I assume I could write my own MP3-decoder, but that's more trouble than I'm willing to go through right now).</p><p>I've already asked this question on the <a href=""http://android.stackexchange.com/questions/3114/is-there-something-in-the-android-architecture-that-prevents-people-from-creating"">Android Enthusiasts Stack Exchange Beta Site</a>, but in retrospect I decided it was more of a programming question and decided it was better to ask here.</p>","8409","","390278","","2012-02-24 14:56:07","2012-06-02 06:28:37","Is there something in the Android architecture or API that prevents people from creating MP3 players that read embedded lyrics?","<android><mp3><id3>","3","1","","",""
"4271109","1","","","2010-11-24 20:15:40","0","187","<p>How can I read an XML file and then take over the individual items as markers in an overlay.</p><p>Here is an example of my XML files.</p><p>                    </p><pre><code>&lt;marker name=""Crab Pot"" address=""1301 Alaskan Way, Seattle, WA"" lat=""47.605961"" lng=""-122.340363"" type=""restaurant""/&gt;&lt;marker name=""Mama's Mexican Kitchen"" address=""2234 2nd Ave, Seattle, WA"" lat=""47.613976"" lng=""-122.345467"" type=""bar""/&gt;&lt;marker name=""Wingdome"" address=""1416 E Olive Way, Seattle, WA"" lat=""47.617214"" lng=""-122.326584"" type=""bar""/&gt;&lt;marker name=""Piroshky Piroshky"" address=""1908 Pike pl, Seattle, WA"" lat=""47.610126"" lng=""-122.342834"" type=""restaurant""/&gt;</code></pre><p></p><p>I'm still a newbie in Java / Android but nowhere can I find a guide.I hope you can help me further.</p>","519345","","","","","2010-11-24 20:25:20","How I can read an xml file in order to hang it as a marker to Mapview Android?","<android><android-mapview><google-maps-markers>","1","0","","",""
"4271125","1","","","2010-11-24 20:17:39","0","314","<p>I made two Buttons in my Android application.the first one activates sending my GPS data to a Website.the second one disables this option.so my question is:</p><p>What can I do to make it possible that when my <code>activatebutton.isEnabled()==false</code> (already pushed) is,that each time when my location changes a method will be executed. </p>","519332","","213269","","2010-11-24 23:06:53","2012-03-28 01:39:08","When a Button is enabled send the GPS data just when the Location changes","<android><button><geolocation><gps><listener>","2","0","","",""
"4271301","1","4271340","","2010-11-24 20:36:02","4","504","<p>If you are developing Android application, you will encounter such a id naming in xml files of view and layouts : </p><pre><code>&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:id=""@+id/new_game""          android:icon=""@drawable/ic_new_game""          android:title=""@string/new_game"" /&gt;    &lt;item android:id=""@+id/quit""          android:icon=""@drawable/ic_quit""          android:title=""@string/quit"" /&gt;&lt;/menu&gt;</code></pre><p>and I am really wondering why such naming is applied to ids. It is because of Linux? What kinda meaning this naming --<code>@+id/...</code>--has?</p><p>When I am looking at <code>android:icon</code> attribute I can interpret that it means <code>ic_new_game</code> is located under drawable folder and <code>@</code> means ""located at"" or I just assume that.</p><p>But naming id attributes are kinda different because they also have <code>+</code> sign. Can somebody help me understand this convention?</p><p>Thanks.</p>","44852","","","","","2010-11-24 20:55:50","Naming ID in Android Applications","<java><android>","1","0","","",""
"4271310","1","","","2010-11-24 20:36:38","1","934","<p>Greetings!What is the most common way to parse the results of the google search, and turn this:</p><pre>{    ""results"": [        {            ""region"": ""IL"",             ""streetAddress"": ""1611 South Randall Road"",             ""titleNoFormatting"": ""Brunswick Zone XL Randall Road"",             ""staticMapUrl"": ""http://maps.google.com/maps/api/staticmap?maptype=roadmap&format=gif&sensor=false&size=150x100&zoom=13&markers=42.162958,-88.334155"",             ""listingType"": ""local"",             ""addressLines"": [                ""1611 South Randall Road"",                 ""Algonquin, IL""            ],             ""lng"": ""-88.334155"",             ""phoneNumbers"": [                {                    ""type"": """",                     ""number"": ""(847) 658-2257""                }            ],             ""url"": ""http://www.google.com/maps/place?source=uds&q=brunswick+zone&cid=8286591317090502839"",             ""country"": ""United States"",             ""city"": ""Algonquin"",             ""content"": """",             ""GsearchResultClass"": ""GlocalSearch"",             ""maxAge"": 604800,             ""title"": ""<b>Brunswick Zone</b> XL Randall""        },        ...    ]}</pre><p>into this:</p><pre>Name=""Brunswick Zone XL Randall Road""Address=""1611 South Randall Road""Phone=""(847) 658-2257""</pre>","518012","","21441","","2010-11-24 20:42:08","2010-12-19 12:16:28","How to parse google search results in android code","<java><android><parsing>","1","0","","",""
"4271579","1","4271616","","2010-11-24 21:09:28","0","830","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4322367/i-lost-my-keystore-file"">I lost my .keystore file!</a>  </p></blockquote><p>I have an app on the android market for 5 months now. I haven't updated it in probably 2 months, so yesterday I went to work coding it. I finish my coding, go to export the app and it asks for my Keystore. The only problem is that when I try the use existing keystore option, THERE ARE NONE!!! So, I go through the long process of creating a new keystore and get the application exported and try to update the app and it tells me the keystores don't match, which is true.</p><p>This is the same computer I developed the first version of the app with, using the original keystore so where did it go? How do I retrieve it? My app has 500-1,000 downloads and it's $0.99 so I really don't want to piss 500 people off by removing the app and uploading a new one.</p><p>Any suggestions?</p>","413488","","19750","","2011-09-05 13:31:40","2011-09-05 13:31:40","Lost original keystore android app eclipse","<android><google-play><keystore><updating>","1","0","","2011-09-29 10:51:14",""
"4271668","1","","","2010-11-24 21:22:13","0","895","<p>So I started with this little write-up.  I wanted to try to make an application that will take pictures while running in the background.   To start though I wanted an application that once opened would simply take a picture every X seconds.  After recreating the classes and methods show in the walk through below I ran into a few problems.  </p><p><a href=""http://itp.nyu.edu/~sve204/mobilemedia_spring10/androidCamera101.pdf"" rel=""nofollow"">http://itp.nyu.edu/~sve204/mobilemedia_spring10/androidCamera101.pdf</a></p><p>For starters its seems that the onCreate function sets up all the objects for the application, but if you try to take a picture through any other method than onClick (IE directly calling it) the application actually hasn't setup the canvas or the preview yet.  </p><p>My first question:Is there any conditional method that you can setup that will wait till all the ""onCreate"" objects are created and their associated methods are called and finished?   How do I wait for the application to finish putting together my surface and starting the cameras preview before automatically starting to take pictures?  </p><p>My second question: I am required to have a preview available to take pictures.  Is there anyway to push this application to the back (IE running in the background) while still taking pictures?  Is drawing to a canvas a requirement?  (From what I can tell AFAIK, you are required to have a surfaceholder to start preview, when you put up another screen or application that pauses the current application and closes the surface/canvas you were presenting that preview on).   If my understanding is correct on all of this the best I will be able to do is make a 1x1 pixel canvas that will still take up the screen due to the application being in the foreground.   </p><p>My Third question: is there any way around this?  Can you still utilize the camera in some fashion without requiring the preview be drawn? </p>","517490","","","","","2010-12-15 15:31:40","Android Camera Application, preview crash","<android><camera>","1","0","1","",""
"4271751","1","4271890","","2010-11-24 21:35:40","3","4541","<p>@hi all got the answer</p><blockquote>  <p>we need to move </p></blockquote><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""/&gt; under &lt;/applications&gt; tag</code></pre><p>Hi,I am a newbie in android development.I tried Hello goolge map tutorial and not able to viewthe mapI signed up for API key.I am using Eclipe which is installed in ""d drive""used following command to obtain MD5 fingerprint fom bin folder of jdk</p><p>c:\program files\java\jdk 1.6\bin> keytool -list -alias androiddebugkey -keystore ""C:\Documents and Settings\Owner.android\debug.keystore"" -storepass android -keypass android</p><p>got this fingerprint</p><p>21:17:B1:D8:01:BD:F2:5A:9F:C9:A3:01:96:FA:9A:5B</p><p>used this to find API key and got this</p><p><code>""0Gm7C3R3R2K1pmQGuGkS0rx582TWJEBdJwryFrA""</code></p><p>used following code in layout</p><pre><code>&lt;com.google.android.maps.MapView             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""             android:apiKey=""0Gm7C3R3R2K1pmQGuGkS0rx582TWJEBdJwryFrA""             /&gt;</code></pre><p>still map is not displayed.Please enlighten me on this.Thanks in advance</p><p>Log Cat error log</p><pre><code>11-25 03:14:38.432: ERROR/AndroidRuntime(10857): ERROR: thread attach failed11-25 03:14:42.162: ERROR/AndroidRuntime(10866): ERROR: thread attach failed11-25 03:14:45.562: ERROR/AndroidRuntime(10877): ERROR: thread attach failed11-25 03:14:47.402: ERROR/MapActivity(10885): Couldn't get connection factory client11-25 03:14:50.652: ERROR/PackageInstallationReceiver(6465): Remove /data/local/tmp/com.testGoogleMap.apk Fail!11-25 03:14:58.952: ERROR/wpa_supplicant(1683): wpa_supplicant_ctrl_iface_ap_scan: 211-25 03:14:58.952: ERROR/wpa_supplicant(1683): Scan request11-25 03:14:59.802: ERROR/wpa_supplicant(1683): wpa_supplicant_ctrl_iface_ap_scan: 1</code></pre><p>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.helloGoogleMaps""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""  android:debuggable=""true""&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_INTERNET""/&gt;    &lt;uses-library android:name=""com.google.android.maps""/&gt;    &lt;activity android:name="".HelloGoogleMaps""              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;/application&gt;&lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre><p>modified manifest</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""  android:debuggable=""true""&gt;    &lt;uses-library android:name=""com.google.android.maps""/&gt;    &lt;activity android:name="".HelloGoogleMaps""              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;/application&gt;&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;&lt;uses-sdk android:minSdkVersion=""7"" /&gt;</code></pre><p> </p>","195504","","195504","","2010-11-24 22:53:26","2010-11-24 22:53:26","Android Maps API key is correct yet map not displayed fo android app","<android><google-maps><android-mapview>","2","13","","",""
"4271806","1","4272029","","2010-11-24 21:44:18","0","1757","<p>I am working with android + SQLite and DatePicker Widget.</p><p>The DatePicker does not format correctly for my SQLite insert commands. I.e, if the chosen date has a month or day less than 10, it does not insert the 0's. For example if I choose the date ""1st January 2010"", the format of the month and date is 1 and 1. This clashes with the usual SQL format of YYYY-MM-DD.</p><p>I tried to concatenate 0's into the integers when they are less than 10 by casting them to strings and prefixing o's by doing the following:</p><pre><code> // 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) {                if(monthOfYear &lt; 10)                {                    String mm = Integer.toString(monthOfYear);                    String m = ""0"" + mm;                    mMonth = Integer.parseInt(m);                }                else{mMonth = monthOfYear;}                if (dayOfMonth &lt;10)                {                    String dd = Integer.toString(dayOfMonth);                    String d = ""0"" + dd;                    dayOfMonth = Integer.parseInt(d);                }                else{mDay = dayOfMonth;}                mYear = year;                updateDisplay();            }        }; // updates the date in the TextViewprivate void updateDisplay() {    mDateDisplay.setText(        new StringBuilder()                // Month is 0 based so add 1                .append(mYear).append(""-"")                .append(mMonth + 1).append(""-"")                .append(mDay).append("""")                );    selecteddate = (String) mDateDisplay.getText();}</code></pre><p>I was expecting this to convert 2010-1-1 to 2010-01-01. It doesnt though. Does anyone have have a simpler way of doing this so that I can get the Date into the correct format before sending it to the sqlite table?</p><p>Thanks in advance.</p>","377613","","","","","2010-11-24 22:23:48","Android DatePicker ""0's"" problem when using SQLite","<java><android><sqlite><datepicker>","2","0","1","",""
"4271868","1","4272140","","2010-11-24 21:53:10","1","622","<p>I'm an android noob that is looking for some advice on how to properly use a service in Android. I am building an app that will connect to a server on the Internet to get a data stream via TCP. That data then needs to get send out to another device that is connected via a bluetooth serial port. I want this to continue to function in the background while the user looks at a different activity.</p><p>The app will be a NTRIP client, which pulls real time RTK correction data from the Internet and sends it to a RTK GPS receiver that I connect to via bluetooth. The data rate will be about 500 bytes/second. The user interface is a single button to connect or disconnect the data stream and some text to show status of the GPS receiver. There are also a few settings that will need to be configured by the user such as the IP/port of the server to connect to and the bluetooth device to communicate with.</p><p>I think I need to have the main activity spawn a local service, and then have the service spawn a thread for the TCP stream and another thread for the bluetooth connection. Does this sound right?</p><p>What is the best model for the service in this scenario?</p><p>-Start(bind) the service every time the activity starts, and have the connect/disconnect button send commands to the service to start/stop the threads. If I go this route, the service will continue to run after the user disconnects and goes to another app. The service would need an inactivity timer to terminate itself.</p><p>-Start and stop the service when the user presses the connect/disconnect button. The service only runs when data is moving. If I do this, the activity will need to see if the service is running when the activity starts, in order to know if it should bind to the service or tell the user that the link is disconnected.</p><p>Thanks.</p>","127287","","840973","","2011-12-29 17:48:38","2011-12-29 17:48:38","Android Service design - start with activity or only when needed?","<android>","3","0","","",""
"4271895","1","4272512","","2010-11-24 21:57:19","0","634","<p>HiI'm working with google maps api in both javascript and java on respectively a pc and android. There's probably a difference, but I've been looking around in the documentation for a max number of markers that is a good idea to put on the map, to not have a system crash. It's probably a lot smaller on android, but I really have no idea of an estimate is it 25 - 100 - 1000?</p><p>So that's why I'm asking you. What is the maximum number of markers on a map that the user system can handle on pc and android? I know that it depends on the individual system, but I also bet that there are some guidelines I'm not aware of, that I can follow to optimize the user friendliness of my applications.</p><p>thanks</p>","347904","","","","","2010-11-24 23:32:14","appropriate number of markers on google maps on android and pc","<java><javascript><android><google-maps>","1","0","","",""
"4271921","1","4272056","","2010-11-24 22:00:43","0","1813","<p>Have to create thread and run it for 5 seconds, then I want to stop. How can I do that?</p><p>I can't do anything with time/milliseconds. </p><p>THX.</p>","507153","","","","","2010-11-24 22:29:49","How to stop asynchronous thread after 5 seconds of running","<android><multithreading><asynchronous>","3","2","1","",""
"4271925","1","","","2010-11-24 22:01:26","0","136","<p>I have to do an application on the Android platform which should load a digital map  on the phone. The digital map is a .vsd file and it represents the map of a building. What  I need for the moment is when I touch the phone screen inside a room I want to modify the border color of this room (I want to select it in a visual way).Thanks </p>","519429","","","","","2010-11-24 22:12:21","Load Digital Map on Android","<android>","1","0","","",""
"4271952","1","","","2010-11-24 22:06:21","1","1204","<p>i have a subfolder in the Assets folder called images where i store my images(of course) :) The things is that i want to get the name for the images which i'm getting but the problem is that i'm also getting other unknown names like: ""android-logo-mask.png"" which i guess are android's default images. Is there a way i can skip this ""android default images"" to get only the names of my images? My plan is to save this names in a database to use it as reference for showing the images later on an ImageView. Is it a good idea to use the image name to show the images? Here is some code if it needs:</p><pre><code>    Context context;     @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            context = this.getApplicationContext();            ImageHelper i = new ImageHelper();            i.readImages(context);     }    public class ImageHelper { public ImageHelper(){} public void readImages(Context context){  AssetManager am = context.getAssets();  try {   String[] getImages = am.list(""images"");   for(String imgName : getImages){        Log.e(""IMAGE NAME-----&gt;"", imgName);       }  } catch (IOException e) {   e.printStackTrace();  } }}</code></pre><p>Thanks in advance.</p>","499488","","","","","2011-09-27 09:31:08","problem while looping through assets folder :(","<android>","3","2","","",""
"4271989","1","4272409","","2010-11-24 22:11:27","2","5419","<p>I have been searching for quite some time now, and I haven't been able to find a way to actually get an SPL/db value from a microphone on android. The few threads and articles that I have found that discussed it treated it like something SO obvious that anyone should be able to do it, and were more concerned with getting their conversion algorithms correct. Does anyone know how to do this?</p>","519436","","519436","","2010-12-08 19:50:22","2011-02-23 22:12:24","Getting decibel from an android microphone","<android><microphone><decibel>","2","3","6","",""
"4271998","1","4272060","","2010-11-24 22:12:13","0","141","<p>I am struggling in how to <a href=""http://img684.imageshack.us/img684/5599/androidlayout.png"" rel=""nofollow""><strong>create this layout</strong></a> <em>[ImageShack Link]</em> for my android application.</p><p>I tried nesting several things into each other but I kept getting errors and I finally have some code which does nothing like I want it to. I hope I get an idea on what layouts I should use and how I nest them together.</p><p>Here is my XML code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TableRow android:id=""@+id/TableRow01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;TextView android:text=""94.6"" android:id=""@+id/id_number"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;/TextView&gt;    &lt;/TableRow&gt;    &lt;TableRow android:id=""@+id/TableRow02"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;TextView android:text=""KG"" android:id=""@+id/id_unit"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;/TextView&gt;    &lt;/TableRow&gt;    &lt;TableRow android:id=""@+id/TableRow03"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;Button android:text=""@+id/Add"" android:id=""@+id/add_button"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;        &lt;Button android:text=""@+id/View"" android:id=""@+id/view_button"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","51649","","","","","2012-11-13 16:16:55","Struggling with Android Layout","<java><android>","5","0","","",""
"4272021","1","","","2010-11-24 22:14:42","0","415","<p>As of November 24 some of my apps are not visible in my developer console.  Does anyone have any idea why?  they have all been there every other day.  Any help is greatly appreciated.</p>","519441","","","","","2010-11-24 22:58:50","Why are some of my apps not showing in Android Market Developer Console?","<android><console>","1","0","","",""
"4272025","1","","","2010-11-24 22:15:32","1","869","<p>Re-wording per previous request... I am dynamically adding TableLayouts at runtime.  A view rundown looks like this...  LinearLayout->ScrollView->TableLayout->Loop creating TableLayouts and TableRows at runtime.  So basically I am looping and adding the following:</p><p>for(i=0.... i++)</p><p>Left &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Middle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Right </p><p>Bottom</p><p>Now everything gets added correctly, looks correct and scrolls correctly.  However I am attempting to create an onTouch event which changes the background on the touched dynamically created TableLayout.  Inside the onTouch for each dynamically created TableLayout I have a onTouch event that when called does the following:</p><pre><code>            tableLayoutRow1.setOnTouchListener(new OnTouchListener() {            @Override            public boolean onTouch(View v, MotionEvent event) {                Log.d(""OnTouch"", ""OnTouch Event for "" + Integer.toString(v.getId()) + "" event:"" + Integer.toString(event.getAction()));                switch(event.getAction())                {                    case MotionEvent.ACTION_DOWN:                        Log.d(""OnTouch"", ""Changing to GREEN"");                        v.setBackgroundColor(Color.GRAY);                        break;                    case MotionEvent.ACTION_UP:                    case MotionEvent.ACTION_MOVE:                        Log.d(""OnTouch"", ""Changing to BLACK"");                        v.setBackgroundColor(Color.BLACK);                        break;                }                return true;            }        });</code></pre><p>Whenever it calls the setBackgroundColor it messes up the alignment of every one of the dynamically created TableLayouts and makes them look like this:</p><p>LeftMiddleRight</p><p>Bottom</p><p>The entire code follows.  I hope this is clear now.</p><pre><code>public class TableActivity extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    LinearLayout linearLayout = new LinearLayout(this);    linearLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    linearLayout.setWeightSum(1);    ScrollView scrollView = new ScrollView(this);    scrollView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    TableLayout tableLayoutMaster = new TableLayout(this);    tableLayoutMaster.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    // &lt;table&gt;    //      &lt;tr&gt;&lt;td&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;    //      &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;    // &lt;/table&gt;    for(int i=0; i&lt;=30; i++)    {        TableLayout tableLayoutRow1 = new TableLayout(this);        tableLayoutRow1.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));         tableLayoutRow1.setColumnStretchable(2, true);        //tableLayoutRow1.setBackgroundColor(Color.GREEN);        TableRow tableRow = new TableRow(this);        ImageView left_column = new ImageView(this);        left_column.setImageResource(17301550);        tableRow.addView(left_column);        TextView middle_column = new TextView(this);        middle_column.setText(""Left Column:"" + Integer.toString(i));        middle_column.setTypeface(null, Typeface.BOLD);        middle_column.setGravity(Gravity.LEFT);        middle_column.setPadding(5, 0, 0, 0);        tableRow.addView(middle_column);        TextView right_column = new TextView(this);        right_column.setText(""Right Column:"" + Integer.toString(i));        right_column.setTypeface(null, Typeface.BOLD);        right_column.setGravity(Gravity.RIGHT);        right_column.setPadding(0, 0, 5, 0);        tableRow.addView(right_column);        tableLayoutRow1.addView(tableRow);        tableRow = null;        // now for the bottom row        TextView bottom_column = new TextView(this);        bottom_column.setText(""Starting activity com.developersinfo.testing.TableActivity on device emulator-5554"");        bottom_column.setTextSize(12f);        bottom_column.setGravity(Gravity.LEFT);        bottom_column.setPadding(30, 0, 0, 0);        tableLayoutRow1.addView(bottom_column);        tableLayoutRow1.setId(i);        tableLayoutRow1.setOnFocusChangeListener(new OnFocusChangeListener() {            @Override            public void onFocusChange(View v, boolean hasFocus) {                // TODO Auto-generated method stub                Log.d(""OnFocusChange"", ""OnFocusChange Event for "" + Integer.toString(v.getId()));            }        });        tableLayoutRow1.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                Log.d(""OnClick"", ""OnClick Event for "" + Integer.toString(v.getId()));            }        });        tableLayoutRow1.setOnTouchListener(new OnTouchListener() {            @Override            public boolean onTouch(View v, MotionEvent event) {                Log.d(""OnTouch"", ""OnTouch Event for "" + Integer.toString(v.getId()) + "" event:"" + Integer.toString(event.getAction()));                switch(event.getAction())                {                    case MotionEvent.ACTION_DOWN:                        Log.d(""OnTouch"", ""Changing to GREEN"");                        v.setBackgroundColor(Color.GRAY);                        break;                    case MotionEvent.ACTION_UP:                    case MotionEvent.ACTION_MOVE:                        Log.d(""OnTouch"", ""Changing to BLACK"");                        v.setBackgroundColor(Color.BLACK);                        break;                }                return true;            }        });        // now add to master table        tableLayoutMaster.addView(tableLayoutRow1);    }    scrollView.addView(tableLayoutMaster);    linearLayout.addView(scrollView);    setContentView(linearLayout);    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);}</code></pre><p>}</p><p>I have tried everything I can think of to keep it from doing this but so far I am unable to explain why or how to correct it.  As long as I do not call the setBackgroundColor inside the onTouch everything scrolls and aligns as expected. </p>","519044","","","","","2010-11-25 02:29:10","setBackgroundColor causing TableLayout alignment problems","<android>","3","0","","",""
"4272178","1","4272264","","2010-11-24 22:35:42","2","2481","<p>I have followed the article <a href=""http://developer.android.com/resources/articles/layout-tricks-stubs.html"" rel=""nofollow"">Layout Tricks: Using ViewStubs</a> to set a View on top of another. I used <code>FrameLayout</code> as the root element containing one <code>MapView</code> and a <code>ViewStub</code>. At the place for <code>ViewStub</code> I later opened a <code>LinearLayout</code> with the <code>android:background</code> set to a color with color value <code>&lt;color name=""blue_opaque""&gt;#f005&lt;/color&gt;</code>.</p><p>The position for the <code>LinearLayout</code> seem to be right, it sits on top and it has a blue background but it is not transparent. What am I doing wrong?</p>","213269","","","","","2010-11-24 22:45:58","How do I make a View 50% transparent?","<android><colors><view><transparent>","1","0","","",""
"4272408","1","4272449","","2010-11-24 23:11:48","2","4734","<p>I am considering to do an in-app purchase model within a paid app that releases or adds video content if the user opts in via a google check out method. Does anyone know how to do this from a coding standpoint? and does anyone know if this is possible?</p><p>thank you ahead of time...</p>","1512634","","","","","2011-02-04 22:34:52","Android In-App purchase Google checkout","<android><in-app-purchase><google-checkout>","2","0","2","",""
"4272444","1","4272502","","2010-11-24 23:20:08","2","1590","<p>My Android application uses minSdkVersion=3 and targetSdkVersion=8.  I used 8 because that is the highest level of API the application was tested on; however, it was written for level 3 and does not use any features beyond that level (except one for level 4 using reflection).  Could using targetSdkVersion=8 be causing:</p><ol><li><p>the Android Market to filter the application for some devices?  My intention is for the application to be available for ALL devices >= level 3 with NO filtering.</p></li><li><p>problems in the application since targetSdkVersion=8 will, according to google: ""disable compatibility settings that are not required for the target version (which may otherwise be turned on in order to maintain forward-compatibility) or enable newer features that are not available to older applications"".</p></li></ol>","236975","","","","","2010-11-24 23:30:16","Could android:targetSdkVersion=8 be causing problems?","<android>","1","2","2","",""
"4272685","1","","","2010-11-25 00:09:35","2","721","<p>I'm trying to run the sources from the Android SDK but most of them contains errors and they are not working. I have tried to clean them (eclipse->project->clean) or refresh with F5 but they still contain errors. Do you have any idea what's the matter with these ""ready"" examples?</p>","519526","","213269","","2010-11-25 00:12:10","2013-11-02 23:38:31","Problem with Android SDK examples","<android>","2","8","","",""
"4272750","1","","","2010-11-25 00:27:19","1","1814","<p>I want to create a virtual device (nexus one) with wvga800, 800x480 but when I do, I can't see the whole screen on my 13"" macbook pro, and I can't scroll down to see the bottom of the screen.  How can I see the bottom of my virtual phone screen???thanks,</p>","519543","","","","","2011-02-14 04:25:36","How to create a Virtual Android device 800x400 that I can see on my laptop?","<android><android-emulator>","4","0","","",""
"4272761","1","4272778","","2010-11-25 00:29:47","3","1498","<p>After creating textures in Android OpenGL ES, do I have to explicitly delete these textures later using glDeleteTextures()?  If so, how would I set up a callback to do this?</p><p>Thanks in advance</p>","450153","","","","","2011-01-06 00:55:20","Do I have to delete textures in GLSurfaceView?","<android><memory><textures>","2","0","","",""
"4272802","1","4272835","","2010-11-25 00:37:53","7","2961","<p>I am trying to send the files from an Android project so that a friend of mine can open a new Android project in eclipse and mess around with code/run the project from their home machine.  However, I have run into some problems dealing with missing manifest files, and non-matching signatures.</p><p>What is the simplest procedure for bundling up an Android project (not an .apk) to send to someone for their use in eclipse?</p>","487840","","47773","","2010-11-25 00:52:15","2010-11-25 00:56:42","How do you share an Android project?","<android><eclipse><android-manifest><apk>","2","0","2","",""
"4272828","1","","","2010-11-25 00:43:46","2","1427","<p>I have a String Array Resource that has about 1000 drug names</p><pre><code>&lt;string-array name=""index""&gt;&lt;item&gt;Aspirin&lt;/item&gt;  &lt;item&gt;Levitra&lt;/item&gt;  ....&lt;/string-array&gt;</code></pre><p>I tried to load this string array into a String[] inside an activity.Using the same syntax provided by Google's java documentation found here.<a href=""http://developer.android.com/guide/topics/resources/string-resource.html#StringArray"" rel=""nofollow"">http://developer.android.com/guide/topics/resources/string-resource.html#StringArray</a></p><pre><code>Resources res = getResources();String[] drugs = res.getStringArray(R.array.index);</code></pre><p>It appears my string-array has too many records and its causing my App to crash (stack-overflow?) When I reduce the string-array resource to about 506 records, the app works again, but adding even 1 more element in the string-array would crash the app. </p><p>What should I do? I want to code logic to filter and do other things to the list. I do not have a SQL db in the app so I can't do the processing in the DB. Is there a way to iterate through the string-array resource without loading it into a String []? I notice the resource is a pointer. Or is there an alternative data structure or approach that would work?</p><p>Thanks,</p>","519549","","519549","","2010-11-25 00:56:52","2010-11-25 00:56:52","Android Development String Array Resource too big, crashing Android App!","<java><android><string-array>","1","3","","",""
"4272905","1","4273540","","2010-11-25 01:03:29","1","2533","<p>I am trying to write something to an empty file on my apache server</p><pre><code>myClient= new DefaultHttpClient();StringEntity myString = new StringEntity(""important message"");HttpPost httpPost = new HttpPost(""http://10.0.218.211/myfile"");httpPost.setEntity(myString);HttpResponse response = myClient.execute(httpPost);</code></pre><p>The reponse returns ""HTTP/1.1 200 OK"" so it does find the file</p><p>I tried removing the file and it returned Error 404</p><p>I read apache's docs and looks like am doing it right ""i think""</p><p>My problem is... the contents of the file do not get updated!</p><p>An example would be great!</p>","512974","","","","","2012-04-10 00:37:49","HttpPost not working!","<android><http><http-post>","2","3","2","",""
"4272906","1","4272999","","2010-11-25 01:03:36","6","4925","<p>I have a Weather app with four Activities. The main/launcher activity is 'invisible' using...</p><p>android:theme=""@android:style/Theme.Translucent.NoTitleBar""`</p><p>...and is simply used to do a few checks (whether this is a new install, whether a network connection is available etc) before firing off one of the other Activities. The other Activities are UI-oriented - two simply display weather data pulled from a website and the third to provide a location 'picker' so the user can choose which area to show the weather for.</p><p>However, all four activities make use of a WeatherHelper object which basically does everything from checking for available SD card storage to maintaining preferences and pulling/formatting website pages.</p><p>So, my question(s)...what is the best way to have one instance of WeatherHelper which can be used by multiple activities and where/how are best to create it in my case?</p><p>I've been an OO programmer for a lot of years but I'm very new to Android and the design concepts - I've read a lot on the Android Developers site over the past weeks but I've stalled trying to decide on this.</p><p>Any ideas gratefully received.</p>","488241","","","","","2010-11-25 02:54:08","Sharing an object between activities","<android>","2","0","1","",""
"4273050","1","","","2010-11-25 01:32:48","2","616","<p>After I upgraded to Android SDK 8 I started seeing geocoding failures in the emulator. However, everything was fine on a device.</p><p>Now my app fails to gecode on 1.5 and 1.6 devices as well as in the emulator. Has anyone been able to fix this? I can't test on a 2.2 device. Perhaps it works OK there. </p><p>Is anyone else suffering from this and have they fixed it? </p><p>Many thanks,</p><p>pawpaw17</p>","519569","","","","","2010-11-25 01:50:48","Help! Geocoding fails: forwardGeocode(): GLS failed with status 20","<android><geocoding>","1","0","","",""
"4273055","1","4275074","","2010-11-25 01:34:51","0","463","<p>I have one Map on my main activity and It works fine. Recently I added another small map view on one of my sub activities using the same google map key. Now when I press back after looking at the map on sub activity, it returns to the main view and bottom of the map on main activity turns black. See the attached image. <img src=""http://i.stack.imgur.com/4tLE3.png"" alt=""alt text""></p><p>Is there anyone who has faced this problem and know why sometimes bottom of map turns balck? </p>","343679","","","","","2010-11-25 08:36:55","Android: Bottom of Google Maps gets black inside the application","<android><google-maps>","1","0","","",""
"4273168","1","4273215","","2010-11-25 02:02:57","2","2620","<p>When calling javah on a .java file in my android project, javah was unable to find the android classes (specifically android.graphics.Bitmap).</p><p>here's the terminal output:</p><pre><code>thomas@THOMASDESKLINUX:~$ javah -classpath .:/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/bin org.me.renderscene.Billboardjavadoc: error - In doclet class com.sun.tools.javah.MainDoclet,  method start has thrown an exception java.lang.reflect.InvocationTargetExceptioncom.sun.tools.javac.code.Symbol$CompletionFailure: class file for android.graphics.Bitmap not found1 error</code></pre><p>help appreciated!</p>","450153","","","","","2012-02-26 09:47:54","javah not able to find android classes","<android><native><classnotfoundexception>","1","0","","",""
"4273207","1","4279581","","2010-11-25 02:12:41","4","1370","<p>I have written some code in Java that will decode a SHOUTcast stream and return metadata.  This code works as intended, but when I port it to Android the same code does not work.  Specifically, I can't seem to parse the HTTP response header from the SHOUTcast server.  Where I can parse it just fine outside Android, I seem to get nothing but garbage back when the request is made via Android.</p><p>The relevant code follows.</p><pre><code>        URL u = new URL(""http://scfire-mtc-aa01.stream.aol.com:80/stream/1074"");        URLConnection uc = u.openConnection();        uc.addRequestProperty(""Icy-MetaData"", ""1"");        InputStream in       = uc.getInputStream();        byte[] byteheader    = new byte[512];        int c = 0;        int i = 0;        int metaint = 0;        while ((c = in.read()) != -1){            byteheader[i] = (byte)c;            if (i &gt; 4){                if (byteheader[i - 3] == '\r' &amp;&amp;                    byteheader[i - 2] == '\n' &amp;&amp;                    byteheader[i - 1] == '\r' &amp;&amp;                    byteheader[i] == '\n')                    break;               }            i++;        }</code></pre><p>When run in Android, this code overflows the ""byteheader"" buffer.  When run outside Android, it functions properly.  To make matters stranger, I have sniffed on the conversation via Wireshark and echoed the header sent by Android to a file.  When using netcat to make a request with the same header, I get the appropriate response back.  When I look at the logcat output of Android, ""byteheader"" contains only garbage.  </p><p>My only idea is that this is something environmental that I'm overlooking.  Or, I'm missing something massively obvious.</p><p>Any ideas?</p><p>As an edit, I've further isolated the problem by creating a dummy app and putting only the offending code in it.  The problem persists, with Android returning garbage, and my identical external code working as expected.  I thought this could be somehow related to character encodings, but it appears both environments are defaulting to UTF8.</p>","458290","","458290","","2010-11-25 16:06:24","2011-02-28 05:49:23","Android SHOUTcast request","<android><shoutcast>","2","1","3","",""
"4273231","1","","","2010-11-25 02:19:30","2","186","<p>I'm getting a constraint failed exception in my Android project, and I can't quite figure out where it's coming from. My helper class looks like this:</p><pre><code>    public static final String WORDS_TABLE = ""words"";public static final String ATT_WORD = ""word"";public static final String ATT_T1 = ""T1"";public static final String ATT_T2 = ""T2"";public static final String ATT_T3 = ""T3"";public static final String ATT_T4 = ""T4"";public static final String ATT_T5 = ""T5"";public static final String ATT_RECENT = ""recent"";public static final String ATT_RATING = ""rating"";public static final String STATISTICS_TABLE = ""statistics"";public static final String ATT_GAMESPLAYED = ""gamesPlayed"";public static final String ATT_wordsCORRECT = ""wordsCorrect"";public static final String ATT_wordsWRONG = ""wordsWrong"";public static final String ATT_POINTTOTAL = ""pointTotal"";public static final String ATT_WINS = ""wins"";public static final String ATT_LOSSES = ""losses"";public static final String SETTING_TABLE = ""settings"";public static final String ATT_SID = ""sid"";public static final String ATT_TYPE = ""type"";public static final String ATT_DURATION = ""duration"";public static final String ATT_PTSTOWIN = ""ptsToWin"";public static final String CATEGORIES_TABLE = ""categories"";public static final String ATT_CATEGORY = ""category"";public static final String BELONGS_TABLE = ""belongs"";public static final String USER_TABLE = ""user"";public static final String ATT_UID = ""uid"";public static final String DATABASE_NAME = ""taboo"";private static final int DATABASE_VERSION = 1;private static final String TAG = ""DBAdapter"";private static final String WORDS_CREATE =    ""create table words (_id primary key autoincrement, word text, ""    + ""T1 text, T2 text, T3 text, T4 text, T5 text, ""    + ""recent integer, rating integer);"";private static final String CATEGORIES_CREATE =    ""create table categories (_id integer primary key autoincrement, category text unique);"";private static final String BELONGS_CREATE =        ""create table belongs (_id integer primary key autoincrement, word text, category text, ""    + ""foreign key (word) references words (word), foreign key (category) references categories (category));"";private static final String USER_CREATE =    ""create table user (_id integer primary key autoincrement, uid text unique);"";private static final String STATISTICS_CREATE =       ""create table statistics (_id integer primary key  autoincrement, uid text unique, gamesPlayed integer, wordsCorrect integer, ""    +""wordsWrong integer, pointTotal integer, wins integer, losses integer, ""    +""foreign key (uid) references user (uid));"";private static final String SETTINGS_CREATE =    ""create table settings (_id integer primary key autoincrement, uid text, sid text, ""    +""type text, duration integer, ptsToWin integer, ""    +""foreign key (uid) references user (uid));""    ;//**************************************************************//*********************  Function Constants ********************//**************************************************************private final Context context; private DatabaseHelper DBHelper;public static SQLiteDatabase db;private int wordCount = 100;//********************  Object public DBAdapter(Context ctx) {    this.context = ctx;    DBHelper = new DatabaseHelper(context);}private static class DatabaseHelper extends SQLiteOpenHelper {    DatabaseHelper(Context context)     {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db)    {        db.execSQL(WORDS_CREATE);        db.execSQL(CATEGORIES_CREATE);        db.execSQL(BELONGS_CREATE);        db.execSQL(USER_CREATE);        db.execSQL(STATISTICS_CREATE);        db.execSQL(SETTINGS_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 "" + WORDS_TABLE);        onCreate(db);    }}    //****************************************************//********  Database Functions  **********************//****************************************************public DBAdapter open() throws SQLException {    db = DBHelper.getWritableDatabase();    return this;} public void close() {    DBHelper.close();}</code></pre><p>The population of my database table 'words' used JExcelAPI to scan from an excel spreadsheet the data to be entered. The populate method looks like this:</p><pre><code>public void WordPopulate(Context ctx) throws SQLException, BiffException, IOException{    Workbook wb = null;    AssetManager asst = ctx.getAssets();    wb = Workbook.getWorkbook(asst.open(""words.xls""));    ContentValues content = new ContentValues();    Sheet sh = wb.getSheet(0);    final int rows = sh.getRows() - 1;    final int columns = sh.getColumns() - 1;    Cell a1;    for (int i = 1; i &lt;= rows; i++) {            for (int j = 1; j &lt;= columns; j++) {                a1 = sh.getCell(j,i);                String str = a1.getContents();                if (j == 1) content.put(DBAdapter.ATT_WORD, str);                if (j == 2) content.put(DBAdapter.ATT_T1, str);                if (j == 3) content.put(DBAdapter.ATT_T2, str);                if (j == 4) content.put(DBAdapter.ATT_T3, str);                if (j == 5) content.put(DBAdapter.ATT_T4, str);                if (j == 6) content.put(DBAdapter.ATT_T5, str);                if (j == 7) content.put(DBAdapter.ATT_RECENT, (int)0);                if (j == 8) content.put(DBAdapter.ATT_RATING, (int)0);            }            DBAdapter.db.insert(DBAdapter.WORDS_TABLE, ""NULL"", content);        }    }</code></pre><p>I think all of the data in the spreadsheet is ok. Does anyone have any ideas on what would cause the SQLiteConstraintException? Thanks for the time</p>","365491","","","","","2011-02-14 10:31:08","Getting SQLiteContraintException in Android database","<java><android><sqlite>","1","4","","",""
"4273235","1","","","2010-11-25 02:21:22","0","2720","<p>Now I am make video player. and try to make video screen size change.</p><p>I find </p><pre><code>MediaPlayer.OnVideoSizeChangedListener mSizeChangedListener =    new MediaPlayer.OnVideoSizeChangedListener() {</code></pre><p>but this is callback function. not direct call function.</p><p>How to change video screen size?</p>","510250","","1776603","","2013-04-04 14:34:16","2013-04-04 14:34:16","How to change full screen mode during play video","<android><multimedia>","2","0","","",""
"4273263","1","4273282","","2010-11-25 02:30:22","4","6069","<p>Everything was working fine earlier. I then happened to add a new xml file to my layouts. now, one of my classes is giving an error when setContentView points to (R.layout.menu). Eclipse is telling me that R.layout.menu cannot be resolved. I can't figure out why; I have a layout called menu defined in my layout folder.</p><p>Any suggestions?</p>","479180","","345717","","2010-11-25 02:33:29","2012-09-21 23:51:18","R.layout.menu cannot be resolved","<java><android>","6","3","","",""
"4273288","1","","","2010-11-25 02:36:24","5","1737","<p>guys!I have googled a whole day,still,I can not find a solution.So, I post my question here,hope to get some hit.</p><p>I want to add some blank area at the end of a webview in android, I try to set the bottom padding of webview,however, it doesn't work. I know the layout of webview is absoluteLayout,which is deprecated, and I tried get the whole length of webview,and add a view at the end, I try to use getContentHeight(), however, the height is not quite correct,it is not end of webview,maybe because of picture or something else, I do not know.</p><p>So,my question is,is there anyway to achieve my original goal, which is add some blank area at the end of a webview?</p><p>Thanks in advance!</p>","469758","","","","","2013-10-24 10:57:49","Add a view at the end of Webview","<android><webview>","3","0","1","",""
"4273316","1","4274480","","2010-11-25 02:43:06","2","1784","<p>Does anyone know if there will be support for applications like that you download from the market to be written in <a href=""http://en.wikipedia.org/wiki/Canvas_element"" rel=""nofollow"">canvas</a>+javascript?</p><p>I know currently there is html5 and canvas support for the android browser but I am looking more for a solution for full screen games and such.</p><p>Thanks</p>","97464","","","","","2012-03-01 18:44:00","html5 canvas as a application","<android><html5><canvas>","2","0","","",""
"4273523","1","4281842","","2010-11-25 03:31:41","1","1143","<p>I think I'm doing the classpath wrong on the command line, and I get the following error:My android program uses Bitmap from the package android.graphics.Bitmap</p><pre><code>thomas@THOMASDESKLINUX:~$ javah -verbose -classpath :/home/thomas/Documents/LinuxProgramming/AndroidSDKs/android-sdk-linux_x86/platforms/android-8.jar;/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/bin org.me.renderscene.BillboardError: No classes were specified on the command line.  Try -help.bash: /home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/bin: is a directory</code></pre><p>and javah cant find the class</p><p>thanks!</p>","450153","","","","","2010-11-26 00:51:33","javah multiple classpath","<android><jni><classpath>","1","0","","",""
"4273539","1","4274257","","2010-11-25 03:34:16","1","1497","<p>I have an Android service, created in OnCreate of first Activity of the application using StartService(). I need this service to be  running throughout the life span of the application ie, all the activities in the application. But the service should not consume the resources after user pressed Home key or Back button. Is there any elegant way to do that other than stopping the service in onPause() method of all the activities?</p>","516712","","","","","2010-11-25 06:18:09","Android service running after pressing Home key","<android>","2","2","1","",""
"4273673","1","4273883","","2010-11-25 04:15:06","0","828","<p>i have an android emulator installed that has an android market app on its emulator..i have installed many apps from that,i want to download skype app from over there but  there is  no app by name skype at all...</p><p>plz anyone help me out..</p>","505580","","","","","2010-11-25 07:26:16","how to get skype from android market place","<android><emulator>","2","0","","2010-11-26 02:35:37",""
"4273684","1","","","2010-11-25 04:17:35","0","772","<p>Resources myResources = getResources();</p><p>CharSequence styledText = myResources.getText(R.string.stop_message);Drawable icon = myResources.getDrawable(R.drawable.app_icon);</p><p>int opaqueBlue = myResources.getColor(R.color.opaque_blue);</p><p>float borderWidth = myResources.getDemension(R.dimen.standard_border);</p><p>Animation tranout = AnimationUtils.loadAnimation(this, R.anim.spin_shrink_fade);</p><p>String{} stringArray = myResources.getStringArray(R.array.string_array);</p><p>int[] intArray = myResources.getIntArray(R.array.integer_array);</p><p>Resources myResources = getResources();AnimationDrawable rocket = (AnimationDrawable)myResources.getDrawable (R.drawable.frame_by_frame);</p><p>I'm comparing the last couple statements with the proceeding ones.  My question is why is AnimationDrawable explicitly cast when in the other examples above no casting is required?</p>","434716","","343816","","2010-11-25 06:10:36","2010-11-25 06:10:36","Casting a datatype in Android","<android><oop><inheritance><casting>","2","0","","",""
"4273688","1","4273733","","2010-11-25 04:19:40","1","1030","<p>I am trying to pass a HTML string to webview as following</p><p><code>String data =  ""&lt;html&gt;"" +""&lt;body bgcolor=\""white \"" align=\""center \"" valign=\""center \""&gt;"" +""&lt;table width=\""470\"" height=\""725 \"" &gt;"" +""&lt;tr&gt;"" +""&lt;td align=\""center\"" valign=\""center\""&gt;"" +""&lt;font color=\""gray\""&gt;"" +getResources().getString(R.string.loading) + //this is the string i want to localize""&lt;/font&gt;"" +<br>""&lt;br/&gt;"" +""&lt;br/&gt;"" +""&lt;br/&gt;"" +""&lt;br/&gt;"" +""&lt;br/&gt;"" +""&lt;img src=\"""" +""loading.gif"" + //this the GIF i want to pass""\""&gt;"" +""&lt;/td&gt;"" + ""&lt;/tr&gt;"" +""&lt;/table&gt;"" +""&lt;/body&gt;"" +""&lt;/html&gt;"";webview.loadData(data, ""text/html"", ""UTF-8"");</code></p><p>All works fine but that gif is not getting loaded.Only reason for passing html is to localize that string ""loading"".Earlier It was in assets and the string ""Loading"" was hard coded in html file. now I am passing it by getting getting string resources (getResources().getString(R.string.loading)). Problem is passing ""GIF"".</p><p>Please help me to resolve this.</p>","511945","","","","","2010-11-25 04:30:25","How to get the path of a drawable or "".gif"" in android","<html><android><image>","1","0","","",""
"4273708","1","4273932","","2010-11-25 04:23:54","2","1357","<p>I've just ventured into the fun world of Android development, but had a very quirky problem with the test app I was working on.</p><p>The app uses a TableLayout where each TableRow contains an EditText and some Buttons.</p><p>The TableRows can be added and removed at runtime. It all appeared to be working okay, until I accidentally tilted my device. The display responded and rearranged the layout, but suddenly all of the values were the same on each row.</p><p>After some head-scratching I figured out what was going on. Because of the orientation change Android was restarting the activity. When this happens Android tries to save and then restore your instance state, but it does this by storing data relative to the component id.</p><p>In my case, because the rows are all created from the same layout, then the EditText in every row has the same id. The result as far as I can tell, is that when the info is saved it is being overwritten for each row, so that the last row wins out.</p><p>When restoring there is only one value associated with that id and so it gets applied to every row!</p><p>In my case I was able to work around it as I didn't really need to keep the values anyway. In my onSaveInstanceState I DON'T call super.onSaveInstanceState, and likewise in onRestoreInstanceState.</p><p>So that finally brings me to my question!</p><p>What if I DID want those individual row values to be saved and restored? Is there an accepted way of generating unique ids on reused components (in my case the TableRow)?</p><p>Thanks for any suggestions / recommendations!</p>","519654","","","","","2011-10-31 22:29:01","How can I avoid duplicate ids in android child components?","<android><instance><ids>","2","2","1","",""
"4273712","1","4273747","","2010-11-25 04:25:06","0","1635","<pre><code>private final Button[] BUTTONS = {    btn1, btn2, btn3,btn4};...btn1 = (Button) this.findViewById(R.id.btn_1);btn2 = (Button) this.findViewById(R.id.btn_2);btn3 = (Button) this.findViewById(R.id.btn_3);btn4 = (Button) this.findViewById(R.id.btn_4);...int n = BUTTONS.length;for(int i=0; i&lt;n; i++) {    if(DEBUG) Log.d(TAG, String.valueOf(i));    BUTTONS[i].setOnClickListener(this);}</code></pre><p>throws NullPointerException, whereas</p><pre><code>btn1.setOnClickListener(this);btn2.setOnClickListener(this);btn3.setOnClickListener(this);btn4.setOnClickListener(this);</code></pre><p>works fine. Doesn't make any sense to me.</p>","421372","","421372","","2010-11-25 04:43:15","2010-11-25 04:43:15","setOnClickListener throws NullPointerException ONLY inside for loop. Why?","<android><arrays><button><for-loop><nullpointerexception>","1","2","","",""
"4273809","1","4391797","","2010-11-25 04:45:05","0","407","<p>So I'm trying to launch the Camera activity using the following code:</p><pre><code>//In public void captureImage()...Intent cameraIntent = new Intent(MediaStore.ACTION_CAPTURE_IMAGE);cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT,                      Uri.fromFile(new File(""/sdcard/image.jpg"")));startActivityForResult(cameraIntent, REQUEST_CAMERA);</code></pre><p>And then to handle the result:</p><pre><code>//In onActivityResult()...case REQUEST_CAMERA:  Intent intent = new Intent (CurrentScreen.this, NextScreen.this);  intent.putExtra(data);  startActivity(intent);  CurrentScreen.this.finish();...</code></pre><p>Where I use <code>intent.putExtra(data)</code> to attach the small bitmap to the intent, and use it as a thumbnail in the next activity, and the full sized file is supposedly saved as <code>/sdcard/image.jpg</code>.</p><p>This is the expected behavior (according to the documentation), to have a small bitmap for a thumbnail, and a large file saved.  However when testing this on a G1 and an Eris, I have been seeing some strange behavior.</p><p>On the G1:</p><ul><li>Although the resultCode shows RESULT_OK, the intent data that is returned to the result handler is null.</li><li>Also EXTRA_OUTPUT seems to be completely ignored, I have no idea where it is saving the image.</li></ul><p>On the Eris:</p><ul><li>The intent data comes back OK</li><li>EXTRA_OUTPUT is also ignored, but it is saving the images to the regular media store at <code>/sdcard/dcim/100media</code></li></ul><p>So my question is this: is there any way to get consistent behavior for what I am trying to do using the standard camera activity?  I could write up a custom activity to try and get it to work the way I want, but I'd prefer to avoid that route.</p>","433483","","","","","2010-12-08 20:10:45","EXTRA_OUTPUT ignored on Eris, causes data to return null on G1","<java><android><android-camera><android-camera-intent>","1","0","","",""
"4273838","1","4273854","","2010-11-25 04:50:23","2","3625","<p>I am using scroller class for auto scroll of the text in edittext but after stopping the animation scrolling goes back to top of the text and i want it to stop at current position. How can i perform this task?I am using this code for scrolling:</p><pre><code>public void Scroll()       {        scroll = new Scroller(PromptModeActivity.this,new LinearInterpolator());        length = prompt_text.getLineCount();        scroll.computeScrollOffset();        prompt_text.setScroller(scroll);        int a=prompt_text.getBottom();        scroll.extendDuration(scroll.getFinalY());            scroll.startScroll(scroll_x,scroll_y,0,a+500,                (400000)/ speedAmount);        }</code></pre><p>and using scroll.abortAnimation() to stop scrolling.Thanks in advance.</p>","493193","","345717","","2010-11-25 05:05:23","2010-11-25 05:05:23","How to perform automatic scrolling?","<android>","1","1","2","",""
"4273891","1","4273920","","2010-11-25 05:01:39","1","209","<p>In my iPhone project I was using the TouchXML parser. I want to develop that project in Android. I am new to Android, can anyone suggest a parser I should use. I just need to read XML and have no need of writing.</p>","450487","","310574","","2010-11-25 05:04:35","2010-11-25 05:08:31","What is the equivalent parser for TouchXML in Android?","<iphone><android><xml-parsing>","1","0","","",""
"4274238","1","","","2010-11-25 06:14:37","2","2943","<p>How we can route audio output via speaker even when the headset is plugged in?</p><p>My code:</p><pre><code>    if(audioManager.isWiredHeadsetOn())    {        audioManager.setWiredHeadsetOn(false);        audioManager.setSpeakerphoneOn(true);         audioManager.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_SPEAKER, AudioManager.ROUTE_ALL);          audioManager.setMode(AudioManager.MODE_NORMAL);     }</code></pre><p>Am I missing something here?</p>","516040","","","","","2013-04-25 07:36:25","Route audio via speaker when headphone plugged it","<android><audio><media>","3","0","1","",""
"4274272","1","4274451","","2010-11-25 06:20:38","3","551","<p>I want to provide common functionality between different activity types such as opening and closing a database connection.  Consider the following class:</p><pre><code>public class DataActivity extends Activity {    private DbAdapter mDbAdapter;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        //open database        mDbAdapter = new DbAdapter(this);        mDbAdapter.open();}    @Override    protected void onDestroy() {        super.onDestroy();        //close database        mDbAdapter.close();    }    public DbAdapter getDbAdapter() {        return mDbAdapter;    }}</code></pre><p>I could then simply extend <code>DataActivity</code> and have access to my data throughout the class.  However, what if I wanted to do this for a <code>ListActivity</code> or an <code>ExpandableListActivity</code>?  I would need to make a copy of <code>DataActivity</code> and have it extend the desired class.  </p><p>This seems really messy having multiple classes with duplicate implementation code for each activity type I would like to add this to.</p><p><strong>Edit</strong>It looks like what I am trying to do above isn't really possible due do the way Java is designed (no multiple inheritance).  There are several ways to minimize duplication of code but inheritance just doesn't work in this case.</p>","383761","","383761","","2010-12-17 20:44:36","2010-12-17 20:44:36","Sharing common functionality between different activity types","<android><inheritance><activity>","1","0","1","",""
"4274339","1","4363006","","2010-11-25 06:35:50","0","709","<p>HII am trying to send sms in android 1.5 by breaking it in multiple parts as the message text exceeds 160 characters but the problem is that only first part of  the sms is forwared. i.e. remaining messages are not sent and  NullPointerException is generated.</p><p>for eg</p><p>original sms is ""gaurav is a good boy""</p><p><strong>SMS 1 :</strong> gaurav<strong>SMS 2 :</strong> is a <strong>SMS 3 :</strong> good boy</p><p>These sms are lying in a String array named smsArray[]i am sending these these sms in a loop  by calling sendTextMessage </p><p>'for(int i=0;i&lt;3;i++){</p><p>sendTextMessage(""9815798751"",null , smsArray[i],null,null);</p><p>}'</p><p>I have even tried to use <strong>sendMultiPartTextMessage()</strong>but that does not help either.</p><p>Please Help</p>","1484525","","1484525","","2010-11-25 10:37:20","2010-12-06 03:43:26","sendTextMessage gives nullpointerexception while sending more than one sms in android","<android><messaging>","1","0","","",""
"4274365","1","4274439","","2010-11-25 06:39:29","2","1459","<p>Is there any way to set time out in android, if there is no response from server for specific period.</p>","493423","","","","","2010-11-25 07:25:13","How to set time out in android","<android><timer>","2","1","2","",""
"4274391","1","4274462","","2010-11-25 06:44:34","3","937","<p>i have a textview and a Menu , the textview is currently showing at the bottom of the screen and when menu pressed ,currently the menu hide the textview ,but i want the textview automatically move upwords so that everybody can see </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:orientation=""vertical""  android:background=""@drawable/android_bg""  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=""50dp""          android:background=""@drawable/navigationbar""&gt;         &lt;TextView android:layout_width=""wrap_content"" android:layout_centerInParent=""true""         android:id=""@+id/banner_text""            android:layout_height=""wrap_content"" android:background=""@drawable/bannertext_angies_list""&gt;&gt;&lt;/TextView&gt;            &lt;Button            android:layout_width=""55dp""              android:layout_alignParentRight=""true""            android:layout_centerVertical=""true""             android:layout_marginRight=""5dp""            android:layout_height=""35dp""             android:background=""@drawable/sign_out_button_clicked_button""                android:id=""@+id/signout""/&gt;    &lt;/RelativeLayout&gt;      &lt;ScrollView             android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;            &lt;LinearLayout android:layout_width=""fill_parent""            android:orientation=""vertical""            android:layout_height=""fill_parent""&gt;    &lt;LinearLayout         android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;    &lt;TableLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_marginTop=""20dp""&gt;        &lt;TableRow            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:gravity=""center""            android:layout_marginTop=""10dp""&gt;            &lt;TextView                android:visibility=""gone""                android:textColor=""#000000""                android:text=""Thank you, your report has been""                android:textSize=""16sp""                android:textStyle=""bold""                android:layout_width=""260dp""                android:layout_height=""fill_parent""                android:id=""@+id/Thanks_to_submission1""/&gt;                &lt;/TableRow&gt;                &lt;TableRow            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            &gt;                &lt;TextView                android:visibility=""gone""                android:paddingLeft=""70dp""                android:textColor=""#000000""                android:text=""submitted successfuly!""                android:textSize=""16sp""                android:textStyle=""bold""                android:layout_width=""260dp""                android:layout_height=""fill_parent""                android:id=""@+id/Thanks_to_submission2""/&gt;        &lt;/TableRow&gt;        &lt;TableRow            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:gravity=""center""            android:layout_marginTop=""50dp""&gt;            &lt;Button                android:layout_width=""260dp""                android:layout_height=""fill_parent""                android:background=""@drawable/submitbutton""                android:id=""@+id/submitreport_providertype_button""/&gt;        &lt;/TableRow&gt;        &lt;TableRow            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:gravity=""center""            android:layout_marginTop=""10dp""&gt;            &lt;Button                android:layout_width=""260dp""                android:layout_height=""fill_parent""                android:background=""@drawable/searchlist_button""                android:id=""@+id/search_list_button""/&gt;        &lt;/TableRow&gt;        &lt;TableRow            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:gravity=""center""            android:layout_marginTop=""10dp""&gt;            &lt;Button                android:layout_width=""260dp""                android:layout_height=""fill_parent""                android:background=""@drawable/bigdeal_button""                android:id=""@+id/big_deal_button""/&gt;      &lt;/TableRow&gt;&lt;/TableLayout&gt;        &lt;LinearLayout            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:gravity=""center_horizontal""             android:layout_marginTop=""50dp""&gt;            &lt;TextView             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:layout_gravity=""center""             android:textSize=""14sp""            android:textStyle=""bold""              android:onClick=""true""             android:textColor=""#000000""             android:text=""Or visit our website at"" /&gt;            &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""40dp""            android:id=""@+id/link""            android:gravity=""center_vertical""           android:autoLink=""web""            android:linksClickable=""true""            android:layout_gravity=""center""            android:textSize=""14sp""           android:textStyle=""bold""             android:onClick=""true""            android:textColor=""#000000""            android:text=""@string/link"" /&gt;          &lt;/LinearLayout&gt;        &lt;TextView             android:visibility=""invisible""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:layout_marginLeft=""14dp""             android:text=""Or visit our website at"" /&gt; &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;  &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","487219","","487219","","2010-11-25 06:53:38","2010-11-25 06:58:24","Android textview and Menu","<android><menu><textview>","1","2","","",""
"4274423","1","4274513","","2010-11-25 06:51:52","0","1061","<p>I am getting null pointer exception when I am trying to get lat/long from address using reverse geocoding in Android.... can you pleas elet me know is there any other way??</p>","511280","","","","","2010-11-25 09:06:37","reverse geocoding not working : Google paltform : 2.2 , Api :8","<android><android-emulator>","2","1","","",""
"4274512","1","4274531","","2010-11-25 07:12:28","1","1593","<p>I wrote a simple loop to aid in billboarding that will check if a pixel is white.  if so, it will set it to 100% transparency.  i wrote it in native code because the java equivalent of this loop took 19 seconds to run for a 256x256 bitmap, too slow.</p><p>when compiling:</p><pre><code>#include ""org_me_renderscene_Billboard.h""#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;JNIEXPORT jintArray JNICALL Java_org_me_renderscene_Billboard_NativeSetAlphaWhereWhite  (JNIEnv *envptr, jclass jClass, jintArray pixels, jint length){    int *mPixels = (*int)malloc(length * 4);    static int currentcolor;    static int writecolor;    static int red, green, blue;    for(int x = 0; x &lt; length; x++)    {        currentcolor = pixels[x];        red = currentcolor &lt;&lt; 16;        green = currentcolor &lt;&lt; 8;        blue = currentcolor;        if((red == 0) &amp;&amp; (green == 0) &amp;&amp; (blue == 0))        {            mPixels[x] = 0x00000000;        }        else        {            mPixels[x] = currentcolor;        }    }    return mPixels;</code></pre><p>}</p><p>the auto-generated stub for which is:</p><pre><code>/* DO NOT EDIT THIS FILE - it is machine generated */#include &lt;jni.h&gt;/* Header for class org_me_renderscene_Billboard */#ifndef _Included_org_me_renderscene_Billboard#define _Included_org_me_renderscene_Billboard#ifdef __cplusplusextern ""C"" {#endif/* * Class:     org_me_renderscene_Billboard * Method:    NativeSetAlphaWhereWhite * Signature: ([II)[I */JNIEXPORT jintArray JNICALL Java_org_me_renderscene_Billboard_NativeSetAlphaWhereWhite  (JNIEnv *, jclass, jintArray, jint);#ifdef __cplusplus}#endif#endif</code></pre><p>i get these errors:</p><pre><code>thomas@THOMASDESKLINUX:~/Documents/LinuxProgramming/EclipseWorkspace/RenderScene$ /home/thomas/Documents/LinuxProgramming/AndroidSDKs/android-ndk-r4b/ndk-buildCompile thumb  : Billboardlib &lt;= /home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/jni/org_me_renderscene_Billboard.c/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/jni/org_me_renderscene_Billboard.c: In function 'Java_org_me_renderscene_Billboard_NativeSetAlphaWhereWhite':/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/jni/org_me_renderscene_Billboard.c:9: error: expected expression before 'int'/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/jni/org_me_renderscene_Billboard.c:9: error: expected ',' or ';' before 'malloc'/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/jni/org_me_renderscene_Billboard.c:15: error: 'for' loop initial declarations are only allowed in C99 mode/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/jni/org_me_renderscene_Billboard.c:15: note: use option -std=c99 or -std=gnu99 to compile your code/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/jni/org_me_renderscene_Billboard.c:17: warning: dereferencing 'void *' pointer/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/jni/org_me_renderscene_Billboard.c:17: error: void value not ignored as it ought to bemake: *** [/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/RenderScene/obj/local/armeabi/objs/Billboardlib/org_me_renderscene_Billboard.o] Error 1</code></pre><p>why is this happening?  my C code should be fine, and these errors dont make much sense.</p>","450153","","","","","2010-11-25 16:53:40","C code not compiling correctly","<android><compilation><android-ndk>","3","0","","",""
"4274519","1","4274562","","2010-11-25 07:13:17","5","5777","<p>I have a list view , where i am adding headerview to that list . every thing fine , but when am scrolling list headerview also moving with list, so i want to avoid headerview scrolling , i mean i have to scroll only list when i list reached to topview (titlebar), headerview has to remain bottom of titlebar .</p><p>can any one gimme a solution for this ?</p>","414777","","76337","","2011-02-14 01:39:53","2013-01-08 08:48:16","Android : How to avoid header from scrolling in listview , android?","<android><listview><header>","5","0","2","",""
"4274524","1","","","2010-11-25 07:14:57","2","9613","<p>I created an XML document using Java in my android application. I have to call a web service in my application and pass this XML as an argument there. But my problem is there created a white space between each tag in the XML.   </p><pre><code>DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();DocumentBuilder docBuilder = dbfac.newDocumentBuilder();Document doc = docBuilder.newDocument();Element root = doc.createElement(""subscriber"");doc.appendChild(root);//creating child node for usernameEditText txtusername=(EditText)findViewById(R.id.txtUserName);subscriber[0]=String.valueOf(txtusername.getText());Element UserName=doc.createElement(""UserName"");             UserName.setTextContent(subscriber[0]);root.appendChild(UserName);//creating child node for PASSWORD EditText txtPassword=(EditText)findViewById(R.id.txtPassword);subscriber[1]=String.valueOf(txtPassword.getText());Element Password=doc.createElement(""Password"");Password.setTextContent(subscriber[1]);root.appendChild(Password);//set up a transformerTransformerFactory transfac = TransformerFactory.newInstance();Transformer trans = transfac.newTransformer();trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, ""yes"");trans.setOutputProperty(OutputKeys.INDENT, ""yes"");//create string from xml treeStringWriter sw = new StringWriter();StreamResult result = new StreamResult(sw);DOMSource source = new DOMSource(doc);trans.transform(source, result);String xmlString =sw.toString();url = new URL(""http://192.168.70.14/NewsLetter/subscribing.php?register= "" + xmlString);conn = (HttpURLConnection) url.openConnection();conn.addRequestProperty(""Content-Type"", ""text/xml; charset=UTF-8""); dis = conn.getInputStream();</code></pre><p>The XML is:</p><pre><code>&lt;subscriber&gt; &lt;UserName&gt;miya&lt;/UserName&gt; &lt;Password&gt;today&lt;/Password&gt; &lt;/subscriber&gt;</code></pre><p>Please give the solution for how to remove the white spaces between the <code>UserName</code> and <code>Password</code> tags.</p>","504117","","1578604","","2013-09-13 16:20:18","2013-09-13 16:20:18","How to remove the white spaces between tags in XML","<android><xml>","3","3","","",""
"4274585","1","4274648","","2010-11-25 07:25:03","2","2039","<pre><code>public class SynchronisedScrollView extends ListView {    private ScrollViewListener scrollViewListener = null;    public SynchronisedScrollView(Context context) {        super(context);    }    public SynchronisedScrollView(Context context, AttributeSet attrs,            int defStyle) {        super(context, attrs, defStyle);    }    public SynchronisedScrollView(Context context, AttributeSet attrs) {        super(context, attrs);    }    @Override    protected void onScrollChanged(int x, int y, int oldx, int oldy) {        Log.d(""Hello"", ""I am scrolled"");    //  super.onScrollChanged(x, y, oldx, oldy);    }}</code></pre><p>I want to catch how much the listView is scrolled, so I extend ListView. I am <strong>able</strong> to scroll the list. But OnScrollChanged is not called. For <strong>ScrollView</strong> and <strong>HorizontalScrollView</strong>  OnScrollChanged is called whenever it scrolls. Which function is triggered when we scroll a ListView.</p>","405747","","","","","2012-10-15 17:59:26","In ListView Which function is called while scrolling","<android>","2","0","1","",""
"4274771","1","","","2010-11-25 07:54:12","0","371","<p>I referred to projects like xmlwise and andriods pull parser and understood the logic for loading a plist into a hashmap. It seems that the conversion takes quite a long time for big plists say 30 seconds. here is my theory. Is it possible to convert this hashmap into a flat file in a java webserver, send that file to android phone and load it in seconds to a hashmap object on android phone ?</p>","154352","","","","","2010-11-25 07:54:12","flat file with hashmap to an android phone","<java><android><hashmap><plist>","0","5","","",""
"4274792","1","4274935","","2010-11-25 07:57:19","0","141","<p>Hi how i can use custom listview with textview and imageview.i tried following code</p><pre><code>ListView lv = (ListView) findViewById(R.id.ListView01);  this.getListView().setCacheColorHint(00000000);  String[] data = new String[] { ""aac"", ""xsfdf"", ""dsf"", ""frgr"" };  int[] to = new int[] { R.id.TextView01};   SimpleAdapter adapter = new SimpleAdapter(           this,null,R.layout.newimage,data, to);    setListAdapter(adapter);</code></pre><p>but it is not working.Help me.Thanx</p>","714976","","345717","","2010-11-25 08:00:46","2010-11-25 08:18:03","how can use customized listview","<android>","1","1","","",""
"4274819","1","4274903","","2010-11-25 08:00:41","2","4893","<p>I want to simply set the height of an EditText component to be 50% of the user's screen height.</p><p>I'm creating the initial layout from an xml file (main.xml), loaded in the Activity's onCreate(Bundle).  From the xml configuration, I understand how to set the EditText height to a literal value, e.g., android:layout_height=""150dip"", and from the onCreate(Bundle), I understand that I can call setHeight(int) on the EditText component, but the call to setHeight(int) appears to be ignored, and if I don't have the layout_height setting in the xml, then I get an exception when my app is starting, complaining that the height value is required (and the app dies).</p><p>Is there a way to set the height from the xml based on the user's screen height?  In other words, within the xml, is it possible to retrieve the user's screen height and use it to calculate a value for a component?</p><p>(I'm placing the EditText in a LinearLayout with vertical orientation.)</p>","519818","","519818","","2010-11-26 06:49:45","2010-11-26 06:49:45","How To Dynamically Set EditText Height","<android>","3","2","","",""
"4275032","1","4275048","","2010-11-25 08:31:24","0","1990","<p>I want to place three button images of same size equal to screen it is working fine in size 320 x 480,it occupies full 320 size but android is having different resolutions of phones of different sizes 480 x 800 and 240 x 320 how I has to place same image for all resolutions equally to occupy full screen ? </p>","460336","","","","","2010-11-25 08:33:52","How to handle one image for all different resolution of android mobiles?","<android>","1","0","","",""
"4275072","1","","","2010-11-25 08:36:53","1","298","<p>I Have developed an application which contains many activity.</p><p>I have noticed an issue while one activity starts another activity and meanwhile if we press camera button or get a call my application hangs and never recovers even after ending the call or closing the camera.</p><p>Basically what I want to know is how to handle external interrupts(alarms, calls, camera) so that my app resumes from where it had stopped.</p><p>I am replicating this issues on emulator as well as on LG Device.Can anyone give me some idea to how to handle onpause and onrsume function call in this case.</p><p>Thanks</p>","519846","","519846","","2010-11-29 04:48:11","2010-11-29 04:48:11","Handle external interrupts while switching activities in an App","<android>","0","3","1","",""
"4275097","1","","","2010-11-25 08:41:08","2","2183","<p>Hi i want to add xml layout daynamically to scrollview in my aplication . but it is showing error.</p><p>This is my code</p><p>enter code here</p><pre><code>LinearLayout ll = (LinearLayout)findViewById(R.id.myContent1);    LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);     View vv = vi.inflate(R.layout.headerone, null);     ll.addView(vv);//, new LinearLayout.LayoutParams(ll.getLayoutParams().width, ll.getLayoutParams().height));    View vv2 = vi.inflate(R.layout.headertwo, null);     ll.addView(vv2);//, new LinearLayout.LayoutParams(ll.getLayoutParams().width, ll.getLayoutParams().height));    View vv3 = vi.inflate(R.layout.headerone, null);     ll.addView(vv3);</code></pre><p>""headerone.xml"" and ""headertwo.xml"" are my two xml layout files.</p>","307585","","307585","","2010-11-25 08:45:36","2010-11-25 09:48:34","adding layout dynamically to ScrollView android","<android><layout>","1","3","1","",""
"4275167","1","4275598","","2010-11-25 08:49:57","7","5810","<p>is it possible to open an android contact card by contact's id? It works with the phone-number. Here is an example, if I use</p><p><code>Intent i = new Intent();     i.setAction(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT);i.setData(Uri.fromParts(""tel"", ""123456"", null)); //&lt;---- Change here from Phone to IDcontext.startActivity(i);</code></p><p>I'd see this:</p><p><a href=""http://img690.imageshack.us/img690/7562/helpxm.png"">Here a screenshot of a contact called by upper statement</a></p><p>But I want to open this contact card by ID, for example if the phone-number from the contact would change. </p>","519859","","","","","2010-11-25 09:43:34","How to open a contact card in Android by ID","<android><contact>","2","0","4","",""
"4275216","1","","","2010-11-25 08:57:45","4","2715","<p>I have two ListViews. Is there any way to synchronize the position of ListViews when I scroll any one of the  Lists</p>","405747","","","","","2012-03-20 08:32:57","Synchronize two ListView positions","<android>","2","0","3","",""
"4275311","1","","","2010-11-25 09:09:07","13","30867","<p>I want to encrypt file and store it in SD card. I want to decrypt that encrypted file and store it in SD card again. I have tried to encrypt file by opening as file stream and encrypt is but it is not working. I want some idea on how to do this.</p>","519887","","2360535","","2014-01-06 12:30:24","2014-03-28 16:46:00","How to encrypt and decrypt file in Android?","<android><security><encryption>","5","0","13","",""
"4275328","1","5056701","","2010-11-25 09:10:58","0","241","<p>I am programming for Android 1.6, the following code works in 2.2 (API Level 5):</p><pre><code>  Intent intentChooser = Intent.createChooser(intent, ""Choose between these programs"");  Intent intentTest= new Intent(Intent.ACTION_VIEW);    ....  Parcelable [] parcelable = new Parcelable [1];   parcelable[0] = new LabeledIntent(intentTest, """", ""the text of the label"", 0);  intentChooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, parcelable);  activity.startActivity(intentChooser);</code></pre><p>I don't know if the parcelable can include another type of data (not LabeledIntent). That would be a possible solution.</p><p>I have tried to include the code of LabeledIntent in my project, I have found here:<a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/android/content/pm/LabeledIntent.java"" rel=""nofollow"">http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/android/content/pm/LabeledIntent.java</a></p><p>but no success. That would be another question, how to include classes of later versions in older Android versions.</p><p>Any ideas?</p>","31791","","","","","2011-02-20 11:22:35","Android: LabeledIntent, how to use it with Android 1.6 (API level 4) to include it in a createChooser function?","<android><android-widget>","2","0","","",""
"4275339","1","4275386","","2010-11-25 09:12:24","-2","2420","<p>Is there any built-in function available in java for removing contents (ex: white space) between XML tags:</p><pre><code> &lt;student&gt; &lt;name&gt;miya&lt;/name&gt; &lt;number&gt;12&lt;/number&gt; &lt;/student&gt; </code></pre><p>I want to convert the above document as :</p><pre><code> &lt;student&gt;&lt;name&gt;miya&lt;/name&gt;&lt;number&gt;12&lt;/number&gt;&lt;/student&gt;</code></pre><p>by removing the white space?</p><p>Thank you...</p>","504117","","","","","2012-11-29 07:05:31","built-in function in java for removing space between XML tags","<android><xml><whitespace>","3","1","","",""
"4275366","1","","","2010-11-25 09:15:02","4","2086","<p>I am using ""loadDataWithBaseUrl(...)"" to load a html file, stored in assets, to Webview. that contains a string ""Loading..."" and a rotating GIF. String ""Loading..."" is hard coded, and it'll not be localized. How to replace that string dynamically, so that it can be localized?</p><p>Please help me to resolve this.</p>","511945","","","","","2011-05-05 06:39:26","Replacing string in html dynamically in Android","<html><android>","3","0","2","",""
"4275383","1","4276212","","2010-11-25 09:17:16","1","1385","<p>I have 3 image resources in my app.Loading and displaying any one of them in an ImageView goes smoothly.But when I remove the displayed ImageView from the layout, null it andadd a new image, things get weird.</p><p>Either the process crashes completely (signal 11) when I trycalling .recycle() on the old bitmap or I get an OutOfMemoryError incase I don't use recycle.</p><p>This only happens on API Levels below 8, so my guess is that bugs withGC on the native heap are causing it and these bugs were fixed on2.2.  However, since 2.1 is currently the most common version outthere I need a workaround...</p><p>Again, there shouldn't be a lack of memory for the native heap. I holdonly 1 image at a time and null the previous so the GC should be ableto retrieve the heap space (like happens on 2.2).</p><p>I've created a very small sample app which can be downloaded fromhere:<a href=""http://www.4shared.com/file/QqHrhJLR/BitmapRecycleTest.html"" rel=""nofollow"">http://www.4shared.com/file/QqHrhJLR/BitmapRecycleTest.html</a></p><p>Any suggestions will be appreciated.</p>","519900","","","","","2011-02-11 19:48:42","Process crash (signal 11) on image handling","<android>","2","0","","",""
"4275461","1","","","2010-11-25 09:24:44","2","1662","<p>I have a problem with my app, the new market feature added the ""uses feature"" implicitly, for the wifi feature.the wifi feature in my app is optional, so I wanted to add </p><pre><code>&lt;uses-feature android:name=""android.hardware.wifi"" android:required=""false"" /&gt;</code></pre><p>but, now the app does not compile (using SDK version 5 for android 1.6)</p><p>AndroidManifest.xml:52: error: No resource identifier found for attribute 'required' in package 'android'</p><p>AndroidManifest.xml:52: error: No resource identifier found for attribute 'required' in package 'android'</p>","406682","","","","","2010-11-25 09:46:38","uses-feature required=false in manifest.xml not compiling on android 1.6","<android><android-manifest>","1","0","1","",""
"4275678","1","4275950","","2010-11-25 09:49:31","54","32230","<p>I'm using the following code to make a call in Android but it is giving me security exception please help.</p><pre><code> posted_by = ""111-333-222-4""; String uri = ""tel:"" + posted_by.trim() ; Intent intent = new Intent(Intent.ACTION_CALL); intent.setData(Uri.parse(uri)); startActivity(intent);</code></pre><p>permissions</p><pre><code> &lt;uses-permission android:name=""android.permission.CALL_PHONE"" /&gt;</code></pre><p>Exception</p><pre><code>11-25 14:47:01.661: ERROR/AndroidRuntime(302): Uncaught handler: thread main exiting due to uncaught exception11-25 14:47:01.681: ERROR/AndroidRuntime(302): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:111-333-222-4 cmp=com.android.phone/.OutgoingCallBroadcaster } from ProcessRecord{43d32508 302:com.Finditnear/10026} (pid=302, uid=10026) requires android.permission.CALL_PHONE11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at android.os.Parcel.readException(Parcel.java:1218)11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at android.os.Parcel.readException(Parcel.java:1206)11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1214)11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1373)11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at android.app.Activity.startActivityForResult(Activity.java:2749)11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at android.app.Activity.startActivity(Activity.java:2855)11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at com.Finditnear.PostDetail$2$1$1$1.onClick(PostDetail.java:604)11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:884)11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at android.widget.ListView.performItemClick(ListView.java:3285)11-25 14:47:01.681: ERROR/AndroidRuntime(302):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640)</code></pre>","249991","","2441810","","2013-06-03 04:06:47","2014-03-21 22:21:59","how to make phone call using intent in android?","<android><android-implicit-intent>","7","0","11","",""
"4275731","1","","","2010-11-25 09:54:55","0","179","<p>I got some problem with my database in my Android application. Perhaps, my application is working but let me explain you.</p><p>Here are just parts of the code from my app.. i don't want to paste the whole it's not needed.</p><pre><code>private SQLiteStatement insertStmt;   private static final String INSERT = ""insert into ""      + TABLE_NAME + ""(name,surname) 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, String surname) {      this.insertStmt.bindString(1, name);      this.insertStmt.bindString(2, surname);      return this.insertStmt.executeInsert();   }@Override      public void onCreate(SQLiteDatabase db) {         db.execSQL(""CREATE TABLE IF NOT EXISTS "" + TABLE_NAME +           ""(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, surname TEXT)"");      }</code></pre><p>So when i try to run my app i get Force close, but when i put manually :</p><pre><code>dh.insert(""test"", ""ooo"");</code></pre><p>..in the onCreate method in my main activity everything is fine and working.So, the conclusion is that i must put some value for the first time i run the app so it can work properly. I thought maybe to update that row with the new informations that i insert later through some TextView's from the app but i'm wondering if there is smarter solution than this? </p>","518667","","","","","2010-11-25 11:44:14","My Android application is crushing if the database is not populated","<android><database>","1","2","","",""
"4275794","1","","","2010-11-25 10:00:28","3","488","<p>We can launch the app in two ways, 1 is form the app, clicking on device back button till we reach the android home screen and launching the app or 2nd is from the app we can click the device home button and then we can launch.</p><p>How can we differentiate these to launches? In 2nd type launch onrestart will be called, onrestart will be called in some other cases also.</p><p>I want to do something in the 2nd type of launch.</p><p>Can any one tel me how to do this...</p><p>Thanks in advance.</p>","262523","","","","","2010-11-25 13:20:34","App launch in android","<android><activity><launch>","1","0","2","",""
"4275797","1","4275969","","2010-11-25 10:00:46","27","10258","<p>Android View. setPadding(int left, int top, int right, int bottom) only accepts values in px but I want to set padding in dp. Is there any way around it?</p>","343679","","","","","2012-01-15 22:02:36","View.setPadding accepts only in px, is there anyway to setPadding in dp?","<android>","4","0","9","",""
"4275818","1","4278766","","2010-11-25 10:03:10","1","744","<p>I am working on an Android application that parses one or more XML feeds based on user preferences. Is it possible to parse (using SAX Parser) more than one XML feed at once by providing the parser with an array of URLs of my XML feeds?</p><p>If no, what would be an alternative way of listing the parsed items from different XML feeds in one list? An intuitive approach is to use <code>java.io.SequenceInputStream</code> to merge the two input streams. However, this throws a NullPointerException:</p><pre><code>try {  URL urlOne = new URL(""http://example.com/feedone.xml"");  URL urlTwo = new URL(""http://example.com/feedtwo.xml"");  InputStream streamOne = urlOne.openStream();  InputStream streamTwo = urlTwo.openStream();  InputStream streamBoth = new SequenceInputStream(streamOne, streamTwo);  InputSource sourceBoth = new InputSource(streamBoth);  //Parsing  stream = xmlHandler.getStream();  }catch (Exception error) {  error.printStackTrace();}List&lt;Item&gt; content = stream.getList();return content;</code></pre>","519908","","","","","2012-04-17 22:45:24","How to parse multiple XML feeds at once from an array of URLs with SAX Parser for Java?","<java><android><parsing><merge>","1","2","","",""
"4275823","1","4276320","","2010-11-25 10:03:47","0","1185","<p>I have a date in string format as <strong><code>25 November 2010</code></strong> and i am trying to fetch the Milliseconds of that date, for that i have done the below code:</p><pre><code>strDateSelcted = ""25 November 2010"" // Actually i am receiving date in this formatSimpleDateFormat curFormater = new SimpleDateFormat(""dd MMM yyyy"");  try {    Date dateObj = curFormater.parse(strDateSelcted);        insertEventtoCalendar(dateObj.getTime());   // Actually insert an event onto the native calendar  } catch (ParseException e) {    // TODO Auto-generated catch block        e.printStackTrace(); } </code></pre><p>But, when i try to run the application,it creates an event a day before the date inserted, i.e. For 25 November 2010 it inserts event on 24 November 2010 and For 27 November 2010 it inserts event on 26 November 2010, and same.</p><p>So where i am making a mistake???? pls show me way to do right</p>","379693","","21234","","2012-02-23 10:16:23","2012-02-23 10:16:23","Problem while fetching Milliseconds from Date","<java><android><date>","4","4","","",""
"4275858","1","4331995","","2010-11-25 10:08:19","0","655","<p>hi can you tell me how to execute the test cases defined in /external/opencore/engines/player/test/src in the donut code?</p><p>I have seen the PVplayer documentation , but that does not provide any information.I am trying to run an SDP file in the PVplayer.</p>","507466","","","","","2010-12-08 04:33:02","how to execute the test cases of PVplayer in android?","<android><testing><sdp><opencore>","1","0","","",""
"4275928","1","4276031","","2010-11-25 10:17:03","2","2704","<p>I have an Android Service which copies files to an ftp server.</p><p>While it is doing that, I want to send feedback to my Activity so the user knows what happens.</p><p>I tried implementing it using the <a href=""http://developer.android.com/reference/android/app/Service.html#RemoteMessengerServiceSample"" rel=""nofollow"">RemoteMessengerServiceSample</a> code, but I have a problem ... All messages I send during the ftp transfer arrive at my Activity the moment the copy operation is finished ... not message by message while the copy job runs as I would like.</p><p>Is there any way to fix this? Maybe i'm using the wrong method for sending messages to my activity?</p>","4186","","","","","2010-11-25 10:29:07","Sending Messages from my Service to my Activity?","<android>","1","0","","",""
"4276018","1","4276489","","2010-11-25 10:27:30","5","3450","<p>I have some content on a webpage which contains æ ø å, but my webview cant show them properly.</p><p>Does anyone know what the problem might be ? </p>","453562","","157882","","2010-11-25 11:39:32","2010-11-25 11:44:26","Webview doesnt show Æ Ø Å properly","<html><android><character-encoding><webview><android-webview>","2","1","","",""
"4276068","1","4276249","","2010-11-25 10:34:15","5","3160","<p>how to make dynamically edittext field for accepting only double and float values?</p>","1746300","","1077754","","2013-10-07 10:50:39","2013-10-07 10:50:39","how to make edittext field for decimals","<android>","3","0","2","",""
"4276134","1","","","2010-11-25 10:43:19","0","242","<p>in android app.if use a EditText,it default  have a context menu,how get the menu ,so i can modify it thanks </p>","233618","","","","","2010-11-25 10:43:19","how to get the system context menu?","<android>","0","3","","",""
"4276215","1","4276758","","2010-11-25 10:53:41","8","13934","<p>I am developing an Android application using SQLite as backend.</p><p>I want to make sure all the tables in the database use UTF-8. How can I achieve that?</p><p>I have tried:</p><pre><code>CREATE TABLE myTable (_all_columns_definitions_) DEFAULT CHARSET=utf8;</code></pre><p>but a syntax error arose.</p>","354742","","648313","","2012-02-08 16:37:16","2012-02-08 16:37:16","Make sure the SQLite on Android uses UTF-8 as a charset","<android><sqlite>","3","0","3","",""
"4276242","1","4276697","","2010-11-25 10:57:04","0","738","<p>I want to make button that when I press on it it wil open the default email client and makes it possible to send a mail to a pre-defined email adres, like a mailto: method.</p><p>I cant't figure out how to do it...</p>","520020","","","","","2010-11-25 11:48:26","How can I make a mail button for Android","<android>","1","0","","",""
"4276289","1","","","2010-11-25 11:02:15","0","2695","<p>I am trying to add table rows dynamically...... Following is my java code:</p><pre><code>TableLayout tl = (TableLayout) findViewById(R.id.tablerow);        /* Create a new row to be added. */        TableRow tr = new TableRow(this);        tr.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,   LayoutParams.WRAP_CONTENT));        /* Create a Button to be the row-content. */        Button b = new Button(this);        b.setText(""Dynamic Button"");        b.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));        /* Add Button to row. */        tr.addView(b);        /* Add row to TableLayout. */        tl.addView(tr, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));</code></pre><p>My XML code is</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/tablerow""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;TableRow&gt;        &lt;TextView            android:id=""@+id/content""            android:singleLine=""false"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>But I get error at this line:</p><pre><code>final TableLayout tl = (TableLayout)findViewById(R.id.tablerow);</code></pre><p>Error I get is <strong>Cannot cast from view to TableLayout</strong></p><p>Any help will be appreciated</p>","396543","","840520","","2012-07-17 12:32:35","2012-12-26 13:21:40","Dynamically add rows to the TableLayout","<android>","5","4","","",""
"4276346","1","4277341","","2010-11-25 11:10:46","2","285","<p>I have a tight game loop in a separate thread where I paint a lot of things on the canvas.</p><p>When I paint the score to the canvas I use the following function:</p><pre><code>public void clearAndDraw(Canvas canvas, Integer score) {    canvas.drawText(score.toString(), middleOfScreen, textYPosition, paint);</code></pre><p>When I check allocations in ddms I see that .toString not totally unsurprising allocates a char array on each conversion from an Integer to a String. This array will eventually be claimed by the garbage collect and cause uneven rendering of frames on slow android devices.</p><p>Is there a better way of painting integers on a canvas that won't cause new allocations and garbage collects?  </p>","12126","","45664","","2010-11-25 11:13:57","2010-11-25 20:07:00","Print integer to canvas fast and without garbage collects","<java><android>","1","0","1","",""
"4276352","1","4277965","","2010-11-25 11:11:19","8","3835","<p>In Android I get the version of the SDK easily (<code>Build.VERSION.SDK</code>) but I need to use LabeledIntent only if the platform is newer than 1.6 (<code>>Build.VERSION_CODES.DONUT</code>)</p><p>I suppose that Reflection is necessary (I have read <a href=""http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html"">this link</a> but it is not clear for a class or to me).</p><p>This is the code but it gives me an exception because in my Android 1.6, the compiler verifies if the package exists even if the condition is not applied:</p><pre><code> Intent theIntent=....;      if(Integer.parseInt(Build.VERSION.SDK) &gt; Build.VERSION_CODES.DONUT)   {     try{             Intent intentChooser = Intent.createChooser(intent,""Choose between these programs"");              Parcelable[] parcelable = new Parcelable[1];              parcelable[0] = new android.content.pm.LabeledIntent(theIntent, """", ""Texto plano"", 0);               intentChooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, parcelable);   activity.startActivity(intentChooser);   }   catch(Exception e)   {    activity.startActivity(theIntent);   }  } else  {   activity.startActivity(intentMedicamento);  }</code></pre><p><strong>HOW I SOLVED IT, SOME NOTES TO THE RIGHT ANSWER</strong></p><p>@Commonsware show me the way to do it. We create a bridge class so that depending on the API LEVEL, you instance one class that uses an API LEVEL or another class that uses another API LEVEL.The only detail one beginner could forget is that you have to compile your app with the newest SDK you are goint to make reference.</p><pre><code>public abstract class LabeledIntentBridge { public abstract Intent BuildLabeledIntent(String URL, Intent theintent); public static final LabeledIntentBridge INSTANCE=buildBridge(); private static LabeledIntentBridge buildBridge() {  int sdk=new Integer(Build.VERSION.SDK).intValue();  if (sdk&lt;5) {   return(new LabeledIntentOld());  }  return(new LabeledIntentNew()); }}</code></pre><p>So in the <code>LabeledIntentNew</code>, I included all the code that refers to <code>LabeledIntent</code> only available in API LEVEL 5. In <code>LabeledIntentOld</code>, I can implement another kind of control, in my case I return the intent itself without doing nothing more.</p><p>The call to this class is done like this:</p><pre><code>LabeledIntentBridge.INSTANCE.BuildLabeledIntent(URLtest,theIntent);</code></pre>","31791","","31791","","2010-11-30 12:31:16","2010-11-30 12:31:16","Android: how to code depending on the version of the API?","<android><reflection>","2","5","2","",""
"4276372","1","4276465","","2010-11-25 11:13:59","0","428","<p>Greetings,</p><p>I'm currently developing an Android application, but I'd like to be able to handle button click events etc in a separate file for each Activity. Is this possible? At the moment, I have one very large file that handles all events for several Activity windows.</p><p>Any advice greatly appreciated.</p><p>Thanks in advance,</p>","395974","","","","","2012-04-02 18:32:42","Android: Possible to have a seperate Java file for each Activity?","<java><android><file><activity>","3","0","","",""
"4276376","1","","","2010-11-25 11:14:43","0","103","<p>how do i develop an app that draws a line on screen at fixed coordinates, Setting up a repeating timer of 1 second duration? On every tick of the timer,the line refreshes.</p><p>LineRefresh.java:</p><pre><code>package LineRefresh.xyz.com;import java.util.Timer;import android.app.Activity;import android.graphics.Color;import android.os.Bundle;public class LineRefresh extends Activity {DrawView drawView;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);drawView = new DrawView(this);drawView.setBackgroundColor(Color.WHITE);setContentView(drawView);}}DrawView.java: package LineRefresh.xyz.com;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint; import android.view.View;public class DrawView extends View {Paint paint = new Paint();public DrawView(Context context) {super(context);}@Overridepublic void onDraw(Canvas canvas) {paint.setColor(Color.BLACK);canvas.drawLine(50, 200, 270, 200, paint);}  }</code></pre>","520047","","520047","","2010-11-25 12:44:57","2011-05-21 01:59:18","timer, refresher","<java><android><timer>","1","2","","",""
"4276545","1","4277891","","2010-11-25 11:32:20","2","1784","<p>I'm completely new to Android developing and i'm trying to read the available home screen widgets list.I can populate a grid using the available applications list using</p><pre><code>Intent myIntent = new Intent(Intent.ACTION_MAIN, null);myIntent.addCategory(Intent.CATEGORY_LAUNCHER);List&lt;ResolveInfo&gt; appsInfo = MyActivity.getPackageManager().queryIntentActivities(myIntent, 0);</code></pre><p>and than iterating through each ResolveInfo.<br>How can I do the same with available Home screen widgets? I'd like to populate a grid with the same list that appears keep touching the screen and choosing 'widget' from the appearing popup.Thanks in advance.</p>","520032","","590042","","2011-02-04 05:20:19","2013-07-11 09:30:50","How to obtain the installed widget list?","<android><list><widget><home><homescreen>","2","0","","",""
"4276660","1","4276911","","2010-11-25 11:43:54","1","4918","<p>I need to display a list of <em>categories</em> from a ListActivity. My data source is a ArrayList of type <code>Category</code> which is  implementing the android Parcelable interface. stucture is given at the bottom. it has an id and a title</p><p>I need title to be displayed as list text and on clicking the list item, i need to get the id for further processing</p><p>It is possible to create a new array of 'title's by iterating the category ArrayList and use <code>this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.rowlayout, R.id.label, names));</code></p><p>But bu using this method i will get only the title of the category upon click and not the id.</p><p>Is it possible to directly use the ArrayList of objects as data source?</p><pre><code>public class CategoryList extends ListActivity  {    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        Intent t = new Intent(this, ParsingWebXML.class);        startActivityForResult(t,1);    }    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        if(requestCode == 1 &amp;&amp; resultCode == RESULT_CANCELED){            finish();        } else {            createCategoryList(data);        }    }    private void createCategoryList(Intent data) {        ArrayList&lt;Category&gt; categories = null;        try {            categories = data.getParcelableArrayListExtra(""categoryList"");            Iterator&lt;Category&gt; itr = categories.iterator();            String[] names = new String[categories.size()];            int i=0;            while (itr.hasNext()) {                Category c = itr.next();                names[i++] = c.getTitle();            }            this.setListAdapter(new ArrayAdapter&lt;Category&gt;(this, R.layout.rowlayout, R.id.label, categories));            // String[] names = new String[] { ""Sports"", ""Mediacal"", ""Computers"" };            // this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.rowlayout, R.id.label, names));        } catch (Exception e) {            // TODO: handle exception        }    }    @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();        if(keyword==""Categories""){            Intent cat = new Intent(this, CategoryActivity.class);            startActivity(cat);            //Toast.makeText(this, keyword, Toast.LENGTH_LONG).show();        } else {            Intent cat = new Intent(this, CategoryActivity.class);            startActivity(cat);        }    }}</code></pre><p>Category.java</p><pre><code>public class Category implements Parcelable {    private int id;    private String title;    public Category() {    }    public Category(Parcel source) {        id = source.readInt();        title = source.readString();    }    public void setId(int id) {        this.id = id;    }    public void setTitle(String title) {        this.title = title;    }    public int getId() {        return this.id;    }    public String getTitle() {        return this.title;    }    @Override    public int describeContents() {        return 0;    }    @Override    public void writeToParcel(Parcel dest, int flags) {          dest.writeInt(id);          dest.writeString(title);    }    public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {        @Override        public Category createFromParcel(Parcel source) {            return new Category(source);        }        @Override        public Category[] newArray(int size) {            return new Category[size];            // TODO Auto-generated method stub        }    };}</code></pre>","174261","","174261","","2010-11-25 11:57:37","2010-11-25 12:12:05","Android ListActivity with ArrayList of Objects as layout resource","<android><android-layout>","2","0","2","",""
"4276677","1","","","2010-11-25 11:45:32","2","358","<p>please help me to create the following xml layout for the row of my listview</p><p><img src=""http://i.stack.imgur.com/4zXBY.jpg"" alt=""alt text""></p><p>Here the Text is written in a textview and remaining 5 boxes are 5 different ImageView, and the Images should be clickable.</p><p>Main problem is how thetext comes over the images.</p>","152867","","","","","2010-11-25 11:57:29","How to create such layout for each row of Android Listview?(Tricky Layout :) )","<android>","2","0","","",""
"4276699","1","","","2010-11-25 11:48:45","0","634","<p>I am writing an android application, which is sending some xml based data to struts2 </p><p>In struts i retrieve the data and store it in a database.</p><p>But how can i send the same data to android in struts. give some code details with </p><p>explanation.</p><p>Thank you.</p>","520083","","","","","2010-11-25 11:59:55","android, servlet","<android><struts2>","1","1","1","",""
"4276703","1","4280289","","2010-11-25 11:48:55","0","1581","<p>I have an activity which uses <code>android:theme=""@android:style/Theme.Dialog""</code>. The activity contains an ImageView which can show images of different dimensions. The ImageView should scale the Image so that it entirely fits into the window, at least on axes fits entirely and maintains the original aspect ratio. The size of the dialog should only be as large as the ImageView (plus its border width).</p><p>I tried the following but the dialog window always uses the whole available space:</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/imageParent""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:padding=""10dip""&gt;    &lt;ProgressBar        android:id=""@android:id/progress""        android:layout_width=""40dip""        android:layout_height=""40dip""        android:layout_centerInParent=""true""        android:visibility=""gone""        style=""@android:attr/progressBarStyleSmallTitle""/&gt;    &lt;ImageView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:adjustViewBounds=""true""        android:scaleType=""fitCenter""        android:id=""@+id/image""/&gt;&lt;/RelativeLayout&gt;</code></pre>","272802","","","","","2011-02-27 14:45:30","How to scale image to maximum size in a dialog-style activity","<android><dialog><imageview><scale>","1","0","1","",""
"4276857","1","4277868","","2010-11-25 12:06:04","33","5887","<p>I've written a wrapper on top of Log.java that is provided by android. My Class will add some other application level features in Logs.</p><p>Now the things is that i want to check from the code whether ""debuggable"" is set to 'true' or 'false' in androidManifest.xml file. </p><p>Can i do that? If yes, how?</p><p>Thanks All in advance.</p>","376148","","","","","2012-10-28 21:50:44","Getting ""debuggable"" value of androidManifest from code?","<android>","3","1","18","",""
"4276967","1","4277103","","2010-11-25 12:18:07","3","3967","<p>I am using the following code to blur an image in android, but it does not work. The final image that I get is with very distorted color and not a blur which I want. What am I doing wrong?</p><pre><code>public Bitmap blurBitmap(Bitmap bmpOriginal){            int width, height;    height = bmpOriginal.getHeight();    width = bmpOriginal.getWidth();        Bitmap bmpBlurred = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);    for (int i = 1; i &lt; width - 1; i++) {        for (int j = 1; j &lt; height - 1; j++) {            int color = (int) getAverageOfPixel(bmpOriginal, i, j);            bmpBlurred.setPixel(i, j, Color.argb(Color.alpha(color), Color.red(color), Color.green(color), Color.blue(color)));        }    }    return bmpBlurred;}private double getAverageOfPixel(Bitmap bitmap, int i, int j) {     return (    bitmap.getPixel(i-1, j-1) + bitmap.getPixel(i-1, j) + bitmap.getPixel(i-1, j+1) +    bitmap.getPixel(i, j-1) + bitmap.getPixel(i, j) + bitmap.getPixel(i, j+1) +     bitmap.getPixel(i+1, j-1) + bitmap.getPixel(i+1, j) + bitmap.getPixel(i+1, j+1)) / 9;}   </code></pre>","235246","","","","","2011-10-20 19:43:51","Blurring an image in Android","<android><image-processing>","1","1","3","",""
"4277032","1","","","2010-11-25 12:25:33","1","3040","<p>I want to add a timer that, on every tick of the timer (1second), causes the line to refresh. How do I use the timer in my code?</p><p>The following is my code:</p><p><strong>LineRefresh.java</strong>:</p><pre><code>package LineRefresh.xyz.com;import java.util.Timer;import android.app.Activity;import android.graphics.Color;import android.os.Bundle;public class LineRefresh extends Activity {DrawView drawView;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    drawView = new DrawView(this);    drawView.setBackgroundColor(Color.WHITE);    setContentView(drawView);}</code></pre><p>}</p><p><strong>DrawView.java</strong>:</p><pre><code>package LineRefresh.xyz.com;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.view.View;public class DrawView extends View {Paint paint = new Paint();public DrawView(Context context) {    super(context);}@Overridepublic void onDraw(Canvas canvas) { paint.setColor(Color.BLACK);    canvas.drawLine(50, 200, 270, 200, paint);}}</code></pre>","520047","","457237","","2012-05-08 18:10:36","2012-05-08 18:10:36","Add a timer to my code","<java><android><timer><draw>","4","0","0","",""
"4277077","1","","","2010-11-25 12:29:02","1","9977","<p>I am using the below code to execute a HTTP POST request. The PostData is in the form of a String</p><p>Sample of PostData:</p><p>urn:marlin:broadband:1-1:registration-service:linkAcquisitionurn:marlin:organization:testpdc:device-maker-x:clientnemo:aa08a1:59ea7e8cfa7a8582http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"" URI=""urn:marlin:core:1.0:nemo:protocol:profile:1"" wsu:Id=""sigid0003"" nemosec:Usage=""http://nemo.intertrust.com/2005/10/security/profile""/>&lt;/SOAP-ENV:Envelope></p><p>We are expecting a xml/soap response, instead we are getting an xml file as the response. Can anyone tell me if the procedure to do an HTTP POST is correct (as in the below code)</p><p>Note: The same postData when used with cuRL for performing a POST is working fine.</p><pre><code>public byte [] sendRecv(String PostData, long postDataSize){  try{   if(!(PostData.equals(""empty""))){    isPost = true;    //InputStream postDataInputStream = new ByteArrayInputStream(postData);    //BasicHttpEntity httpPostEntity = new BasicHttpEntity();    //httpPostEntity.setContent(postDataInputStream);    StringEntity httpPostEntity = new StringEntity(PostData, HTTP.UTF_8);    //httpPostEntity.setContentLength(postData.length);    //httpPostEntity.setContentType(""application/x-www-form-urlencoded"");    httpPost.setEntity(httpPostEntity);    httpPost.setHeader(""Content-Length"", new Integer(PostData.length()).toString());    httpPost.setHeader(""Content-Type"", ""application/x-www-form-urlencoded"");    httpPost.setHeader(""Expect"", ""100-continue"");   }  }catch(Exception e) {   e.printStackTrace();  }  try {   if(isPost == true){    response = mAndroidHttpClient.execute(httpPost);    isPost = false;   }   else {    response = mAndroidHttpClient.execute(httpGet);   }   statusCode = response.getStatusLine().getStatusCode();   if(statusCode != 200 ){    if(statusCode == 404) {     //System.out.println(""error in http connection : 404"");     //return ERR_HTTP_NOTFOUND     } else if(statusCode == 500){     //System.out.println(""error in http connection : 500"");     //return ERR_HTTP_INTERNALSEVERERROR    } else {     //System.out.println(""error in http connection : error unknown"");     //return ERR_HTTP_FATAL    }   }   HttpEntity entity = response.getEntity();   InputStream is = entity.getContent();   ByteArrayOutputStream bos = new ByteArrayOutputStream();   for (int next = is.read(); next != ENDOFSTREAM; next = is.read()) {    bos.write(next);   }   responseBuffer = bos.toByteArray();   bos.flush();   bos.close();   }catch (IOException e) {    e.printStackTrace();    }   return responseBuffer; }  </code></pre>","175482","","","","","2013-10-04 17:11:38","Problem with Android HTTP POST","<android><http><post><get>","3","0","3","",""
"4277133","1","","","2010-11-25 12:36:17","2","4508","<p>I have one subclass which extends <code>Dialog</code> class, it seems I can not use<code>startActivity()</code> function to start a new Activity in this subclass which extends <code>Dialog</code> class, how to resolve it? </p><p>How to start a new Activity in a Dialog subclass? (In my customized dialog subclass, I haveone button, when pressed, I would like to have a new Activity start).</p>","475850","","","","","2011-12-09 07:36:37","How to startActivity() in a subclass of Dialog?","<android>","3","0","1","",""
"4277155","1","4277305","","2010-11-25 12:39:50","10","3796","<p>I wish to sell paid applications via Android Market, however my country (Slovakia) is not in the list of entitled countries(http://market.android.com/support/bin/answer.py?hl=en&amp;answer=150324). </p><p>Could I temporarily overcome this limitation by getting a bank account and a paycard from a bank within the country(Austria in my case) entitled for Android Market merchandise?</p><p>Do you know, whether the Android Market merchants are allowed to use the store based on the location of their bank, their residence encoded in the card, or the internet connection location? </p><p>Solving this would help many others wishing to distribute paid apps but their country has not yet been allowed for Android Market merchandise.</p>","478569","","","","","2011-10-17 06:14:46","Solution to Not-Yet-Supported Country for Android Market Merchandise","<android><google-play>","2","4","5","2011-10-17 15:42:10",""
"4277201","1","","","2010-11-25 12:44:52","0","2369","<p>I have defined two views <code>ExampleView1</code>, <code>ExampleView2</code>, <code>ExampleView3</code> and <code>ExampleView4</code> in resources.</p><p>In my Activity I have an empty ViewFlipper. Based on doing some logic I want to add either  <code>ExampleView1</code> and <code>ExampleView2</code> to the ViewFlipper and show the view.</p><p>Later I want to add based on internal logic either <code>ExampleView3</code> and <code>ExampleView4</code>.</p><p>How do I do this? Is there some tutorial or can someone help me with example code?</p>","25282","","","","","2010-11-25 12:52:45","Adding a view on runtime to a ViewFlippers","<android><android-ui>","1","0","","",""
"4277229","1","","","2010-11-25 12:48:51","0","478","<p>I have a really big .txt file ( 4.2MB) that I have to access in my android application. It consists of words and their definitions in this format:</p><pre><code>word - definitionword2 - definition2</code></pre><p>Should I put this file in /assets folder or in res/raw? Or something third? Maybe I should put it on SD card because of its size?</p><p>And how should I get file contents in the code?I have tried both assets and res/raw, but the file size always seems to be the problem or I am doing something wrong.</p>","508216","","","","","2010-11-25 13:03:15","4 MB .txt file in android application","<android>","2","4","2","",""
"4277270","1","4284342","","2010-11-25 12:54:09","0","582","<p>All of a sudden, my Android app doesn't display any AdMob ad. I don't see any error message in LogCat when running my app with ad test mode disabled. And I can't see any ""ad request"" message (but may be there isn't such log trace). In the AdMob website dashboard, the number of ad requests seems to be frozen.</p><p>Do you how one can see what the AdMob server respond to the Android app when it request for an add? There might be some request answer, like ""wrong publisher id"", ""account suspended"" (I don't think it is as I didn't received any mail)...</p>","446576","","","","","2010-11-26 10:16:50","AdMob/Android : no requests at all","<android><admob>","1","2","","",""
"4277285","1","4277431","","2010-11-25 12:55:14","0","530","<p>Is it possible to set height and width of tabs in android? I tried setting customized textview as the indicator of tabspec setting its height and width to different values but no matter what its height and width value is, it's always set to the default height and width value.</p><p>Can anybody please help?</p><p>Thanx in advance.</p>","227943","","","","","2010-11-25 13:13:52","Set custom frame of tab in Android","<android><tabbar>","1","0","","",""
"4277327","1","4281777","","2010-11-25 13:01:26","0","183","<p>i have a mapview with itemizedoverlay, like in the example of mapview in androids developers guide</p><p>i have my own icon on the items, but also i want to personalize them, adding some text, not only the icon. But i mean text visible on the map, not when i press on the item</p><p>can i do it? how?</p>","479886","","","","","2010-11-26 16:45:31","Can I personalize the items of my mapview?","<android><google-maps>","1","2","","",""
"4277356","1","4704822","","2010-11-25 13:05:06","0","553","<p>When loading a lot of web pages into a WebView, it seems that the JavaScript part of the web pages don't behave like in a PC browser - it keeps running after switching URL, and basically makes the WebView experience slower and slower for that reason.</p><p>Has anybody else experienced this or something similar on Android 2.1 and found a solution/workaround?</p>","1507543","","494543","","2010-11-25 13:07:51","2011-01-16 10:23:09","Android webview javascript continues after URL change, making it slow down over time","<android>","1","0","","",""
"4277478","1","4308316","","2010-11-25 13:20:02","1","145","<p>I work on a high-profile app which runs on all versions of Android. Unfortunately for me the last update on Market included an absolutely-last-minute patch &lt;sigh&gt; which introduced a dependency on an API introduced in 2.0. Every 1.x client who upgraded promptly crashed, causing us to (quite reasonably) get slaughtered in market feedback.</p><p>Obviously there are procedural issues here... under no circumstances should we have shipped code not tested on all 4 major platform versions... but that's not why I'm here.</p><p>It occurs to me that the tools should be a lot more proactive to avoid this problem.</p><p>Put simply, during development I would like to be able to see a list of every place I use an API which was introduced at a level above that specified by <code>android:targetSdkVersion</code>. </p><p>My question is: How would such a tool work? Would it be possible to write something that looks in each android.jar under &lt;sdk-root&gt;/platforms  of each platform (to build some kind of list of function signatures paired with version numbers) and then do some kind of search? I just don't know enough about the guts of Java/Dalvik to get a real handle on solving the problem.</p>","440602","","","","","2010-11-29 21:31:59","How might an ""API Level Analyser"" tool work?","<java><android>","3","1","","",""
"4277497","1","","","2010-11-25 13:22:19","1","668","<p>i started a small android application to learn. I placed an input text and button on the screen. That shows on the emulator. After i press the button(which has an onClickListener) the application cracks and tells me on the screen of the emulator : ""The application... has stopped unexpectably.Try again"" and i have a ""Force close"", which of course closes the application. I cleaned and rebuild the project a lot of times. i have no errors shown.(using eclipse)this is the layout/main.xml:                </p><pre><code>&lt;ScrollView android:id=""@+id/widget37"" android:layout_width=""247px""    android:layout_height=""282px"" android:scrollbars=""vertical""    android:layout_x=""38px"" android:layout_y=""130px""&gt;&lt;/ScrollView&gt;&lt;RadioButton android:id=""@+id/compactList""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""    android:text=""Compact List"" android:layout_x=""36px"" android:layout_y=""78px""&gt;&lt;/RadioButton&gt;&lt;RadioButton android:id=""@+id/detailedList""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""    android:text=""Detailed List"" android:layout_x=""176px""    android:layout_y=""78px""&gt;&lt;/RadioButton&gt;</code></pre><p></p><p>this is the activity class:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;public class ShowStuffs extends Activity implements View.OnClickListener {private Button searchbtn;private EditText input;public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    searchbtn = (Button)findViewById(R.id.searchBtn);    searchbtn.setOnClickListener(this);}public void onClick(View view) {    System.out.println(""on click..."");    String searchedText = input.getText().toString();}}</code></pre><p>I cannot figure out what is wrong with it. Any suggestions are more than welcomed.Thank you .</p>","520197","","24054","","2010-11-25 13:36:13","2010-11-25 19:57:50","Android application fails and stops after clicking a button","<android><android-emulator><android-widget>","2","1","","",""
"4277498","1","","","2010-11-25 13:22:23","0","259","<p>LineRefresh.java:</p><pre><code>package LineRefresh.xyz.com;import android.app.Activity;import android.graphics.Color;import android.os.Bundle;public class LineRefresh extends Activity {DrawView drawView;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    drawView = new DrawView(this);    drawView.setBackgroundColor(Color.WHITE);    setContentView(drawView);}}</code></pre><p>DrawView.java:</p><pre><code>package LineRefresh.xyz.com;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.os.Handler;import android.view.View;public class DrawView extends View {Paint paint = new Paint();public DrawView(Context context) {    super(context);}@Overridepublic void onDraw( final Canvas canvas) {  paint.setColor(Color.BLACK); canvas.drawLine(50, 200, 270, 200, paint);      final Handler handler = new Handler();    Runnable runnable = new Runnable() {     public void run() {               paint.setColor(Color.BLACK);      canvas.drawLine(50, 200, 270, 200, paint);       handler.postDelayed(this, 1000);     }    };                 }}</code></pre>","520047","","","","","2010-11-25 15:00:32","why doesn't the line refresh?","<java><android><handler>","1","1","","",""
"4277554","1","4277590","","2010-11-25 13:27:07","0","66","<p>Am developing one apps using sqlite.I created database in main Activity ,I created that database in the ""<strong>MODE_WORLD_WRITEABLE</strong>"" mode.I can only access this database within alone that activity only,but i need to use same database for all activity.What can i do for single  database for all the activity accessible  within that application.I don't know how to proceed that . this is my first apps using sqlite,So anyone help me to fix this problem?</p><p>Thanks</p>","450596","","379993","","2010-11-25 13:30:05","2010-11-25 13:31:47","Can't Accsess database in all the activity in my android aplication?","<android><sqlite>","1","0","","",""
"4277596","1","","","2010-11-25 13:32:22","9","12299","<p>it is possible to set the orientation of an activity in the manifest file.</p><p>but is it also possible to do it from code? if so, how?</p><p>thanks!</p>","97688","","","","","2010-11-25 13:37:00","android setting activity orientation by code","<android><screen><orientation>","1","6","","",""
"4277624","1","","","2010-11-25 13:35:08","2","968","<p>Iam new to Android, </p><p>Need help to implement Accelerometer Sensor to an Image.</p><p>My requirement is i have to move an image according to the device moving(rotation).</p><p>Is there any other way to achieve this.NEED HELP(VERY URGENT)</p><p>Thanks in Advance,   Sriramjava86. </p>","520192","","21234","","2010-11-25 13:48:04","2010-11-26 00:27:06","How to implement AccelerometerSensor to an image in Android","<android><accelerometer>","1","0","1","",""
"4277625","1","4277856","","2010-11-25 13:35:27","0","186","<p>Is it possible to retrieve the contacts without using Activity class?</p><p>I'm using LWUIT for developing android application. I need to retrieve the contacts from android phonebook. How its possible?</p><p>Because normally retrieve contacts process achieved in inside of extend Activity class. ( I seen some examples).</p><p>In LWUIT, They created own Activity class. So i need to achieve some other class not in activity class.</p><p>How its possible?</p>","488433","","","","","2010-11-25 14:00:40","Is it possible to retrieve the contacts without using Activity class?","<android><lwuit>","1","0","1","",""
"4277655","1","4278838","","2010-11-25 13:38:15","0","763","<p>i have a scrollview ,it include one textView, the textView have many lines,in other word the textView entire screen size, if i want to see all  strings in the textView,i need scroll the scrollbar,but i donot want to so,i want the textView or the screen  automatic moving upwards interval for a period of time ,so that don't need user operations, how to realize it Looks like ebook effect?</p>","233618","","233618","","2010-11-25 13:54:00","2010-11-25 15:58:13","textView automatically move upwards","<android><android-widget>","2","0","","",""
"4277913","1","","","2010-11-25 14:08:18","1","475","<p>I am looking for reliable data regarding app compatibility to gingerbread (android 2.3)I cant seem to find any professional information on the subject and i predict that after its launch we'll see a rain of gingerbread devices manly tablets...</p><p>One needs to prepare :)</p><p>Thanks in advance</p><p>Guido</p>","496158","","","","","2010-11-25 14:28:10","How do I port for Android 2.3 Gingerbread?","<android>","1","0","","",""
"4277954","1","4278028","","2010-11-25 14:12:58","3","1847","<p>I am using a Java application to send UDP packets to an Android device. There I have another Java application that receives these UDP packets and displays its data - very simple.</p><p>Now I am working on some routing algorithms - therefore it would be nice to know how many hops a UDP packet did since it was send. My idea is to just read out the TTL (time-to-live) value of the packet and display it. Do you know if this is possible with pure Java? The class <a href=""http://download.oracle.com/javase/6/docs/api/java/net/DatagramPacket.html"" rel=""nofollow""><code>DatagramPacket</code></a> doesn't give any hints at all.</p><p>I guess that this is not possible because this information might already have been removed at a lower layer, but I just want to be sure. :-)</p>","446461","","","","","2010-11-25 14:31:37","How to get TTL of a UDP packet in Java?","<java><android><udp><ttl>","2","2","2","",""
"4277967","1","4278104","","2010-11-25 14:13:52","2","697","<p>I've created a simple web based game (text driven) in PHP and have recently become very interested in moving this onto Android - originally i thought the game could be rewritten in Java but after some investigation i found you can embed pages straight into an Android application.</p><p>Am i missing something or will i be able to simply embed my web application into Android and expect it to work flawlessly? Is there any issues i should be aware of? My app uses a login system utilising sessions / cookies - will this pose a problem for Android users?</p><p>I'd be interested in hearing anyones thoughts that have done something similar and any issues they've encountered. The only issue i forsee is how the page renders on different phones (although this i imagine this can be somewhat nullified by good markup and well thought out javascript) and any issues in regards to sessions / cookies?</p><p>If anyone has any good resources for doing this sort of work i'd be grateful.</p><p>As a final thought it'd be good to hear peoples thoughts on whether i should rewrite it or keep it embedded, what are the benefits of rewriting it?</p><p>Thanks</p>","516816","","","","","2010-11-25 14:29:14","Embedding a web based game into an Android Application","<php><android>","2","0","","",""
"4278017","1","","","2010-11-25 14:19:49","-2","149","<p>I am developing an application,I would like publish my application in android market. I want to find what are the user using my application and his location point out in Google map,How to find my user for my application,How to possible?</p><p>Thanks all</p>","500595","","473070","","2010-11-25 14:28:32","2010-11-25 14:28:32","How to find my application's user in google map?","<android><geolocation>","1","3","","",""
"4278037","1","","","2010-11-25 14:22:04","0","1322","<p>My machine is running on  window 7.I want to communicate between two android emulator's running on same machine.<br>Emulator first is listening on some IP 10.0.2.15When second emulator tries to create  </p><p><code>Socket socket = new Socket (""10.0.2.15"",8080);</code>  </p><p>It gives exception, unable to connect to 10.0.2.15does any one know how to solve this problem?</p>","520109","","520109","","2014-01-22 15:21:53","2014-01-22 15:21:53","Communication between two Android emulators","<java><android>","2","1","","",""
"4278068","1","4280433","","2010-11-25 14:25:13","0","81","<p>In my application first I am displaying home activity .in home activity I am getting the value from webservice and parse the value and display to user .from the home activity user click it will display to article display activity.from artcile display activity if user click it will come again home activity .It again and again calling web services and parsing the value it take time .</p><p>How to store the webservice  parsed value in firsttime and get the value for all activty.Instead of calling again and again webservice can anybody give example?</p><p>Thanks</p>","426344","","","","","2010-11-25 19:51:03","webservices performances","<android>","1","0","","",""
"4278164","1","","","2010-11-25 14:34:25","0","162","<p>I have implemented android's searchmanager using onSearchRequested().  This works fine but it shows itself on top of the page. How can I adjust the layout to just around 60dip from top?</p><p>many thanks,</p>","520280","","21234","","2010-11-25 14:50:25","2010-11-25 15:50:27","android: how to position SearchManager somewhere around 60dip from top?","<android><android-searchmanager>","1","1","","",""
"4278204","1","4278441","","2010-11-25 14:38:50","0","1158","<p>I want to get text from Edit text as it is and display in TextView.But whenver i get text using getText() it gives me text in one line. How to entered text in multiline EditText as it is. Please give me guidance?</p>","486216","","295342","","2012-11-23 03:58:02","2012-11-23 03:58:02","retrieve EditText multiline text as it is android?","<android>","1","0","","",""
"4278267","1","4279009","","2010-11-25 14:44:55","0","542","<p>I have some tabs and an activity group (Contacts) with several nested activities:</p><blockquote>Contacts Tab<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>Contact Groups -> Contact List -> Edit Contact</blockquote><p>I used <a href=""http://blog.henriklarsentoft.com/2010/07/android-tabactivity-nested-activities/"" rel=""nofollow"">this example</a> to manage walking through these nested activities. So, when I click on a Contact Group, I'm sending parameters about that group using intent and LocalActivityManager</p><blockquote>LocalActivityManager lam = Contacts.contacts.getLocalActivityManager();<br>Window w = lam.startActivity(""ContactListActivity"", intent);<br>View view = w.getDecorView();</blockquote><p>But when I get back to the first activity (Contact Groups) and select another contact group from the list, ContactListActivity is starting without firing ""onCreated"" method - it seems that the activity started using LocalActivityManager is somehow kept alive and doesn't fire ""pause"", ""destroy"" and other events until its parent ActivityGroup experiences that event.</p><p>I tried using <code>getLocalActivityManager().destroyActivity(activityId, false);</code> but then, when I would click contact group again, this: <code>lam.startActivity(""ctsActivity"", intent);</code> would return null...</p><p>Help! How can I use nested activities with normal activity lifecycle?</p>","133648","","","","","2010-11-25 16:18:38","Lifecycle of nested activities","<android><activity><nested>","1","0","","",""
"4278303","1","4278367","","2010-11-25 14:49:57","0","1304","<p>Hi i need to put some text over an imageview.</p><pre><code>    &lt;ImageView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_gravity=""center_vertical""    android:src=""@drawable/bg""/&gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:text=""TEST""/&gt;</code></pre><p>But this doesnt displays the text only the picture. And also I have to rotated this text. Is this even possible with TextView?</p>","440212","","","","","2010-11-25 14:59:08","Put rotated text on an imageview","<android><xml><textview><imageview>","1","0","","",""
"4278394","1","4279158","","2010-11-25 15:03:01","0","422","<p>I love to send latitude and longitude from my Android application to open in Google Map in Android phone. </p><p>But I wonder can we do the same thing with Foursquare application? Just like send the latitude and longitude and bring Foursquare app with place around the position we send to.</p>","95974","","","","","2010-11-25 16:34:14","How to invoke Foursquare application from my app in Android phone?","<android><foursquare>","1","0","","",""
"4278422","1","","","2010-11-25 15:06:00","0","1661","<p>I want to show a pdf in my application. My webservice gives me the pdf and I want to download it to sd card and then I want show that pdf in my app through webview.</p>","383597","","5640","","2013-11-07 16:03:14","2013-11-07 16:03:14","Display PDF in webview","<android>","2","0","1","",""
"4278471","1","4695134","","2010-11-25 15:10:48","3","1488","<p>Has anyone else experienced this on the Samsung Galaxy S?</p><p>When I use the folowing to turn the Loudspeaker on it works fine:</p><pre><code>audioManager.setSpeakerphoneOn(true);</code></pre><p>But when I try the opposite to turn it off:</p><pre><code>audioManager.setSpeakerphoneOn(false);</code></pre><p>The Loudspeaker stays on and audio is played via that instead of the ear piece on the device. </p><p>The above works on the Nexus One and HTC Hero, just got a Samsung Galaxy the other day and it doesn't work, has anyone else encountered the issue and perhaps know why it is happening and if there is a work around?</p>","243999","","","","","2012-04-19 08:39:11","Trouble with loud speaker off on Galaxy S","<android><audio><android-sdk-2.1><speakerphone>","1","1","3","",""
"4278535","1","4278600","","2010-11-25 15:20:06","10","8646","<p>I've developed and app that is a slide show of pictures which each play a sound when you tap them. It's like a picture book for ages 2-4.</p><p>The problem is, since android won't let you capture a home button press and essentially disable it, when parents give the phone to their child to play with unattended (brave parent), the child can inadvertenly exit the app and then make calls or otherwise tweak the phone.</p><p>There are two other apps that currently have a psuedo fix for this issue. The apps are Toddler Lock and ToddlePhone. I've tried contacting the developers of these apps for some guidance but they haven't been willing to disclose anything, which if fine, but does anyone here have any suggestions?</p><p>It looks like both of those other apps are acting like a home screen replacement app. When you enable the ""childproof mode"" on those apps the user is prompted to chose and app for the action and the choices are ""Launcher, LauncherPro, etc."" plus the toddler app. You then have to make the toddler app the default and voila, the phone is ""locked"" and can only be ""unlocked"" using a key combination or touching the four corners of the screen, etc. when you ""unlock"" the phone. your normal home screen app default restored. You don't even have to make the toddler app the default the next time you enable the ""childproof mode"".</p><p>I have read that these two apps have problems with Samsung phones and they can cause an an infinite crash-and-restart-loop that requires a factory reset to fix. Obviously this is not the ideal solution to the problem but it looks like the only one availiable at this point. </p><p>Does anyone have any ideas on how to implement a ""childproof mode""?</p>","520332","","","","","2013-12-24 07:34:57","Disable home button in android toddler app?","<android><children><replacement><home>","4","0","6","",""
"4278634","1","4278664","","2010-11-25 15:31:36","0","288","<p>I'm trying to add a custom ImageView to my main.xml, but if I start the program it closes with a forced close.</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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/background""    &gt;    &lt;test.testpkg.CustomImageView     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:layout_gravity=""center_vertical""     android:src=""@drawable/bg""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>JAVA</p><pre><code>package test.testpkg;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.widget.ImageView;public class CustomImageView extends ImageView { public CustomImageView(Context context) {  super(context);  // TODO Auto-generated constructor stub } @Override protected void onDraw(Canvas canvas) {  // TODO Auto-generated method stub  super.onDraw(canvas); }    }</code></pre><p>Also if I start the program in Debugger after the FC I only get this:<a href=""http://i.stack.imgur.com/35wJU.png"" rel=""nofollow"">link text</a></p>","440212","","","","","2010-11-25 15:35:53","Forced Close after adding custom ImageView","<android><xml><imageview>","1","0","","",""
"4278891","1","4279364","","2010-11-25 16:04:35","4","249","<p>My application is essentially a service that is started on boot (by a boot-completed receiver), and should periodically gather data, send it over the network, and go to sleep (probably using AlarmManager). It has no activities - no UI whatsoever.</p><p>Is there any reason to spawn an additional thread to perform the application logic?if not, where should I perform the logic? in the OnStart method?</p>","16418","","","","","2010-11-25 17:01:57","Should I do work in a separate thread if my android app has no UI?","<android><multithreading><android-service>","1","0","","",""
"4278949","1","4279218","","2010-11-25 16:11:05","7","6054","<p>We have a server application (implemented in Java) that will provide some data for our mobile apps. The apps will be created for Android and iOS.</p><p>Which is the best protocol / library for this purpose? The overhead of the protocol should be as small as possible.</p><p>Thanks.</p><p>Edit: It should be a request->response szenario. Data lost is not acceptable. The answer could contain a long list of data and therfore less overhead is required.</p><p>The client shall request the data (a specified key and some definied parameters) e.g. ""give me all file from folder x that have the extension y"". The server answers with the list.</p><p>The first idea was using XMLRPC, but the generated responses are too large.</p>","18633","","18633","","2010-11-25 17:16:20","2013-03-09 04:16:51","What is the best server client communication protocol to use in Android and iOS?","<java><android><ios><protocols>","2","5","2","",""
"4279035","1","","","2010-11-25 16:21:03","0","539","<p>I know you need a root access to do Remote Control on Android.</p><p>so given it is a rooted device, how do I access screen / inject keys?</p><p>Use IWindowManager? But IWindowManager is still hidden on rooted device.</p><p>Grant READ_FRAME_BUFFER, INJECT_EVENTS permissions?Do I then use: cat /dev/graphics/fb0 to grab screenshot?</p>","432056","","","","","2013-01-30 15:28:43","Remote Control on rooted device","<android><control><root>","1","1","","",""
"4279041","1","","","2010-11-25 16:21:36","1","788","<p>I am trying to develop a Google Reader app for Android.This app was working fine before today with the following code :</p><pre><code>monTransport = GoogleTransport.create();GoogleHeaders entete = (GoogleHeaders) monTransport.defaultHeaders;entete.setApplicationName(""ActuXml"");entete.gdataVersion = ""2"";entete.setGoogleLogin(jeton);XmlHttpParser parseur = new XmlHttpParser();parseur.contentType = ""text/xml; charset=UTF-8"";parseur.namespaceDictionary = NAMESPACE_DICTIONARY;monTransport.addParser(parseur);HttpRequest requete = monTransport.buildGetRequest();requete.url = new GenericUrl(""http://www.google.com/reader/atom/"" + finurl);try {   flux = requete.execute().parseAs(ReaderItems.class);} catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace();}</code></pre><p>I get a valid token by using the android API 2.0 code :</p><pre><code>AccountManager manageurcomptes = AccountManager.get(getBaseContext());Bundle bundle = manageurcomptes.getAuthTokenByFeatures(""com.google"", AUTH_TOKEN_TYPE,  null, moi,                       null, null, null, null).getResult();   if (bundle.containsKey(AccountManager.KEY_AUTHTOKEN)) {    authJeton = bundle.getString(AccountManager.KEY_AUTHTOKEN);    util = bundle.getString(AccountManager.KEY_ACCOUNT_NAME);</code></pre><p>Yesterday this code was working, today it doesn't work anymore.Any change on the server side for the unofficial Google Reader API ?</p>","520372","","811","","2012-10-30 20:30:48","2012-10-30 20:30:48","Usage of unofficial Google Reader API on Android","<android><google-reader>","0","0","1","",""
"4279077","1","","","2010-11-25 16:25:00","4","9833","<p>I am trying to set my applications background to a user chosen image, but I am having some trouble. Is it possible for someone to give me an example of how to do this? I can set the image ok from my resources, but when I try to use an image on the phone I can't seem to make it work.</p>","517922","","","","","2010-11-25 21:40:53","Android - Set Application Background","<java><android><image><bitmap>","1","0","1","",""
"4279096","1","","","2010-11-25 16:27:02","2","1061","<p>I'm trying to retrieve my Caller Id name associated with my number on my phone to use it in a field in my app.  I'm having trouble finding it in the SDK docs.  I can get my number from the TelephonyManager, but don't see where I can get my Caller Id name.</p><p>Rob W.</p>","326430","","181337","","2012-05-05 19:13:25","2012-10-29 20:47:52","How to get my Caller Id name in code?","<android><telephony>","2","0","","",""
"4279131","1","4279556","","2010-11-25 16:30:45","1","596","<p>For context see <a href=""http://stackoverflow.com/questions/4258517/what-is-best-1-table-per-record-or-1-table-with-all-records-linked-with-foreign"">post</a> </p><p>Following the awsome sugestion provided by yock, I changed my database design to use foreign keys. You can check the overall database design in this <a href=""http://stackoverflow.com/questions/4258517/what-is-best-1-table-per-record-or-1-table-with-all-records-linked-with-foreign"">post</a>.</p><p>So I have 2 tables.</p><pre><code>              TABLE(1)                         TABLE (2)+--------------------------------------+     +-----------+|            SURVEYS TABLE             |     |   ICONS   |+----+------+-------------+------------+     +----+------+| ID | name | description |   iconID   |     | ID | ICON |+----+------+-------------+------------+     +----+------+|    |      |             | FOREIGN KEY|     +--------------------------------------+     </code></pre><p>I constructed a VIEW using the two tables.</p><pre><code>public static final String VIEW_SURVEYS = ""surveysview"";      public static final String VIEW_SURVEYS_CREATE =       ""CREATE VIEW "" + VIEW_SURVEYS +       "" AS SELECT "" + TABLE_SURVEYS + ""."" + KEY_ROWID + "" AS _id, "" +        TABLE_SURVEYS + ""."" + KEY_NAME + "", "" +       TABLE_SURVEYS + ""."" + KEY_DESCRIPTION + "", "" +       TABLE_ICONS + ""."" + KEY_ICON + "" "" +       ""FROM "" + TABLE_SURVEYS + "" JOIN "" + TABLE_ICONS +       "" ON "" + TABLE_SURVEYS + ""."" + KEY_ICONID + "" = "" +                TABLE_ICONS + ""."" + KEY_ROWID;</code></pre><p>The tables and views are called in my Adapter constructor.</p><pre><code>private static class DatabaseHelper extends SQLiteOpenHelper {    DatabaseHelper(Context context) {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db) {    // TABLES    db.execSQL(TABLE_ICONS_CREATE);    db.execSQL(TABLE_SURVEYS_CREATE);    // VIEWS    db.execSQL(VIEW_SURVEYS_CREATE);    }</code></pre><p>And this is the method used to query the view.</p><pre><code>    public Cursor getSurveys() {return db.query(VIEW_SURVEYS, new String[] {        KEY_ROWID, KEY_NAME, KEY_DESCRIPTION, KEY_ICON},        null, null, null, null, null);}</code></pre><p>Which is called in my activity through a cursor</p><pre><code>    DBAdapter db = new DBAdapter(this);    db.open(); // Opens db session     Cursor survey_cursor = db.getSurveys();    startManagingCursor(survey_cursor);</code></pre><p>The problem is when I try run the above code, my program crashes. The line at it crashes is Cursor survey_cursor = db.getSurveys();</p><p>And Catlog show</p><pre><code>11-25 16:19:42.324: ERROR/AndroidRuntime(6146): Caused by: android.database.sqlite.SQLiteException: no such table: surveysview: , while compiling: SELECT _id, name, description, icon FROM surveysview</code></pre><p>I reread the code countless times and can't find anything wrong. What am I missing?</p><p>Here's the output for SELECT * FROM sqlite_master</p><pre><code>table|android_metadata|android_metadata|3|CREATE TABLE android_metadata (locale TEXT)table|fieldtype|fieldtype|4|CREATE TABLE fieldtype (_id integer primary key autoincrement, type text not null)table|sqlite_sequence|sqlite_sequence|5|CREATE TABLE sqlite_sequence(name,seq)table|editicons|editicons|6|CREATE TABLE editicons (_id integer primary key autoincrement, icon text not null)table|surveys|surveys|7|CREATE TABLE surveys (_id integer primary key autoincrement, name text not null, description text, editableid integer not null, FOREIGN KEY(editableid) REFERENCES editicons(_id))table|questions|questions|8|CREATE TABLE questions (_id integer primary key autoincrement, field text not null, typeid text not null, survey_id integer not null, FOREIGN KEY(typeid) REFERENCES fieldtype(_id)FOREIGN KEY(survey_id) REFERENCES surveys(_id))table|choices|choices|9|CREATE TABLE choices (choice text, question_id integer not null, FOREIGN KEY(question_id) REFERENCES questions(_id))table|answers|answers|10|CREATE TABLE answers (choice_id integer not null, FOREIGN KEY(choice_id) REFERENCES choices(_id))view|surveysview|surveysview|0|CREATE VIEW surveysview AS SELECT surveys._id AS _id, surveys.name AS name, surveys.description AS description, editicons.icon AS icon FROM surveys JOIN editicons ON surveys.editableid = editicons._id</code></pre><p>(this output reflects some changes I made to the code since I added "" AS "" after each column)</p>","295342","","516316","","2012-11-20 23:01:11","2012-11-20 23:01:22","Error when querying a created dbView (not table)!","<android><database><sqlite><view>","2","0","3","",""
"4279219","1","","","2010-11-25 16:42:32","1","2890","<p>I have an Android app which uses the ListView to populate courses from a database. What I want is to put the CourseID from the database in the ListView. I also want to use the OnItemClickListener to parse this ID to a new intent which shows the course details.</p><p>My code looks like this:</p><pre><code>import java.io.IOException;import java.util.ArrayList;import android.app.Activity;import android.app.AlertDialog;import android.content.Intent;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.text.InputFilter.LengthFilter;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;public class Menu extends Activity {/** Called when the activity is first created. */private ListView lv1;private String lv_arr[]={""BSc Business Information Technology"",""BSc Computer Forensics"",""BSc Computer Science"",""BSc Computing"",""BSc Internet Computing"",""BSc IT Security"",""BSc Mobile Computing"",""BSc Software Engineering""};@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    lv1 = (ListView)findViewById(R.id.ListView01);    DataBaseHelper myDbHelper;    myDbHelper = new DataBaseHelper(this);    try     {        myDbHelper.createDataBase();    }     catch (IOException ioe)     {        throw new Error(""Unable to create database"");    }    try     {        myDbHelper.openDataBase();        SQLiteDatabase db = myDbHelper.getReadableDatabase();        Cursor cursor = db.query(""Courses"", new String[]{""coursename""}, null, null, null, null, ""coursename"");        startManagingCursor(cursor);        if (cursor.getCount() &gt; 0)        {            if (cursor.moveToFirst())            {                ArrayList strings = new ArrayList();                do                 {                                        String mC = cursor.getString(0);                    strings.add(mC);                  }                while (cursor.moveToNext());                lv_arr = (String[]) strings.toArray(new String[strings.size()]);            }        }          else         {            Toast.makeText(this, ""No courses in database"", Toast.LENGTH_SHORT).show();        }        cursor.close();        // 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));          }    catch(SQLException sqle)    {        throw sqle;    }       lv1.setOnItemClickListener(new OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; a, View view, int position, long id)         {            Intent detailsIntent = new Intent(view.getContext(), CourseDetails.class);            detailsIntent.putExtra(""CourseID"", position);            //Cursor c = (Cursor) cursorAdapter.getItem(position);            startActivity(detailsIntent);         }    });}}</code></pre><p>Instead of the ""position"" parameter in the putExtra() method I want to put the Course ID from the database. How do I do that?</p>","520425","","","","","2010-11-25 17:09:04","Set and retrieve ID from database in ListView in Android","<android><listview><android-intent>","1","0","1","",""
"4279255","1","4279670","","2010-11-25 16:46:46","1","971","<p>My app contains a listview which can optionally contain images from a users sd card. It works fine however when any image is loaded there is noticeable lag. I have this in my getView:</p><pre><code>          BitmapFactory.Options o = new BitmapFactory.Options();             o.inJustDecodeBounds = true;             BitmapFactory.decodeFile(image, o);             final int REQUIRED_SIZE=70;             //Find the correct scale value. It should be the power of 2.             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++;             }             //Decode with inSampleSize             BitmapFactory.Options o2 = new BitmapFactory.Options();             o2.inSampleSize=scale;             Bitmap myBitmap = BitmapFactory.decodeFile(image, o2);             image_main.setImageBitmap(myBitmap);</code></pre><p>Any suggestions?</p><p>EDIT: Replaced the above with this but no images are loading...</p><pre><code>            class Thumbnailer extends AsyncTask&lt;String, Void, Bitmap&gt; {                    String image;                    @Override                    protected void onPostExecute(Bitmap result) {                        image_main.setImageBitmap(result);                    }                    @Override                     protected void onProgressUpdate(Void... progress) {                     }                    @Override                    protected Bitmap doInBackground(String... params) {                         BitmapFactory.Options o = new BitmapFactory.Options();                         o.inJustDecodeBounds = true;                         BitmapFactory.decodeFile(image, o);                         final int REQUIRED_SIZE=70;                         //Find the correct scale value. It should be the power of 2.                         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++;                         }                         //Decode with inSampleSize                         BitmapFactory.Options o2 = new BitmapFactory.Options();                         o2.inSampleSize=scale;                                                           return BitmapFactory.decodeFile(image, o2);                    }                }                 new Thumbnailer().execute(image);</code></pre>","427377","","427377","","2010-11-25 20:09:06","2010-11-25 20:09:06","Android listview image lag","<android><listview>","1","0","0","",""
"4279398","1","4279744","","2010-11-25 17:06:01","5","11787","<p>How can I center these buttons on Android?<img src=""http://i.stack.imgur.com/QjCIj.png"" alt=""alt text""></p><p>The code I'm using in the layout is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""      android: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 android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:orientation=""horizontal""&gt;     &lt;Button android:text=""Test""       android:layout_width=""100px""       android:layout_height=""40px"" /&gt;     &lt;Button android:text=""Test""       android:layout_width=""100px""       android:layout_height=""40px"" /&gt;     &lt;Button android:text=""Test""       android:layout_width=""100px""       android:layout_height=""40px"" /&gt;     &lt;Button android:text=""Test""       android:layout_width=""100px""       android:layout_height=""40px"" /&gt;       &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","143979","","","","","2010-11-25 17:55:33","Center layout Android","<android><xml><button><android-layout><android-sdk-1.6>","2","0","2","",""
"4279528","1","","","2010-11-25 17:22:24","1","393","<p>With an Android theme, it looks like you can change the default colors and appearance with a theme switch. However, I would like string values to change as well. For example, I have a TextView in my layout. If I switch to the Blue Theme, I would like the string to change to ""This is the blue theme."". I also want to switch graphic resources as well. </p><p>How can I do this without generating the layout programmatically or putting an if-else for every branded string?</p><p>Thanks!</p>","520468","","","","","2012-08-02 14:39:44","In Android, how can string values and graphic resources be switched with a theme?","<android><string><resources><icons><themes>","1","0","","",""
"4279655","1","4279939","","2010-11-25 17:40:48","10","5694","<p>I added a header view to my ListView and it's working quite well, the problem I'm having right now is that I need to remove the default clicking/focus effect when I click the header.</p><p>Apart from that, is it possible to also remove the click/focus effect to some items when they are ""disabled"" options?</p>","133055","","","","","2012-10-31 21:10:57","ListView: disabling clicking/focus","<java><android>","2","0","1","",""
"4279787","1","4279847","","2010-11-25 18:03:34","12","11386","<p>I am asking the user for input via a Dialog:</p><pre><code>package com.android.cancertrials;import android.app.Dialog;import android.content.Context;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;public class CustomDialog extends Dialog  {    private String name;//    private ReadyListener readyListener;     public static EditText etName;     public String zip;    public CustomDialog(Context context, String name) {        super(context);        this.name = name;//        this.readyListener = readyListener;    }    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mycustomdialog);        setTitle(""Enter the Zip Code "");        Button buttonOK = (Button) findViewById(R.id.ok);        buttonOK.setOnClickListener(new OKListener());        etName = (EditText) findViewById(R.id.EditZip);    }    private class OKListener implements android.view.View.OnClickListener {        @Override        public void onClick(View v) {//            readyListener.ready(String.valueOf(etName.getText()));            CustomDialog.this.dismiss();        }    }}</code></pre><p>When the user hits OK, how can I pass the value that was entered in the textbox, back to a member variable in the Activity that launched it?</p>","19875","","","","","2014-01-24 07:15:17","How can I pass values between a Dialog and an Activity?","<java><android><variables><dialog>","2","2","12","",""
"4279962","1","4280119","","2010-11-25 18:33:13","1","156","<p>I'm trying to get TextToSpeech to speak alphanumeric references in the Android emulator. If I have a string such as ""31NAA123"", then I insert spaces between all the characters and then submit it to the speak method. It copes OK with most letters but stumbles on the 'A's, they come out as barely audible very short ""ah""s, almost as short as clicks. I've tried <strong>replaceAll(""A"", ""AY"")</strong> which comes out as ""ay, why"". I've tried most speech rates down to 0.3f - nothing works. I'm using a UK locale to give a British accent. I'd be grateful if anyone has any useful suggestions.</p><p>(I suspect 'i' will give similar problems, 'o' seems to be OK)</p>","440010","","","","","2010-11-25 18:57:02","Persuading TextToSpeech to pronounce letters of the alphabet","<android><speech>","1","0","","",""
"4279981","1","","","2010-11-25 18:35:11","1","436","<p>please could any one help me out with this issue?I have a little widget, which has to files (<strong>widgetapp.java</strong> and <strong>widgetconfig.java</strong>).</p><p>In the <strong>preference (config)</strong> file, I call intent to display instaled apps</p><pre><code>Intent mainIntent = new Intent(Intent.ACTION_MAIN, null).addCategory(Intent.CATEGORY_LAUNCHER);              Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);pickIntent.putExtra(Intent.EXTRA_INTENT, mainIntent);startActivityForResult(pickIntent, 0);</code></pre><p>In the <strong>onActivityResult</strong> I can receive the app class, <strong>*<em>but how do I pass the result to my widget class (widgetapp.java)</strong>, to set up pending intent so that by tapping on the widget homescreen would lead you to open the specified app selected within this process?</em>*</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {  if (data != null) {  }}</code></pre><p>Thank you for any hints.Standa</p>","512840","","","","","2010-11-25 18:35:11","How to create tap to open option in Android widget?","<android><widget><android-intent><preferences>","0","0","","",""
"4280061","1","","","2010-11-25 18:47:46","2","1423","<p>So basically I'm making a Calendar Application for Android. I would like to know the procedure of simply retrieving all the events from Google Calendar(online) when a user enters their username and password to the android app. Is it possible for my application to get all the events from Google Calendar and possible store it in an ArrayList or some other structure? If so, then can you link/show me an example. I can't seem to find any solution.</p>","484881","","756941","","2013-12-11 05:09:43","2013-12-11 05:09:43","In Android, How can I access Google Calendar's (online) events data from my own application using Java?","<java><android><google-calendar>","1","1","","",""
"4280162","1","12157474","","2010-11-25 19:03:20","6","12670","<p>Are there any image libraries available for Android as seen in <a href=""http://www.jhlabs.com/ip/filters/index.html"">http://www.jhlabs.com/ip/filters/index.html</a>? Or have some one ported the same? Thanks in advance.</p>","421372","","","","","2012-10-06 21:23:51","Android image filter libraries","<android><graphics><image-processing><filter><image-manipulation>","4","0","12","",""
"4280240","1","","","2010-11-25 19:16:35","0","587","<p>I am looking for some guidance and hopefully someone can tell me the proper way to implement this scenario. In my app I am going to show a splash screen on startup and immediately start downloading some data from internet. When splash screen is finished, after about three seconds, the mapview should be shown. When the downloading of data is finished, after about one to ten seconds, the mapview should be updated with points of interest relating to the downloaded data. How do I best implement this in Android. Of course I first have an activity for the splash screen and another mapactivity for the mapview. But what do I use to download the data and when it is finished notify the mapactivity to update the mapview? Do I use an asynctask?</p><p>Best regards</p><p>P</p>","274426","","","","","2010-11-25 21:30:45","Download data and update MapView","<android><android-mapview>","1","0","","",""
"4280330","1","9752494","","2010-11-25 19:32:28","13","9097","<p>I have an <code>AsyncTask</code> that fetches some data and then updates the UI with this new data. It has been working fine for months, but I recently added a feature that displays a notification when there is new data. Now when my app is launched through the notification, sometimes I get this exception and <code>onPostExecute</code> is not called.</p><p>This is what happens when the app is launched:</p><p>1) Expand the UI and find views</p><p>2) Cancel the alarm (through <code>AlarmManager</code>) that checks for new data and reset the alarm. (This is so that if the user disables the alarm it is cancelled before the next time he/she reboots.)</p><p>3) Start the <code>AsyncTask</code>. If the app was launched from the notification, pass in a little bit of the data and then cancel the notification.</p><p>I'm stuck on what could be causing this exception. It seems that the exception is from the <code>AsyncTask</code> code, so I'm not sure how I can fix it.</p><p>Thanks!</p><p>Here is the exception:</p><pre><code>I/My App(  501): doInBackground exitingW/MessageQueue(  501): Handler{442ba140} sending message to a Handler on a dead threadW/MessageQueue(  501): java.lang.RuntimeException: Handler{442ba140} sending message to a Handler on a dead threadW/MessageQueue(  501):  at android.os.MessageQueue.enqueueMessage(MessageQueue.java:179)W/MessageQueue(  501):  at android.os.Handler.sendMessageAtTime(Handler.java:457)W/MessageQueue(  501):  at android.os.Handler.sendMessageDelayed(Handler.java:430)W/MessageQueue(  501):  at android.os.Handler.sendMessage(Handler.java:367)W/MessageQueue(  501):  at android.os.Message.sendToTarget(Message.java:348)W/MessageQueue(  501):  at android.os.AsyncTask$3.done(AsyncTask.java:214)W/MessageQueue(  501):  at java.util.concurrent.FutureTask$Sync.innerSet(FutureTask.java:252)W/MessageQueue(  501):  at java.util.concurrent.FutureTask.set(FutureTask.java:112)W/MessageQueue(  501):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:310)W/MessageQueue(  501):  at java.util.concurrent.FutureTask.run(FutureTask.java:137)W/MessageQueue(  501):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)W/MessageQueue(  501):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)W/MessageQueue(  501):  at java.lang.Thread.run(Thread.java:1096)</code></pre><p>EDIT: Here is my <code>onCreate</code> method in my main activity (the one opened by the notification). There are some <code>onClickListeners</code> that I omitted to save space. I don't think they should have any effect, since the buttons they are attached to are not being pressed.</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState); // Call the parent    setContentView(R.layout.main); // Create the UI from the XML file    // Find the UI elements    controls = (SlidingDrawer) findViewById(R.id.drawer); // Contains the    // buttons    // comic = (ImageView) findViewById(R.id.comic); // Displays the comic    subtitle = (TextView) findViewById(R.id.subtitleTxt); // Textbox for the    // subtitle    prevBtn = (Button) findViewById(R.id.prevBtn); // The previous button    nextBtn = (Button) findViewById(R.id.nextBtn); // The next button    randomBtn = (Button) findViewById(R.id.randomBtn); // The random button    fetchBtn = (Button) findViewById(R.id.comicFetchBtn); // The go to specific id button    mostRecentBtn = (Button) findViewById(R.id.mostRecentBtn); // The button to go to the most recent comic    comicNumberEdtTxt = (EditText) findViewById(R.id.comicNumberEdtTxt); // The text box to Zooming image view setup    zoomControl = new DynamicZoomControl();    zoomListener = new LongPressZoomListener(this);    zoomListener.setZoomControl(zoomControl);    zoomComic = (ImageZoomView) findViewById(R.id.zoomComic);    zoomComic.setZoomState(zoomControl.getZoomState());    zoomComic.setImage(BitmapFactory.decodeResource(getResources(), R.drawable.defaultlogo));    zoomComic.setOnTouchListener(zoomListener);    zoomControl.setAspectQuotient(zoomComic.getAspectQuotient());    resetZoomState();    // enter the new id    imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); // Used to hide the soft keyboard    Log.i(LOG_TAG, ""beginning loading of first comic"");    int notificationComicNumber = getIntent().getIntExtra(""comic"", -1);    Log.i(LOG_TAG, ""comic number from intent: "" + notificationComicNumber);    if (notificationComicNumber == -1) {        fetch = new MyFetcher(this, zoomComic, subtitle, controls, comicNumberEdtTxt, imm, zoomControl);        fetch.execute(MyFetcher.LAST_DISPLAYED_COMIC);    } else {        fetch = new MyFetcher(this, zoomComic, subtitle, controls, comicNumberEdtTxt, imm, zoomControl);        fetch.execute(notificationComicNumber);        ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).cancelAll();    }    Log.i(LOG_TAG, ""ending loading of new comic"");    Log.i(LOG_TAG, ""first run checks beginning"");    // Get SharedPreferences    prefs = getSharedPreferences(""prefs"", Context.MODE_PRIVATE);    // Check if this is the first run of the app for this version    if (prefs.getBoolean(""firstRun-"" + MAJOR_VERSION_NUMBER, true)) {        prefs.edit().putBoolean(""firstRun-"" + MAJOR_VERSION_NUMBER, false).commit();        firstRunVersionDialog();    }    // Check if this is the first run of the app    if (prefs.getBoolean(""firstRun"", true)) {        prefs.edit().putBoolean(""firstRun"", false).commit();        firstRunDialog();    }    Log.i(LOG_TAG, ""First run checks done"");            // OnClickListener s for the buttons omitted to save space</code></pre><p>EDIT 2: I've been digging through Android source code tracking down where the exception is coming from. This is lines 456 and 457 of <code>sendMessageAtTime</code> in <code>Handler</code>:</p><pre><code>msg.target = this;sent = queue.enqueueMessage(msg, uptimeMillis);</code></pre><p>And this is <code>enqueueMessage</code> from <code>MessageQueue</code>:</p><pre><code>    final boolean enqueueMessage(Message msg, long when) {        if (msg.when != 0) {            throw new AndroidRuntimeException(msg                    + "" This message is already in use."");        }        if (msg.target == null &amp;&amp; !mQuitAllowed) {            throw new RuntimeException(""Main thread not allowed to quit"");        }        synchronized (this) {            if (mQuiting) {                RuntimeException e = new RuntimeException(                    msg.target + "" sending message to a Handler on a dead thread"");                Log.w(""MessageQueue"", e.getMessage(), e);                return false;            } else if (msg.target == null) {                mQuiting = true;            }            msg.when = when;            //Log.d(""MessageQueue"", ""Enqueing: "" + msg);            Message p = mMessages;            if (p == null || when == 0 || when &lt; p.when) {                msg.next = p;                mMessages = msg;                this.notify();            } else {                Message prev = null;                while (p != null &amp;&amp; p.when &lt;= when) {                    prev = p;                    p = p.next;                }                msg.next = prev.next;                prev.next = msg;                this.notify();            }        }        return true;    }</code></pre><p>I'm a little confused about what <code>mQuiting</code> is, but it looks like the previous time <code>enqueueMessage</code> was called <code>msg.target</code> was null.</p>","118391","","118391","","2010-11-30 22:26:22","2014-02-07 03:36:16","onPostExecute not being called in AsyncTask (Handler runtime exception)","<android><android-asynctask><alarmmanager>","5","6","7","",""
"4280398","1","","","2010-11-25 19:43:39","10","7764","<p>Whenever I try to add a 9-patch image to \drawable folder in my project, I get the same error:</p><p><strong>ERROR: 9-patch image C:...\res\drawable\appwidget.9.png malformed.Frame pixels must be either solid or transparent (not intermediate alphas).Found at pixel #3 along top edge.Failure processing PNG image C:...\res\drawable\appwidget.9.png</strong></p><p>The weird thing in this example is that I've got this image from the ""android-g1-icon"" images found in the sdk resources, so it is supposed to be ok. The same happened with any 9-patch image I've tried so far. What could be wrong?</p>","461084","","","","","2013-11-18 05:02:21","9-patch image error in Android","<android>","4","1","3","",""
"4280408","1","4280486","","2010-11-25 19:45:26","0","399","<p>i'm still porting a J2ME app to Android and now my problem is with the GUI.For what i've seen, Android's Activities are great, but my J2ME is filled with the classic:</p><pre><code>public void switchDisplayable(Alert alert, Displayable nextDisplayable) {        Display display = getDisplay();        if (alert == null)            display.setCurrent(nextDisplayable);        else             display.setCurrent(alert, nextDisplayable);}</code></pre><p>I just can't make every Displayable to an Activity, so i thought about replacing them with View. I tried that but it just doesn't works, the app doesn't changes the screen.</p><p>Update:</p><p>Thanks for answering, but placed al vews inside FrameLayout and still nothing. This is the core of my test code, so you can check it out:</p><pre><code>public class TestActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                setContentView(R.layout.main);        TextView t = (TextView)findViewById(R.id.text); // Shows ""Hi""        showDialog(); // it just shows a dialog asking if the user wants to change screen    }    showDialog() {        // in OnClick()... i do the following, and here is where it fails, i tried so far:                TestView testv= new MarcoLoco(MFActivity.this);    setContentView(testv);        testv.invalidate();    testv.requestFocus();    testv.showMeSomething();    }public class TestView extends View{    private Context context;    TextView tv;        public TestView(Context context) {        super(context);        this.context=context;    }       public void showMeSomething() {        tv = (TextView)findViewById(R.id.tessto); // it should show ""Bye""    }}</code></pre><p>After the OnClick the ""Hi"" dissapears from the screen but nothing appears, no ""Bye"".</p><p>Why, oh, why!?</p>","495904","","495904","","2010-11-25 21:04:58","2010-11-28 05:54:00","SwitchDisplayable a la Android","<java><android><java-me>","3","0","","",""
"4280411","1","4440529","","2010-11-25 19:45:37","1","148","<p>Let if web page is bound to WebView, then is it possible to capturethe data that user is entering in the data fields of the web page?</p><p>In other words my activity need to intercept and interpret what is happening inwebview.... Is it possible?</p>","512025","","1471203","","2013-01-09 11:20:00","2013-01-09 11:20:00","Intercepting WebView","<java><android><android-layout>","2","0","","",""
"4280457","1","4280518","","2010-11-25 19:55:10","1","513","<p>hello i would like to present a different menu in my activity depending on some condition. i tried like this.</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu){    MenuInflater inflater = getMenuInflater();    if (specialMode)    {        inflater.inflate(R.menu.menuA, menu);    }    else    {        inflater.inflate(R.menu.menuB, menu);    }    return true;}</code></pre><p>however, i always get the same menu, no matter what the value of specialMode is.</p>","97688","","","","","2010-11-25 20:06:57","android: different menu depending on situation","<android><menu>","1","2","1","",""
"4280507","1","4493294","","2010-11-25 20:05:21","10","8688","<p>I am unable to run my signed, release keystore in Eclipse:</p><p>I get the error:</p><pre><code>Keystore was tampered with, or password was incorrect</code></pre><p>How can I resolve this?</p><p>Here is the error:<img src=""http://i.stack.imgur.com/KO0NX.png"" alt=""alt text""></p><p>Here is me successfully signing the keystore:<img src=""http://i.stack.imgur.com/IYRVj.png"" alt=""alt text""></p>","19875","","19875","","2010-11-26 17:06:47","2013-05-16 17:47:35","Problem running my signed, release keystore in Eclipse","<java><android><eclipse><keystore><keytool>","5","1","1","",""
"4280543","1","","","2010-11-25 20:10:21","0","664","<p>I have created an html page for login containing fields for username and password on top left corner of page. I want then when this page is viewed in Android emulator browser, only the top left part of my original page should be filling the entire page. How should I do this? How to make a webpage compatible to mobile browser. </p>","417266","","1269037","","2012-11-20 12:09:33","2012-11-20 12:09:33","How can I resize a form in my HTML to fill the screen of a mobile device?","<android><html><responsive-design>","2","0","","",""
"4280608","1","4283864","","2010-11-25 20:21:19","1","2606","<p>Is there a simple way to disable a user interacting with an activity.To be done when there is an action running (and a spinning progress bar in the title bar)</p><p>EDIT: As it seems I was not clear enough I meant to say: while I already have a spinning progress bar, the user is still able to push any button on the activity, I want to disable the user from being able to do that while the task is running. I do not want to however disable each item on the screen one by one.</p><p>Thanks, Jason</p>","407133","","407133","","2010-11-25 21:53:14","2013-12-06 00:41:24","Disable a whole activity from user action","<android>","5","2","1","",""
"4280611","1","4280705","","2010-11-25 20:21:58","4","3349","<p>I have built an expert system in <a href=""http://en.wikipedia.org/wiki/Prolog"" rel=""nofollow"">Prolog</a>. Is there a way I can incorporate the Prolog code into my Android application so that the application takes arguments passes them to the Prolog expert system, and the expert system returns the answer to the Android application?</p>","434885","","63550","","2011-01-20 22:07:38","2013-03-29 14:57:53","Android and Prolog","<android><prolog>","4","0","3","",""
"4280767","1","","","2010-11-25 20:50:53","1","2932","<p>I need to develop an application that communicates with the server. I am not new to Android, but I have never developed a program that uses server/client communication. </p><p>Basically, I am planning to store my databse in the server and this server takes query from the client and then returns the result back. How can I send query from client to server ? How can I take the resulting data bacik in client ?</p><p>I do not know what kind of connection/protocol should I use. Can you suggest me any book ? Or if there is someone who is experienced in this subject, can give me advice ? What should be my starting point ?</p><p>Thank you all. </p>","520628","","","","","2010-11-25 21:00:58","How to construct communication between server and client for Android Application that uses Database","<java><android><web-services><network-programming>","1","0","0","",""
"4280780","1","4281720","","2010-11-25 20:53:38","0","1688","<p>I have the below code in my getView. It populates an imageview with an image and it works but not without problems. Problem being that I don't see the image until I click something on the screen. Also if I have more than one image in the listview clicking something on screen will make the images shift around. </p><pre><code>                    class Thumbnailer extends AsyncTask&lt;String, Void, Bitmap&gt; {                        @Override                        protected void onPostExecute(Bitmap result) {                            image_main.setImageBitmap(result);                            image_main.setVisibility(View.VISIBLE);                            image_table.setVisibility(View.VISIBLE);                        }                        @Override                         protected void onProgressUpdate(Void... progress) {                         }                        @Override                        protected Bitmap doInBackground(String... params) {                             BitmapFactory.Options o = new BitmapFactory.Options();                             o.inJustDecodeBounds = true;                             BitmapFactory.decodeFile(params[0], o);                             final int REQUIRED_SIZE=70;                             //Find the correct scale value. It should be the power of 2.                             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++;                             }                             //Decode with inSampleSize                             BitmapFactory.Options o2 = new BitmapFactory.Options();                             o2.inSampleSize=scale;                                                               return BitmapFactory.decodeFile(params[0], o2);                        }                    }                     new Thumbnailer().execute(image);</code></pre>","427377","","","","","2010-11-26 00:18:59","Android AsyncTask Listview problem","<android><listview>","3","2","","",""
"4280785","1","4648479","","2010-11-25 20:54:15","0","1518","<p>I'm working on an app that needs to provide a Bluetooth ServerSocket to some other device.The device I have to work with establishes the connection ignoring the uuid and only looking for devices with correct Service Name.</p><p>I open the BluetoothServerSocket with the following command:</p><pre><code>UUID uuid = UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB"");tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(""PWAccesP"", uuid);</code></pre><p>My problem is, that the ServiceName is not published by the Android SDP. When I query the available services using sdptool, I get the following output:</p><pre><code>...Service RecHandle: 0x10008Service Class ID List:  UUID 128: 00001101-0000-1000-8000-00805F9B34FBProtocol Descriptor List:  ""L2CAP"" (0x0100)  ""RFCOMM"" (0x0003)Channel: 6</code></pre><p>So the Service is available, but the service name is not listed and so my device can't connect.</p><p>I'm working with an HTC Wildfire with Android 2.1.  </p><p><strong>My question now is, is this a problem of the HTC Bluetooth stack, is it a problem of the Wildfire or is it a problem of Android 2.1?</strong></p><p>Unfortunately I have no other phones available to check so I ask the community to help me out here... Has anybody encountered this before or knows how to get the Service name to show up?</p><p>Btw:I was able to verify that the BluetoothSocketServer connects using a different device that connects by uuid rather than by service name.</p><p>Thanks and regards,Michael</p>","520046","","","","","2011-11-20 04:51:52","Bluetooth Service Name not shown by HTC Wildfire","<android><bluetooth>","4","0","","",""
"4281091","1","4281154","","2010-11-25 21:51:53","0","1288","<p>I'm trying to put a admob ad at the top of my app but the normal text needs to stay centered in the middle... with the below code only one of the components are displayed..</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/test.testpkg""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:layout_gravity=""center"" android:gravity=""center""android:background=""@drawable/background""android:padding = ""10dip""&gt; &lt;com.admob.android.ads.AdView android:id=""@+id/ad""  android:gravity=""center"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" myapp:backgroundColor=""#000000"" myapp:primaryTextColor=""#FFFFFF"" myapp:secondaryTextColor=""#CCCCCC""   /&gt;&lt;test.testpkg.CustomTextView android:id=""@+id/landscapeText""android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:textColor = ""#000""android:textSize=""40sp""android:shadowColor=""#FFF""android:shadowDx=""1.2""android:shadowDy=""1.2""android:shadowRadius=""1.2""android:gravity=""center_vertical""android:text =""Test""/&gt;</code></pre><p></p>","440212","","440212","","2010-11-25 22:05:09","2010-11-25 22:05:56","android xml put component on top with layout_gravity=""center""","<android><xml>","1","0","","",""
"4281095","1","4332545","","2010-11-25 21:52:41","1","1266","<p>I have a samsung galaxy s and i have made an application that make a list of sensor in the phone.That program show me many sensor, but my question is on two of them:MS-3C Magnetic sensor -->type:2MS-3C Orientation sensor -->type:3</p><p>why it say that they are two different sensor?in the sheet of yamaha <a href=""http://www.yamaha.co.jp/english/product/lsi/magnetic_sensor/"" rel=""nofollow"">http://www.yamaha.co.jp/english/product/lsi/magnetic_sensor/</a> it seems to be a single sensor.Why android report it as two different sensor?it use the same chip to give me two type of data?</p><p>Sorry for my english</p>","520235","","332922","","2011-07-06 20:41:21","2013-06-16 09:23:46","yamaha MS-3C sensor on samsung galaxy","<android><sensor><galaxy>","1","0","2","",""
"4281125","1","","","2010-11-25 22:00:01","5","2318","<p>Try the following:</p><ol><li><p>Create a HelloWorld application.  </p></li><li><p>Add a Log statement to the end of onCreate:</p></li></ol>  <pre>    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Log.d(""HelloWorldActivity.onCreate()"", ""setContentView() completed"");    }  </pre><ol><li><p>Place a breakpoint on the Log statement.</p></li><li><p>Run the app in the emulator and note it works and step to see the Logged entry in the LogCat window of Eclipse.  </p></li><li><p>Change the HelloWorldActivity to extend from ListActivity instead of Activity.</p><pre>public class HelloWorldActivity extends ListActivity {</pre></li><li>Run the app in the emulator again and note it fails to reach the Log statement.  </li></ol><p>My question is NOT why this fails.  My question is, how would you go about debugging this failure?  All I see in the Eclipse Debug pane is a RuntimeException.  I see LogCat has a bunch of messages, but it's huge and I've searched it but can't find anything to indicate what's wrong or where in my code the exception happened.  I can't find a way to display the message inside the RuntimeException or a stack trace to know which line of code initiated the exception.  </p><p>I assume there must be better ways to use the tools to find errors, but I'm new and can't seem to figure out a better way to debug besides wrapping everything I code in a try/catch.  I would have expected to find a message in LogCat generated by the throwing of the exception.  I would have expected the Debug window to allow you to inspect the exception's contents.  I'm not saying that such techniques don't exist, I'm saying I'm having trouble figuring out as a beginner how to debug and asking what techniques do exist and how do I use them?  </p><p>So, simply put:</p><ul><li>How would you find this error if you didn't already know what was causing it?  </li><li>What techniques would you use to find out the root cause?  </li><li>How would you go about inspecting the Exception's details?  </li><li>Generally, how do you find problems in your Android code using Eclipse?  </li></ul><p>Multiple suggestions and discussion are welcomed.  :)</p><p>I would have included my LogCat contents, but it's so large that's not reasonable.  You should be able to easily reproduce this yourself, so I left it out.  It is possible something is in LogCat to help me, but because it's so large with even running a small program, I would need a hint as to what to search for and how to interpret it when hitting an exception thrown from an API call.  I see other posts that state something should be in LogCat, which while might be true, I'm not finding anything myself.  If you think something should be in LogCat, please run the test yourself and copy the lines into your response that I should be finding.  </p><p>Thanks.  </p><p>========</p><p>Summary techniques list so far is as follows:</p><p>Invasive Techniques:1. Place a Toast in code locations where you want to see you you've executed.2. Place try/catch around code where you think there's a possibility of an Exception being thrown. 3. Comment out code and recompile and retest.</p><p>Non-Invasive Techniques:1. Use the debugger. Breakpoints, variable inspection...2. Monkey stress tester.3. Download Android source library.4. Use LogCat filters to see if a ""Caused By"" is listed.</p><p>Unclear if Available:1. Debug version of Android library that has additional logging, assertions or other additional help. 2. Ability to inspect an Exception in Eclipse through the Debug pane or other techniques.3. A way to define a more global try/catch exception handler.4. Ability to debug through the Android library source code.</p><p>Not Available:1. A non-invasive way to view the contents of an Exception or where the Exception happened.</p>","405821","","405821","","2010-11-26 19:15:40","2010-11-29 12:54:43","How do you debug Android inEclipse","<android><eclipse><debugging><exception><logging>","4","3","1","",""
"4281182","1","4281200","","2010-11-25 22:11:29","0","4556","<p>I want to set image backgroung dynamically from javacode, the image is in Drawlable folder ?</p>","508377","","40347","","2010-11-25 22:23:31","2013-04-15 06:34:20","How to set image background from code in Android?","<android>","3","2","","",""
"4281201","1","4281263","","2010-11-25 22:15:01","0","1632","<p>Scenario:Have encrypted mp3 files in my .apk.  Need to decrypt and send to MediaPlayer object.</p><p>Problem:After I read the files and decrypt them, how do I get MediaPlayer to play them ?</p><p>Now.  MediaPlayer has 4 versions of setDataSource().</p><pre><code>setDataSource(String path)setDataSource(FileDescriptor fd)setDataSource(FileDescriptor fd, long offset, long length)setDataSource(Context context, Uri uri)</code></pre><p>None of which are ideal for the situation.  Guess ideal would be to give MediaPlayer an InputStream ?</p><p>Possible solutions:</p><ul><li>Write decrypted data to file playthat file.  A lot of IO overhead.</li><li>Create a dummy http server(ServerSocket ?) and pass the url toMediaPlayer.  Again, messy.  Am Ieven allowed to create a socket.</li></ul><p>Does anyone have a better solution ?</p>","466771","","466771","","2010-11-26 08:27:41","2010-11-26 08:27:41","Feeding data from memory to MediaPlayer","<android>","2","0","","",""
"4281247","1","4281678","","2010-11-25 22:24:03","0","1493","<p>Kindly provide me a sample code which will contain the following:</p><ol><li><code>ListView</code> in which each list items will have an image icon loaded from an url &amp; 2 textviews .The image is to be lazily loaded.</li><li>Pagination in Android where when the user scrolls vertically &amp; go to the 20th item , a progress dialog will be displayed &amp; in the background a call to the <code>webeservice</code> is made to fetch the next set of list items.</li></ol><p>I have implemented the Lazy loading part but unable to implement the pagination code.I got a suggestion to implement the EndlessWrapper class but I am unable to add the logic to the existing code for pagination.Kindly provide the sample code/logic on how to implement the <code>Pagination</code> on the existing Customised ListView.</p><p>Here is the ListView code:</p><pre><code>public class LazyListAdapter extends BaseAdapter implements Filterable,            OnClickListener {        int count = 0;        private Activity activity;        private String[] data;        private LayoutInflater inflater = null;        public ImageLoader imageLoader;        public LazyListAdapter(Activity a, String[] d) {            activity = a;            data = d;            inflater = (LayoutInflater) activity            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);            imageLoader = new ImageLoader(activity.getApplicationContext());        }        public int getCount() {            return data.length;        }        public Object getItem(int position) {            return position;        }        public long getItemId(int position) {            return position;        }        public class ViewHolder {            public TextView textTitle;            public ImageView image;            public ImageView addImage;        }        public View getView(final int position, View convertView,                ViewGroup parent) {            View vi = convertView;            ViewHolder holder;            if (vi == null) {                vi = inflater.inflate(R.layout.list_videos_content, null);                holder = new ViewHolder();                holder.image = (ImageView) vi.findViewById(R.id.iconLine);                holder.textTitle = (TextView) vi.findViewById(R.id.textLine);                holder.addImage = (ImageView) vi.findViewById(R.id.buttonLine);                vi.setTag(holder);            } else                holder = (ViewHolder) vi.getTag();            String textStr =tempVec.elementAt(1)            holder.textTitle.setText(textStr);            // Icons bound to the rows.            // Bind the data efficiently with the holder.            holder.image.setTag(data[position]);            holder.addImage.setImageResource(R.id.buttonLine);            imageLoader.DisplayImage(data[position], activity, holder.image);            return vi;        }    }    public Filter getFilter() {        // TODO Auto-generated method stub        return null;    }    public void onClick(View v) {        int i = v.getId();        // TODO Auto-generated method stub    }</code></pre>","443141","","387076","","2011-06-24 10:26:00","2011-08-23 05:39:00","Unable to add the Pagination code in Android to the existing Listview which handles lazy loading of images","<android>","1","0","","",""
"4281349","1","4282093","","2010-11-25 22:48:17","1","1084","<p>I'm trying to display a Admob ad but this only works in Landscape but not in normal mode.</p><p>layout-land/main.xml and layout/main.xml are the same! (well now they are because i deleted everything else to find the bug)</p><pre><code>    &lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""xmlns:myapp=""http://schemas.android.com/apk/res/test.testpkg""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/background""    android:padding = ""10dip""    &gt; &lt;com.admob.android.ads.AdView android:id=""@+id/ad""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" myapp:backgroundColor=""#000000"" myapp:primaryTextColor=""#FFFFFF"" myapp:secondaryTextColor=""#CCCCCC""   /&gt;&lt;/RelativeLayout&gt;</code></pre>","440212","","","","","2010-11-26 02:08:27","Android XML Layout works in landscape but not in normal orientation","<android><xml><landscape><admob>","1","6","","",""
"4281596","1","4281623","","2010-11-25 23:48:32","-1","532","<p>First time it worked great.  But after modifying to use resource files I don't get ""Hello Android"", I get a pretty picture of a phone image with ""No service"", calm water image, with padlock and speaker image and ""charging 50%"" etc..</p><p>Using Eclipse on Windows Vista.  Tried closing Eclipse, restarting and creating a new project with original ""non-resource file"" sample but still same pretty picture instead of ""Hello Android"".</p><p>I am a Seasoned Microsoft C#.net developer.  Very impressed by <a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/hello-world.html</a>and Eclipse + SDK, etc was really easy to install and will maybe come over to the ""Light Side"" if I can get this working!!!!!!!Cheers.  Ewan.</p>","520737","","","","","2011-07-25 12:22:51","Complete newbie - tutorial - http://developer.android.com/resources/tutorials/hello-world.html","<android>","1","1","","",""
"4281700","1","5365058","","2010-11-26 00:14:13","0","510","<p>In Android 2.1 this</p><pre><code>JSONObject o = new JSONObject();o.put(""MyDate"", ""/Date(1289334937639)/"");Log.d(TAG, o.toString());</code></pre><p>produces</p><pre><code>{""MyDate"":""/Date(1289334937639)/""}</code></pre><p>but in 2.2 it produces</p><pre><code>{""MyDate"":""\/Date(1289334937639)\/""}</code></pre><p>I am talking to a .Net web service so the 2.2 version works correctly for me.  How do I make 2.1 produce the same thing without breaking 2.2?</p><p>Thanks for your help.</p>","447690","","447690","","2010-12-17 02:59:45","2011-03-19 21:35:59","JSONObject.toString() gives different result in 2.2 than in 2.1 (.Net Date format)","<android><json><serialization><android-2.2-froyo><android-2.1-eclair>","2","0","","",""
"4281749","1","4281770","","2010-11-26 00:24:03","25","23900","<p>I want to add a ""search"" icon to appear inside an <code>EditText</code> in the left edge? such as search box in Facebook Android app?</p>","508377","","1058406","","2013-11-08 07:14:36","2013-11-08 07:14:36","How to add icon inside EditText view in Android ?","<android>","4","0","12","",""
"4281838","1","4488987","","2010-11-26 00:50:45","18","14080","<p>I want to turn off displaying ""Suggested Words"" on the soft/virtual keyboard when someone is using my application (only on certain <code>Activities</code>). For the default Android keyboard, this can be found under 'Settings' (under Word Suggestion Settings).</p><p>Is there a way to disable it only within your application, without requiring the user to manually go and do it? I basically want the user to type words without providing any hints.</p><p>Thanks!</p>","478230","","","","","2014-02-10 06:47:50","How to disable displaying ""suggestions"" on the Soft Keyboard","<android>","6","1","2","",""
"4281850","1","4286136","","2010-11-26 00:53:22","0","575","<p>i subclass the ItemizedOverlay to draw a custom graphics for my items, the problem is that i have the MapView and my custom overlay with a List items... when i construct the items, populate and draw in the ""map mode"" (setSatellite(false)) works good, but when i change the mode to setSatellite(true) my custom overlay holds all the items but not refresh, invalidate, redraw the map, i try invoking all those methods and nothing. i also try, claring the overlays and adding a new one (pretty bad) and nothing. Anyone knows what happens with the custom overlay when i change set setSatellite true or false?</p><p>thanks in advance.</p>","519515","","","","","2010-11-26 14:33:42","Problem drawing into an ItemizedOverlay MapView on Satellite mode","<android><google-maps><android-mapview><itemizedoverlay>","1","0","","",""
"4281873","1","5118072","","2010-11-26 01:00:13","0","367","<p>I see the sample codes and walkthroughs on how to register your application, get the pin/uid and retrieve the access token and use it in the OnNewIntent method.</p><p>How can I do this OAuth authentication for a widget instead of an application?</p>","494659","","","","","2011-02-25 13:58:10","Widget for retrieving the timeline of a user with Twitter4j, OAuth on Android","<android><oauth><widget><twitter4j>","1","0","","",""
"4281893","1","4282078","","2010-11-26 01:06:42","0","247","<p>I am trying to use Roboguice in my app, but no matter how i try to add the jars they don't seem to be added to the apk doesn't include the roboguice/guice jars.  What do I do?  using eclipse 3.5 and adt .9.9</p>","22763","","136445","","2011-02-03 18:18:15","2011-02-03 18:18:15","Eclipse and Android application development","<android><eclipse><guice><roboguice>","1","0","","",""
"4282001","1","4282604","","2010-11-26 01:39:48","3","14661","<p>someone can tell me how to update a control Textview Android from a function? I have searched deep into the internet and see many people who ask the same question, I tested threads but could not work, someone has a simple working example of doing this? for example to call a function (which runs several times in a loop) and the function writes in the TextView, but the problem is that until the function is not finished running, it shows me the text.</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    while(condition) //here freezes the UI and the text in textview only shows when the loop ends    {        HardWork();      }}public void HardWork() {      txtProgreso.append(""Test Line"" + ""\n\n"");};</code></pre><p>Thanks in advance.</p>","518657","","518657","","2010-11-26 02:53:23","2010-11-30 13:37:15","Update Textview from function Android","<java><android><multithreading><eclipse><textview>","3","3","1","",""
"4282214","1","4288382","","2010-11-26 02:47:53","8","12928","<p>I don't understand why this piece of code is not working. Only backspace and return key are detected. Listener doesn't fire for any other key. My device is Nexus One.</p><p>I tried to override activity's OnKeyDown method and that's even worse. The only detected button was hardware back button. </p><p>I am seeing around a suggestion to use TextWatcher and onTextChanged, while that might work in some cases, it's not a real work around. For example, if textbox is empty, you won't detect if user press BackSpace(Delete) button.So any ideas? </p><pre><code>        TextView txtInput = (TextView)findViewById(R.id.txtInput);    txtInput.setOnKeyListener(new View.OnKeyListener() {        @Override        public boolean onKey(View v, int keyCode, KeyEvent event) {            makeToast(keyCode + "" key pressed"");            return true;        }    });</code></pre>","507153","","124946","","2012-11-03 15:58:35","2013-02-07 13:32:28","onKeyListener not working on virtual keyboard","<android><onkeypress><onkeydown><virtual-keyboard>","4","3","2","",""
"4282216","1","4282226","","2010-11-26 02:49:28","0","267","<p>I have an app with a layout using the following view objects.  2 spinners, 2 buttons, 1 seekbar and a custom view object that is basically a canvas I draw to.</p><p>For some reason the spinners and seekbar are drawn on top of the canvas, but the 2 buttons are not.  I'm confused as to why this is.</p><p>So, how is this ordered determined?</p><p>Thanks.</p><p>Edit: XML at request (this is before I moved the customview to the top which fixes the problem).  If the order is supposed to be XML based then the custom view should have covered the spinners which it did not.</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;Spinner        android:id=""@+id/cc_component""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_centerHorizontal=""true""        android:drawSelectorOnTop=""true""        android:prompt=""@string/cc_component_spinner"" /&gt;    &lt;TextView        android:id=""@+id/desc""        android:text=""@string/step1_desc""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_margin=""10dip""        android:visibility=""gone""        android:layout_centerHorizontal=""true""        android:textSize=""25sp""/&gt;    &lt;Button        android:id=""@+id/switch_left""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:layout_centerVertical=""true""/&gt;    &lt;com.cmllc.zcc.CCView        android:id=""@+id/cc""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;    &lt;Button        android:id=""@+id/switch_right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentRight=""true""        android:layout_centerVertical=""true""        android:background=""@drawable/rightarrow1"" /&gt;     &lt;Spinner        android:id=""@+id/component_color""        android:layout_above=""@+id/switch_color""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_centerHorizontal=""true""        android:drawSelectorOnTop=""true""        android:prompt=""@string/component_color_spinner"" /&gt;    &lt;SeekBar        android:id=""@+id/switch_color""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_centerHorizontal=""true""        android:max=""100""        android:minWidth=""200dip""        android:progress=""50""/&gt;&lt;/RelativeLayout&gt;</code></pre>","432209","","432209","","2010-11-26 03:04:20","2010-11-26 23:15:23","What controls the order of view's appearing on the screen on the UI?","<java><android><view>","2","1","","",""
"4282222","1","4282611","","2010-11-26 02:50:38","1","374","<p>I want to send a treemap between two activities,how can i do this?</p>","275674","","","","","2010-11-26 04:52:56","passing data between activities","<java><android>","1","1","1","",""
"4282410","1","4293523","","2010-11-26 03:47:57","0","81","<p>I have written a custom View which is used to display a tileable pattern, and want the user to be able to zoom in (which I've got covered) and then move around within the pattern.</p><p>Because the pattern is tileable it means that there are effectively no bounds on it.  In theory a user could just keep scrolling left (right, up, or down) forever. In reality I would be using a modulus to adjust the virtual position.</p><p>I'm just not sure where to start. Would I use something with scrollbars? I'm not sure that makes any sense, because as I said the viewable area is effectively infinite.</p><p>Thanks for any suggestions!</p>","519654","","","","","2010-11-27 19:40:26","How to ""scroll"" a view of indeterminate size?","<android><view><scrolling>","2","0","","",""
"4282466","1","4282723","","2010-11-26 04:07:05","0","548","<p>Hello Guys can you help me for creating a TextView in title  bar so that if we type 'a' in that TextView than all entries in the ListView starting with 'a' only will get displayed.</p><p>The TextView will be something of type filterBox in Contact list.</p><p>Thanks in advance.</p>","395661","","","","","2010-11-26 05:25:53","How to create dialer style filter box in android custom title bar?","<android>","1","0","1","",""
"4282506","1","","","2010-11-26 04:21:00","1","223","<p>In my android application i would like to have bitrate shifting between 2G and 3G.i have found connectivity_Action method in  connectivity manager to know if the connection is changed.Please let me know if this event will be called whenever there is a change or do we have to set any timer for the check. </p><p>Please let me know its ussage and any other better way to do this bitrate shifting.</p><p>Please forward your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2010-11-26 09:53:54","2G,3G,bitrate shifting in android","<android>","1","0","","",""
"4282535","1","","","2010-11-26 04:29:21","0","444","<p>I am writing an app for android that requires tabs and I have the content from my list rolling over my tabs.  I know it must be something simple, but I cannot find it.  </p><p>Here is my main.xml</p><p></p><pre><code>&lt;TabWidget android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:id=""@android:id/tabs"" /&gt;&lt;FrameLayout android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:id=""@android:id/tabcontent""&gt;&lt;/FrameLayout&gt;</code></pre><p></p><p>and here is the java code</p><p>public class Again extends TabActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    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, Download.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""download"")            .setIndicator("""", res.getDrawable(R.drawable.ok))            .setContent(intent);    tabHost.addTab(spec);    // Do the same for the other tabs    intent = new Intent().setClass(this, Settings.class);    spec = tabHost.newTabSpec(""settings"")            .setIndicator("""", res.getDrawable(R.drawable.ok))            .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTab(0);}</code></pre><p>}</p><p>Any help would be greatly appreciated.  </p><p>Jason</p>","520895","","","","","2011-07-16 10:22:27","Android: Content rolling over tabs","<android><android-tabhost>","1","1","","",""
"4282552","1","4289411","","2010-11-26 04:35:29","48","56387","<p>Now I am totally confused by this error message: <strong>Android library projects cannot be launched.</strong> </p><p>I carefully checked the build path and library, everything is ""OK"". And there is no error in Problems view. However, when I tried to run my application as an Android project, it failed and showed this message.</p><p>Please tell me what the problem is?</p>","482604","","656600","","2013-09-07 10:41:36","2014-01-28 05:24:04","""Android library projects cannot be launched""?","<android>","7","0","11","",""
"4282629","1","","","2010-11-26 04:57:18","1","1234","<p>Hi I am new to Android programming and Java.  I have been searching for a good answer to this question for days.  I have copied and pasted and tried my best to understand the code.  I have a strong programming background in many different non OOP languages so I am super newish at Java.  Anyways I was wondering if anyone can show me the absolute easiest way (somehow less than 50 lines of code?) to pull objects from an XML file that are laid out like so:<pre><code>&lt; CDs >&lt; CD >&lt; artist >Michael Jackson&lt; /artist >&lt; album >Bad&lt; /album >&lt; tracks >11&lt; /tracks >&lt; /CD >...&lt; /CDs ></pre></code></p><p>Than have Java in Android display CD0, click next button in Activity which then increments to the next CD and displays it in the same fashion.  This XML file is compiled statically into the Android Project.  I am using SDK 2.1-update1 and Eclipse.Thanks in advance for the help, I swear I have been trying to read through my two Java books, the Google Android website, and search Google for a good example of how to do this.  I saw the SAX and XPP methods but I don't clearly understand them.</p>","520925","","494543","","2010-11-26 05:05:11","2010-11-26 05:23:46","Android to pull objects from XML and loop through each?","<android><xml><object>","2","0","","",""
"4282696","1","","","2010-11-26 05:17:10","0","104","<p>I write a program which records video using MediaRecorder. When I press the home button and lauch app from the menu on long press home button camera is not responding, a black screen is shown.Can anybody help me to fix the issue?</p><hr><blockquote>  <p>11-26 11:37:06.779: INFO/DEBUG_TAG(346): onPause executes ...<br>  11-26 11:37:06.819: INFO/WindowManager(75): Setting rotation to 0, animFlags=0<br>  11-26 11:37:06.829: INFO/WindowManager(75): Config changed: { scale=1.0 imsi=0/0 loc=en_US touch=3 keys=1/1/2 nav=3 orien=1 layout=18}<br>  11-26 11:37:07.209: DEBUG/StatusBar(75): updateResources<br>  11-26 11:37:07.219: INFO/DEBUG_TAG(346): surfaceDestroyed executes ...<br>  11-26 11:37:08.139: INFO/DEBUG_TAG(346): onStop executes ...<br>  11-26 11:37:08.139: INFO/OMXVenc(51): send_command::690 attempt to move to new state 2<br>  11-26 11:37:08.139: INFO/OMXVenc(51): process_state_change::2452 Req to Move to Idle: Call venc_stop<br>  11-26 11:37:08.149: INFO/OMXVenc(51): process_DL_status::2610 got DL status for VENC_CMD_STOP<br>  11-26 11:37:08.149: INFO/OMXVenc(51): process_DL_status::2681 encoder already moves to idle state. call event handler now<br>  11-26 11:37:08.159: INFO/OMXVenc(51): send_command::690 attempt to move to new state 1<br>  11-26 11:37:08.169: DEBUG/CameraService(51): stopRecording (pid 51)<br>  11-26 11:37:09.149: WARN/AudioFlinger(51): AudioRecordThread: buffer overflow<br>  11-26 11:37:10.299: INFO/ActivityManager(75): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10100000 cmp=com.motivity.videorecording/.login }<br>  11-26 11:37:10.649: DEBUG/dalvikvm(75): GC freed 6246 objects / 305240 bytes in 304ms<br>  11-26 11:37:10.659: INFO/WindowManager(75): Setting rotation to 1, animFlags=0<br>  11-26 11:37:10.669: INFO/WindowManager(75): Config changed: { scale=1.0 imsi=0/0 loc=en_US touch=3 keys=1/1/2 nav=3 orien=2 layout=18}<br>  11-26 11:37:10.669: INFO/ARMAssembler(75): generated scanline__00000077:03010104_00000504_00000000 [ 18 ipp] (37 ins) at [0x278350:0x2783e4] in 305175 ns<br>  11-26 11:37:10.699: WARN/WindowManager(75): performLayoutAndPlaceSurfacesLocked called while in layout<br>  11-26 11:37:10.869: DEBUG/StatusBar(75): updateResources<br>  11-26 11:37:13.069: DEBUG/dalvikvm(75): GC freed 908 objects / 39000 bytes in 204ms<br>  11-26 11:37:13.569: DEBUG/NetworkLocationProvider(75): onCellLocationChanged [131,31183]<br>  11-26 11:37:20.340: WARN/ActivityManager(75): Launch timeout has expired, giving up wake lock!<br>  11-26 11:37:20.861: WARN/ActivityManager(75): Activity idle timeout for HistoryRecord{43324650 com.motivity.videorecording/.VideoRecording}  </p></blockquote>","520944","","1108213","","2012-03-07 13:54:20","2012-03-07 13:54:20","videorecording issue","<android>","1","0","","",""
"4282809","1","4282832","","2010-11-26 05:48:02","0","149","<p>i want to develop same game on different platforms like android,webos,iphone(ios)</p><p>i heared we can port native code on this platforms.i am using windows.is there any chance for </p><p>me develop game in windows and port that into above platforms.</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","44729","","2010-11-26 07:54:21","2010-11-26 07:54:21","opengl game programme","<iphone><android><windows><opengl-es>","3","0","","",""
"4282811","1","","","2010-11-26 05:48:06","0","216","<p>HI Friends,</p><p>I implemented facebook connect in android using facebook-android-sdk. Most of the times I am getting error while i am publishing.</p><p>Less number of times publish is working fine.</p><p>Publish story window is opening good with What's on your mind text box. When i am clicking on the publish button in the Publish story window, i am getting error.</p><p>The error is  constantly changing when i coming(clicking ) to next time.</p><p>some of the the  errors i have been seen in my application when i am clicking in the publish button are.</p><p>Error Examples:<br>1.An error occurred with Holyplanets Connect.please try again later</p><p>2.An error occurred with WordpressBlog Connect.please try again later</p><p>3.An Error occurred with UFOS ON EARTH. Please try agian later</p><p>How can i fix this error? If anybody knows please let me know.</p><p>Thanks and Regards,</p><p>Kiran </p>","416143","","491044","","2011-03-10 15:15:54","2011-03-10 15:15:54","Facebook Publish Error In Android Application","<android>","1","0","","",""
"4282833","1","","","2010-11-26 05:52:10","1","147","<p>I am getting the following error while building using ant:-</p><p>BUILD FAILEDH:\USE\android-sdk-windows\tools\ant\ant_rules_r3.xml:361: The following erroroccurred while executing this line:H:\USE\android-sdk-windows\tools\ant\ant_rules_r3.xml:174: apply returned: 255</p>","515791","","","","","2010-11-26 05:52:10","getting error while building the project","<android>","0","0","","",""
"4282870","1","4283060","","2010-11-26 06:00:34","0","895","<p>i have a picasa app installed on my emulator,i just want to launch that picasa app from my application...</p><p>please any one give the code to launch picasa..</p>","505580","","","","","2010-12-02 09:38:52","how to launch picasa from my app(android)","<android><android-intent>","2","3","","",""
"4282874","1","4282918","","2010-11-26 06:01:34","0","317","<p>HiIn my android application i am using videoview.I would like to start a timer and stop the player after 30 minutes.I tried using the below code but the alert is displaying before the time is reached.</p><pre><code>  public final void timerAlert() {    Handler handler = new Handler();    handler.postDelayed(new Runnable() {        public void run() {            mVideoView.pause();            Alerts.ShowAlert(""Cannot play"",                    ""Subscribed time has been completed"", context);        }    }, realtime);</code></pre><p>Where realtime is the time after which i want the dialogue to be executed.</p><p>And am calling this in onprepared listener of player.</p><p>Please let me know if i require to change anything.</p><p>Please forward your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","302328","","2010-11-26 06:05:26","2010-11-26 06:12:21","stop player once time reached","<android><videoview>","1","0","","",""
"4282912","1","4406133","","2010-11-26 06:10:28","1","1139","<p>i want loading images for net. I display data along with Image Gallery... In gallery i am displaying imageView as an gallery Item. I just want to display an activity Indicator in ma gallery until the actual image loaded and then displayed. Functionality is used in iphone. Activity indicator look like this...</p><p><a href=""http://getsetgames.com/wp-content/uploads/2009/12/ActivityIndicator.gif"" rel=""nofollow""> Activity Indicator</a></p><p>How i can do this?</p>","486139","","","","","2010-12-10 05:58:01","How to display Activity Indicator instead Gallery Image?","<android><android-widget><android-layout>","2","0","1","",""
"4282926","1","4283073","","2010-11-26 06:14:35","0","3000","<p>Although all mobile OS are good but still there must be a comparison based on different area, so i want to know the difference between these operating system.</p>","332258","","","","","2010-11-26 06:46:32","Which one is better in which area Symbian, android and bada?","<android><symbian><mobile-phones><bada>","1","1","","",""
"4282968","1","4283023","","2010-11-26 06:25:29","1","719","<p>I am pretty much new to Android application. I have a question to ask. My XML file looks like below</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/myTableLayout"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TableRow&gt;        &lt;TextView            android:layout_column=""0""            android:text=""Name""            android:padding=""0px"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;       &lt;EditText            android:layout_column=""0""            android:id=""@+id/name""            android:layout_width=""250px""            android:layout_height=""wrap_content""            /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>Is there a way i can assign values to EditText using java code and then display it. Basically all i want to do is to get value from database and display it. Any help is appreciated.</p>","396543","","","","","2010-11-26 06:35:32","Display values from database","<android>","1","0","","",""
"4282969","1","","","2010-11-26 06:25:29","0","489","<p>In my application i have a tabView , with 5 tab buttons. I need a custom title bar for all the views in myapplication .Is it possible to have common titlebar for all of my views</p>","414777","","491044","","2011-03-11 12:55:32","2011-04-22 05:54:49","Android : Custom titleBar for complete Application in android?","<android><titlebar>","1","0","1","",""
"4282975","1","","","2010-11-26 06:26:31","3","1457","<p>I have to embed a clickable text in a paragraph text, clickablespan can do it. But instead of using the default focus/press/unfocus style, can I change those style ?  Like when focus, the background color is blue, text color is white, when unfocus, the background color is white, text color is blue.</p>","441316","","","","","2012-04-11 01:39:21","can I change the look and feel of the clickablespan","<android><coding-style><textview>","1","0","","",""
"4283009","1","4283135","","2010-11-26 06:33:07","0","2853","<p>How to add and retrieve arraylist of value in shared preference in android. Can you please give example for that.</p><p>Thanks</p>","426344","","597657","","2012-12-19 07:17:19","2012-12-19 07:17:19","How to add and retrieve arraylist of value in shared preference in android","<android>","1","0","1","",""
"4283012","1","","","2010-11-26 06:33:38","0","545","<p>If I leave my the application in background for about 12 hours, all the static variables are erased and the application goes nuts.</p><p>Why does this happen ?</p><p>What is the correct way to keep application level (scope) variables that are never destroyed until the application terminates ?</p><p>Thanks in advance,Afzal</p>","231849","","","","","2010-11-26 08:33:55","Why my android application's all static variables are destroyed when the app is in background for a long period of time?","<android><variables><static><background><scope>","3","0","","",""
"4283038","1","4283131","","2010-11-26 06:38:32","3","4652","<p>I am trying to implement a AlertDialog with a Webview inside.</p><pre><code>public OnClickListener imageButtonViewOnClickListener = new OnClickListener() {public void onClick(View v) {    LayoutInflater inflater = LayoutInflater.from(MyActivity.this);    // error here    View alertDialogView = inflater.inflate(R.layout.alert_dialog_layout, null);    WebView myWebView = (WebView) findViewById(R.id.DialogWebView);    myWebView.loadData(webContent, ""text/html"", ""utf-8"");    AlertDialog.Builder builder = new AlertDialog.Builder(MyActivity.this);    builder.setView(alertDialogView);    builder.setPositiveButton(""OK"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which) {            dialog.cancel();        }    }).show();}</code></pre><p>};</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:orientation=""vertical""&gt;&lt;webView android:id=""@+id/DialogWebView"" android:layout_height=""wrap_content""    android:layout_width=""fill_parent"" android:layout_marginLeft=""20dip""    android:layout_marginRight=""20dip"" android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;</code></pre><p> </p><p>However, I got an error at ""View alertDialogView = inflater.inflate(R.layout.dialog_layout, null);"" say ""android.view.InflateException: Binary XML file line #6: Error inflating class webView"" and ""11-26 17:15:47.934: ERROR/AndroidRuntime(4699): Caused by: java.lang.ClassNotFoundException: android.view.webView in loader dalvik.system.PathClassLoader@43457e60""</p><p>Can anyone knows whats happened? Does AlertDialog support WebView? Thank you for any advice in advance.</p><p>Cheers,Chris</p>","479927","","","","","2010-11-26 07:00:24","Does AlertDialog support WebView?","<android><webview><alertdialog>","1","1","","",""
"4283049","1","","","2010-11-26 06:40:45","4","3242","<p>Can I dump logs from an android phone over wifi (using tcp/ip) using adb? adb connect can be used, but it needs some server to be running on the phone (at 5555 port). How do I start this server? Or the only way to get logs from a phone is by connecting it as a USB device?</p>","235246","","","","","2011-06-14 12:45:38","adb logcat on a real phone using tcp/ip","<android><adb>","3","0","2","",""
"4283057","1","4283082","","2010-11-26 06:41:59","0","207","<p>is there any chance for take android project backups by running script file. rather every time copy and paste</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2010-11-26 06:48:22","android project backup","<android>","2","0","","",""
"4283062","1","4283532","","2010-11-26 06:43:07","18","14816","<p>I want to implement the <code>TextWatcher</code> interface for more than one <code>EditText</code> fields. Currently I am using :</p><pre><code>text1.addTextChangedListener(this);text2.addTextChangedListener(this);</code></pre><p>then overriding the methods in my Activity:</p><pre><code>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) { // do some operation on text of text1 field // do some operation on text of text2 field }</code></pre><p>However this is working fine but I'm looking for other ways so that I can explicitly identify that in which <code>EditText</code> field the <code>SoftKeyboard</code> is currently focused.</p>","457982","","779408","","2012-12-16 09:12:07","2013-12-24 15:29:40","TextWatcher for more than one EditText","<android><interface><activity><edittext><textwatcher>","5","0","13","",""
"4283075","1","4283120","","2010-11-26 06:46:47","0","488","<pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""&gt;&lt;soap:Body&gt;&lt;loginResponse xmlns=""https://comm1.get.com/""&gt;&lt;loginResult&gt;true&lt;/loginResult&gt;&lt;result&gt;success&lt;/result&gt;&lt;/loginResponse&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre><p>Is there a way to parse a string  which has xml data?</p><p>i want to get the result success</p>","450487","","","","","2010-11-26 06:58:00","Parse xml data which is stored as string","<android><string><xml-parsing>","2","0","","",""
"4283087","1","4283452","","2010-11-26 06:48:57","1","793","<p>I have a client server program to communicate the pc with an android phone using usb, based on <a href=""http://www.anothem.net/archives/2010/10/15/android-usb-connection-to-pc/"" rel=""nofollow"">http://www.anothem.net/archives/2010/10/15/android-usb-connection-to-pc/</a></p><p>Now I need to design a protocol that facilitates information exchange from the pc to the phone. How should I go about this ? Should we use XML for this? I was looking at google protocol buffer.. Is that the right direction ?</p><p>ThanksCaroline</p>","454711","","","","","2010-11-27 23:41:18","Protocol design","<android><xml><protocols><protocol-buffers>","2","3","1","",""
"4283090","1","4283505","","2010-11-26 06:50:08","3","2020","<p>What i am getting is a blank white screen in my emulator and the map doesn't display. Here is what is suppose to be displayed in a browser: <a href=""http://code.google.com/apis/maps/documentation/javascript/examples/layer-georss.html"" rel=""nofollow"">http://code.google.com/apis/maps/documentation/javascript/examples/layer-georss.html</a>   Here's the code for 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.apps.mylocations""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".MyLocations""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;/manifest&gt;</code></pre><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""        &gt;    &lt;WebView android:id=""@+id/web_engine""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""            /&gt;&lt;/LinearLayout&gt; package com.apps.mylocations;        import android.app.Activity;        import android.os.Bundle;        import android.webkit.WebView;        public class MyLocations extends Activity {            /** Called when the activity is first created. */            @Override            public void onCreate(Bundle savedInstanceState) {                super.onCreate(savedInstanceState);                setContentView(R.layout.main);                WebView engine = (WebView) findViewById(R.id.web_engine);                engine.getSettings().setJavaScriptEnabled(true);                String data = ""&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: KmlLayer GeoRSS&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;"" +         ""function initialize() {"" +          ""var myLatlng = new google.maps.LatLng(49.496675,-102.65625);"" +          ""var myOptions = {"" +            ""zoom: 4,"" +            ""center: myLatlng,"" +            ""mapTypeId: google.maps.MapTypeId.ROADMAP"" +          ""}"" +          ""var map = new google.maps.Map(document.getElementById(\""map_canvas\""), myOptions);"" +          ""var georssLayer = new google.maps.KmlLayer('http://api.flickr.com/services/feeds/geo/?g=322338@N20&amp;lang=en-us&amp;format=feed-georss');"" +          ""georssLayer.setMap(map);"" +        ""}"" +        ""&lt;/script&gt;"" +         ""&lt;/head&gt;"" +         ""&lt;body onload=\""initialize()\""&gt;"" +           ""&lt;div id=\""map_canvas\""&gt;&lt;/div&gt;"" +         ""&lt;/body&gt;"" +         ""&lt;/html&gt;"";                engine.loadData(data, ""text/html"", ""UTF-8"");            }        }</code></pre>","2355649","","2355649","","2010-11-26 09:33:13","2010-12-06 02:02:09","Whats the issue with the android emulator to display map in Web View","<android>","3","1","","",""
"4283112","1","","","2010-11-26 06:56:00","0","1307","<p>Can I develop it on J2SE or J2ME is important?</p>","521018","","590042","","2011-10-01 04:05:58","2011-10-01 04:05:58","Which java technology is used to develop android apps?","<java><android>","3","0","","",""
"4283133","1","4283569","","2010-11-26 07:01:30","0","529","<p>i am making a Poker game in Android, i have made some TextViews and ImageViews to show on the cards of player and computr and the COmmunity cards.. now the problem is that when a player takes its turn after that it calls a method of call_computer and all the implementation of computer executes but there is no Delay between the player and computer turnmeans when a player takes its turn and just after that a card is displayed . what i want is after player turn the computer should wait for a while and then its would display a Text ""Computer Selects Check/Fold/Raise"" and then according to the action selected the card should be displayed....</p><p>please help me friends.... i need it urgent... please brothers.. Hope u understand my problem..</p><p>i have call a call_computer function just after the player turn and action performed.. and i put that method in a new Thread and put a sleep of 5 sec. but still no success.... please help</p>","521015","","","","","2010-11-26 08:21:47","Computer Turn, Wait and delay in Android 2.2","<android>","1","1","","",""
"4283174","1","4283378","","2010-11-26 07:10:55","3","857","<p>My application is crashing when trying to parse a large XML file using SAXParser.<br>I found a question in SO regarding it <a href=""http://stackoverflow.com/questions/4159916/parsing-large-xml-files-in-android"" >here</a>  unanswered.<br>It is working as intended  when i reduce the size of the XML<br>Here is my LogCat output.</p><pre><code>11-26 12:08:45.099: WARN/dalvikvm(218): threadid=17: thread exiting with uncaught exception (group=0x4001aa28)11-26 12:08:45.109: ERROR/AndroidRuntime(218): Uncaught handler: thread Thread-9 exiting due to uncaught exception11-26 12:08:45.220: ERROR/AndroidRuntime(218): java.lang.OutOfMemoryError11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at java.lang.Object.internalClone(Native Method)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at java.lang.Object.clone(Object.java:82)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:141)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at java.lang.StringBuilder.append(StringBuilder.java:282)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at   com.google.android.iopex.SaxXMLHandler.characters(SaxXMLHandler.java:24)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at org.apache.harmony.xml.ExpatParser.text(ExpatParser.java:166)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at org.apache.harmony.xml.ExpatParser.append(Native Method)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:506)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:467)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:329)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:286)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at javax.xml.parsers.SAXParser.parse(SAXParser.java:361)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at javax.xml.parsers.SAXParser.parse(SAXParser.java:240)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at com.google.android.iopex.SaxParser.parse(SaxParser.java:22)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at com.google.android.iopex.iOPEXActivity$4.run(iOPEXActivity.java:112)11-26 12:08:45.220: ERROR/AndroidRuntime(218):     at java.lang.Thread.run(Thread.java:1060)</code></pre><p><a href=""http://pastebin.com/eeQ89cem"" rel=""nofollow""><strong>HERE</strong></a> is the code that i'm using to parse</p>","379712","","379712","","2010-11-26 07:22:41","2011-06-09 13:02:28","Android OutOfMemoryError","<java><android><heap><saxparser><xml-parsing>","1","4","","",""
"4283189","1","","","2010-11-26 07:12:29","3","653","<p>I have created a list activity calles as Category List to show a list of category dynamically from web by parsing an XML file. The XML file contains values ""ID""(id of the particular category) and ""title""(category name). So what I've done is, I've parsed the XML file and collected the ID and title to an ArrayList called categries using SAX parser. </p><p>In the list activity, I have a created a new string array and added the title of each category to it. The thing I want to do is to assign the category id to each category shown in the list view and to use the id to get the appropriate view for that category. Is there any way to assign an id to the each of the list items. </p><p>regardsdj   </p>","395959","","","","","2010-11-26 08:11:31","how to generate dynamic data for an item in listview","<android><listview><listadapter>","1","2","2","",""
"4283199","1","4283277","","2010-11-26 07:14:33","0","761","<p>i have made a widget which display images from sd card and thennavigate through it. Now i want to animate the image while i navigatethrough it.I need to achieve following animation.</p><p>1step : default galleryView motion  2step : perspective galleryView motion</p><p>hope to hear soon from some one. any link will be much helpful</p>","512973","","","","","2010-11-26 07:30:09","Animation in appWidget","<android><android-widget>","1","0","","",""
"4283346","1","4283363","","2010-11-26 07:41:36","1","622","<p>i am using following code in order to fetch contacts from Phone i am getting names but not number , help me to find out other fields of contacts.</p><pre><code>public class DialActivity extends Activity {private ListView mContactList;public  String[] fields; public  Cursor cursor; public    boolean mShowInvisible; public   Uri uri; public   String[] projection; public   String[] selectionArgs; public  String selection; public  String sortOrder;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mContactList = (ListView) findViewById(R.id.ListView01);     // Populate the contact list    populateContactList();}   /** * Populate the contact list based on account currently selected in the account spinner. */private void populateContactList() {    // Build adapter with contact entries    Cursor cursor = getContacts();    String[] fields = new String[] {            ContactsContract.Data.DISPLAY_NAME    };    SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.listrow, cursor,            fields, new int[] {R.id.TextView01});    mContactList.setAdapter(adapter);}/** * Obtains the contact list for the currently selected account. * * @return A cursor for for accessing the contact list. */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 + "" = '"" +            (mShowInvisible ? ""0"" : ""1"") + ""'"";    String[] selectionArgs = null;    String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + "" COLLATE LOCALIZED ASC"";    return managedQuery(uri, projection, selection, selectionArgs, sortOrder);}</code></pre><p>}</p><p>In the above code i am using a custom ListRow layout and showing the contact name in each row, but want to populate a list which has names and corresponding number so that i can make a call on those number by clicking on that listItem. I know how to make call but i am not having the numbers.</p>","395661","","","","","2010-11-26 08:13:50","I want to fetch contacts stored in Phone but getting problem","<android>","1","0","","",""
"4283449","1","4554642","","2010-11-26 08:00:37","18","14815","<pre><code>W/ActivityManager(   81): Launch timeout has expired, giving up wake lock!W/ActivityManager(   81): Activity idle timeout for HistoryRecord</code></pre><p>Does anyone know what reason would cause this happens?Thanks.</p>","428022","","","","","2012-03-23 09:15:09","Activity idle timeout for HistoryRecord?","<android><timeout><activity>","2","2","6","",""
"4283455","1","4880004","","2010-11-26 08:01:47","2","4381","<p>hai friends...my java file indicate this error:R.styleable cannot be resolved.... </p><p>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""&gt;&lt;Gallery xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/videoGrdVw""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:numColumns=""auto_fit""      android:verticalSpacing=""5dip""      android:horizontalSpacing=""5dip""      android:columnWidth=""80dip""      android:stretchMode=""columnWidth""      android:gravity=""center""/&gt;  &lt;ImageSwitcher     android:id=""@+id/switcher""     android:layout_height=""match_parent""     android:layout_width=""match_parent""&gt;    &lt;/ImageSwitcher&gt;    &lt;resources&gt;    &lt;declare-styleable name=""HelloGallery""&gt;    &lt;attr name=""android:galleryItemBackground"" /&gt;    &lt;/declare-styleable&gt;    &lt;/resources&gt;    &lt;/LinearLayout&gt;</code></pre><p>source code:</p><pre><code>private class VideoGalleryAdapter extends BaseAdapter{     private int itemBackground;    public VideoGalleryAdapter(Context c)     {        _context = c;        TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);        itemBackground = a.getResourceId(                R.styleable.Gallery1_android_galleryItemBackground, 0);        a.recycle();     }</code></pre>","486554","","24054","","2010-11-26 08:11:12","2013-09-05 07:11:29","R.styleable cannot be resolved","<java><android><imageview>","3","1","0","",""
"4283519","1","","","2010-11-26 08:14:29","0","1228","<p>I would like to apply a sort of semi-transparent (configurable alpha channel value) filter (an png, activity, don't know yet how) over the screen and this filter to not process touch events.How can I do this ?</p><p>Later edit: no I don't think is possible what I want in this manner, I need another solution.Basically I want to implement something similar to Screen Filter : <a href=""http://www.appbrain.com/app/screen-filter/com.haxor"" rel=""nofollow"">http://www.appbrain.com/app/screen-filter/com.haxor</a></p><p>How this could be done ?Thanks.</p>","467780","","467780","","2010-11-26 12:59:32","2011-06-19 12:25:12","How to create a transparent filter that don't process touch events","<android><filter><transparent>","2","1","2","",""
"4283755","1","","","2010-11-26 08:50:59","36","9531","<p>I am wondering if there are any good options to implement a <strong>rich text editor</strong> in Android. Please note I am talking about a rich text editor that can be used in an Android application, not the one embedded in a web page using HTML and Javascript.</p><p>My requirements are:</p><ul><li>Basic formatting (color, fonts, highlight, bold, italic, underline, etc.)</li><li>Hyperlinks</li><li>Inline images</li><li>Bullet lists and numbered lists</li><li>Inline table (only the contents inside a cell is editable, not the table structure)</li></ul><p>As you can see, this is pretty much something quite similar to a typical RichEdit control on Windows.</p><p>Here are some efforts (investigation &amp; prototyping) I have made so far:</p><h2>Using WebView</h2><p>I have tried using a WebView control to load an HTML fragment with one . The content becomes editable and as it is HTML, I suppose it can meet most of my requirements. But it has several issues:</p><ul><li>(deadly) No text caret. The user will have no idea where his/her typed characters will be inserted.</li><li>The on-screen soft keyboard is not visible by default. There is a trick that the user has to long-press the Menu button to bring up the keyboard. But I think this is a very bad user experience. Besides, the screen layout is not properly rearranged and the text inserting point sometimes will be covered by the keyboard.</li></ul><hr><h2>Using EditText</h2><p>I have tried using the EditText control. It seems to support some level of rich text editing (color, fonts, bold, italic, underline, inline images, bullet lists). But I still cannot figure out how I can implement the following requirements:</p><ul><li>Control the appereance of the bullet symbol (dot, circle, dash, arrow, star, etc.)</li><li>Numbered list (1., 2., 3., etc.)</li><li>Table</li></ul><p>BTW, I have seen there are several *Span classes out there but I am not sure if they can be any help... And the <a href=""http://developer.android.com"">http://developer.android.com</a> does not provide much useful information about them.</p><hr><p>So, how on earth can I implement a rich text editor on Android?Can I extends the EditText and add my new functionalities? Or should I do something from scratch - extends the View and implement everything by myself? For later option (extending View), I actually even don't know how to show a text caret and blink it, not mentionging moving the caret with user typing.</p><p>I am desperate now... Any hints?</p><p>Thanks!</p><p>-Tony</p><hr><h2>(<em>EDIT</em>)</h2><p>After some further investigation, it looks like extending EditText would be my best bet. I somehow figured out how to use those Span classes and guess I should be able to do most of the tricks by using (extending) them.</p><p>For example, extending the BulletSpan and overriding drawLeadingMargin should give me the control of the bullet appereances. Extending the LeadingMarginSpan should help me on the numbered list.</p><p>As to the table, my initial plan is to extend the LineBackgroundSpan and draw all the table borders in the drawBackground override. However, I still need to figure out how to layout all the text in the table cells and properly handle the caret movement and selection. Suggestions?</p>","520958","","520958","","2010-12-03 05:47:28","2013-09-09 08:56:39","Android question: implementing a rich text editor?","<android><richedit>","5","1","19","",""
"4283802","1","4283849","","2010-11-26 08:58:46","0","143","<p>I want to parse this xml and get the result between the  tag... but i cant get the result my xml is</p><p><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""&gt;&lt;soap:Body&gt;&lt;loginResponse xmlns=""https://comm1.get.com/""&gt;&lt;loginResult&gt;true&lt;/loginResult&gt;&lt;result&gt;success&lt;/result&gt;&lt;/loginResponse&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code>The handler</p><pre><code>public class MyXmlContentHandler extends DefaultHandler {    String result;    private String currentNode;    private String currentValue = null;    public String getFavicon() {        return result;    }    @Override    public void startElement(String uri, String localName, String qName,            Attributes attributes) throws SAXException {        if (localName.equalsIgnoreCase(""result"")) {            //offerList = new BFOfferList();            this.result = new String();        }    }    @Override    public void endElement(String uri, String localName, String qName)            throws SAXException {        if (localName.equalsIgnoreCase(""result"")) {            result = localName;        }     }    @Override    public void characters(char[] ch, int start, int length)            throws SAXException {         String value = new String(ch, start, length);         if (currentNode.equals(""result"")){            result = value;            return;         }}}</code></pre><p>Any changes needed</p>","450487","","450487","","2010-11-26 09:09:39","2010-11-26 11:13:57","Error in parser","<android><xml-parsing>","1","2","","",""
"4283831","1","4284184","","2010-11-26 09:03:15","-9","1070","<p>I am having an 20 Buttons as an Array, and i have also displayed it onto the Screen, but now i want to restrict the user to Click only one button at a time, so is there anyway to do so ??</p><p>Note: I know i can use RadioButtons, but i need to have Buttons array because my application is somewhat like Calendar View (Consider Calendar View, where we can display ""Day"" value with the use of Button and then putting day value as 1, 2, 3 ,4,......31), now as user can select only date at a time, same way , i wants to have only one button click at a time.</p><p>Please Understand my requirement.</p>","379693","","967315","","2012-10-14 10:56:37","2012-10-14 10:57:03","Array of Buttons","<android>","5","7","1","2013-12-19 00:04:23",""
"4283984","1","","","2010-11-26 09:24:11","0","602","<p>i have tried using a timertask to refresh a line(after every 1 second) drawn with fixed point coordinates. But the line doesn't appear to refresh...is there anything wrong in my code?</p><p>LineRefresh.java:</p><pre><code>package LineRefresh.xyz.com;import android.app.Activity;import android.graphics.Color;import android.os.Bundle;public class LineRefresh extends Activity {DrawView drawView;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    drawView = new DrawView(this);    drawView.setBackgroundColor(Color.WHITE);    setContentView(drawView);}}</code></pre><p>DrawView.java:</p><pre><code>package LineRefresh.xyz.com;import java.util.Timer;import java.util.TimerTask;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.view.View;public class DrawView extends View {Paint paint = new Paint();public DrawView(Context context) {    super(context);    }@Overridepublic void onDraw(final Canvas canvas) {     paint.setColor(Color.BLACK);    canvas.drawLine(50, 200, 270, 200, paint);      Timer timer = new Timer();    TimerTask task = new TimerTask() {        @Override        public void run() {            paint.setColor(Color.BLACK);            canvas.drawLine(50, 200, 270, 200, paint);            }    };    timer.schedule(task, 1000,1000);}}</code></pre><p>sholud i,instead, place the timertask somewhere else in my code?</p>","520047","","","","","2010-11-26 11:10:56","timertask doesn't work!","<java><android><timer><draw>","1","1","","",""
"4284115","1","4285853","","2010-11-26 09:42:26","0","828","<p>Create an xml document from InputStream which contains xml data. Is it possible?</p>","450487","","","","","2010-11-26 13:55:39","Create an xml document from InputStream","<android><xml-parsing>","2","0","","",""
"4284224","1","4285773","","2010-11-26 09:58:13","13","11595","<p>Morning all,</p><p>I'll admit straight off that I'm new to development and trying my hand at Android. I've been trying to search the 'net to find advice on how to implement some ""Hold Button to Repeat Action"" - I've created a custom numpad from buttons and want a backspace-like behaviour. Having got so far, I called upon a friend who hasnt coded Android before, but done lots of C# / Java and seems to know what he's doing.</p><p>The code below works just fine, but I feel it could be done more neatly.  I apologise if I've missed bits out, but hopefully this explains my approach.  I think the onTouchListener is ok, but the way Threads are handled doesnt feel right.</p><p>Is there a better or more simple way to do this?</p><p>Thanks,</p><p>M</p><pre><code>public class MyApp extends Activity {private boolean deleteThreadRunning = false;private boolean cancelDeleteThread = false;private Handler handler = new Handler();public void onCreate(Bundle icicle) {    super.onCreate(icicle);    //May have missed some declarations here...    Button_Del.setOnTouchListener(new OnTouchListener() {        public boolean onTouch(View v, MotionEvent event) {           switch (event.getAction())           {               case MotionEvent.ACTION_DOWN:               {                   handleDeleteDown();                   return true;               }               case MotionEvent.ACTION_UP:               {                   handleDeleteUp();                   return true;               }               default:                   return false;           }        }        private void handleDeleteDown() {            if (!deleteThreadRunning)                startDeleteThread();        }        private void startDeleteThread() {            Thread r = new Thread() {                @Override                public void run() {                    try {                        deleteThreadRunning = true;                        while (!cancelDeleteThread) {                            handler.post(new Runnable() {                                   @Override                                public void run() {                                    deleteOneChar();                                }                            });                            try {                                Thread.sleep(100);                            } catch (InterruptedException e) {                                throw new RuntimeException(                                    ""Could not wait between char delete."", e);                            }                        }                    }                    finally                    {                        deleteThreadRunning = false;                        cancelDeleteThread = false;                    }                }            };            // actually start the delete char thread            r.start();        }    });}private void handleDeleteUp() {    cancelDeleteThread = true;}private void deleteOneChar(){    String result = getNumberInput().getText().toString();    int Length = result.length();    if (Length &gt; 0)        getNumberInput().setText(result.substring(0, Length-1));        //I've not pasted getNumberInput(), but it gets the string I wish to delete chars from}</code></pre>","521213","","521213","","2010-11-26 13:09:19","2014-02-08 09:41:28","Android - Hold Button to Repeat Action","<android><handler><ontouchlistener>","5","2","6","",""
"4284232","1","4284254","","2010-11-26 09:59:19","6","300","<p>Anybody can give me a Android tutorial for parsing Json data which is located in web.</p>","438676","","","","","2010-11-26 10:03:00","Json on Android","<android>","2","0","1","",""
"4284242","1","4285277","","2010-11-26 10:00:29","4","6067","<p>I'm trying to display information from a <code>Cursor</code> in a <code>ListView</code>, each row contains a <code>ImageView</code> and a <code>TextView</code>. I have a <code>CustomCursorAdapter</code> extending <code>CursorAdapter</code>, in <code>bindView</code> I evaluate the data from the cursor and based on that set the views image and text.</p><p>When I run the app the <code>ListView</code> displayes the correct amount of rows, but they are empty. I know I have missed something when overriding bindView, but I'm not sure what.</p><p>Any help would be greatly appreciated.</p><pre><code>private class CustomCursorAdapter extends CursorAdapter {  public CustomCursorAdapter() {    super(Lmw.this, monitorsCursor);  }  @Override  public View newView(Context context, Cursor cursor, ViewGroup parent) {    LayoutInflater layoutInflater = getLayoutInflater();    return layoutInflater.inflate(R.layout.row, null);  }  @Override  public void bindView(View view, Context context, Cursor cursor) {    try {      int monitorNameIndex = cursor.getColumnIndexOrThrow(DbAdapter.MONITORS_COLUMN_MONITOR_NAME);      int resultTotalResponseTimeIndex = cursor.getColumnIndexOrThrow(DbAdapter.RESULTS_COLUMN_TOTAL_RESPONSE_TIME);      String monitorName = cursor.getString(monitorNameIndex);      int warningThreshold = cursor.getInt(resultTotalResponseTimeIndex);      String lbl = monitorName + ""\n"" + Integer.toString(warningThreshold) + "" ms"";      TextView label = (TextView) view.findViewById(R.id.label);           label.setText(lbl);      ImageView icon = (ImageView)view.findViewById(R.id.icon);      if(warningThreshold &lt; 1000) {        icon.setImageResource(R.drawable.ok);            } else {        icon.setImageResource(R.drawable.alarm);      }    } catch (IllegalArgumentException e) {      // TODO: handle exception    }  }}</code></pre>","434457","","1318946","","2013-10-07 13:18:56","2013-10-07 13:21:29","How to override CursorAdapter bindView","<android><sqlite><cursor><override>","1","1","","",""
"4284402","1","","","2010-11-26 10:23:46","13","6340","<p>I'm wondering: other than GPS location, is there any way to find if two phones is within a certain distance from each other? For example, if one phone is under 3 feet from another one, as GPS is not that accurate. </p><p>I'm developing a multiplayer interactive game for my final year project on the android platform and it would require that one gamer is within 3 feet or less from another. </p><p>Anything at all is most helpful but from looking around it would seem that it's not really possible. Most phone data can be shared and I will be using both bluetooth and multicast sockets.</p><p>Thanks very much for your time.</p><hr><p>Thanks to everyone so far for your replies. I'm still looking into this and will update when I find something  alittle bit easier to do; but so far it would seem using bluetooth RSSI value is the way to go.</p>","521241","","75801","","2011-03-08 19:49:30","2012-10-27 20:38:29","Distance between two android phones","<android><bluetooth><distance>","4","4","5","",""
"4284436","1","","","2010-11-26 10:27:36","2","7032","<p><code>if(new File(""/mnt/sdcard/t.m"").exists()) {...}</code></p><p>When I create a java program using Eclipse and debug it on my Android phone, it tests right.But when I put it into a app in my Android system, it does not detect the file.</p><p>And, in another app (built in my Android system, too), though I've put following in AndroidManifest.xml,</p><p><code>&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""/&gt;</code></p><p>the code below causes an exception saying no permission,</p><p><code>File f=new File(""/mnt/sdcard/a.t""); f.createNewFile();</code></p><p>Thank you. I'm new to Android.</p>","521230","","403455","","2012-07-17 16:56:22","2012-07-17 16:56:22","android File.exists fails to check a file on SD card","<android><android-sdcard><file-exists>","1","0","","",""
"4284487","1","4285429","","2010-11-26 10:34:25","3","356","<p>Is there any official guide for developing Android apps using HTML and CSS like the ones iPhone has which specifies the guidelines for height/width etc?</p><p>Thanx in advance.</p>","227943","","","","","2010-11-26 12:53:22","Any guidelines for using CSS and HTML for developing webapps?","<html><android><css><guidelines>","3","0","","",""
"4284609","1","","","2010-11-26 10:49:27","1","731","<p>I have a doubt,</p><p>I have started my acitivity with the flag FLAG_ACTIVITY_REORDER_TO_FRONT, so first time oncreate() will be called, if the activity already exists in the history stack then onrestart() will be called. </p><p>So first time I am putting some extras in the intent, in oncreate i can get the bundle values, when i try to get the bundle in onrestart when the activity is brought to front, I am not able to get the newly bundled values.</p><p>how to do this?</p>","262523","","","","","2010-11-26 11:40:10","how to get the bundle values in onrestart when the activity is brought to front","<android><activity><bundle>","1","0","","",""
"4284640","1","4284692","","2010-11-26 10:54:11","1","803","<p>I am new to android.I just what to create a Edittext at a run time when a button is clicked.for example in contact when the image + is clicked it will add a button and a edittext in the layout.can anyone help me with some sample codes.Thanks in advance. </p>","366916","","","","","2013-06-18 06:36:09","Android-Creating a runtime Edittext when a Button is Clicked","<android>","1","0","","",""
"4284668","1","","","2010-11-26 10:58:24","2","1913","<p>I need to use Bluetooth for communication with another application which sends data via bluetooth SPP profile. I use the Bluetooth Chat app from Android developer site. I am using real phone (HTC Desire) as there is no Bluetooth API in Android emulator. I use a BlueSoleil bluetooth dongle.</p><p>When the other application tries to connect to my phone via Bluetooth and send data via SPP, it is not possible to connect the phone to the application. So I tried Windows Hyperterminal to send data and connect the phone through the dongle. In this situation, I can receive the data and display on the phone.</p><p>I would like to know how to find out which bluetooth profile was used when communicating with Hyperterminal. </p><p>I have read that bluetooth stack has a buggy implementation in HTC Desire and the SPP profile doesn't work consistently always.</p><p>Appreciate any suggestion and time spent on this.</p><p>Cheers,</p><p>Madhu Nandan</p>","487851","","","","","2010-11-27 19:31:04","How to find out which Bluetooth profile is used for communication","<android><bluetooth><profile><htc>","1","2","2","",""
"4284690","1","","","2010-11-26 11:01:20","0","326","<p>How to drag a button view horizantally in image</p>","521273","","","","","2010-11-26 11:01:20","how to drag a button horizantally in android with example","<android>","0","2","","",""
"4284741","1","","","2010-11-26 11:09:36","0","798","<p>I was wondering if there are attractive user interface components for Android already developed by third parties.</p>","422688","","","","","2010-11-26 11:09:36","Android attractive user interface components","<android><android-layout>","0","3","1","",""
"4284946","1","4285180","","2010-11-26 11:39:08","15","9105","<p>I'd like to place a drawable into a dialogs title bar. I tried the following:</p><pre><code>final Dialog dialog = new Dialog(this);dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON);dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.some_icon);dialog.setTitle(R.string.my_dialog_title);dialog.setContentView(R.layout.my_dialog_layout);...</code></pre><p>The icon doesn't show up but the title moves a little to the right. It seems the dialog reserves space for the drawable but doesn't draw it. I tried several different icons (also from the android resources) but non of them worked.</p>","272802","","","","","2013-08-07 11:12:13","How to place an icon into the title of a custom dialog","<android><dialog><icons><title>","6","0","4","",""
"4284993","1","4285660","","2010-11-26 11:45:16","2","280","<p>I want a code to search to google engine for songs via zippyshare . For example the keyword will be ""inna sun is up zippyshare"" and the first result is  this url www32.zippyshare.com/v/55151563/file.html . i want to retrieve the code 55151563 from the the 1st result of google.Thank you in advance</p>","514611","","","","","2010-11-26 13:26:40","Android get 1st result and copy from google search(automatic)","<java><android>","1","0","","",""
"4284999","1","","","2010-11-26 11:46:01","0","576","<p>I want my android app to open up wikipedia.com as soon as the icon is pressed on your android device. I've setup everything correctly, its just a programming problem. This is what i've got so far in my src folder:</p><pre><code>package com.wikipedia.lewicki;import android.app.Activity;import android.os.Bundle;public class WikipediaMobile 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>I want to execute www.wikipedia.com, thanks v much alex</p>","521331","","180538","","2010-11-26 11:51:48","2010-11-26 12:29:41","I'm making an android app - all it does is open up a website - any help please?","<android><website><android-intent>","2","1","","",""
"4285143","1","","","2010-11-26 12:04:10","0","185","<p>Could you help me, please? I want to mount my Droid in magnetic windshield mount. How could I check programatically that Droid is mounted?   </p>","448147","","","","","2010-11-26 12:32:51","Android Magnetic windshield mount","<android><magnetometer><magnetic>","1","0","","",""
"4285225","1","4285644","","2010-11-26 12:18:52","23","16663","<p>I know that fonts properties can be found in the <code>TypeFace</code> class but I can't find the default characteristics of the writing in Android. I mean, if I take a <code>TextView</code> and simply do <code>setText(""Blabla"")</code> on it, what will I get? Which size in px? Which font? etc.</p>","263521","","1748450","","2014-03-16 17:47:26","2014-03-16 17:47:26","What are the default font characteristics in Android ?","<android><fonts><default>","2","0","12","",""
"4285266","1","4285936","","2010-11-26 12:26:10","5","4406","<p>Is it ok to call the SQLiteDatabase update method in the Insert() overridden method of a content provider?</p>","513267","","","","","2010-11-26 14:07:01","Android Contentprovider - update within an insert method","<android><android-contentprovider>","2","0","1","",""
"4285320","1","4285372","","2010-11-26 12:35:52","1","1592","<p>I am looking for a number picking like those used in the date controls on an Android and found this question:<a href=""http://stackoverflow.com/questions/3729068/hour-minute-picker-for-android-countdown-timer"">hour/minute picker for android countdown timer</a></p><p>Following that example I can get the controls I want - Yay!  The problem is I don't see how to get the value the user selects?  Normally I would set an on change listener and be happy, but how do I create a class that implements the internal interface <code>com.android.internal.widget.NumberPicker$OnChangedListener</code>?  Is there another way to get the current selection?</p>","199818","","","","","2010-11-26 12:54:09","How can I get the value of an NumberPicker widget?","<java><android><reflection><android-widget>","1","2","1","",""
"4285398","1","4285850","","2010-11-26 12:49:09","1","672","<p>My company wants to publish a library for android, so that other people can integrate our content easily in their custom apps.</p><p>Now I am still very uncertain how I should provide the content. Right now I am using POJOs to provide the data in my project.</p><p>I was following the <a href=""http://stackoverflow.com/questions/2545148/pojos-versus-cursors-in-android"">debate ""POJOs vs. Cursors""</a> which turned out in favor of Cursors. I also have seen <a href=""http://mgmblog.com/2008/11/25/android-ruby-on-rails-project-part-3-using-android-cursors/"" rel=""nofollow"">an example</a> where somebody stores the parsed resource in a SQLLite-DB and accesses it later through Cursors.</p><p>I know that Cursors have many advantages compared to POJOs. But would you like to mess with cursors when you need to implement a library? Some of you guys might have written such libs as well. What did you use and why?</p><hr><p><strong>How other libs are doing it...</strong></p><p><a href=""https://github.com/facebook/facebook-android-sdk/"" rel=""nofollow"">Facebook seems to use POJOs:</a></p><p>Response format: The server response is a JSON string. The SDK provides a Util.parseJson() method to convert this to a JSONObject, whose fields and values can be inspected and accessed.</p>","433718","","433718","","2010-11-29 12:49:57","2010-11-29 12:49:57","Would you like to integrate a POJO- or Cursor-based library in your android app?","<android><cursors><pojo><android-contentprovider><android-library>","1","0","","",""
"4285419","1","","","2010-11-26 12:52:16","1","546","<p>I'm using code similar to this one:</p><p><a href=""http://stackoverflow.com/questions/2267513/using-navigator-geolocation-getcurrentposition-in-webview-on-android-2-0-phoneg"">Using navigator.geolocation.getCurrentPosition in WebView on Android 2.0+ (PhoneGap related)</a></p><p>After closing the app, the GPS icon stays in the status bar and won't go away. Is there a way to fix this?</p>","132187","","","","","2011-02-18 00:35:36","GPS Icon stays in status bar after closing app that uses GeoClient() in webview","<android><geolocation><android-webview>","1","0","","",""
"4285422","1","4285725","","2010-11-26 12:52:31","4","2245","<p>I am currently using the following code and wondering if there is a more effecient way of doing this via a function?</p><pre><code>showDisplay = (LinearLayout)findViewById(R.id.display1);if (isA){ { showDisplay.setVisibility(0);}else{ showDisplay.setVisibility(8); }showDisplay = (LinearLayout)findViewById(R.id.display2);if (isB){ showDisplay.setVisibility(0);}else{ showDisplay.setVisibility(8); }showDisplay = (LinearLayout)findViewById(R.id.display3);if (isC){ showDisplay.setVisibility(0);}else{ showDisplay.setVisibility(8); }</code></pre>","330368","","","","","2010-12-03 09:16:32","Using findViewById more effeciently","<java><android>","3","0","","",""
"4285528","1","4302102","","2010-11-26 13:09:34","3","4478","<p>I have used scroller for auto scrolling, but it keeps on scrolling even when text gets over. I want to find the position and want to stop scrolling automatically, so thta text comes to its initial position as during text scrolling text gets over. How can i do this?</p><p>The code used for autoscrolling is:</p><pre><code>public void Scroll(){    //text = (TextView) findViewById(R.id.TxtView);    length = text.getLineCount();    scroll.computeScrollOffset();    text.setScroller(scroll);    int a = text.getBottom();    int b = text.getTop();    //scroll.extendDuration(scroll.getFinalY());    scroll.startScroll(scroll_x, scroll_y, 0, a, (500000)/ speedAmount);    }</code></pre>","493193","","387076","","2012-02-10 12:44:46","2012-02-10 12:44:46","how to implement Scroller in textview for auto scrolling?","<android><scroll>","2","0","3","",""
"4285791","1","4286229","","2010-11-26 13:43:17","1","7627","<p>I am looking for an elegant way to access local files (either on phone memory or SD Card) on an Android device from JavaScript running in WebView on an Android device.  </p><p>I am loading said WebView with a html page from the device located in the assets folder.  Along these lines, I believe I can access any file in this assets folder from the Javascript, but can't load anything from SD card or phone memory.  I am aware of the addJavaScriptInterface, but I am specifically trying to load images, so using this method would require some tweaking to pass a B64 encoded image.</p><p>I am new to Android development, and want to make sure I am not missing something obvious.</p>","163757","","","","","2011-02-07 13:33:57","Android Access Local File From WebView Javascript","<javascript><android><webview>","2","0","","",""
"4285848","1","","","2010-11-26 13:55:18","1","517","<p>The IBM tutorial here: <a href=""http://www.ibm.com/developerworks/opensource/library/x-android/"" rel=""nofollow"">http://www.ibm.com/developerworks/opensource/library/x-android/</a> is not working. It's crashing saying that 'The app quit unexpectedly.' </p><p>Has anybody got it working?</p><p>Thanx in advance.</p>","227943","","","","","2011-01-18 09:35:16","IBM tutorial for RSS reader for ANdroid not working","<html><android><css><guidelines>","1","0","","",""
"4285877","1","","","2010-11-26 13:59:47","27","7704","<p>As far as I can see onRetainNonConfigurationInstance is a redundant callback. If my activity has really expensive initialization, I am better off using onSaveInstanceState. Saved instance covers more situations than non-configuration instance. Is there any guideline for using one API vs. the other? Thanks.</p>","521442","","","","","2010-11-26 15:18:39","Which one to use: onSaveInstanceState vs. onRetainNonConfigurationInstance?","<android>","1","0","16","",""
"4285981","1","8831226","","2010-11-26 14:12:40","15","32928","<p>I am developing one android application which use transparent activity.. I used the following <a href=""http://stackoverflow.com/questions/2176922/how-to-create-transparent-activity-in-android"">link</a> as reference but my problem is when i set background color as black i am not able see previous. i need transparent like this .</p><p><img src=""http://i.stack.imgur.com/Y29DN.jpg"" alt=""alt text""></p><p>Thanks in Advance...</p>","405640","","","","","2012-01-12 06:57:18","Transparent layout in Android?","<android>","2","0","18","",""
"4286040","1","4286090","","2010-11-26 14:19:24","1","2275","<p>In my <strong>Android Application</strong>, I am trying to convert Date/Time to Milliseconds, check the below code:</p><pre><code>public long Date_to_MilliSeconds(int day, int month, int year, int hour, int minute){       Calendar c = Calendar.getInstance();       c.setTimeZone(TimeZone.getTimeZone(""UTC""));       c.set(year, month, day, hour, minute, 00);        return c.getTimeInMillis();}</code></pre><p><strong>Problem:</strong> I am getting 1290455340800(Nov 22 14:49:00 EST 2010) for Nov 22 19:49:00 EST 2010 (i.e. 5 hours back)</p><p><strong><code>FYI, I am Currently in Indian TimeZone, but application can be executed from any country. so How do i exact Convert the date/time into the Milliseconds?</code></strong></p>","379693","","379693","","2010-11-26 14:25:03","2011-12-13 05:35:43","Facing problem While Converting Date to MilliSeconds","<java><android>","5","1","","",""
"4286075","1","","","2010-11-26 14:24:05","11","3703","<p>Does anyone have an idea how to implement an Brightness Screen Filter like the one here:</p><p><a href=""http://www.appbrain.com/app/screen-filter/com.haxor"" rel=""nofollow"">http://www.appbrain.com/app/screen-filter/com.haxor</a></p><p>I need a starting point and I can't figure out how to do it.</p>","467780","","1288","","2011-05-12 20:44:40","2013-07-11 05:29:38","Brightness Screen Filter","<android><filter><screen><brightness>","4","2","11","",""
"4286237","1","4286390","","2010-11-26 14:48:11","3","6097","<p>I'm writing simple Android app to filter some events from user's calendar. The questions is, <strong>what is the best way to access it?</strong></p><p>One option that comes to my mind is through Google Calendar Data API where I will have to authenticate the user and synchronize with the calendar in my app. </p><p>Is there any way to access the calendar through Android? Meaning that I will only access it locally and Android itself will handle the authentication, synchronization, etc.</p>","72583","","","","","2010-12-01 03:27:43","How to access user's Calendar on Android device?","<android><google-api><google-calendar>","3","0","2","",""
"4286265","1","4286365","","2010-11-26 14:52:09","3","596","<p>I want to fetch data from the webpage, that contains some json data. The problem is, json data only returns if user is logged in on the website. If he is not, the login page is returned.</p><pre><code>URL url = new URL(API_URL);URLConnection conn = url.openConnection();BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream)));StringBuilder builder = new StringBuilder();String line = """";while ((line = br.readLine()) != null) {    builder.append(line + System.getProperty(""line.separator""));}String result = builder.toString();</code></pre><p>So, in <code>result</code> I'm expecting to have json data. But I have a login page there. I tried logging in from the browser, but it did not help.</p><p>How do I use cookies from my browser to get through this login page?</p>","163423","","","","","2010-11-29 11:18:50","Android fetch url, that needs logging in","<java><android><urlfetch>","2","0","3","",""
"4286439","1","4287279","","2010-11-26 15:16:45","4","2045","<p>When starting my app, several POI coordinates shall be added to the Android System. Some hours later, my app is closed and the user walks close to one of the POI he shall get notified e.g. through a status message. </p><p>Is <a href=""http://developer.android.com/reference/android/location/LocationManager.html#addProximityAlert%28double,%20double,%20float,%20long,%20android.app.PendingIntent%29"" rel=""nofollow"">this</a> the right approach for my scenario? Are there more things available in Android to achieve this? </p><blockquote>  <p>public void addProximityAlert (double  latitude, double longitude, float  radius, long expiration, PendingIntent  intent)</p></blockquote>","433718","","","","","2012-11-10 08:54:01","Location Alarm for Android?","<android><android-location><location-aware><location-based-service><android-alarms>","1","0","5","",""
"4286531","1","4298863","","2010-11-26 15:28:09","1","2357","<p>I have been going through loads and loads of tutorials found through Google, loads of sample code, loads of ideas and I can't get them to work. There's something I'm not doing right every single time, so I want to start from scratch. Does anyone know of a simple ""You are here"" type of application. Something that will load Google Maps, and go to the user's location?</p><p>I have tried the tutorial from the Android API, but it doesn't tell the entire code, and I'm going wrong somewhere.</p><p>With a fresh tutorial I can solve my problem <strong>and</strong> learn. Thanks</p>","348261","","1228","","2013-08-14 12:25:44","2013-08-14 12:25:44","Does anyone know of a simple ""You are here"" Android Maps tutorial?","<android><google-maps><location>","2","0","2","2013-08-14 12:35:28",""
"4286642","1","4287161","","2010-11-26 15:44:45","1","3961","<p>I want to display 3 images on a background image. First I thought of using a relative layout and setting the background to be my background image. Then I placed the images in the layout: left, center and right. The problem is that the relative layout fills the whole screen and the background image is scaled. Using the background image as an image view in the layout is not an option, because I want my 3 images to have a maximum height determined by the background height. What is the best way to achieve this? here is my code too: </p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content""android:layout_height=""wrap_content"" android:background=""@drawable/instruction_background""&gt;&lt;ImageView android:id=""@+id/background""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentLeft=""true""    android:layout_alignParentBottom=""true""/&gt;   &lt;ImageView     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentLeft=""true""    android:layout_alignBottom=""@+id/background""    android:src=""@drawable/apple_sauce""/&gt;&lt;ImageView     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentRight=""true""    android:layout_alignParentBottom=""true""    android:src=""@drawable/white_wine""/&gt;&lt;ImageView     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_centerHorizontal=""true""    android:layout_alignParentBottom=""true""    android:src=""@drawable/tuna_fish""/&gt;</code></pre><p>    </p><p>Best Regards</p>","460611","","","","","2010-11-26 16:53:05","RelativeLayout wrap_content problem","<android>","1","2","","",""
"4286809","1","","","2010-11-26 16:04:51","2","691","<p>I have android application which deals with lot of progress dialogs.I have to create a separate dialog for each activity.</p><p>Dialog creation takes a activity(context) as parameter while constructing.</p><p>Is there a way by which I can create a single dialog (which is tied to application and not the activity) and show it in different activity so that I do not have to create it repeatedly.</p>","521572","","","","","2010-11-27 02:16:41","android singleton dialog","<android><progressdialog>","3","0","","",""
"4286829","1","","","2010-11-26 16:08:14","0","848","<p>I have stored date as primary key in SQLite database (MM/DD/YYYY format) when I select date in DESC order, it is not selecting in correct order i.e. in place of</p><p>26NOV2010</p><p>25NOV2010</p><p>26NOV2009</p><p>25NOV2009</p><p>it is printing like that</p><p>26NOV2010</p><p>26NOV2009</p><p>25NOV2010</p><p>25NOV2009</p><p>plz provide some pointer for storing date in correct format and retrieving in descending order.</p><p>thanking you</p>","520174","","","","","2010-11-26 17:32:53","Android SQLite problem","<android><sqlite>","1","0","","",""
"4286921","1","","","2010-11-26 16:19:12","1","2579","<p>I register an BroadcastReceiver to receive SMS in a SystemService, but we don't have the permisson ""android.permission.RECEIVE_SMS"". So how to use permission inside android framework? In the SystemService, it's context is get from ActivityManagerService.main(). </p><pre><code> public void setWindowManager(WindowManagerService wm) {    mWindowManager = wm;}public static final Context main(int factoryTest) {    AThread thr = new AThread();    thr.start();    synchronized (thr) {        while (thr.mService == null) {            try {                thr.wait();            } catch (InterruptedException e) {            }        }    }    ActivityManagerService m = thr.mService;    mSelf = m;    ActivityThread at = ActivityThread.systemMain();    mSystemThread = at;    Context context = at.getSystemContext();    m.mContext = context;    m.mFactoryTest = factoryTest;    PowerManager pm =        (PowerManager)context.getSystemService(Context.POWER_SERVICE);    m.mGoingToSleep = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, ""ActivityManager-Sleep"");    m.mLaunchingActivity = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, ""ActivityManager-Launch"");    m.mLaunchingActivity.setReferenceCounted(false);    m.mBatteryStatsService.publish(context);    m.mUsageStatsService.publish(context);    synchronized (thr) {        thr.mReady = true;        thr.notifyAll();    }    m.startRunning(null, null, null, null);    return context;}</code></pre>","787182","","","","","2013-07-12 15:03:13","How to use permission inside android framework?","<android><permissions>","6","0","","",""
"4287028","1","","","2010-11-26 16:35:11","1","1248","<p>My create table statement looks like this:</p><pre><code>private static final String USER_CREATE = ""create table user (uid text unique, pw text, admin integer);"";</code></pre><p>When I try to insert into the db, it lets me insert a value for uid, but if I try to insert a value for pw or admin, it throws a SQLiteException 'table user has no column named pw', and the same for admin. Is my syntax not right? Here's my DBAdapter code:</p><pre><code>public class DBAdapter extends Activity {</code></pre><p>//<strong><em>*</em>**<em>*</em>***</strong><em>DATABASE CONSTANTS</em><strong><em>*</em>**<em>*</em>**<em>*</em>***</strong></p><p>public static final String WORDS_TABLE = ""words""; public static final String ATT_WORD = ""word"";    public static final String ATT_T1 = ""T1"";    public static final String ATT_T2 = ""T2"";    public static final String ATT_T3 = ""T3"";    public static final String ATT_T4 = ""T4"";    public static final String ATT_T5 = ""T5"";    public static final String ATT_RECENT = ""recent"";    public static final String ATT_RATING = ""rating"";</p><pre><code>public static final String STATISTICS_TABLE = ""statistics"";public static final String ATT_GAMESPLAYED = ""gamesPlayed"";public static final String ATT_wordsCORRECT = ""wordsCorrect"";public static final String ATT_wordsWRONG = ""wordsWrong"";public static final String ATT_POINTTOTAL = ""pointTotal"";public static final String ATT_WINS = ""wins"";public static final String ATT_LOSSES = ""losses"";public static final String SETTING_TABLE = ""settings"";public static final String ATT_SID = ""sid"";public static final String ATT_TYPE = ""type"";public static final String ATT_DURATION = ""duration"";public static final String ATT_PTSTOWIN = ""ptsToWin"";public static final String CATEGORIES_TABLE = ""categories"";public static final String ATT_CATEGORY = ""category"";public static final String BELONGS_TABLE = ""belongs"";public static final String USER_TABLE = ""user"";public static final String ATT_UID = ""uid"";public static final String ATT_PW = ""pw"";public static final String ATT_ADMIN = ""admin"";public static final String DATABASE_NAME = ""taboo"";private static final int DATABASE_VERSION = 1;private static final String TAG = ""DBAdapter"";private static final String WORDS_CREATE =    ""create table words (_id primary key autoincrement,word text,""
    + ""T1 text,T2 text,T3 text,T4 text,T5 text,""
    + ""recent integer,rating integer);"";private static final String CATEGORIES_CREATE =    ""create table categories (_id integer primary key autoincrement,category text unique);"";private static final String BELONGS_CREATE =   ""create table belongs (_id integer primary key autoincrement,word text,category text,""
    + ""foreign key (word) references words (word),foreign key (category) references categories (category));"";private static final String USER_CREATE = ""create table user (uid text unique, pw text, admin integer);"";private static final String STATISTICS_CREATE =       ""create table statistics (_id integer primary key  autoincrement, uid text unique, gamesPlayed integer, wordsCorrect integer, ""    +""wordsWrong integer, pointTotal integer, wins integer, losses integer, ""    +""foreign key (uid) references user (uid));"";private static final String SETTINGS_CREATE =    ""create table settings (_id integer primary key autoincrement, uid text, sid text, ""    +""type text, duration integer, ptsToWin integer, ""    +""foreign key (uid) references user (uid));""    ;//**************************************************************//*********************  Function Constants ********************//**************************************************************private final Context context; private DatabaseHelper DBHelper;public static SQLiteDatabase db;private int wordCount = 100;//********************  Object public DBAdapter(Context ctx) {    this.context = ctx;    DBHelper = new DatabaseHelper(context);}private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context)     {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db)    {        db.execSQL(WORDS_CREATE);        db.execSQL(CATEGORIES_CREATE);        db.execSQL(BELONGS_CREATE);        db.execSQL(USER_CREATE);        db.execSQL(STATISTICS_CREATE);        db.execSQL(SETTINGS_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 "" + WORDS_TABLE);        onCreate(db);    }}    //****************************************************//********  Database Functions  **********************//****************************************************public DBAdapter open() throws SQLException { db = DBHelper.getWritableDatabase();    return this;} public void close() {    DBHelper.close();}</code></pre><p>And my insert code:</p><pre><code>public long enterUser(ContentValues content){ long result = db.insert(USER_TABLE, null, content); return result;}</code></pre><p>Any ideas would be much appreciated. Thanks!</p>","365491","","","","","2010-11-26 18:01:11","Problem creating table with SQLite in Android","<java><android><sqlite>","1","6","","",""
"4287073","1","4287217","","2010-11-26 16:41:38","0","690","<p>Hi I have a problem with ListView scrolling. My activity layout:</p><pre><code>&lt;ScrollView&gt;  &lt;ReleativeLayout&gt;      &lt;ListView&gt;      &lt;... other controls&gt;</code></pre><p>When this list view has a lot of elements, so that they do not fit on the screen, I cannot scroll. The interesting part is that the scroll works in landscape orientation, but not in portrait. </p><p>Does any one has a suggestion on how to tweak my layout in order to allow scrolling?</p><p>Thanks</p>","94892","","","","","2010-11-26 17:00:54","Android: ListView problem","<android><listview><scrolling>","1","0","","",""
"4287084","1","4288056","","2010-11-26 16:43:31","0","1278","<p>I have a static radiogroup in my XML layout, but I have created all of the radiobuttons dynamically as an effect of user input.  Since none of these have ID's, is there a way I can call a method on a whole radiogroup to just return the text (or label) of the checked radio button?  All the labels are URL's so if I can get the URL of the checked radio button then I can pass it to a method i created to open the web browser.  </p><p>I can use ID's but then I would have to create a bunch of extra text for the radio button labels anyways, then a bunch of if statements with the labels written a second time.. [ if this ID is selected go to this URL, if this ID is open go to this URL...] Where as I just want to take the RadioButton's label and just put it right into the browser method.</p><p>I found this post: <a href=""http://stackoverflow.com/questions/3070377/android-how-to-get-text-of-dynamically-created-radio-button-selected-by-the-user"">Android: How to get text of dynamically created radio button selected by the user? </a></p><p>but it wasn't answered correctly.</p><p>Thanks in advance.</p>","520925","","","","","2010-11-26 19:27:58","Is there a way to get the text from a checked radiobutton from a radiogroup?","<android><radio-button>","1","1","","",""
"4287091","1","4287215","","2010-11-26 16:44:44","5","981","<p>Can anybody point me to any public source where I can see how a pullable/draggable screen, like the one in the Facebook application for notifications, is implemented?</p><p>I have seen also this pattern in the application Öffi for DE/AT/CH/BE/UK.</p><p>Thanks for any help!</p>","308666","","","","","2010-11-26 17:00:33","Facebook-Notification like Pullable Screen","<android><facebook><screen><draggable>","1","0","6","",""
"4287097","1","","","2010-11-26 16:44:55","0","237","<p>I want to make a border in every row of Listview . How to do this?</p>","461972","","1077754","","2013-10-07 10:57:10","2013-10-07 10:57:10","Listview in android","<android>","2","1","","",""
"4287112","1","4288245","","2010-11-26 16:46:22","1","582","<p>Is there a way to get HTTP response code from Browser activity launched from another Android application?</p><p>Since I haven't found any occurrences of ""setResult"" string in BrowserActivity source code, I assume startActivityForResult won't do much.</p><p>If not I'll probably stick with HEAD request from my activity.</p>","521590","","","","","2010-11-26 20:03:29","How to get http response code from browser activity?","<android><http><browser><networking>","1","0","","",""
"4287206","1","","","2010-11-26 16:59:13","2","2162","<p>I am displaying  image from web using Image downloading logic,I want to image download at first time only,next time don't  download image from web,because First time downloaded image store in cache memory so i display image from catch memory,In case,does not exits that image in cache memory,will download otherwise don't need download that image from web,How is possible?</p><p>Thanks Friends.</p>","500595","","","","","2013-12-21 09:02:45","How to use cache memory for image download?","<android>","5","0","1","",""
"4287280","1","4287348","","2010-11-26 17:08:50","1","834","<p>how to show the option menu when click to row of listview</p>","510992","","","","","2010-12-19 07:53:24","listview and option menu","<android><menu>","1","0","","2012-08-18 04:54:11",""
"4287306","1","","","2010-11-26 17:12:53","2","1867","<p>I want to develop an alarm clock like services in android that is the app should run on the some user entered time and even if the mobile is switched of that app should work as alarm clock works .</p>","478535","","","","","2010-11-26 17:22:16","Alarm clock like services","<android>","1","0","","",""
"4287412","1","4287470","","2010-11-26 17:29:32","0","3335","<p>I made another post earlier about this subject but I've since changed my code around a bit based on suggestions but the same problem exists. My images keep shifting around if I click other elements on screen. </p><p>Here is my code which I call by this:</p><p>new Thumbnailer(image_main, image_table).execute(image);</p><p>image_main is my imageView and image_table is the table that holds it. </p><pre><code> private class Thumbnailer extends AsyncTask&lt;String, Void, Bitmap&gt; {      private ImageView imageView;      private TableLayout imageTable;        public Thumbnailer(ImageView imageView, TableLayout imageTable) {            this.imageView = imageView;            this.imageTable = imageTable;        }  @Override  protected void onPostExecute(Bitmap result) {      imageView.setImageBitmap(result);               imageView.setVisibility(View.VISIBLE);               imageTable.setVisibility(View.VISIBLE);  }  @Override      protected void onProgressUpdate(Void... progress) {      }  @Override  protected Bitmap doInBackground(String... params) {         BitmapFactory.Options o = new BitmapFactory.Options();          o.inJustDecodeBounds = true;          BitmapFactory.decodeFile(params[0], o);          final int REQUIRED_SIZE=70;          //Find the correct scale value. It should be the power of 2.          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++;          }          //Decode with inSampleSize          BitmapFactory.Options o2 = new BitmapFactory.Options();          o2.inSampleSize=scale;                 return BitmapFactory.decodeFile(params[0], o2);  } }</code></pre>","427377","","","","","2013-09-05 20:48:18","Android Listview AsyncTask image problem","<android><android-asynctask><listivew>","3","0","1","",""
"4287466","1","4288305","","2010-11-26 17:37:51","0","9041","<p>I am working with Spinner, cursors and adapters.</p><p>I want to setup a click listener for the spinner so that once a user selects an item from the spinner it gets the current selected item and then carrys out some other tasks ( all this extra code is fine, its just 1 problem I am having).... It kind of works, however, once I declare the setOnItemSelectedListener callback, since the cursor has already been populated, the event is fired as soon as the app launches. </p><p>I guess I need a way to define the cursor without selecting an initial item so that the event doesnt fire (since an item will not be selected). Or is there another better way to achieve this?</p><p>Basically, as it stands, once the app loads the setOnItemSelectedListener function is firing because the cursor is being populated ( i think). Moreover, ignoreing the fact that the event is firing too soon, if I then select the -same- item in the spinner, it doesnt fire the event sincethe item didnt change. SHould I be using a different callback instead of setonitemslectedlistener? Here is the code I have so far. </p><pre><code>            c = db.getallrecents();    startManagingCursor(c);    busnumspinner = (Spinner) findViewById(R.id.Spinner01);        SimpleCursorAdapter spinneradapter = new SimpleCursorAdapter(this,                R.layout.lvlayout, c, spincol, spinto);    busnumspinner.setAdapter(spinneradapter);    busnumspinner.setOnItemSelectedListener(new OnItemSelectedListener() {        @Override        public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id) {            String spinnerString = null;            Cursor cc = (Cursor)(busnumspinner.getSelectedItem());            if (cc != null) {                spinnerString = cc.getString(                    cc.getColumnIndex(""busnum""));                text = spinnerString;            }            showDialog(DATE_DIALOG_ID);        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; parentView) {            // your code here        }    });</code></pre>","377613","","377613","","2010-11-26 18:02:41","2012-11-19 11:03:51","Android spinner ""onclicklistener"" question","<java><android>","4","1","1","",""
"4287473","1","4290532","","2010-11-26 17:38:44","28","10942","<p>I have this strange problem whereas whenever the soft keyboard appears, it resizes the background image. Refer to screenshot below:<img src=""http://i.stack.imgur.com/wXU2h.jpg"" alt=""alt text""></p><p>As you can see, the background is sorta squeezed. Anyone can shed a light on why the bg resizes?</p><p>My Layout is as follow, thank's in advance:</p><pre><code>    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""       android:background=""@drawable/page_bg"" android:isScrollContainer=""false""    &gt;        &lt;LinearLayout android:layout_height=""wrap_content""   android:orientation=""horizontal""  android:layout_width=""fill_parent"" &gt;       &lt;EditText android:id=""@+id/CatName""       android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:layout_weight=""1""   android:inputType=""textCapSentences""   android:lines=""1""  /&gt;  &lt;Button android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:text=""@string/save""   android:onClick=""saveCat""  /&gt; &lt;/LinearLayout&gt;     &lt;ImageButton      android:id=""@+id/add_totalk""  android:layout_height=""wrap_content""   android:layout_width=""wrap_content""  android:background=""@null""  android:src=""@drawable/add_small""  android:scaleType=""center""  android:onClick=""createToTalk""  android:layout_marginTop=""5dp"" /&gt;    &lt;/LinearLayout&gt;</code></pre>","135448","","","","","2013-06-04 11:55:54","Android: Soft Keyboard resizes background image","<android><view><android-linearlayout>","4","0","12","",""
"4287481","1","","","2010-11-26 17:39:34","0","1103","<p>I have read your solution to disable an Item in a List Activity in this link <a href=""http://stackoverflow.com/questions/2183610/android-how-to-disable-list-items-on-list-creation"">Android: How to disable list items on list creation</a>.But when i tested your solution, it works fine, the item wanted is disabled, but the separator of the list is gone.Do you Have an issue for this problem ?? </p>","521654","","750987","","2011-05-28 13:02:22","2011-05-28 13:02:22","disable an Item In the list View !","<android><android-listview>","1","2","","",""
"4287506","1","4289599","","2010-11-26 17:45:00","0","2544","<p>I have a screen (Activity) that does the following: it has a toggle button that toggles the airplane mode; it does it by using a service that spawn off a new Thread. It also has a button that does exactly the same thing in exactly the same way. There is really nothing fancy as the code snippets below show. While everything works as expected for the toggle button (airplane mode changes to ""on"" if currently the phone is not in airplane mode; changes to ""off"" if currently in airplane mode), when the button is clicked, the airplane mode toggles continuously (airplane mode toggles from ""on"" to ""off"" and back to ""on"" and then to ""off""...) as if it falls into a loop. After some research on the internet, I suspected this had something to do with the way the intent/broadcastReceiver for the phone/service state was fired in Android; as the toggle button had two states which effectively prevented the intent from being broadcast again. Is this correct?? If so, what would be the right way of toggling airplane mode using a button (vs. a radiobutton or a togglebutton)? </p><pre><code>/** Handler for the button. */runToggleAirplaneModeServiceBtn.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {    startService(new Intent(SleepScheduleController.this, AirplaneModeService.class));}});/** Handler for the toggle button. */airplaneModeToggleButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {    startService(new Intent(SleepScheduleController.this, AirplaneModeService.class));}});/** In the same screen as the toggle button and the button. * Need this to update the state of the toggle button once  * the toggling command is executed. */intentFilter = new IntentFilter(""android.intent.action.SERVICE_STATE"");receiver = new BroadcastReceiver() {    @Override    public void onReceive(Context context, Intent intent) {        displayAirplaneMode();    }};registerReceiver(receiver, intentFilter);private void displayAirplaneMode() {    if(airplaneModeToggler.isInAirplaneMode()){        airplaneModeToggleButton.setChecked(true);        airplaneModeTextView.setText(R.string.airplane_mode_on);    }else{     airplaneModeToggleButton.setChecked(false);     airplaneModeTextView.setText(R.string.airplane_mode_off);    }}/** Code snippet in AirplaneModeService*/@Overridepublic void onCreate() {    airplaneModeToggler = new AirplaneModeToggler(this);    Thread mThread = new Thread(null, airplaneModeToggleTask, ""AirplaneModeToggleTask"");    mThread.start();}private Runnable airplaneModeToggleTask = new Runnable() {    @Override    public void run() {        airplaneModeToggler.toggle(null);        AirplaneModeService.this.stopSelf();    }};/** Code snippet in the Utility class used by AirplaneModeService.*/public Boolean toggleAirplaneMode(Boolean enabling) {    boolean _enabling = enabling == null ? !isInAirplaneMode() : enabling.booleanValue();Settings.System.putInt(mContext.getContentResolver(),            Settings.System.AIRPLANE_MODE_ON,             _enabling ? AIRPLANE_MODE_ON : AIRPLANE_MODE_OFF);    Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);    intent.putExtra(""state"", _enabling);    mContext.sendBroadcast(intent);    return _enabling;}</code></pre>","392093","","392093","","2010-11-26 17:54:30","2010-11-27 01:34:00","Control and display airplane mode in Android","<android><button><radio-button><togglebutton><airplane>","1","1","1","",""
"4287809","1","","","2010-11-26 18:42:57","0","503","<p>I need to update the package name of my first Android app. To avoid changing the import in all my java classes, is there a way to specify the package name for the generated R.java file independent of the package name declared in the AndroidManifest.xml file?</p>","443755","","469983","","2012-11-19 11:05:54","2012-11-19 11:05:54","Setting the package name of R.java independent of package attribute in AndroidManifest.xml","<android><android-manifest>","1","2","","",""
"4287819","1","4288179","","2010-11-26 18:45:13","1","2622","<p>I have posted this question over a week ago on the Android dev list but so far no responses.</p><p>I have run into a weird issue. I work with a database located on /sdcard/ and for some reason whenever I add <code>&lt;uses-sdk android:minSdkVersion=""8"" /&gt;</code> to the manifest sqlite opens the db as read only. It gets a bit weirder too. The below code opens the db and checks if the db is readonly, which returns false:</p><p><code>db = SQLiteDatabase.openDatabase(""/sdcard/test.db3"", null,SQLiteDatabase.OPEN_READWRITE);Log.i(LOGTAG, ""Database status: "" + db.isReadOnly());</code></p><p>but if I try to write any data it bombs with:</p><p><code>INFO/Database(6576): sqlite returned: error code = 8, msg = preparedstatement aborts at 24: [INSERT INTO tags(type_id , tag)VALUES(?, ?);]ERROR/Database(6576): Error inserting type_id =1 tag=TestTagERROR/Database(6576): android.database.sqlite.SQLiteException: errorcode 8: attempt to write a readonly database</code></p><p>If I remove the uses-sdk tag from manifest everything works fine. I verified this behavior on the emulator, NexusOne running 2.2.1 and Galaxy Tab. Is this a known issue? Is there a workaround?</p><p>Any help will be greatly appreciated.</p>","521708","","","","","2010-11-26 19:50:27","Why are sqlite databases located on sdcard readonly when using min-sdk tag in manifest?","<android><android-manifest>","1","0","1","",""
"4288037","1","4288315","","2010-11-26 19:25:31","1","1502","<p>Hi I'm writing an app that has multiple activities. Right now it starts at the home screen, then when the user presses a button it starts a new activity and goes to another screen, then the user enters in information and presses a button to start another activity and another screen.</p><p>I have a menu setup so that from whatever the activity the user is in they can get back to the home screen. What I want it to do is kill all the current activities and just take the user right back to the home screen, so there is only one activity running again. How can I do this?</p>","515377","","","","","2010-11-26 20:17:25","switching between activities in android","<android><android-emulator>","2","0","","",""
"4288047","1","","","2010-11-26 19:27:22","1","1874","<p>I'm opening an xml-page in the WebView and I'm trying to read its xml-source (i.e. the xml that hasn't been ""translated"" by the browser), but I'm always getting the html source.</p><p>I've tried <a href=""http://lexandera.com/2009/01/extracting-html-from-a-webview"" rel=""nofollow"">this way</a>, but it's not usable (in my opinion) as WebView returns the already ""translated"" page (i.e. html instead of original xml).</p><p><strong>Simple code:</strong></p><pre><code>import android.app.Activity;import android.os.Bundle;import android.webkit.CookieSyncManager;import android.webkit.WebView;import android.webkit.WebViewClient;public class WebViewTest extends Activity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    CookieSyncManager.createInstance(this);    CookieSyncManager.getInstance().startSync();    WebView webview = new WebView(this);    webview.setWebViewClient(new WebViewClient() {      @Override      public void onPageFinished(WebView view, String url) {        CookieSyncManager.getInstance().sync();      }      @Override      public boolean shouldOverrideUrlLoading(WebView view, String url) {        view.loadUrl(url);        return true;      }    });    setContentView(webview);    webview.loadUrl(""http://eu.wowarmory.com/character-sheet.xml?r=Tirion&amp;cn=Random"");  }  @Override  protected void onPause() {    super.onResume();    CookieSyncManager.getInstance().stopSync();  }  @Override  protected void onResume() {    super.onResume();    CookieSyncManager.getInstance().startSync();  }}</code></pre><p><strong>The examples:</strong></p><p>a) xml-page URL: <code>http://eu.wowarmory.com/character-sheet.xml?r=Tirion&amp;cn=Random</code></p><p>b) xml-page source: <code>http://vipsaran.webs.com/character-sheet.xml</code></p><p>c) ""browser-translated"" source of the same page: <code>http://vipsaran.webs.com/character-sheet.html</code></p><p><em>(sorry for the text instead of links, I have a max of 1 link per post)</em></p><p><strong>Summary:</strong></p><p>So, what I'm trying to achieve is to open an URL (like a) in Android's WebView and to read its ""untranslated"" source (like b). <em>Not to read the ""translated"" source (like c).</em></p><p>Thanks in advance!</p>","451962","","","","","2011-01-11 13:17:41","How to read xml-page source from WebView","<android><xml><webview><source><world-of-warcraft>","1","0","","",""
"4288062","1","4288118","","2010-11-26 19:28:22","0","4072","<p>i want my app to run in the background as it has to get the time every second..and do some task when the user sets a time and wants the app to do some task at that time..!!</p>","470892","","","","","2010-11-28 21:04:35","i want to make my android app run in the background 24/7 unless closed by the user..what do i do..?","<java><android><background>","4","2","","",""
"4288091","1","4766168","","2010-11-26 19:34:24","5","1084","<p>I've currently written an app that is observing the content://sms URI for any changes to the database. My observer is successfully being triggered when individual messages are added or removed, however, no notification is triggered when an entire thread is deleted at once. Is there any way to get this event to trigger? Or maybe there's another content provider I should be observing?</p><pre><code>Uri URI = Uri.parse(""content://sms"");String[] columns = {""_id"", ""date""};Cursor c = getContentResolver().query(URI, columns, ""type=?"", new String[]{""1""}, ""_id DESC"");Observer observer = new Observer();c.registerContentObserver(observer);</code></pre><p>And my observer class:</p><pre><code>private class Observer extends ContentObserver {    public Observer() {        super(null);    }    @Override    public void onChange(boolean selfChange) {        super.onChange(selfChange);        if (!selfChange) {            // do stuff            // never called when a thread is deleted        }    }}</code></pre>","521722","","521722","","2011-01-12 05:12:20","2012-03-20 13:12:42","Android: Observing SMS for Deleted Threads","<android><android-contentprovider>","1","3","1","",""
"4288127","1","","","2010-11-26 19:40:47","0","789","<p>I have an ImageView with a background image. On top of this ImageView is a custom view which utilizes a Bitmap to allow the user to draw/paint. Currently theBitmap ""captures"" the background drawable so that every time theonDraw method is called (which is frequently) the Bitmap with thebackground image drawn onto it are constantly redrawn on the screenthus creating a lot of lag (the tail of the paint is slow followingthe user's finger).</p><pre><code>    protected void onDraw(Canvas canvas) {        canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);        canvas.drawPath(mPath, mPaint);    }</code></pre><p>So what I am trying to do is ""hide"" the ImageView from the Bitmap sothat it does not get ""captured"". I want the ImageView to display sothe user sees it but not be drawn onto the Bitmap. How can I hide thebackground image from being painted onto the Bitmap?</p><p>I tried ImageView.setWillNotCacheDrawing(true) andImageView.setWillNotDraw(true) to no avail.</p><p>Any help would be greatly appreciated!</p><p>Matt. </p>","457534","","","","","2010-11-26 19:40:47","Hide Background ImageView from above Bitmap/Canvas","<android><canvas><bitmap><imageview><ondraw>","0","2","","",""
"4288270","1","4288352","","2010-11-26 20:06:54","0","100","<p>My app works on two different phones, but it no longer works on the emulator. I immediately get the stopped unexpectedly error on the emulator. I have rebooted my computer, and it did not change things. I am at wits end!</p><p>The debugger shows this:</p><pre><code>Thread [&lt;1&gt; main] (Suspended (exception RuntimeException))      ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2663      ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2679       ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125     ActivityThread$H.handleMessage(Message) line: 2033      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>","479542","","418183","","2010-11-26 20:10:25","2010-11-26 20:25:08","App works on real phones but no longer on emulator","<android>","1","2","1","",""
"4288274","1","4288496","","2010-11-26 20:07:55","1","1428","<p>After downloading images it saves them to this location</p><pre><code> String extStorageDirectory;protected void onCreate(Bundle icicle) {extStorageDirectory = Environment.getExternalStorageDirectory().toString(); //set it to the SD card directory} public void savetoSD(Integer Index) //Index is what pic number it is 1 through 9    {        OutputStream outStream = null;        String filename = ""Hentai"" + System.currentTimeMillis() + "".JPEG"";        String filepath = extStorageDirectory + ""/media/pictures/MyAppsDownloadFolder/"" + filename;        File file = new File(filepath);           try {            outStream = new FileOutputStream(file);            //get a download here for the real bitmap            DownloadFromUrl(myMainPicURL[Index],filename);            Bitmap saveME = null;                    saveME = BitmapFactory.decodeFile(PATH+filename);                    saveME.compress(Bitmap.CompressFormat.JPEG, 100, outStream);                outStream.flush();                outStream.close();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            //need to refresh the damned MediaScanner            try {                MediaStore.Images.Media.insertImage(getContentResolver(), filepath, filename, ""myDownloadedPics"");            } catch (FileNotFoundException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            message_user(""Saved as "" + filepath);    }</code></pre><p>I believe the mediastore doesnt work or i dont know how to use it please help</p><p>I want the downloaded images to appear in the gallery or atleast have the folder MyAppsDownloadFolder to show in the gallery which it doesnt!</p>","499046","","","","","2010-11-26 20:57:08","My android app can download images but doesn't appear in gallery","<android><download><image><mediastore>","1","0","2","",""
"4288381","1","4288400","","2010-11-26 20:32:00","2","4201","<p>sometimes when i m trying to run my code the eclipse console say Error in an XML file: aborting build.that means that i have a mistake in my main.xml file.is there any way to find my mistake without making guess and erasing some xml code in order to see where is the problem?something like validation of my xml file!!thanks</p>","519526","","","","","2010-11-26 20:50:14","how to find my errors in the xml file","<android><xml><android-xml>","3","0","","",""
"4288434","1","","","2010-11-26 20:44:49","2","1587","<p>In the ContentObserver class, the method onChange is passed a boolean selfChange that's defined as: <em>""true if the update was caused by a call to commit on the cursor that is being observed.""</em></p><p>What's the proper way to update the cursor so that selfChange is set to true? My current code doesn't reference the cursor at all for an update and selfChange is always false as a result.</p><pre><code>ContentValues values = new ContentValues();values.put(""date"", date.getTime());getContentResolver().update(URI, values, ""_id = "" + id, null);</code></pre>","521722","","","","","2014-01-29 00:09:59","Android: ContentObserver selfChange","<android>","3","1","","",""
"4288539","1","4288862","","2010-11-26 21:06:56","4","1731","<p>I draw a lot of lines rectangles each frame in my game - it's a recreation of an old school handheld electronic game. The ones that had crude dot matrix display for the main game and custom images for text or some images.</p><p>I have 20x20 big ""pixels"" on a virtual dot matrix screen, I also draw some 7-segment displays on the screen and some other things.</p><p>According to TraceView, most of time is spent at drawLine and drawRectangle methods, because there is simply too much of them. I draw each 'pixel' of the dot matrix display, and each segment of 7-segment displays in <em>every</em> frame.</p><p>An optimization came to my mind, that I would repaint only those pixels/segments which changed, so I have saved the previous state of pixels/segments and tried to repaint only changed ones. Basically it's a crude invalidation.</p><p><strong>The behavior I was expecting was that the Canvas would stay as it was after the last frame finished painting, and I would only repaint necessary stuff.</strong></p><p>Alas, my Canvas was flickering to black and every once in a while when state of my screen changed, only pixels of dot matrix display/segments flickered on for a frame. And I made sure that I didn't Clear my canvas.</p><p>I'm drawing on a Canvas inside a SurfaceView, updating Thread, as is described in Lunar Lander Android sample. In the Lunar Lander sample, they repaint everything in each frame.</p><p>Maybe I could render everything to a Bitmap on the first frame, then update that Bitmap on every other frame?</p><p><strong>Which technique should I use for my paint() method?</strong></p>","72746","","72746","","2010-11-26 21:16:25","2010-11-26 22:10:38","How to draw game on Android Canvas with lots of primitives","<android><canvas>","2","3","","",""
"4288605","1","4288617","","2010-11-26 21:20:51","3","464","<p>I'm working on an Android application. Our problems manifest when the user runs our app, navigates away via the home or back button, and comes back later. From the official Android <a href=""http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle"" rel=""nofollow"">activity lifecycle documentation</a> and Eric Burke's helpful reformatting of the <a href=""http://stuffthathappens.com/blog/2008/11/05/android-activity-lifecycle-updated/"" rel=""nofollow"">lifecycle diagram</a>, I suspect that our activity is begin killed while stopped, but (critically) not destroyed.</p><p>In other words, from running, the functions called are <code>onPause(), onStop(), onRestart(), onStart()</code>, and <code>onResume()</code>. Note, importantly, that this means that <code>onRestart()</code> is being called in the middle instead of onCreate(), which would happen if the app were just killed and removed from memory. This, I think, is the problem.</p><p>That's the setup. Here's the question: is there any way that I can reliably force the application to be <strong>stopped</strong> so that I can reproduce this condition. I don't want to kill the app, and I don't want it to just be <code>paused</code>. </p><p>Is there an ADB command? DDMS? Something in the phone?</p><p>I've tried faking it by running other memory-hungry apps, but that always just leads it getting killed outright, which means the app gets started all over and onCreate is run and I don't learn anything.</p>","28001","","28001","","2010-11-27 00:36:25","2010-11-27 00:36:25","How do I stop (not kill) an Activity to trigger an onRestart()?","<android><activity><stop>","1","0","2","",""
"4288707","1","4288734","","2010-11-26 21:43:00","0","396","<p>this is my main.xml file</p><pre><code>?xml version=""1.0"" encoding=""utf-8""?&gt;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/label""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""This is the first photo:""        /&gt;    &lt;ImageViewGroup       android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:orientation=""vertical""&gt;    &lt;ImageView     android:id=""@+id/pc1""    android:adjustViewBounds=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@drawable/icon""        android:layout_alignParentRight=""true""        /&gt;    &lt;ImageView    android:id=""@+id/pc2""    android:adjustViewBounds=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@drawable/icon""        /&gt;        &lt;/ImageViewGroup&gt;         &lt;RatingBar          android:id=""@+id/ratingbar""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:numStars=""5""        android:stepSize=""1.0""/&gt;/    LinearLayout&gt;`</code></pre><p>i m trying to create a group that will be including from 2 images at vertical orientation.If it was radio button i could create a .what i must use for images?(here i tried ImageViewGroup but its wrong!!)thanks!!</p>","519526","","345717","","2010-11-26 21:53:50","2010-11-26 21:53:50","images in LinearLayout","<android><android-widget>","1","1","","",""
"4288728","1","4288840","","2010-11-26 21:47:18","0","911","<p>I have been struggling with this for several days now and I ran out of ideas. </p><p>In my listview, each row can have a vertical bar flushed left with a different color depending on status. That ""bar"" has no other purpose than visual representation of status and is not clickable.</p><p>I implemented the vertical bar using an ImageView with background set to a drawable which has the desired color. The problem is that the vertical bar doesn't stretch, it's only 1 pixel high even though I specified fill_parent.</p><p>The row layout is 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"" &gt;    &lt;ImageView        android:id=""@+id/id1""        android:scaleType=""fitXY""        android:layout_width=""5dp""        android:layout_height=""fill_parent""        android:background=""@drawable/d1"" /&gt;    &lt;RelativeLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/id1""&gt;...</code></pre><p>(leaving content of the second relative layout out on purpose for simplicity)</p><p>My drawable d1 looks like this:</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=""@color/c1"" /&gt;    &lt;corners android:topRightRadius=""5dip"" android:bottomLeftRadius=""5dip"" /&gt;&lt;/shape&gt;</code></pre><p>So,</p><ol><li>Why isn't the ImageView stretching vertically?</li><li>Is there a better way to implementthis than using an ImageView? (Itried a simple View with abackground color but it doesn't showup at all)</li></ol><p>Any help greatly appreciated. Thanks</p>","59201","","59201","","2010-11-26 23:12:15","2010-11-26 23:12:15","Android ImageView not stretching vertically in ListView row","<android>","1","0","","",""
"4288807","1","4289784","","2010-11-26 22:00:54","20","15490","<p>I've been looking through the documentation for <code>ProgressBar</code> class and found these attributes:</p><ul><li>android:progressBarStyle</li><li>android:progressBarStyleHorizontal</li><li>android:progressBarStyleLarge</li><li>android:progressBarStyleSmall</li></ul><p>These four parameters are supposed to be a reference to some style as I take it. So the question is, what are these for? Style for the progress bar is set via android:style attribute and a reference to the global style attributes.</p><p>Documentation doesn't say anything helpful, searched the Web, found nothing.</p>","45668","","56285","","2013-12-23 15:40:06","2013-12-23 15:40:06","What's the meaning of android:progressBarStyle attribute in ProgressBar?","<android><android-progressbar><android-styles>","2","0","11","",""
"4288889","1","","","2010-11-26 22:16:28","0","4353","<p>I have main activity + service. Service is calling second activity.- If main is in foreground, all is fine. Second is opened above main.- If I close main by ""Back"" button, then second is opened above desktop. It's cool.- BUT when I close main by switching to desktop (press ""Home"" button), then second activity is opened invisible and you can see it only when you switch to app's task.</p><p>Can you help me to move my task to foreground in case if app is in background?I tried make second activity as new task, but this doesn't help.</p>","148387","","15168","","2012-05-04 21:15:31","2014-01-19 10:35:25","Android Bring Task to Front","<android><activity><task><foreground>","3","0","1","",""
"4289230","1","4289320","","2010-11-26 23:38:07","2","1178","<p>I've implemented a simple Observer pattern in a ""hello world"" style app.</p><p>I've got 2 buttons, which call <code>onStart()</code> and <code>onDestroy()</code> on a <code>Service</code>.</p><p>In the <code>onStart()</code> I register an observer and then get my observer to run a for loop calling <code>observe.update()</code> once every second for 10 seconds. This in turn calls an <code>update()</code> method in my service.</p><p>I'm trying to display some dummy data which gets returned, but I'm getting the following error : </p><pre><code>11-26 23:21:12.829: ERROR/AndroidRuntime(676): FATAL EXCEPTION: Thread-8        java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()        at android.os.Handler.&lt;init&gt;(Handler.java:121)        at android.widget.Toast.&lt;init&gt;(Toast.java:68)        at android.widget.Toast.makeText(Toast.java:231)        at com.jameselsey.observerpattern.LocalService.observe(LocalService.java:27)        at obs.Stub$1.run(Stub.java:49)        at java.lang.Thread.run(Thread.java:1096)</code></pre><p>I'm doing the following in my service : </p><pre><code>public void observe(String message)    {        Context context = getApplicationContext();        Log.d(""TEST"", ""Inside observe() on service, value is "" + message);        Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);        toast.show();    }</code></pre><p>After a bit of research, it seems I can't create a Toast message as this method doesn't run on the main UI thread.</p><p>Is there anyway I can spit out <code>message</code> onto my UI? I'm just looking to have it display on the activitiy, even a regular textView is OK.</p>","155695","","","","","2010-11-26 23:57:46","How can I update my UI using an observer?","<android><observer-pattern><android-2.1-eclair>","1","2","","",""
"4289275","1","4289326","","2010-11-26 23:46:40","3","820","<p>I did the following:</p><ol><li>Create a working Android project (not a library or test project) in Eclipse.  It has a single package called X with an activity X.A.</li><li>Create a new Java package Y within the aforementioned project with at least one class Y.C.</li><li>Call Y.C from within X.A (that is, call something in the new package from the original package that previously works).</li><li>Build and run the Android project.</li></ol><p>It builds fine, but throws NoClassDefFoundError on the first line using Y.C, saying it cannot find Y.C.  When I Refactor -> Move Y.C into package X (so it is now X.C), the runtime exception is no longer thrown.  What's wrong?</p><p>Vague hint: I've read that similar problems can happen when the build-time and runtime classpaths get out of sync somehow, but I haven't found yet how to troubleshoot or fix the issue.</p>","120682","","","","","2010-11-26 23:58:54","NoClassDefFoundError happens at runtime when I use mutliple Java packages in a single Android project","<android><eclipse><build-process><noclassdeffounderror>","1","0","","",""
"4289337","1","4289621","","2010-11-27 00:01:24","0","2652","<p>I'm working on an app that has a canvas with a bunch of little images that the user can drag around, and a ""box"" that the user will drag from to create new image objects or drag an existing image to it, and it will remove it. </p><p>What is the best way to detect if the user has touched an area, or an image on the screen? The first thing that comes to mind is obviously comparing the touch coordinates with each object's coordinates, but that seems a little cumbersome. Is there a better, or built in way?</p><p>Thanks</p>","368845","","","","","2010-11-27 01:34:36","How to detect when a drawable is touched","<android><touch><drawable>","2","2","1","",""
"4289342","1","4289700","","2010-11-27 00:02:30","0","365","<p>Hey, How can I get my application into the Complete action using for Long press of the Search button? I already know that the action is SEARCH_LONG_PRESS, but what do I do with this in the Manifest so that my application will show up in this list?</p>","481082","","","","","2010-11-27 01:55:43","Catching Complete action using","<android><android-manifest>","1","0","","",""
"4289354","1","","","2010-11-27 00:06:03","1","230","<p>I am going to start on my first graphics program on the Android(<a href=""http://blog.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/"" rel=""nofollow"">http://blog.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/</a>), but it would seem faster to use use javascript, and so use <code>WebGL</code> (<a href=""http://en.wikipedia.org/wiki/WebGL"" rel=""nofollow"">http://en.wikipedia.org/wiki/WebGL</a>) to prototype the graphical part of the game.</p><p>One difference is in how textures are done, I expect, but for the main part of the game, which is this case is something similar to Tetris, in that you try to pack various shapes into a container optimally.</p><p>I would like to prototype it in javascript, but if it will be work to get it to work on the Android then it may not be worth it, hence my question as to how similar is OpenGL on these two platforms?</p>","67566","","","","","2011-02-10 16:08:31","Would WebGL be a good prototype for code that will work on the Android platform","<android><opengl-es><webgl>","2","0","","",""
"4289364","1","4289370","","2010-11-27 00:08:47","2","490","<p>I am new to android and developing a small game based on AndEngine (www.andengine.org).</p><p>The game displays a tiled map for the background, with different types of tiles (some moveable, some rotatable). I also draw some lines on the screen.</p><p>The problem is, when the game runs first time (running on phone, started from Eclipse) it runs flawlessly but if I exit the game using the phone's BACK button and restart the game from the phone homescreen icon the application is very buggy. The lines no longer appear on the screen and the functionality of moving and rotating tiles works only once then the game is non-operational. It doesn't crash but the bugs caused by the game restart make it useless.</p><p>I've read all I can find on the application lifecycle and tried setting various objects to null in the onDestroy() method but nothing I do has made any difference. Something is clearly 'hanging around' from the first app run and causing issues when it is started a second time. Please help, 24 hrs of Googling and wracking my brain has been fruitless.</p><p>Thanks,Steve</p><p>P.S. Same behaviour when run in emulator.</p><p>UPDATE:</p><p>I investigated my code further:</p><p>I created a small program to investigate part of the above issue, drawing a line and it not being drawn on the re-run of the app.</p><p>Using AndEngine one must Override onLoadScene(). In this method you specify what you want on screen at startup and the method returns a Scene object. A Scene handles what you see on-screen, so if you want to say, add a new line (or sprite,  or whatever) to the screen, you call myScene.addEntity(myLine). I created a main activity class and a class called MyLine which draws the line.</p><p>My main activity:</p><pre><code>public class LineTest extends BaseGameActivity {@Override    public Scene onLoadScene() {        scene = new Scene(1);        myLine = new MyLine();        myLine.displayLine();           return scene;    }}</code></pre><p>The MyLine class:</p><pre><code>public class MyLine {    static final Scene SCENE = LineTest.scene;    static final int LINE_WIDTH = 4;    Line line = new Line(0,0,0,0);    public MyLine() {    }    public void displayLine() {        line.setLineWidth(4);        line.setColor(1f, 0f, 0f);        line.setPosition(10, 10, 400, 400);        SCENE.getBottomLayer().addEntity(line);     }     public void removeLine() {        SCENE.getBottomLayer().removeEntity(line);    }}</code></pre><p>You may notice a problem with the above, in my defense I am new to Java and OOP.My activity uses only one Scene, so I thought, within my MyLine class, I could declare SCENE as a static final as it will not change. WRONG!Debugging the program I found that the static final SCENE once set, never changes, even after the program has been stopped (using back key) and restarted. However, when the program restarts the code Scene scene = new Scene(1); creates a new Scene with a new ID, so the static final SCENE points to the old Scene not the new one, hence no line is created in the new scene.</p><p>I found that two options work to resolve this:</p><p>Either:</p><pre><code>Scene SCENE = LineTest.scene;</code></pre><p>Or:</p><pre><code>static Scene SCENE;</code></pre><p>And in constructor:</p><pre><code>    SCENE = LineTest.scene; //I could also pass scene as param to constructor which may be better OOP practice.</code></pre><p>I suspect my other issues with my game application are all related to declaring things as static or static final when they shouldn't be.</p><p>Is there a rule of thumb I can use when deciding what type variables (and methods) should be?</p><p>UPDATE: I had three variables in my Game class declared as static final when they should have been just static. Changing them to static and assigning them in the constructor has resolved all the problems, WOOHOO! {:-)</p>","457199","","1864222","","2013-05-19 03:31:15","2013-05-19 03:31:15","Problems running Android app for second+ time","<java><android><andengine>","4","2","0","",""
"4289414","1","4289421","","2010-11-27 00:28:13","8","2842","<p>I am an app developer and I have a paid Android app in the market. I'd like to give one free copy to a specific person. Is this possible to do, and if so, how?</p>","47493","","","","","2011-06-10 04:03:06","How can I give away a free copy of my paid Android app?","<android>","2","0","2","",""
"4289439","1","","","2010-11-27 00:35:16","0","5672","<p>I am using a titlebar with a background image in my android app.</p><p>values/custom_styles.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;style name=""TitlebarBackgroundStyle""&gt;        &lt;item name=""android:background""&gt;@drawable/titlebar&lt;/item&gt;    &lt;/style&gt;    &lt;style name=""Theme.MyCustomTheme"" parent=""android:Theme""&gt;         &lt;item name=""android:windowTitleBackgroundStyle""&gt;@style/TitlebarBackgroundStyle&lt;/item&gt;        &lt;item name=""android:windowTitleSize""&gt;45dp&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>layout/titlebar.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""horizontal"" android:layout_width=""fill_parent"" android:layout_height=""45dip"" android:gravity=""center_vertical""&gt; &lt;ImageView  android:id=""@+id/header""  android:src=""@drawable/titlebar""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Manifest:</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:theme=""@style/Theme.MyCustomTheme""&gt;</code></pre><p>This works pretty well so far.</p><p>The only thing I'd like to do now is to hide the text on the titlebar ... </p><p>I tried:</p><pre><code>&lt;item name=""android:textSize""&gt;0dp&lt;/item&gt;</code></pre><p>but with no luck. Is there any way to set the transparency or some other property that would allow me to see the background image but not the text?</p><p>thanks for your thoughtsRon</p>","195932","","","","","2012-09-11 06:24:46","Android custom TitleBar - hide text","<android><background><imageview><titlebar>","8","1","2","",""
"4289689","1","4306361","","2010-11-27 01:50:19","1","6840","<p>I am trying to create an ExpandableListView with selectable elements(children) so that the selections don't disappear after a group is closed or the selected elements are scrolled away.I haven't found any native solution for this so I've tryed to save the selected state of the elements in a seperate list and change the state and color of the elements in an onChildClickListner. The problem is - I can't get the Listner to work. It just won't go inside. However I can set a Listner on each child seperately. This does work but doesn't solve my problem because in this case I don't get any information about the position of a child in group.It's probably just a small mistake.. here is the code:</p><p>p.s. some variable names are in German, sorry for that =)p.p.s. I'd be grateful for any hints!</p><pre><code>package com.example.android.apis;import java.util.ArrayList;import android.app.ExpandableListActivity;import android.os.Bundle;import android.view.Gravity;import android.view.View;import android.view.ViewGroup;import android.widget.AbsListView;import android.widget.BaseExpandableListAdapter;import android.widget.ExpandableListAdapter;import android.widget.ExpandableListView;import android.widget.TextView;import android.widget.ExpandableListView.OnChildClickListener;public class ApiDemos extends ExpandableListActivity {    // This one works just fine if i set it for each child    private View.OnClickListener cl1 = new View.OnClickListener() {        public void onClick(View v) {            if (((TextView) v).isSelected() == false) {                ((TextView) v).setSelected(true);                ((TextView) v).setTextColor(RED);            } else {                ((TextView) v).setSelected(false);                ((TextView) v).setTextColor(WHITE);            }        }    };    // each child has a relation with one of these:    class veranstaltungView {        public String text;        public boolean marked;        public veranstaltungView(String txt) {            text = txt;            marked = false;        }    }    // This one is set on the whole ExpandableListView. It just doesnt get    // inside!    private OnChildClickListener cl = new OnChildClickListener() {        public boolean onChildClick(ExpandableListView parent, View v,                int groupPosition, int childPosition, long id) {            if (((TextView) v).isSelected() == false) {                veranstaltungenList.get(groupPosition).get(childPosition).marked = true;                ((TextView) v).setSelected(true);                ((TextView) v).setTextColor(RED);            } else {                veranstaltungenList.get(groupPosition).get(childPosition).marked = false;                ((TextView) v).setSelected(false);                ((TextView) v).setTextColor(WHITE);            }            return false;        }    };    private static final int WHITE = 0xffffffff;    private static final int RED = 0xffbc0000;    ExpandableListAdapter mAdapter;    private ArrayList&lt;ArrayList&lt;veranstaltungView&gt;&gt; veranstaltungenList;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // generate some elements        veranstaltungenList = new ArrayList&lt;ArrayList&lt;veranstaltungView&gt;&gt;();        for (int i = 0; i &lt; 6; i++) {            ArrayList&lt;veranstaltungView&gt; semester = new ArrayList&lt;veranstaltungView&gt;();            for (int j = 0; j &lt; 3; j++) {                semester.add(new veranstaltungView(""Veranstaltung "" + i + "".""                        + j));            }            veranstaltungenList.add(semester);        }        // Create and set the adapter        ExpandableListView elv = getExpandableListView();        mAdapter = new MyExpandableListAdapter();        setListAdapter(mAdapter);        elv.setItemsCanFocus(false);        elv.setChoiceMode(ExpandableListView.CHOICE_MODE_MULTIPLE);        elv.setOnChildClickListener(cl);    }    public class MyExpandableListAdapter extends BaseExpandableListAdapter {        // The groups        private String[] semesterArray = { ""SEMESTER1"", ""SEMESTER2"",                ""SEMESTER3"", ""SEMESTER4"", ""SEMESTER5"", ""SEMESTER6"" };        public Object getChild(int groupPosition, int childPosition) {            return veranstaltungenList.get(groupPosition).get(childPosition).text;        }        public long getChildId(int groupPosition, int childPosition) {            return childPosition;        }        public int getChildrenCount(int groupPosition) {            return veranstaltungenList.get(groupPosition).size();        }        public TextView getGenericView() {            // Layout parameters for the ExpandableListView            AbsListView.LayoutParams lp = new AbsListView.LayoutParams(                    ViewGroup.LayoutParams.FILL_PARENT, 64);            TextView textView = new TextView(ApiDemos.this);            textView.setTextColor(WHITE);            textView.setLayoutParams(lp);            // Center the text vertically            textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);            // Set the text starting position            textView.setPadding(36, 0, 0, 0);            return textView;        }        public View getChildView(int groupPosition, int childPosition,                boolean isLastChild, View convertView, ViewGroup parent) {            TextView textView = null;            textView = getGenericView();            textView.setText((String) getChild(groupPosition, childPosition));            textView.setClickable(true);            textView.setSelected(veranstaltungenList.get(groupPosition).get(                    childPosition).marked);            if (veranstaltungenList.get(groupPosition).get(childPosition).marked == true)                textView.setTextColor(RED);            else                textView.setTextColor(WHITE);            // textView.setOnClickListener(cl1);            return textView;        }        public Object getGroup(int groupPosition) {            return semesterArray[groupPosition];        }        public int getGroupCount() {            return veranstaltungenList.size();        }        public long getGroupId(int groupPosition) {            return groupPosition;        }        public View getGroupView(int groupPosition, boolean isExpanded,                View convertView, ViewGroup parent) {            TextView textView = getGenericView();            textView.setText(getGroup(groupPosition).toString());            return textView;        }        public boolean isChildSelectable(int groupPosition, int childPosition) {            return true;        }        public boolean hasStableIds() {            return true;        }    }}</code></pre>","507481","","82118","","2011-01-29 00:47:57","2012-11-18 09:58:57","ExpandableListView - select elements","<android><expandablelistview>","1","0","","",""
"4289714","1","4289861","","2010-11-27 01:59:37","0","1152","<p>i have listview the fisrt time i when i click to row it open the context menu then  i override the oncontextitemselected </p><pre><code>public boolean onContextItemSelected(MenuItem item) {    switch(item.getItemId()) {        case CALL_ID:        {        AdapterContextMenuInfo info2 = (AdapterContextMenuInfo) item.getMenuInfo();        String phone=mDbHelper.getPhone(info2.id);        String toDial=""tel:""+phone.toString();        startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse(toDial)));        return true;        }    }    return super.onContextItemSelected(item);}</code></pre><p>this do correctly but when i </p><pre><code>public boolean onMenuItemSelected(int featureId, MenuItem item) {        switch(item.getItemId()) {        case CALL_ID:        {        AdapterContextMenuInfo info2 = (AdapterContextMenuInfo) item.getMenuInfo();        String phone=mDbHelper.getPhone(info2.id);        String toDial=""tel:""+phone.toString();        startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse(toDial)));        return true;        }        return super.onMenuItemSelected(featureId, item);    }}</code></pre><p>the app crashed can u show me the difference between them</p>","510992","","11238","","2011-01-07 09:29:20","2011-01-07 09:29:20","option menu and context menu","<android><menu>","1","0","1","",""
"4289736","1","4290544","","2010-11-27 02:07:40","1","1873","<p>I'm trying to send open up the messaging app to start a sms message from a widget but when I start the activity I get the ""Complete action using"" dialog with a long list of applications but I don't see the messaging application that I think should be the default for trying to send sms messages.</p><p>Here is my code:</p><pre><code>public void onUpdate(Context context,     AppWidgetManager appWidgetManager, int[] appWidgetIds) {   Intent sendIntent = new Intent(Intent.ACTION_VIEW);   PendingIntent smsIntent1 = PendingIntent.getActivity(context, 0, sendIntent, 0);   sendIntent.putExtra(""address"", ""8017777777"");   sendIntent.setType(""vnd.android-dir/mms-sms"");   views.setOnClickPendingIntent(R.id.sms_btn1, smsIntent1);   appWidgetManager.updateAppWidget(appWidgetIds, views);   super.onUpdate(context, appWidgetManager, appWidgetIds); </code></pre><p>}</p><p>and my manifest has this in it:</p><pre><code>&lt;uses-permission android:name=""android.permission.SEND_SMS""/&gt;</code></pre><p>Any ideas? Thanks!</p>","469682","","","","","2010-11-27 07:08:45","trying to send SMS message brings up ""Complete action using"" dialog, but messaging app isn't in the list?","<android><sms><android-widget>","2","0","","",""
"4289775","1","5150221","","2010-11-27 02:19:12","4","3145","<p>I'm working on an Android app, specifically one that uses the Facebook Android SDK.  In development mode, I'm working with a test Facebook app that goes by one ID.  However, in release mode, the app will be working with second Facebook app with a different ID.</p><p>I'm wondering how most Android (or Java might be a suitable enough realm of knowledge) developers here go about having their app automatically build with debug vs. release values.  An ideal solution does not involve a manual switch (e.g.: switching <code>public static final DEBUG = false;</code> to <code>true</code>) before building.</p>","107277","","","","","2012-04-17 09:52:29","How to make Android app automatically configure w/ debug vs. release values?","<java><android><release><environment>","5","0","3","",""
"4289795","1","","","2010-11-27 02:26:41","0","247","<p>I have a program where I am going to a website, grabbing XML and parsing, pretty simple.</p><p>Here is the code that works just fine, it's started in the onCreate method</p><pre><code>final Handler handler = new Handler(){ public void handleMessage(Message msg){        progDialog.dismiss();        parse(xmlOut);             }};</code></pre><p><code>progDialog = ProgressDialog.show(this, ""Working..."", ""Doing something..."");thread = new Thread(){</p><pre> public void run(){xmlOut = doSomeFunction(todaysDate);handler.sendEmptyMessage(0); }};</code></pre><p>thread.start();</p><p>I then have a button on the page that reloads the data if a user chooses a different date, can't re-run the same thread, so I just copied the exact same code, changed all the variable names and put it int the OnClickListener for the Button.</p><p>When I click the button I get an exception and get this</p><p>android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</p><p>Doing something wrong but not sure what exactly.  I dont' write too many threaded programs so I am sure I am missing something.</p>","521961","","","","","2010-11-27 03:18:08","Having a problem updating UI from a second thread where the first thread works just fine","<android>","1","0","","",""
"4289820","1","","","2010-11-27 02:36:01","0","450","<p>how i can get the long kick on the row of listview</p>","510992","","","","","2011-11-18 05:05:31","list view on click","<android>","2","0","","",""
"4289862","1","4314553","","2010-11-27 02:48:36","2","872","<p>Hey there-  I'm creating a Live Wallpaper which includes text that is drawn directly to the canvas via a TextPaint and DynamicLayout object.  Within my DynamicLayout Object I set the width to the canvas width, and am now looking for a way to wrap the text that extends past the canvas.  Here is my text set up code:</p><pre><code>    //token is my large text string    TextPaint tp = new TextPaint();    Layout sl = new DynamicLayout(token, tp, (int) canvasWidth, Layout.Alignment.ALIGN_NORMAL, 0, 0, true);    canvas.translate(startPositionX , startPositionY);    sl.draw(canvas);</code></pre><p>How do I wrap this text if it extends past the canvasWidth?  Any help is appreciated!</p>","518116","","","","","2010-11-30 14:02:07","How do you wrap DynamicLayout text?","<android><canvas><android-layout>","1","0","","",""
"4290073","1","4591067","","2010-11-27 04:07:01","1","3663","<p>I am new to Android platform and trying to establish a http request but My Url contains some special characters So it is throwing an Exception.How to Avoid this problem.I did same thing In i-phone Using       [mystring stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]</p>","438676","","","","","2011-01-04 06:02:14","Special character on Http Request","<java><android>","2","0","3","",""
"4290089","1","4296054","","2010-11-27 04:12:15","6","7869","<p>Apparently this is a fairly often experienced issue. I'm not sure entirely where the problem lies, or what needs to be adjusted, but for the life of me I cannot retrieve anything other than a NULL result to my SoapObject or SoapPrimitive from my .NET XML web service with parameters.</p><p>I've tried everything I've found on the net:</p><ul><li>Adding the .setXmlVersionTag = no change</li><li>Using SoapObject instead of SoapPrimitive = no change</li><li>Using SoapPrimitive instead of SoapObject = no change</li><li>Using HttpTransportSE instead of AndroidHttppTransport = no change</li><li>Using AndroidHttpTransport instead of HttpTransportSE = no change</li><li>Setting .dotNet = true = no change</li><li>Removing .dotNet assignment line = no change</li><li>Removing the colon (entire HTTP:// prefix) from the web service = no change</li><li>Using the PropertyInfo class instead of direct assignment = no change</li><li>Using direct assignment instead of the PropertyInfo class = no change</li></ul><p>I'm at a total loss and it's quite frustrating. I have total control of the web service (I wrote it) so minor changes, if helpful, I'm willing to attempt.</p><p>Currently my code as follows is this:</p><pre><code>public void GetResults(){SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);request.addProperty(""lastName"", ""sm"");request.addProperty(""middleName"", """");request.addProperty(""firstName"", """");request.addProperty(""pageSize"", 25);request.addProperty(""pageNumber"", 1);SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);           soapEnvelope.dotNet = true;soapEnvelope.setOutputSoapObject(request);//AndroidHttpTransport aht = new AndroidHttpTransport(URL);HttpTransportSE aht = new HttpTransportSE(URL);try{    aht.setXmlVersionTag(""&lt;?xml version=\""1.0\"" encoding=\""UTF-8\""?&gt;"");    aht.call(SOAP_ACTION, soapEnvelope);               //SoapObject result = (SoapObject)soapEnvelope.bodyIn;    SoapObject result = (SoapObject)soapEnvelope.getResponse();    //SoapPrimitive result = (SoapPrimitive) soapEnvelope.getResponse();    //Object result = soapEnvelope.getResponse();    Log.d(""WS"", String.valueOf(result));          }catch(Exception e){    e.printStackTrace();}       }</code></pre><p>and my globals look like this:</p><pre><code>private static final String SOAP_ACTION = ""http://yoda/SearchPerson"";private static final String METHOD_NAME = ""SearchPerson"";private static final String NAMESPACE = ""http://yoda/"";private static final String URL = ""http://yoda/ws.asmx"";</code></pre><p><strong>I know 'yoda' is translating correctly as my non-parameterized web serivce is working like a bloody champ.</strong> (Everything is identical save the 'request.addProperty' calls which are obviously (part or all) of the issue at hand.)</p><p>If it matters I'm writing this against a 1.6 target platform with KSoap2 2.5.2 and it behaves identically across all my different Android emulators.</p><p>I've sniffed the packets with wireshark and the emulator appears to be sending the correct stuff but the results it receives are always NULL.  (I've tested these exact parameters many times against my test web site that uses these web services, and all is working perfectly there.)</p><p>So, can anyone throw me a bone here?</p><p>Thanks,</p><p>Magua</p><p><strong>EDIT 2010.11.28:</strong></p><p>Even though Wireshark is telling me that I'm sending the parameters it would seem that the web service isn't receiving them correctly, or something similar.  I created a whole new service that was suppose to return a simple string, whatever the first parameter was, with "" TEST"" at the end, hardcoded from the web service itself.</p><p>Well, every time I run this (from Android) I do get a result, and it is always "" TEST"".  No matter how I formulate the SoapEnvelope or no matter what I pass as the parameter, I always receive "" TEST"".  Of course when I invoke the web service on the server it works like a champ (and my result is ""THIS IS A TEST"").</p><p>My web service is on Windows Server 2008 with IIS 7.  The application pool is running against framework v2.0 (not v4.0) with 'Integrated' managed pipeline mode.</p><p>I have no idea where the disconnect lies.  Is KSoap2 sending the parameters improperly?  Is IIS configured incorrectly?  Something else entirely?</p>","521991","","521991","","2010-11-28 06:30:17","2012-07-27 14:13:51","Android, KSoap2 and .NET Web Service w/ parameters = NULL result","<android><web-services><soap><parameters><ksoap2>","4","0","1","",""
"4290140","1","","","2010-11-27 04:32:00","1","383","<p>I'm attempting to use the gdata project from an android app. I'm attempting to upload a new csv file to google docs, but I keep encountering a 411 error (Content-Length). My code looks something like:</p><pre><code>GoogleService ss = new SpreadsheetService(""testApp"");ss.setUserCredentials(""&lt;username&gt;"", ""&lt;password&gt;"");DocumentListEntry newEntry = null;newEntry = new DocumentListEntry();newEntry.setTitle(new PlainTextConstruct(""my.csv""));TextConstruct tc = TextConstruct.plainText(""1,2,3,4,5,6,7,8,9,10"");         newEntry.setContent(new TextContent(tc));DocumentListEntry res = ss.insert(new URL(""https://docs.google.com/feeds/default/private/full/""), newEntry);</code></pre><p>Since the GData lib is abstracting the network calls from me I assume that I don't need to set the Content-Length myself, which leads to me believe I'm simply not using the lib correctly.</p><p>What am I missing? Thanks.</p>","186637","","","","","2012-04-13 18:21:41","uploading csv with gdata - Content-Length error","<android><gdata-api><google-docs-api>","1","1","","",""
"4290210","1","","","2010-11-27 05:04:19","1","544","<p>I have a class which extends OrmliteSqliteOpenHelper in order to provide a persistence module for an Android application.  The problem is, whenever I access this class from the test project in Eclipse, it throws a NoClassDefFound Exception.  The source code appears to be fine as the package is imported and Eclipse has no highlighting to indicate anything will go wrong, but it does.  </p><p>Here's the kicker: not only does everything else in the project work fine when accessed from the test project, but when I move this file into the test project voila it works perfectly!  The issue is that it needs to be in the actual project in order for other components to make calls to it.  Has anyone ever encountered this error or have any idea where I might be going wrong?  </p><p>The class path is set correctly as all the other classes work and the test project always has the main project added to its class path.  I also tried moving the OrmliteSqliteOpenHelper object to an inner class: this allowed the outer class to be visible and touched but as soon as it tried to instantiate the inner class the same error occurs.  Also, if I copy this file into both projects in the same package, an error occurs stating ""class ref in pre-verified class resolved to unexpected implementation"" whenever something in the main project tries to access this class.  Clearly, there is some difference in the way the class is being compiled/handled between the two projects.</p><p>I'm quite stumped :/  Thanks a ton for any assistance!</p>","522016","","522016","","2010-11-27 05:18:33","2011-04-21 13:05:42","NoClassDefFound error with OrmliteSqliteOpenHelper","<java><android><eclipse><sqlite><ormlite>","2","1","","",""
"4290262","1","","","2010-11-27 05:21:29","0","484","<p>I was able to setup admob in my app but it only shows in the first page where i first setup.  I copied same code on different activity and layout but these never appear.  Any idea why? and is it possible to display admob on different layout xml?</p><p>thanks.</p>","513407","","345717","","2010-11-27 05:23:52","2010-11-27 10:24:37","Android: Admob doesn't work on multiple pages?","<android><admob>","1","0","","",""
"4290287","1","4290529","","2010-11-27 05:32:15","4","4582","<p>How can I tell how many contacts there are in the contact list? I got the contact number, but one person can have more than one contact and I want to account for this in finding the total number of contacts in the contact list.</p>","450601","","39934","","2011-11-14 15:15:24","2013-11-12 16:20:52","how many contacts in contact list","<android><contacts><android-contacts>","2","0","3","",""
"4290361","1","","","2010-11-27 05:59:30","0","436","<p>Does anybody know how to run the Android code examples at wrox.com from the book ""Professional Android 2 Application Development""?  I downloaded both the ftp and http versions but I can't seem to run the examples in Eclipse.  I can't find the .apk extensions amongst the folders to run the programs. </p><p><a href=""http://www.wrox.com/WileyCDA/WroxTitle/Professional-Android-2-Application-Development.productCd-0470565527,descCd-DOWNLOAD.html"" rel=""nofollow"">http://www.wrox.com/WileyCDA/WroxTitle/Professional-Android-2-Application-Development.productCd-0470565527,descCd-DOWNLOAD.html</a></p>","434716","","665800","","2011-08-02 11:18:09","2011-08-02 11:18:09","How do I run Android Examples","<android>","1","0","1","",""
"4290363","1","4292691","","2010-11-27 06:01:08","15","5559","<p>Interesting problem I'm having with a ListView. It's using a standard ArrayAdapter, with a custom XML layout for the items within. Simple XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/text1""    android:background=""@drawable/list_bg_blue""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:paddingTop=""20dp""    android:paddingBottom=""20dp""    android:typeface=""serif""    android:textSize=""20px""    android:textStyle=""bold|italic""     android:textColor=""#FF1e5a82""    android:shadowColor=""#FFFFFFFF""    android:shadowDx=""1""    android:shadowDy=""1""    android:shadowRadius=""1""/&gt;</code></pre><p>I don't think there's anything in there that is a problem, but I'm having some strange black lines showing up that I can't seem to get rid of (you can see it in the picture below). I've tried setting <code>android:dividerHeight=""0px""</code> in the ListView, but these still appear. You can see between New Episodes and Shows that there is no line, but for some reason there is after the first and last. </p><p>Any ideas?</p><p>EDIT: Did some more thinking, seems to be just the first and the last, so I found:</p><p><code>android:headerDividersEnabled</code> and<code>android:footerDividersEnabled</code></p><p>Setting footers to false fixed the last one, but oddly setting header dividers to false had no effect. :/</p><p>EVEN MORE EDITS!: Okay, so I added a few more items to the list (should have done that first), and it seems to be every other item (e.g. item 1, item 3, item 5, and so on) that has a divider appearing below it. </p><p><img src=""http://i.stack.imgur.com/SL0Im.jpg"" alt=""Lines on ListView""></p>","321697","","321697","","2010-11-27 06:29:04","2013-08-06 10:28:36","Black Line Under Some ListView Items","<android><listview><divider>","3","0","7","",""
"4290414","1","4290461","","2010-11-27 06:18:42","1","360","<p>I cannot understand this code in page number 68-69  in Hello Android book. Some methods used in the code are new to me. Can anybody elaborate and explain the code.</p><pre><code>private static final String TAG = ""Sudoku"" ;private void openNewGameDialog() {       new AlertDialog.Builder(this)      .setTitle(R.string.new_game_title)      .setItems(R.array.difficulty, new DialogInterface.OnClickListener() {           public void onClick(DialogInterface dialoginterface,int i) {           startGame(i);          }}).show();}private void startGame(int i) {Log.d(TAG, ""clicked on "" + i);// Start game here...}</code></pre>","517525","","","","","2012-03-20 08:49:05","Can any body explain this code from Hello Android book","<android>","2","3","","",""
"4290432","1","5087398","","2010-11-27 06:24:26","0","478","<p>I want to implement Sphinx voice recognition API in my program that run on Android.</p>","473659","","321731","","2013-10-22 17:51:27","2013-10-22 17:51:27","How to implement Shinx voice recognition api in android","<android><sphinx><voice-recognition>","1","0","","2013-09-10 14:07:39",""
"4290467","1","","","2010-11-27 06:36:47","0","401","<p>hiii..in an activity i want to set 4 tabs on the top and 2 tabs in the bottom section of activity?? i create 4 tabs in top section but unable to create 2 tabs in bottom section, please help me...</p>","450601","","","","","2011-01-08 12:45:23","Setting tabs in upper and lower screen","<android><tabs>","1","2","","",""
"4290523","1","4603445","","2010-11-27 06:59:28","2","721","<p>I want to  display a certain YouTube channel's videos and allow the user to select one of their videos to watch on Android. Are there any Json Or Xml data is available for this? Anybody help me where i want to start? Thanks in Advance.</p>","438676","","750593","","2013-05-04 18:29:20","2013-05-04 18:29:20","You Tube videos on Android","<android><youtube>","2","0","2","",""
"4290570","1","","","2010-11-27 07:19:26","1","778","<p>I am new to the client-server side programming so my question might be basic.</p><p>Basically, I am trying to send data in JSON format from android to a Django server. The code for sending the data is the following:</p><pre><code>      try {   ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();   HttpClient httpclient = new DefaultHttpClient();   HttpPost httppost = new HttpPost(""http://localhost:8000/androidweb/edit/"");         JSONObject j = new JSONObject();         try {    j.put(""name"", ""cdfe"");   } catch (JSONException e) {    // TODO Auto-generated catch block    e.printStackTrace();   }   nameValuePairs.add(new BasicNameValuePair(""year"", j.toString()));   httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));   HttpResponse response = httpclient.execute(httppost);  }catch(Exception e) {   //catch the exception and print it }</code></pre><p>So my intention is to basically call the url mentioned in code. I added the url to Django urls.py so I can use the views.py class to store the JSON data I entered above in a sqlite database table, which contains only one field called ""name"". However, I don't know if my approach is right. Most code samples I have seen pass the data to a php file, so I was wondering if it is possible to do it through a python class, views.py?</p><p>If it is possible, can you please give me a code sample to be implemented in ""views.py"" of how to capture JSON data sent from the above code and store it in a table with a ""name"" field?</p><p>Thanks!</p>","522088","","","","","2010-11-27 19:39:58","How can I capture a response sent from android to Django server using views.py?","<android><django><json><sqlite><http-post>","1","0","","",""
"4290600","1","","","2010-11-27 07:32:28","2","1265","<p>How can I draw rectangle at start and end points but still maintain the same width? ie 10 pixels width.</p><p>Rect simplr = new Rect();</p><p>simplr.set(start.x, start.y, end.x, end.y);</p><p>thank you</p>","506828","","506828","","2010-11-27 10:44:43","2010-11-27 10:44:43","Android - Draw a rectangle","<android><android-emulator>","1","1","1","",""
"4290638","1","","","2010-11-27 07:45:25","1","158","<pre><code>try {     doc = db.parse(str);    } catch (SAXException e) {     // TODO Auto-generated catch block     e.printStackTrace();    } catch (IOException e) {     // TODO Auto-generated catch block     e.printStackTrace();    }           Element root = doc.getDocumentElement();           NodeList recipesList = root.getChildNodes();           for (int i = 0; i &lt; recipesList.getLength(); i++) {      Node recipe = recipesList.item(i);      NodeList fields = recipe.getChildNodes();      String title = ((Element) fields.item(0)).getNodeValue();      String description =        ((Element) fields.item(1)).getNodeValue();    tv.setText(title);    tv.setText(description);</code></pre>","1474158","","243943","","2010-11-27 07:47:56","2010-11-27 07:47:56","hello ,i am making my first client server program to read some text or news from server through url","<android>","0","2","0","",""
"4290678","1","4292635","","2010-11-27 08:06:13","1","995","<p>I have a ArrayList and I want to put a lot of strings into it (several hundred) but I don't want to code around a huge list of .add()'s and such. Can I important the strings from my strings.xml file into the ArrayList? If so, how?</p>","499106","","","","","2013-03-27 14:35:58","Loading a large of amounts of strings into my ArrayList, I dont want to clog up my class","<java><android><string><arraylist>","5","4","","",""
"4290806","1","","","2010-11-27 08:48:31","4","7155","<pre><code>11-27 13:24:08.203: ERROR/AndroidRuntime(556): Uncaught handler: thread main exiting due to uncaught exception11-27 13:24:08.628: ERROR/AndroidRuntime(556): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131165233, class android.widget.ListView) with Adapter(class com.bluepal.android.iConcierge.CustomAdapter)]11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.ListView.layoutChildren(ListView.java:1432)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.view.View.layout(View.java:6830)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.TableRow.onLayout(TableRow.java:121)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.view.View.layout(View.java:6830)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.TableLayout.onLayout(TableLayout.java:437)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.view.View.layout(View.java:6830)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.view.View.layout(View.java:6830)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.view.View.layout(View.java:6830)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.view.View.layout(View.java:6830)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.view.View.layout(View.java:6830)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.view.ViewRoot.performTraversals(ViewRoot.java:996)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.os.Handler.dispatchMessage(Handler.java:99)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.os.Looper.loop(Looper.java:123)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at android.app.ActivityThread.main(ActivityThread.java:4363)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at java.lang.reflect.Method.invokeNative(Native Method)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at java.lang.reflect.Method.invoke(Method.java:521)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)11-27 13:24:08.628: ERROR/AndroidRuntime(556):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","489752","","488830","","2010-11-27 08:53:01","2011-02-17 12:44:02","how to solve this issue""The content of the adapter has changed but ListView did not receive a notification""?","<android>","1","3","1","",""
"4290877","1","4291087","","2010-11-27 09:11:58","5","19088","<p>How do you get textview to be justified ? is it possible to get the solution? i have searched most of the forums but i didnt make it up. please help me out.</p><p>Thanks and regards,</p><p>Fargath</p>","484897","","","","","2013-12-13 21:53:24","Justify Text in TextView Android","<android>","3","1","3","2013-07-08 18:44:25",""
"4290887","1","4291072","","2010-11-27 09:14:36","0","200","<p>i want to launch picas app which i have downloaded on my emulator, from my application..i googled a lot but  got only how to  upload  images on picasa..i need to launch the whole stand alone application picasa from my application using some intents and/or some API's..</p><p>i want to know is this possible or not...if this is possible i can very well launch almost all downloaded applications from my application....</p>","505580","","","","","2010-11-27 10:02:57","launching installed(like picasa,skype) app which are on my emulator home screen,from within my app(android)","<android><android-intent><picasa>","1","0","","",""
"4290892","1","4294077","","2010-11-27 09:16:25","1","216","<p>We are developing a product with .net web services and Android, iPhone, BlackBerry, Nokia, and Windows Mobile clients.  The mobile apps are exchanging data with the server.  For that exchange, I need to provide secure communication for the data.  How do we do encryption and decryption between these different languages?</p>","1746300","","75204","","2010-11-27 19:45:00","2010-11-27 21:44:59","secure data exchange between mobile and .net platforms","<.net><iphone><android><blackberry><nokia>","1","2","","",""
"4290958","1","","","2010-11-27 09:34:21","2","3081","<p>I am developing a simple application ,in that there is set of 6 buttons. when i clicked on one of  these button then the other buttons must be partially transparent. I tried to done that By setting alpha of 5 buttons </p><p><code>acre_button.getBackground().mutate().setAlpha(155);</code></p><p>Ui of the application not changed as i expected. i got only 3 out of 5 is get transparent.when clicking on that two button it is slowly changing it's transparency</p><p>Thanks in advance</p><p>regards,kariyachan</p>","482604","","272824","","2010-11-27 09:49:02","2013-07-23 16:28:04","transparency of button is not changed using 'setAlpha'","<android><android-layout>","4","2","1","",""
"4290984","1","4291061","","2010-11-27 09:41:01","1","788","<p>I want to enable the orange highlight that occurs when touching a listView row. </p><p>If the onclick event was generated from the row itself, I can adjust the hightlight by setting the style of the listview.  However in my case, the clicking event is generated by the TextView underneath with onclick event attached to it.</p><p>When touch event occurs, Listview isn't aware of clicking is happening. It doesn't receive focused or pressed event.  </p><p>Is there bubbling or capturing technique I could use like Flex did?  Or any suggestion/solution?</p><p>Thank you very much.</p>","324472","","324472","","2010-11-29 04:38:47","2010-11-29 04:38:47","Hightlight the ListView row when a contained UI element of row is touched","<android><events><listview><onclick><highlighting>","1","0","3","",""
"4291027","1","4291105","","2010-11-27 09:51:33","2","929","<p>In my app, I query for the list of services that have a specific Category in their intent-filters. This goes just fine, I get back a List containing ResolveInfo objects. In these ResolveInfos I found the ""serviceInfo"" field, that's supposed to describe the details of a found service.</p><p>Now how do I construct an Intent from the serviceInfo, that can start the found service? </p><p>My code now is like this:</p><pre><code>PackageManager pm = getApplicationContext().getPackageManager();  Intent i = new Intent();  i.setAction(""&lt;my custom action&gt;"");  i.addCategory(""&lt;my custom category&gt;"");  List&lt;ResolveInfo&gt; l = pm.queryIntentServices(i, 0);  gatherAgentNum = l.size();  if(gatherAgentNum &gt; 0){   for(ResolveInfo info : l){    Intent i2 = new Intent(this, info.serviceInfo.getClass());    i2.putExtra(BaseAgent.KEY_RESULT_RECEIVER, new GatherResult(mHandler));    startService(i2);   }  }</code></pre><p>This's obviously wrong, the ""info.serviceInfo.getClass()"" just returns the serviceInfo object's class. Could anyone help me with this?</p><p>Thank you</p><p>Edit: The solution (at least the one I used):</p><pre><code>PackageManager pm = getApplicationContext().getPackageManager();        Intent i = new Intent();        i.setAction(""&lt;my action&gt;"");        i.addCategory(""&lt;my category&gt;"");        List&lt;ResolveInfo&gt; l = pm.queryIntentServices(i, 0);        if(l.size() &gt; 0){            for(ResolveInfo info : l){                ServiceInfo servInfo = info.serviceInfo;                ComponentName name = new ComponentName(servInfo.applicationInfo.packageName, servInfo.name);                Intent i2 = new Intent();                i2.setComponent(name);                startService(i2);            }        }</code></pre>","446529","","446529","","2010-11-29 07:42:23","2010-11-29 07:42:23","How do I start a service based on a ServiceInfo object?","<android><service>","1","0","1","",""
"4291226","1","4293432","","2010-11-27 10:45:08","2","1090","<p>My app is growing faster every minute and more users keep joining the map. the problem is when you are just looking around on the map, it moves really slow now. just a simple click of overlay is slow  to  pop up, or moving from cleveland to LA is really slow. Anyone have any solutions or ideas? Thanks</p>","516883","","","","","2013-01-04 12:30:06","android map is moving slow after many overlays added","<android><map>","1","3","1","",""
"4291243","1","","","2010-11-27 10:52:06","1","1026","<p>I have a problem with this code. I modify the content of ArrayAdapter and ordered as an argument to the object containing the array. The problem is that modify the view (is a listview) with different things, icons, change the background etc. The fact is that by making the sort seems to mix the properties of some views. For example, the background that has spread to another one because of moving and things like:</p><pre><code>public class IconLVAdapter extends ArrayAdapter&lt;Datos&gt; {        private List&lt;Datos&gt; objetos;        private boolean online;        public IconLVAdapterBuses(Context context, int textViewResourceId, List&lt;Datos&gt; objetos, boolean online) {                super(context, textViewResourceId, objetos);                this.objetos = objetos;                this.online = online;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {                View v = convertView;                if (v == null) {                    LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                    v = vi.inflate(R.layout.rowlist, null);                }                Datos o = objetos.get(position);                if (o != null) {                        TextView tvNum = (TextView) v.findViewById(R.id.num);                        if (o.getpOrigen()==null &amp;&amp; tvNum!= null)                            tvNum.setText(o.getnum());                        else{                                       ************** omitido **************                        }                }                return v;        }        public void refreshArray(){            this.sort(new Comparator&lt;Datos&gt;() {                public int compare(Datos object1, Datos object2) {                    return object1.compareTo(object2);                };            });            this.notifyDataSetChanged();        }</code></pre><p>Any ideas? Thanks</p>","522186","","","","","2010-11-27 11:04:26","Problem with View sorting ArrayAdapter several times","<android><sorting><refresh><android-arrayadapter>","1","0","","",""
"4291313","1","4310732","","2010-11-27 11:08:13","0","2930","<p>I am trying to create an android app ..for that i want to know how to retrieve the particular youtube channels videos as a json Data ..?I mean I dont want to search the videos i want to display only for particular channel videos..</p>","438676","","438676","","2011-01-06 11:38:17","2011-01-06 11:38:17","You tube channels as Json","<android><json><youtube-api>","2","0","2","",""
"4291349","1","4291425","","2010-11-27 11:15:48","4","7032","<p>I want to create an activity that stays always on top (like the modal windows or task manager in Windows) of the others activities.How can I do this on Android? Thanks</p>","467780","","467780","","2010-11-27 11:30:59","2013-05-28 11:58:38","How to make an activity window stay always on top","<android><activity><window><always-on-top>","3","3","1","",""
"4291362","1","","","2010-11-27 11:19:51","1","114","<p>Hi i want to convert string into speech in my code.i saw code for convert the text into speech in activity .But i want to use that text to speech in a class which is extends from LinearLayout.Actually i want to display one image according to that i want to spell that image name.for this purpose tell me some code  suggestions. Thanks in advance</p>","479027","","","","","2012-04-26 10:32:02","how we use text to speech engine in a class which extends from Linear layout","<android>","1","0","","",""
"4291465","1","","","2010-11-27 11:44:52","0","1950","<p>I am working on an Android app, that needs to do the following:- capture a (animated) view to video including audio (from a mp3 file)- encode the captured video (probably a bunch of raw image buffers) and audio to avi.</p><p>After searching, FFMPEG seems the most suitable. Does anybody have a sample code to accomplish what I need. I would really appreciate.</p><p>Whyhow</p>","522212","","","","","2011-01-19 07:22:28","Example encoding video using FFMPEG for Android","<android><ffmpeg>","2","0","","",""
"4291533","1","","","2010-11-27 12:01:09","0","1379","<p>Hi to all im new to android and i have a small problem and i would really appreciate if someone can help me</p><p>first im trying to show all available location providers and its not working and 2nd when ever i run the it i don't get any location information from the best available provider (i have my wifi and network providers on)thanks in advance</p><pre><code>package com.paad.whereami;import java.io.IOException;import java.util.List;import java.util.Locale;import android.app.Activity;import android.content.Context;import android.location.Address;import android.location.Criteria;import android.location.Geocoder;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.os.Bundle;import android.widget.TextView;public class WhereAmI extends Activity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    LocationManager locationManager;    String context = Context.LOCATION_SERVICE;    locationManager = (LocationManager)getSystemService(context);    boolean enabledOnly = true;    List&lt;String&gt; providers = locationManager.getProviders(enabledOnly);    Criteria criteria = new Criteria();    criteria.setAccuracy(Criteria.ACCURACY_FINE);    criteria.setAltitudeRequired(false);    criteria.setBearingRequired(false);    criteria.setCostAllowed(true);    criteria.setPowerRequirement(Criteria.POWER_LOW);    criteria.setSpeedRequired(true);    String provider = locationManager.getBestProvider(criteria, true);         Location location = locationManager.getLastKnownLocation(provider);    updateWithNewLocation(location);    locationManager.requestLocationUpdates(provider, 2000, 1,                                           locationListener);  }  private final LocationListener locationListener = new LocationListener() {    public void onLocationChanged(Location location) {      updateWithNewLocation(location);    }    public void onProviderDisabled(String provider){      updateWithNewLocation(null);    } public void onProviderEnabled(String provider){ }    public void onStatusChanged(String provider, int status,                                Bundle extras){ }  };  private void updateWithNewLocation(Location location) {    String latLongString;    TextView myLocationText;    myLocationText = (TextView)findViewById(R.id.myLocationText);    String addressString = ""No address found"";    if (location != null) {      double lat = location.getLatitude();      double lng = location.getLongitude();      latLongString = ""Lat:"" + lat + ""\nLong:"" + lng;      double latitude = location.getLatitude();      double longitude = location.getLongitude();      Geocoder gc = new Geocoder(this, Locale.getDefault());      try {        List&lt;Address&gt; addresses = gc.getFromLocation(latitude, longitude, 1);        StringBuilder sb = new StringBuilder();        if (addresses.size() &gt; 0) {          Address address = addresses.get(0);          for (int i = 0; i &lt; address.getMaxAddressLineIndex(); i++)            sb.append(address.getAddressLine(i)).append(""\n"");            sb.append(address.getLocality()).append(""\n"");            sb.append(address.getPostalCode()).append(""\n"");            sb.append(address.getCountryName());        }        addressString = sb.toString();      } catch (IOException e) {}    } else {      latLongString = ""No location found"";    }    myLocationText.setText(""Your Current Position is:\n"" +                            latLongString + ""\n"" + addressString);  }}</code></pre>","522222","","2450","","2011-02-08 14:25:53","2013-09-23 09:16:51","location problem","<android>","2","4","","",""
"4291548","1","4294354","","2010-11-27 12:04:40","2","9573","<p>I have been developing an Android app.</p><p>I would like to hide the OK button after the user presses it, as the dialog window will stay at the foreground for some seconds while a computation takes place.</p><p>This is the code:</p><pre><code>    new AlertDialog.Builder(this)    .setMessage(""This may take a while"")    .setPositiveButton(""OK"", new android.content.DialogInterface.OnClickListener() {                        @Override        public void onClick(DialogInterface dialog, int which) {                       // hide the OK button - how?                       // a lot of computation        }    })    .show(); </code></pre><p>How can I achieve that?</p><p>P.S.: I am not interesting to more advanced techniques to handle a computation (such as: progress dialogs, multi-threading).</p><p>Thanks.</p>","354742","","","","","2012-12-02 13:13:02","Android Alert Dialog - how to hide the OK button after it being pressed","<android><alertdialog>","2","2","4","",""
"4291572","1","4291586","","2010-11-27 12:11:51","0","1538","<p>i have the follwoing code, but somes times i have the following Exception that doesn't be catched .. what is the reason and the solution ?</p><pre><code>12-02 12:03:29.101: ERROR/AndroidRuntime(348): FATAL EXCEPTION: main12-02 12:03:29.101: ERROR/AndroidRuntime(348): java.lang.RuntimeException: Unable to start activity ComponentInfo{ayanoo.forms/ayanoo.forms.FriendsActivity}: java.lang.NullPointerException12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at android.os.Handler.dispatchMessage(Handler.java:99)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at android.os.Looper.loop(Looper.java:123)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at java.lang.reflect.Method.invokeNative(Native Method)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at java.lang.reflect.Method.invoke(Method.java:521)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at dalvik.system.NativeStart.main(Native Method)12-02 12:03:29.101: ERROR/AndroidRuntime(348): Caused by: java.lang.NullPointerException12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at org.json.JSONTokener.nextValue(JSONTokener.java:90)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at org.json.JSONObject.&lt;init&gt;(JSONObject.java:154)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at org.json.JSONObject.&lt;init&gt;(JSONObject.java:171)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at ayanoo.forms.FriendsActivity.displayFriends(FriendsActivity.java:79)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at ayanoo.forms.FriendsActivity.onCreate(FriendsActivity.java:36)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)12-02 12:03:29.101: ERROR/AndroidRuntime(348):     ... 11 moretry {            //  String searchText = (String) getIntent().getExtras().get(""searchTextValue"");            JSONObject jsonObject = new JSONObject(Friend.getFriends(1));            if(jsonObject!=null)                    {                JSONArray resultsData = jsonObject.getJSONArray(""GetFriendsResult"");                for (int userIndex = 0; userIndex &lt; resultsData.length(); userIndex++) {                    if (friendsResulted == null) {                        friendsResulted = new ArrayList&lt;FriendResulted&gt;(resultsData.length());                    }                    String[] userArrayData = resultsData.getString(userIndex).split(""--!!--"");                    FriendResulted frindAccountResulted = new FriendResulted();                    frindAccountResulted.setFriendId(Integer.parseInt(userArrayData[0]));                    frindAccountResulted.setUsername(userArrayData[1]);                    frindAccountResulted.setImagePath(userArrayData[2]);                    friendsResulted.add(frindAccountResulted);                    addFriend(frindAccountResulted);                    counter ++;                    if(counter&gt;9)break;                }                }            }        catch (JSONException e) {                Toast.makeText(this,""Please try again, ""+e.getMessage() , Toast.LENGTH_SHORT).show();                }</code></pre>","508377","","","","","2010-11-27 12:16:18","why JSON Exception doesn't be cached in android?","<java><android><json><exception>","1","0","","",""
"4291573","1","4291655","","2010-11-27 12:12:09","2","3115","<p>I wanna idea about ""<code>How to find Hospital Location near by my location</code>"" using android,How is possible?,can i use google's database for get latitude and longitude value for Hospital location,How is possible?</p><p>Thanks All</p>","500595","","","","","2012-11-18 17:01:05","How to find Hospital Location near by my location?","<android>","3","0","4","",""
"4291585","1","4291614","","2010-11-27 12:15:54","1","255","<p>Are there any API that helps the app to know if it is getting key events from hardware keypad or softkey pad?</p><p>Thanks &amp; Best Regards</p><p>Sudhakar Chavali</p>","512025","","4596","","2010-11-27 15:33:19","2010-11-27 15:33:19","How to know if app is using softkey pad or hardware key pad?","<java><android>","1","0","","",""
"4291665","1","4291940","","2010-11-27 12:31:32","0","448","<p>I am trying to setup more than one shared preference with this method.This will successfully create one shared pref:</p><pre><code> static final String SUPPLIER_NUMBER = """";   SharedPreferences myPrefs = getSharedPreferences(""myPrefs"", Context.MODE_PRIVATE);   savednumber = myPrefs.getString(SUPPLIER_NUMBER, """");           SharedPreferences myPrefs1 = getSharedPreferences(""myPrefs"", Context.MODE_PRIVATE);           SharedPreferences.Editor prefsEditor = myPrefs1.edit();           prefsEditor.putString(SUPPLIER_NUMBER, telephonenumber);           prefsEditor.commit();</code></pre><p>This second example simply results in the second pref overriding the first....??? What am I missing here? </p><pre><code> static final String SUPPLIER_NUMBER = """"; static final String SUPPLIER_COST = """";       SharedPreferences myPrefs = getSharedPreferences(""myPrefs"", Context.MODE_PRIVATE);       savednumber = myPrefs.getString(SUPPLIER_NUMBER, """");       savedcost = myPrefs.getString(SUPPLIER_COST, """");               SharedPreferences myPrefs1 = getSharedPreferences(""myPrefs"", Context.MODE_PRIVATE);               SharedPreferences.Editor prefsEditor = myPrefs1.edit();               prefsEditor.putString(SUPPLIER_NUMBER, telephonenumber);               prefsEditor.putString(SUPPLIER_COST, suppliercost);               prefsEditor.commit();</code></pre><p>I do not really want to create an xml file to get the prefs from.. I want it dynamically created, as I believe I am getting here, in the first example.. but I need to be able to add more than one preference.</p>","515080","","1108213","","2012-03-18 17:33:30","2012-03-18 17:33:30","How to set more than one shared preference, without first creating xml","<android>","1","0","","",""
"4291758","1","4291801","","2010-11-27 12:59:46","0","307","<p>I'm developing an android-app for my website. On the website you can create users and login with them. </p><p>Now i want this on the App to. The login function is the problem.</p><p>I've got all the forms (Username &amp; Password).Now I want to connect to an custom adress on my webserver ex: <a href=""http://domain.com/login.php?username=MyUserName&amp;password=MyPassWord"" rel=""nofollow"">http://domain.com/login.php?username=MyUserName&amp;password=MyPassWord</a></p><p>This page will return ""1"" if the login was correct, and ""0"" if not.And I want my app to connect to this adress and then get the content/result my webserver leaves. </p><p>Please help my, I've been sitting HOURS tryin to get it right. </p>","522247","","","","","2010-11-27 13:10:22","Get content/sting from an URL","<java><android><http><httpwebrequest>","1","0","","",""
"4291844","1","","","2010-11-27 13:23:16","0","2281","<p>Hi all i have implemented my customized simpleCursorAdapter and its view merged with another view to create my desired page but when i try to set id to each button of my list view's record than it is giving me an view error</p><p>Half of the logic is from this link:</p><p><a href=""http://thinkandroid.wordpress.com/2010/01/09/simplecursoradapters-and-listviews/http://thinkandroid.wordpress.com/2010/01/09/simplecursoradapters-and-listviews/"" rel=""nofollow"">http://thinkandroid.wordpress.com/2010/01/09/simplecursoradapters-and-listviews/</a></p><p>and other part of code of my customize view is given below:</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);            setContentView(R.layout.fr1);        Cursor c = getContentResolver().query(People.CONTENT_URI,                null, null, null, null);                startManagingCursor(c);                String[] cols = new String[]{People.NAME};                int[] names = new int[]{R.id.FriendsName};        SimpleCursorAdapter rows = new MyAdapter(this,R.layout.flistview,c,cols,names);        setListAdapter(rows);               }public class MyAdapter extends SimpleCursorAdapter{        public DisplayFriendsAdapter(Context context, int layout, Cursor c, String[] from, int[] to) {            super(context, layout, c, from, to);        }        public View getView(int position, View convertView, ViewGroup parent){            View view = super.getView(position, convertView, parent);            ImageButton Btn1 = (ImageButton)view.findViewById(R.id.Button1);            Btn1.setId(position);            ImageButton Btn2 = (ImageButton)view.findViewById(R.id.Button2);            Btn2.setId(position);            Btn1.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                    Log.i(""Accepted"", ""clicked""+v.getId());                }            });             Btn2.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                }            });             return view;        }    }</code></pre>","457146","","457146","","2010-11-27 13:29:37","2011-01-14 22:54:14","button.setId(integer value) gives me view error","<android><android-layout>","1","1","","",""
"4291873","1","4292526","","2010-11-27 13:32:23","2","595","<p>I have a class which implements an Observer.</p><p>I have a method which is triggered in this class when the Obervered state changes, I want to sent out a broadcast in this method. This means my activity can listen for those broadcast messages and do something with the data.</p><p>This is what I have so far</p><pre><code>public class DoStuff extends BroadcastReceiver implements Observer{    public void observe(String message)    {        Log.d(""TEST"", ""Inside observe() on DoStuff "" + message);        // Here I want to send out a broadcast to MyActivity with message        // in the extras    }}</code></pre><p>I can't use <code>context.sendBroadcast</code>, because I don't have access to the application context here, how can I achieve this?</p><p>Thanks in advance</p>","155695","","","","","2010-11-27 16:07:39","Can I send a broadcast from a class which does not extend activity?","<android><observer-pattern><broadcast><android-2.1-eclair>","1","1","","",""
"4291906","1","","","2010-11-27 13:40:05","0","1815","<p><br>I am writing an Android App where I need to display drop down list with an Image on Lefthand side rather that RadioButton in normal Spinner Control. I wanted to customize the spinner control. What are the steps to be followed in customizing Spinner in Android.Can any one provide me sample code in sorting out this issue?<br> I will be waiting for valuable reply. <br></p><p>Thanks in Advance,</p>","429501","","","","","2011-11-05 04:39:16","How to Customize Spinner Adapter","<android>","1","3","1","",""
"4291923","1","4292016","","2010-11-27 13:45:15","0","1958","<p>i was trying to write an analog world clock app. i wanted to use the analog clock component</p><pre><code>&lt;AnalogClock android:id=""@+id/MyAnalogClock"" /&gt; </code></pre><p>This shows the system time. But how do we set a different time(say, a second clock showing time for a different country) to the analog clock component</p>","522268","","","","","2010-11-27 14:07:49","How to set time on android analog clock component?","<android><clock>","1","0","1","",""
"4291954","1","","","2010-11-27 13:53:38","2","118","<p>I am trying to compile the default projects that come with Android; however, it doesn't seem to be working at all. Most of the classes and libs seem to be missing.</p>","","user403005","","user403005","2011-08-09 12:35:37","2011-08-09 12:35:37","Why wouldn't Android applications compile from source?","<android>","2","1","","",""
"4291958","1","4291999","","2010-11-27 13:55:06","0","98","<p>I would like to create an app that has two images side by side and two radioButtons, one down of every image. Which Layout is more suitable for this job (tableLayout, Linear or Relative..)? I have tried it with linear but the images are stacked together.</p>","519526","","213269","","2010-11-27 14:06:13","2010-11-27 14:06:13","Which Layout is better for my app?","<android><layout>","1","0","","",""
"4291961","1","","","2010-11-27 13:56:29","0","327","<p>this code execute correctly if i replace onMenuItemSelected by onContextItemSelected</p><pre><code>   public boolean onMenuItemSelected(int featureId, MenuItem item) {    switch(item.getItemId()) {    case CALL_ID: {      AdapterContextMenuInfo info2 = (AdapterContextMenuInfo) item.getMenuInfo();          String phone=mDbHelper.getPhone(info2.id);         String toDial=""tel:""+phone.toString();startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse(toDial)));        return true; }}    return super.onMenuItemSelected(featureId, item);}</code></pre><p>the logcat show <code>01-02 20:54:45.243: ERROR/AndroidRuntime(279): FATAL EXCEPTION: main01-02 20:54:45.243: ERROR/AndroidRuntime(279): java.lang.NullPointerException01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at com.android.managecontact.onMenuItemSelected(managecontact.java:170)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:730)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at android.view.View$PerformClick.run(View.java:8816)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at android.os.Handler.handleCallback(Handler.java:587)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at android.os.Handler.dispatchMessage(Handler.java:92)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at android.os.Looper.loop(Looper.java:123)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at java.lang.reflect.Method.invokeNative(Native Method)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at java.lang.reflect.Method.invoke(Method.java:521)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-02 20:54:45.243: ERROR/AndroidRuntime(279):     at dalvik.system.NativeStart.main(Native Method)</code></p>","510992","","","","","2010-11-27 13:56:29","context menu and option menu","<android>","0","2","1","",""
"4292032","1","","","2010-11-27 14:11:59","1","859","<p>I have this code:</p><pre><code>String path = ""someapp.db"";SQLiteDatabase db = SQLiteDatabase.openDatabase(path, null, SQLiteDatabase.CREATE_IF_NECESSARY);</code></pre><p>and in the Android manifest:</p><pre><code>&lt;permission-group android:name=""android.permission-group.STORAGE""/&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""/&gt;</code></pre><p>But I always get this on app startup:</p><pre><code>11-27 14:47:18.697: ERROR/Database(221): sqlite3_open_v2(""someapp.db"", &amp;handle, 6, NULL) failed...11-27 14:47:18.717: ERROR/AndroidRuntime(221): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.igon.app/com.igon.app.Home}: android.database.sqlite.SQLiteException: unable to open database file...11-27 14:47:18.717: ERROR/AndroidRuntime(221): Caused by: android.database.sqlite.SQLiteException: unable to open database file</code></pre><ul><li><p>I don't want to use SQLiteOpenHelper because if you do so, you need a context and I don't want to use this because activities should be independent from data</p></li><li><p>contentproviders are also not on my plan because my database should be completely transparent to all other things therefore I am using an object relational mapping</p></li><li><p>I have been looking for 2 days on this problem on the net, I have tried so many things but nothing worked.</p></li></ul>","433618","","496830","","2011-11-10 16:54:34","2011-11-10 16:54:34","How can I create a SQLite database with SQLiteDatabase.openDatabase?","<java><android><sqlite3>","0","2","","",""
"4292082","1","4292125","","2010-11-27 14:20:11","2","7997","<p>i have made one screen with these two imgs and i would like to add a button down of the page witch will drive to a second page when i click it.do you know how i will write it in?i know how to create a button but i dont know how to connect the two screens!thanks</p>","519526","","","","","2013-05-10 06:54:52","how to connect two activities","<android>","3","0","","",""
"4292108","1","4293032","","2010-11-27 14:27:49","0","243","<p><br>I am writing an android where I need to display Spinner and EditText . I am using LinearLayout with vertical orientation. I am getting lot of space between spinner and EditText.Can anyone help me in sorting out this issue.<br>Thanks in Advanvce</p>","429501","","","","","2010-11-27 17:50:05","more space appears between spinner and EditTExt","<android>","1","1","","",""
"4292138","1","4293486","","2010-11-27 14:34:03","2","2936","<p>I have the extremely simple AppWidgetProvider for a test widget:</p><pre><code>public class Test extends AppWidgetProvider {    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){        RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.test_layout);        views.setTextViewText(R.id.TextView01, ""Test message"");    }}</code></pre><p>The test_layout looks like this:</p><pre><code>&lt;LinearLayout     android:id=""@+id/LinearLayout01""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TextView        android:id=""@+id/TextView01""         android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>The problem is that the widget appears in the emulator screen but without any text. I'm sure that's i'm messing something but i can't find what it is...</p>","418543","","","","","2012-02-01 10:21:00","android TextView.setText doesn't work on simple widget","<android><android-emulator><android-widget>","1","0","1","",""
"4292182","1","4421504","","2010-11-27 14:46:12","0","750","<p>I have an ExpandableListView that uses a SimpleCursorTreeAdapter which uses the cursors returned by a ContentProvider. This is fine as it always keeps in sync with the data but sometimes I need to do many changes to the database so that the cursor is requeried many times in the same second. Is it possible to suspend the notification of ContentObservers to avoid unnecessary requerys?</p>","272802","","","","","2010-12-12 12:02:32","How to suspend notification to observers while doing many changes using a ContentProvider","<android><cursor><observer-pattern><android-contentprovider><suspend>","2","0","1","",""
"4292185","1","4293110","","2010-11-27 14:46:50","4","180","<p>I received the email from Android Market announcing the new content rating policy and containing a link to <a href=""http://www.google.com/support/androidmarket/bin/answer.py?hl=en&amp;answer=188189"" rel=""nofollow"">this page</a>. So I dutifully prepared an application update and uploaded it into draft status, but where the heck is there a way to specify the ominous content rating? Has anybody found it yet?</p>","58880","","","","","2010-11-27 18:08:14","Android Market: How to specify the newly required content ratings?","<android><google-play>","2","2","1","",""
"4292207","1","4298053","","2010-11-27 14:54:39","12","3621","<p>My main problem with developing in Android is that the emulator seems to continually get disconnected from eclipse. This always happens the 2-3 time I try to upload my .apk from eclipse without rebooting the emulator. Eclipse indicates this with an empty DDMS ->Device section and logcat stays blank - sometimes I'm not sure if the new code made it on the device.</p><p>The only fix I have for this is to shut down eclipse, and restart it.  With the restarting of Eclipse, on top of the emulator boot time, I can't get any momentum going in my development.</p><p>Is there a way to reconnect the emulator to eclipse without having to restart Eclipse or even the Emulator?</p><p><strong>Update:</strong> There were a couple of answers that helped, particularly ""reset adb"" or Kill-server ->  connect adb. However, sometimes even that is troublesome.</p><p>I am going to try Pentium10's suggestion of hooking up my G1 and using it as an emulator, but for now, I have found that if I don't see my logcat going, and the emulator is working (This is my biggest problem, because I am outputting all my debugging messages to log) then I can open up CMD and type <strong>adb logcat</strong>. This streams the log into the command window. Not nicely color coded, but nice enough for me to find my problems...</p>","462307","","462307","","2010-11-30 18:36:14","2013-05-08 07:01:26","Reconnecting Emulator to Eclipse","<android><ide>","6","5","2","",""
"4292224","1","4292310","","2010-11-27 14:59:44","0","1659","<p>How can i do that? </p><p>on button click: </p><p>mycontext.finish();</p><p>and then: start again?</p>","472537","","","","","2010-11-27 18:34:02","Android restart my activity","<android><context>","1","1","1","",""
"4292254","1","","","2010-11-27 15:06:00","0","155","<p>In my App an Activity starts a Service. The Service obtains network-based geoposition in its onLocatioChanged method, and writes it to Shared Preferences. Then calls its own stopSelf(); method. Back in my Activity, I read the geoposition from Shared Prefs again.</p><p>My code actually works, the only problem is that the geoposition that my Activity reads out from the Shared Prefs, is always from the privious start of the service. The Service needs some milliseconds to obtain the geoposition- during that time the Activity has read the outdated (previous) geoposition. I've searched the forum, tried to start the Servive in a new thread and introduced waiting time in the Activity Thread using Thread.sleep(). Nothing worked so far.</p><p>The relevant code from my Acivity to start GeoServce.class, and read Shared Prefs:</p><pre><code>btnGeoPos.setOnLongClickListener (new View.OnLongClickListener(){            public boolean onLongClick(View v) {            startService(new Intent(getApplicationContext(), GeoService.class));                SharedPreferences mPrefs = getApplicationContext().getSharedPreferences(""CurrentLoc"", MODE_PRIVATE);             DisplayLoc = mPrefs.getString(""LocationTransfer"", ""not available"");             Toast.makeText(getApplicationContext(),""  GeoService retrieved:  ""+DisplayLoc, Toast.LENGTH_LONG).show();            return true;  //LongClick was consumed                       }              });</code></pre><p>This is my Service class that writes the geoposition into SharedPrefs, it works fine per se:</p><pre><code>public class GeoService extends Service { Location location = null; LocationManager lm; LocationListener ll; @Override public IBinder onBind(Intent intent) {  // TODO Auto-generated method stub  return null; }      public void onCreate() {                   lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        ll = new MyLocationListener();                 lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,1,1000, ll);            }        public void onStart(Intent intent, int startiD){} private class MyLocationListener implements LocationListener {  public void onLocationChanged(Location location) {   String message = String.format(""Current Location \n Longitude: %1$s \n Latitude: %2$s"",location.getLongitude(), location.getLatitude());   Toast.makeText(GeoService.this, message, Toast.LENGTH_LONG).show();   SharedPreferences mPrefs = GeoService.this.getSharedPreferences(""CurrentLoc"", MODE_PRIVATE);              SharedPreferences.Editor editor1 = mPrefs.edit();     editor1.putString(""LocationTransfer"", message); // LocationTransfer is the key, message is the content passed         editor1.commit();      lm.removeUpdates(ll);   stopSelf();  }  public void onStatusChanged(String s, int i, Bundle b) {}  public void onProviderDisabled(String s) {   Toast.makeText(GeoService.this,""Network Location turned off"",Toast.LENGTH_LONG).show();  }  public void onProviderEnabled(String s) {} }// End inner class}// End Class</code></pre><p>This roadblock keeps me searching since weeks, I would appreciate any help, thanks to all!</p>","522276","","","","","2011-04-11 02:55:20","Timing problem when updating Activity with Geoposition from a Service (using Shared Preferences to transmit the geoposition from Service to Activity)","<android><service><geolocation>","1","0","","",""
"4292257","1","4292440","","2010-11-27 15:06:12","14","4711","<p>I'm currently trying to support a larger range of devices with my Android app. However, even after reading through what the Android Dev Guide has to say on the issue, I'm unsure as to <em>why</em> I should provide different graphics for ldpi, mdpi and hdpi.</p><p>I understand that the images will automatically be scaled, so I can just supply hdpi graphics and let the device do the rest. Will the scaling quality be lower if the device does it? Will it be a performance issue? Right now I'm more worried about multiplying APK size by three.</p>","499795","","1140748","","2012-05-06 16:37:45","2013-01-05 21:28:18","Android: Why create specific images for ldpi, mdpi and hdpi?","<android><resolution>","4","2","6","",""
"4292270","1","4293396","","2010-11-27 15:09:08","0","2087","<p>I have a custom style that I would like to apply to my views.I was not able to create my views programatically, not through XML, as it is a dynamic content amount (same view can appear X times, but no more then 10, so I do not want a list).</p><p>if i can get an XmlPullParser of the style, I can easly use <code>AttributeSet attrs = Xml.asAttributeSet(parser);</code> and pass it to the View's C'tor.  The problem is obtaining the XmlPullParser.getresources().getX does not have a getStyle() method. Maybe I'm just taking the wrong approach.Does anybody have any idea how to apply the style to a programatic view?</p><p>10x.</p><p>ok, i tried the third C'tpr parameter approach:</p><pre><code>    @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TextView tv = new TextView(this, null, R.style.my_style_2);    tv.setText(""this should be green!"");    setContentView(tv);}</code></pre><p>and the style:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;style name=""my_style_2""&gt;        &lt;item name=""android:textColor""&gt;#FF00FF00&lt;/item&gt;        &lt;item name=""android:textSize""&gt;20sp&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>I don't get big green text. I get default size gray text...</p>","312288","","1399491","","2012-07-09 15:25:30","2012-07-09 15:25:30","reading android style xml","<android><xml><xml-parsing>","2","0","","",""
"4292809","1","","","2010-11-27 17:10:00","0","554","<p>I would like to have the user be able to launch my app while any other app is running on the system.</p><p>1) I was using the search long press.. but didn't want to take away functionality for the voice recognition or make the user choose.</p><p>2) I don't believe you can add an option to specific apps running on the system to allow them to launch my app</p><p>3) You can do a back long press plus power on the galaxy tab to do a screen shot.  Is there an intent to run my software as an option for that?  What other key combination are available to launch my app (intent)?</p><p>4) Is there a way to make the status bar ""clickable""?</p><p>5) Is there a way to add a guesture that would be recognized from any app running?</p><p>Just brainstorming different options.  Any advice would be appreciated.  Thanks.</p>","500187","","","","","2010-11-27 17:27:23","Launch my Android app using a button or other quick guesture","<android><android-intent><launch>","1","0","","",""
"4292926","1","4292993","","2010-11-27 17:29:53","2","113","<p>I have a folder with the name '4' in a zip file containing some image files. When I check the contents of the zip, isDirectory does not register the '4' folder as a directory. </p><p>When 4 is renamed to 'tour_4' isDirectory returns true! Does anyone know this is?</p><p>Can a directory name be a single number character?</p><hr><p>EDIT - OK I've discovered it's nothing to do with the name. It maybe something to do with file system. What I'm trying to do is download and unzip a file from the web. When I create the zip locally (windows file system) it works fine - when it's downloaded from the web (linux file system) it doesn't find the directory name.</p>","278229","","278229","","2010-11-27 17:50:03","2010-11-27 17:50:03","Why can't a number character cannot be used as a directory name? (Java)","<java><android><file-io><zip><naming>","1","1","","",""
"4292930","1","13701369","","2010-11-27 17:30:33","15","7852","<p>I've written a custom <code>View</code>. Now I want to do a little custom animation when the user touches it.</p><p>When I say custom, I mean I basically want to render each frame myself, and <strong>not</strong> use a ""predefined"" animation like described <a href=""http://www.hascode.com/2010/09/playing-around-with-the-android-animation-framework/"">here</a>.</p><p>What is the proper way of implementing this?</p>","276052","","276052","","2011-06-01 13:32:41","2014-02-22 17:19:54","Custom animation in Android","<android><animation>","4","0","4","",""
"4293122","1","","","2010-11-27 18:10:12","1","450","<p>I am useing <a href=""http://www.droidnova.com/creating-sound-effects-in-android-part-1,570.html"" rel=""nofollow"">this example</a> to load and play sounds in my Androidapp. I am adding new sounds with <code>mSoundManager.addSound(2, R.raw.sound1);</code>. How can I load a sound from the SD Card insted of the raw folder in my app?</p>","450019","","","","","2010-11-27 18:20:30","How can I load a sound from the SD Card insted of the raw folder in my Android app useing Soundpool?","<android><sd-card><soundpool>","1","0","1","",""
"4293162","1","4293644","","2010-11-27 18:20:35","0","387","<p>I am designing an application based on android platform.</p><p>I want to show Right To Left strings in my application. I have included a TTF font into asset folder and my output is affected based on this font.</p><p>In Arabic or Persian languages characters Can stick together but in output (display), these are separated.for example, I want to show ""??????"" but in display it shows: ""? ? ? ? ? ?"".</p><p>what should I do?  </p><p>Thanks</p>","513413","","569101","","2013-06-05 11:50:46","2013-06-05 11:50:46","show of Right to Left font has problem","<android><fonts><font-face><right-to-left><languages>","2","0","","",""
"4293192","1","4293203","","2010-11-27 18:28:44","6","1953","<p>I've read through much of the Android documentation and I've yet to find any statement that says what an id value prefix of ""@+id"" means.  I know what ""@string"" and variations of that mean, but not the variation with the ""+"".  Besides giving me the answer, can you show me where in the Android docs this is documented?</p>","10508","","","","","2010-11-27 19:06:33","What does ""@+id"" mean?","<android>","2","0","5","",""
"4293194","1","","","2010-11-27 18:29:23","0","56","<p>I want to pass multiple arrays in adapter view in my project .</p><p>I did it like this:</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        ListView lv = getListView();        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.main, COUNTRIES));</code></pre><p>But I want to pass one more array, name as a people, is this possible?</p>","373041","","79061","","2011-06-30 13:13:09","2011-08-16 08:58:12","How to pass more than 1 array to ArrayAdapterView","<android><listview>","1","0","","",""
"4293223","1","","","2010-11-27 18:35:44","4","602","<p>This is a tough one :/</p><p>I'm making a music-based Android game a la Audiosurf. It works all nice except a few seconds before end of a song (that is being played with a normal MediaPlayer) the music stops aprubtly and the whole game (including UI) freezes for several seconds.</p><p>Each time that happens I see an ""AudioHardware pcm playback is going to standby""-error in logcat.</p><p>Googling has led me to the conclusion that</p><ul><li>this could be a HTC Hero specific issue (cannot be reproduced on emulator or other devices)</li><li>this message is normally logged when a http stream isn't fast enough for MediaPlayer</li><li>Audio in Android sucks in general</li></ul><p>As I am decoding the mp3 with the NDK + libmpg123 for audio analysis already I might aswell just play the audio myself (using a very ugly interface between NDK C code and an AudioTrack in Java).</p><p>Is there a fix/workaround for this bug or should I really go that way? (I only have limited time left to complete this project)</p><p>I appreciate every hint!</p>","387873","","","","","2011-03-13 21:19:29","Android MediaPlayer causes game to freeze with ""AudioHardware pcm playback is going to standby""","<android><media-player><pcm>","1","1","","",""
"4293227","1","4295618","","2010-11-27 18:36:14","2","666","<p>Is there any way to run Android as a webapp?  Either by installing an emulator or something like the <a href=""http://www.android-x86.org/"" rel=""nofollow"">Android-x86</a> or <a href=""http://code.google.com/p/live-android/"" rel=""nofollow"">Live-Android</a> projects on a web server?</p>","296890","","","","","2010-11-28 06:02:23","Is it possible to install Android to a web server and run a Virtual Android OS as a web app","<android><android-emulator><virtualization>","2","0","1","",""
"4293311","1","4293337","","2010-11-27 18:56:08","0","186","<p>How do i make my program load as default example for a url link?</p><p>Thank you!</p><p>PS* sorry for last missunderstanding Question! </p>","502419","","","","","2010-11-27 19:02:11","Android Development: set a program as default","<android>","1","0","","",""
"4293448","1","4293848","","2010-11-27 19:23:52","3","1916","<p>I'm currently trying to assess whether a project can be realised for Android. One major problem I see it that, since it's a P2P client, we'd have to keep a considerable amount of connections open when running. Now the connections do not transfer large amounts of data, it's more of a messaging system, so having a thread for each connection creates a useless overhead if we're reading a single message of 64 bytes every now and then.</p><p>So I was wondering whether there is support for non blocking IO such as select() or poll() on Linux.</p><p>Any suggestion?</p>","49561","","50776","","2012-04-27 20:46:08","2012-04-27 20:46:08","Non blocking IO for Android","<android><select><p2p>","2","0","","",""
"4293451","1","4294598","","2010-11-27 19:24:25","0","111","<p>I'm currently developing a widget for android.</p><p>The widget have some settings and I'm currently managing them with static members which means that all instances of the widget that the user creates share these settings.</p><p>The reason why I do this is because I can't figure out how to bind an instance of an object to the widget instance. The instance(s) of my AppWidgetProvider doesn't seem to be it.</p><p>Basically, I want to know what the 'standard' way to bind settings and other data to the widget instance is.</p><p>Thanks.</p>","242348","","","","","2010-11-27 23:57:33","Binding object instance to widget instance","<java><android><android-widget>","1","0","","",""
"4293527","1","4294044","","2010-11-27 19:41:08","2","1219","<p>I have seen this question answered a few times in which it is suggested to use the method notifyDataSetChanged() from BaseAdapter. </p><p>Is there a way to refresh when your application does not use any adapters? I have a simple application where I use a few activities with preferences, and relative layouts with text views and buttons. At the moment I do not use any of the adapters like SimpleAdapter or ArrayAdapter or CursorAdapter. It seems like in my case I have to create one of them just to get to use notifyDataSetChanged()? There is no easier way for me?</p>","479542","","","","","2011-04-29 17:50:35","Refresh view display when underlying data changes","<android>","3","0","1","",""
"4293642","1","","","2010-11-27 20:08:20","0","670","<p>I am trying to create an android app to read the information from google calender using the json output.</p><p><a href=""http://www.google.com/calendar/feeds/developer-calendar@google.com/public/full?alt=json"" rel=""nofollow"">http://www.google.com/calendar/feeds/developer-calendar@google.com/public/full?alt=json</a></p><p>Can anyone tell me how I can accomplish this using JSONArray and JSONObject  options available in android sdk.</p><p>Greatly appreciate any help on this...</p><p>Thanks in advance...</p>","522505","","750987","","2011-06-16 04:19:57","2011-06-16 04:19:57","JSONArray and JSONObject for google calendar","<android><json><google-calendar>","1","0","","",""
"4293732","1","","","2010-11-27 20:24:59","0","3399","<p>I have a TableLayout in which I add rows dynamically, empty at first and I want to load a xml in that row when the user clicks on it.</p><p>I've assigned the OnClick method to the row, but I don't know how to load the xml when it enters in the onclick method.</p><pre><code>public void onClick(View v){ // CODE TO LOAD THE XML Toast.makeText(getApplicationContext(), ""This should appear"", Toast.LENGTH_SHORT).show();}</code></pre><p>I've tried using inflate, but it seems I am not using it properly because the app crashes when clicking on a row.</p><p>How could I make the row to contain the xml?</p>","522511","","82515","","2011-05-04 13:01:51","2012-02-25 05:56:43","Inflate a TableRow","<android>","2","0","1","",""
"4293806","1","","","2010-11-27 20:39:23","0","1398","<p>Ok, to simplify things, let's say I'm doing a CommentActivity in which all comments are displayed in a threaded-like fashion.</p><p>What I mean is that selecting a comment can collapse (and expand) all of its replies. This works for any level of the comment.</p><p>I tried using ExplandableList but unfortunately this only works for 2 levels. </p><p>Now I basically have a LinearLayout that contains 2 things:<br>- the comment in collapsed mode (originally set to invisible)<br>- the comment in expanded mode (visible) which contains...<br>  ....  - another LinearLayout which will contain any replies to that comment. </p><p>This works kind of in a recursive way...It is just a matter of changing the visibility of each view between one and another to collapse and expand the comment and its replies. It works, but veeeery slowly. The time that passes from the click until the actual collapse/expansion is between 2 or 3 seconds. I suppose this is because of the complex layout of each commentm which is not that simple (they have backgrounds, images, etc etc), and sometimes there are up to 4 levels of comments.</p><p>In the ExpandableList this was done very fast. How can I achieve this performance in a multi-level list?</p>","308666","","308666","","2010-11-27 20:49:24","2010-11-28 04:05:13","How to improve collapse/expand of view in multi-level list?","<android><list><expandablelistview><multi-level>","1","0","","",""
"4293826","1","4294117","","2010-11-27 20:43:13","1","5378","<p>I'm extending the SQLiteOpenHelper class to help me connect and do my database work. According to the <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html"" rel=""nofollow"" title=""docs"">documentation</a>, the OnCreate method should only be called if the database has not been created. Yet, my problem is that I am getting this error when I try to execute a query to insert a record.</p><pre><code>ERROR/Database(214): Failure 1 (table Sample already exists) on 0x218688 when preparing 'CREATE TABLE Sample (RecId INT, SampleDesc TEXT);'.</code></pre><p>The only place this Create query is used in code is the OnCreate method which looks like this.</p><pre><code> @Override      public void onCreate(SQLiteDatabase db) {          db.execSQL(SAMPLE_TABLE_CREATE);      }</code></pre><p><strong>Note:</strong> I'm following a <a href=""http://www.screaming-penguin.com/node/7742"" rel=""nofollow"" title=""Here"">tutorial</a> - the only thing I've done different is make the SQLiteDatabase object public instead of private so that I could extend this class for each entity, letting the public SQLiteDatabase object from the inherited DataHelper class do all the work</p><p>Here is the method that makes the call that fails.</p><pre><code> //This method is in the class that extends DataHelper (See note on tutorial)    public void createSample(Sample sample)//next action form    {                       String id =  sample.getId();            String name =  sample.getSummary();            String query = ""INSERT INTO "" + SAMPLE_TABLE_NAME + ""( "" + SAMPLE_Id + "","" +                         SAMPLE_NAME + "") "" + "" VALUES ("" + id + "","" + name + "")"";            try{                         data.rawQuery(query, null);                }            catch(SQLException e){                 Log.i(""Sample"", ""Errors: Sample LN60: "" + e.getMessage());               }    }</code></pre><p>Can someone tell me what I'm doing wrong? Or maybe a hack (i.e. check if table exists before executing create statement)</p><p>Please let me know what other code I can post to solve this...</p>","462307","","","","","2010-11-27 22:03:13","Problem with SQLite onCreate() in Android","<android><database>","3","1","1","",""
"4293854","1","4293884","","2010-11-27 20:50:02","0","622","<p>I have two classes a <strong>MainActivity.class</strong> and a <strong>IntentsUtils.class</strong>. </p><p>Here is my <strong>IntentsUtils.class</strong>:</p><pre><code> public class IntentsUtils    {        public void invokeWebBrowser(Activity activity)        {            String url = ""http://snipt.net/Martin/android-intent-usage/"";            Intent intent = new Intent(Intent.ACTION_VIEW);            intent.setData(Uri.parse(url));            activity.startActivity(intent);        }    }</code></pre><p>If I wanted to run invokeWebBrowser() from my <strong>MainActivity.class</strong>, what would be the best method?</p><p>Thanks.</p>","483185","","","","","2010-11-27 20:57:25","Proper Android Intent Helper Class Usage?","<android><activity><android-intent>","1","0","","",""
"4293864","1","4294040","","2010-11-27 20:52:13","4","1959","<p>I need to include additional dialing options in the menu appearing after pressing ""Call"" over a contact (<a href=""http://i.stack.imgur.com/JpOis.png"">Screenshot</a>).    </p><p>I'm trying to do it with action-filters for the DIAL and CALL intents without any success.</p><p>I know this is possible because Skype does it (<a href=""http://i.stack.imgur.com/JpOis.png"">Screenshot</a>).  Anybody knows how to implement it?</p>","1330118","","","","","2011-02-20 18:47:26","How to include my application as a dialing option when calling from the addressbook?","<android>","2","0","","",""
"4293865","1","4293896","","2010-11-27 20:52:20","6","1825","<p>Is there any Barcode library available for Android, which i can make of use for Scanning the products?</p>","516712","","","","","2011-09-24 09:46:25","Bar code library for Android","<android>","1","0","1","",""
"4293938","1","4293963","","2010-11-27 21:11:52","0","1188","<p>This simple line of code gives the error ""The method getTextContent() is undefined for the type Element"":</p><pre><code>String color_string = ( ( Element )( ( Element )inner_node ).getElementsByTagName( ""color"" ).item( 0 ) ).getTextContent();</code></pre><p>I get the error in my Android-java version, but not in my PC-Java which I use for testing and debugging Java code before I run it on the phone.</p><p>I have</p><pre><code>import org.w3c.dom.Element;</code></pre><p>on both versions.  And I copied the code from the PC-Java to the Android-Java so I am 100% sure I have the same syntax on both.</p>","324943","","","","","2011-01-31 11:23:24","Android-java vs PC-Java","<java><android>","4","0","","",""
"4293965","1","5334482","","2010-11-27 21:18:42","6","17533","<p>I am fighting with focus management of WebView: WebView messes with focus management of classic components. Here is a simple application with just an EditBox and a WebView in it which loads Google!</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:and=""http://schemas.android.com/apk/res/android""              xmlns:webtag=""http://schemas.android.com/apk/res/com.webtag""              and:orientation=""vertical"" and:layout_width=""fill_parent"" and:layout_height=""fill_parent""&gt;    &lt;LinearLayout and:id=""@+id/HorizontalScrollView02""                  and:layout_width=""fill_parent"" and:layout_height=""wrap_content""&gt;        &lt;EditText and:id=""@+id/EditText01""                  and:layout_width=""wrap_content"" and:layout_height=""wrap_content""                  and:text=""@+id/EditText01""/&gt;    &lt;/LinearLayout&gt;    &lt;WebView and:id=""@+id/uiContent""             and:layout_weight=""1""             and:layout_width=""fill_parent""             and:layout_height=""fill_parent""/&gt;&lt;/LinearLayout&gt;</code></pre><p>And here is the Java code:</p><pre><code>public class WebtagActivity extends Activity{    // UI components.    private WebView mContent;    private EditText mUrl;    @Override    public void onCreate (Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mContent = (WebView) findViewById(R.id.uiContent);        mContent.getSettings().setJavaScriptEnabled(true);        mContent.loadUrl(""http://www.google.fr/"");    }}</code></pre><p>Based on this very simple example, it's impossible to get focus on the WebView (i.e. the google search terms input box)! However when adding ""mContent.requestFocus();"" during initialization, things get better. I can switch from my EditText to my WebView if I click on WebView first only... But behaviour gets soon very ""erratic"", with WebView sometimes not getting focus when touching it, sometimes getting it but staying with a focus rectangle around WebView fields (orange or green depending on your phone) after another touch to go back on EditText component (in which I can write text)!</p><p>Anyway, a solution I found is to add a touchListener and request focus when clicking on a WebView:</p><pre><code>mContent.setOnTouchListener(new View.OnTouchListener() {     @Override    public boolean onTouch(View v, MotionEvent event) {        switch (event.getAction()) {                    case MotionEvent.ACTION_DOWN:                    case MotionEvent.ACTION_UP:                        if (!v.hasFocus()) {                            v.requestFocus();                        }                        break;                }                return false;             }    });</code></pre><p>This solves almost all problems (switching from classic components to WebView and writing text) except one: WebView keeps the focusRectangle (green or orange) around fields whether it has focus or not. In the below screenshot, my EditText has the focus and receive text but WebView still looks like it has focus. I tried clearFocus but that doesn't do anything:</p><p><a href=""http://img139.imageshack.us/i/deviceny.png/"">See the result</a></p><p>Any idea how to solve this?Thanks a lot for your help!</p>","522533","","522533","","2010-11-28 12:50:06","2014-03-06 23:41:15","Android WebView focus problem","<android><focus><android-widget><webview>","3","0","4","",""
"4293975","1","","","2010-11-27 21:20:54","13","25104","<p>Has anyone heard of anyone having any success implementing Apple's new AirPrint protocol on Android?</p><p>From various descriptions, it appears to be a fairly simple protocol employing <a href=""http://en.wikipedia.org/wiki/Internet_Printing_Protocol"">Internet Printing Protocol</a>, bonjour and PDF:</p><p><a href=""http://www.finnie.org/2010/11/13/airprint-and-linux/"">http://www.finnie.org/2010/11/13/airprint-and-linux/</a></p><p>These technologies all appear to be possible to implement on Android, but I'm wondering if there are any likely stumbling blocks?</p><p>(I realise AirPrint only works with a handful of printers just now, and only 11 HPs as listed on <a href=""http://www.apple.com/ipad/features/airprint.html"">Apple's airprint page</a>, but it is presumably only a matter of time before it becomes much more widespread.)</p><p>Thanks!</p>","292166","","292166","","2010-11-30 12:23:44","2011-01-18 00:41:54","printing to an AirPrint printer from Android","<android><airprint>","1","0","6","2013-02-03 02:13:08",""
"4293981","1","4294092","","2010-11-27 21:22:17","0","787","<p>:) My RadioGroup's RadioButtons get dynamically created from an ArrayList (which resides in my main activity) full of links like so:</p><p>ArrayList = { ""hxxp://helloworld.com"", ""hxxp://helloworld2.net"", ..., ""hxxp://whatever.com"" }</p><p>then I have a new class called ""links"" that gets called from a menu button in my main activity which sets a nice layout with a radiobubtton per link (in a scrollview) and a ""go!"" button on the bottom of the page (relative layout).</p><p>This all works great except for one thing.  If you exit the application using the back button, and go back into the application by clicking on the icon in the Android menu, you get to the main activity, then click the ""links"" button in the menu and they are doubled each time. ??? like so:<br /><br />link 0<br />link 1<br />link 2<br />link 0 (again)<br />link 1 (again)<br />link 2 (again)<br /><br />This appends the links to the bottom each time you come back to the ""links"" activity from leaving.  Is there some way I can call a method to clear all radio buttons generated form the last session in the links activity before putting them into the RadioGroup? I tried changing my onPause() to finish(); I tried freeing the cache with RadioGroup.destroyDrawingCache(); nothing seems to do it!Thanks!</p>","520925","","","","","2013-07-24 14:56:56","remove dynamicallly created radiobuttons from a radiogroup in Android","<android><group><dynamic><radio><persist>","3","0","","",""
"4294102","1","4294195","","2010-11-27 21:48:30","15","22590","<p>This is how I draw <code>Bitmap</code> on <code>Canvas</code> in my Android app:</p><pre><code>canvas.save();canvas.scale(scale, scale, x, y);canvas.drawBitmap(bitmap, x, y, null);canvas.restore();</code></pre><p>However the <code>Bitmap</code> is not scaled smoothly, no antialiasing is performed. How can I enable antialiasing?</p>","243225","","","","","2012-05-05 21:02:56","Draw smoothly scaled bitmaps on Canvas","<android><canvas>","5","0","11","",""
"4294111","1","4294405","","2010-11-27 21:49:36","1","8865","<p>I am working on Android application.I am using Spinner control and added items to it.Is there a way to change the  background color of items  in spinner.<br> can any one help me in sorting out this issue.<br>Thanks in Advance,</p>","429501","","","","","2013-05-06 05:19:42","Changing background color for items of Spinner","<android>","3","0","2","",""
"4294135","1","4294612","","2010-11-27 21:58:12","0","1003","<p>My app has alot of overlays on the map, how do i keep the map from being so slow? Its like a 5 second delay when moving around on the map. Take a look at my code below on how i am adding people and can someone show me how to fix this so that its not so slow, I have about 80 overlays on my map and growing by the second.</p><pre><code>ArrayList&lt;String&gt; lstotherslocation = MyGlobalInfomation.getOthersLocation();              List&lt;Overlay&gt; mapOverlays = gMapView.getOverlays();                Drawable drawable = this.getResources().getDrawable(R.drawable.otherslocation);                OthersLocationOverlay otherslocation = new OthersLocationOverlay(drawable,this);                mapOverlays.clear();                for(int i = 0; i &lt; lstotherslocation.size();i++){                    number = number + 1;                      OthersPoint = new GeoPoint((int) (Double.parseDouble(lstotherslocation.get(i).trim())),                                                (int) (Double.parseDouble(lstotherslocation.get(i + 1).trim())));                      OverlayItem overlayitem = new OverlayItem(OthersPoint, ""Title"",                      ""test: "" +  lstotherslocation.get(i+ 2) + ""\n"" +                      ""User: "" + lstotherslocation.get(i+ 3) + ""\n"" +                      ""test: "" + lstotherslocation.get(i+ 4) + ""\n"" +                      ""test: "" +  lstotherslocation.get(i+ 5 ));                    i = i + 5;                    otherslocation.addOverlay(overlayitem);                    mapOverlays.add(otherslocation);</code></pre>","516883","","9167","","2010-11-27 22:12:25","2010-11-28 00:01:52","android map is moving slow after many overlays added","<android><maps>","1","0","","",""
"4294178","1","4294188","","2010-11-27 22:09:01","0","607","<p>Is there a tooling or maybe a log, where I can see what caused my application running on a android mobile phone, to hung or eventually crash?</p><p>I have programmed a signed application that is a runnable, it checks for messages on my server and send sms messages to a receiver, and after two or maybe 3 days, the application hungs or crashes.</p><p>How can I see what caused the crash?</p><p>Regards.</p><p>Shafqat</p><pre><code>    private void startservice() {    r = new Runnable()    {        public void run()         {            //execute the sms class and get the url            //build the url            SendSMS sms = null;            //TODO get the url from a database            Map&lt;String, String&gt; jsonitems = new JSONParser().parse(urlsmsservice+getDeviceId());            if(!jsonitems.isEmpty()){                sms = new SendSMS(context, jsonitems.get(""PHONENUMBER"").toString(), jsonitems.get(""MESSAGE"").toString());                sentReceiver.setCallbackUrl(jsonitems.get(""CALLBACKURL"").toString());                deliveredReceiver.setCallbackUrl(jsonitems.get(""CALLBACKURL"").toString());                sms.send();            }else{                Log.d(TAG, ""No messages in Queue"");            }            //handler.postDelayed(this, getInterval());        }    };    handler = new Handler();    thread = new Thread()    {        @Override        public void run() {            try {                while(thbool) {                    sleep(getInterval());                    handler.post(r);                }            } catch (InterruptedException e) {                e.printStackTrace();            }        }    };    thread.start();}</code></pre>","522569","","522569","","2010-11-28 18:32:25","2010-11-28 18:32:25","How to check in android how a program crashed?","<android><runnable><crash>","1","0","","",""
"4294197","1","4294234","","2010-11-27 22:13:31","2","2362","<pre><code>public SomeClass(Context context, SomeType some_arg) {         super(context);         LayoutInflater inflater = (LayoutInflater)context.getSystemService(                  Context.LAYOUT_INFLATER_SERVICE);        inflater.inflate(R.layout.some_layout_with_button, this, true);        m_button=(Button)findViewById(R.id.mButton);        m_textView=(TextView)findViewById(R.id.mTextView);        m_button.setOnClickListener(new OnClickListener(){                @Override                public void onClick(View v){                //TODO                }            });    }</code></pre><p>In Activity, in onCreate(...) I wrote </p><pre><code>this.setContentView(new SomeClass(getApplicationContext(),arg));</code></pre><p>SomeClass extends LinearLayout, some_layout_with_button.xml is correct But on emulator's display  - nothing. Why?</p><p>UPD:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;    &lt;LinearLayout android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:paddingBottom=""20px""&gt;        &lt;Button android:id=""@+id/mButton""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""BT"" /&gt;        &lt;TextView android:id=""@+id/mTextView""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:textSize=""16px""                /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;        &lt;RadioGroup android:id=""@+id/mRadioGroup""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:orientation=""horizontal""&gt;            &lt;RadioButton android:id=""@+id/mRadioButton1""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginLeft=""60px""                    android:text=""Text1""/&gt;            &lt;RadioButton android:id=""@+id/mRadioButton2""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginLeft=""60px""                    android:text=""Text2""/&gt;        &lt;/RadioGroup&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","278221","","278221","","2010-11-27 22:48:52","2010-11-27 22:48:52","Extends ViewGroup","<android><android-layout>","1","2","","",""
"4294229","1","4294590","","2010-11-27 22:19:34","3","1417","<p>I'm trying to create an application that basically lets a user on an android device send a message that instantly appears in the rails application. Does anyone have suggestions to what I would use to do this?</p>","386020","","","","","2011-07-02 14:32:34","What can I use to allow an android app to communicate with a rails app","<android><ruby-on-rails>","3","1","1","",""
"4294237","1","4294268","","2010-11-27 22:21:52","0","661","<p>So I got this bit of code <a href=""http://pastebin.com/RMh4eHLq"" rel=""nofollow"">http://pastebin.com/RMh4eHLq</a> from the Android dev blog (modified) but when I try and call it via </p><p><code>ImageDownloader.download(image, image_main, image_table);</code> </p><p>it tells me to change the download modifer to static but if I do that the ImageDownloader class tells me no portion is accessible. Any ideas?</p>","427377","","213269","","2010-11-28 13:24:59","2010-11-28 13:24:59","Android - Change modifer to static?","<java><android><static><modifiers>","1","0","","",""
"4294243","1","4294337","","2010-11-27 22:24:27","0","974","<p>So I've just got myself an Android device and wanted to have a go at some Android development, to create myself a simple task manager. The idea was to implement the tab UI seen all around android, so I stumbled across this: <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a></p><p>All good. From this point on I need to apologise because I'm going to be unspecific because I don't know where the problem is. What happens is pretty simple. I run my application, I get a dialog box saying ""com.app.appname was forced to close"". That's it. I don't see the UI.</p><p>So, without further ado, I have implemented:</p><p>Overview.java:</p><pre><code>public class Overview extends TabActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Resources res = getResources(); // 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, ViewTasks.class);        spec = tabHost.newTabSpec(""tasks"").setIndicator(""Tasks"",                          res.getDrawable(R.drawable.ic_tab_artists))                      .setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, ViewGoals.class);        spec = tabHost.newTabSpec(""goals"").setIndicator(""Goals"",                          res.getDrawable(R.drawable.ic_tab_artists))                      .setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(0);    }}</code></pre><p>main.xml (res/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: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""        android:padding=""5dp""&gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Manifest.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=""the.correct.package.name""      android:versionCode=""1""      android:versionName=""1.0""&gt;      &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:name=""vxataskmaster""&gt;        &lt;activity android:name=""Overview"" android:label=""@string/app_name"" android:theme=""@android:style/Theme.NoTitleBar"" android:enabled=""true"" android:screenOrientation=""unspecified""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.VIEW"" /&gt;                &lt;action android:name=""android.intent.action.EDIT"" /&gt;                &lt;action android:name=""android.intent.action.PICK"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name=""ViewGoals"" android:label=""@string/app_name"" android:theme=""@android:style/Theme.NoTitleBar"" android:enabled=""true"" android:screenOrientation=""unspecified""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.VIEW"" /&gt;                &lt;action android:name=""android.intent.action.EDIT"" /&gt;                &lt;action android:name=""android.intent.action.PICK"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name=""ViewTasks"" android:label=""@string/app_name"" android:theme=""@android:style/Theme.NoTitleBar"" android:enabled=""true"" android:screenOrientation=""unspecified""&gt;                &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.VIEW"" /&gt;                &lt;action android:name=""android.intent.action.EDIT"" /&gt;                &lt;action android:name=""android.intent.action.PICK"" /&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=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>As far as I can tell, I have modified the original example to use a few classes of my own. These classes just implement the hello world messages seen on the tutorial site.</p><p>So, what am I doing wrong, please? I can't seem to get anything sensible out of the debugger... it doesn't point to anything in my code, whether run on the emulator or my device.</p><p>I apologise for pasting large chunks of code. If I had an idea of where the problem lay, I would have cut it down, but I don't...!</p><p>Thanks.</p><p>Edited: logcat says this:</p><pre><code>11-27 22:51:32.871: ERROR/AndroidRuntime(10662): java.lang.RuntimeException: Unable to instantiate application correct.root.package.taskmaster.ataskmaster: java.lang.ClassNotFoundException: correct.root.package.taskmaster.ataskmaster in loader dalvik.system.PathClassLoader[/data/app/correct.root.package.taskmaster-1.apk]</code></pre>","257111","","257111","","2010-11-27 22:58:13","2010-11-27 23:16:45","Modified Tabhost example crashing on startup","<java><android><android-tabhost>","2","2","0","",""
"4294297","1","","","2010-11-27 22:38:27","1","2098","<p>I want to implement a hardware driver for my i2c accelerometer on my beagleboard-xm, I'd like it to load it at boot. There are a good amount of resources on the web to help me compile my module but I'm having a hard time finding any information on loading my module at boot.</p><p>It seems that there are two initialization scripts:</p><ul><li>init.rc in the root directory</li><li>init.goldfish.rc in system/etc</li></ul><p>This page describes the process of writing an init.rc script in order to perform a custom initialization: <a href=""http://source.android.com/porting/bring_up.html"" rel=""nofollow"">http://source.android.com/porting/bring_up.html</a></p><p>from previous research I am pretty sure the init.goldfish.rc in system/etc is for custom board loading.. where one would replace goldfish with the name of the hardware in /proc/cpuinfo</p><p>I've looked in these two scripts to see how other modules were loaded at boot but the only thing that is loaded is the console. I feel like I'm missing something here. Are uevents used in order to detect and load the modules? if so What are the triggers for those uevents?</p><p>Any help would be greatly appreciated.</p><p>Dave</p>","522572","","110028","","2011-02-01 13:22:53","2011-02-01 13:22:53","Android driver module booting","<android><driver><boot><kernel-module><beagleboard>","1","0","1","",""
"4294388","1","","","2010-11-27 22:59:20","0","1188","<p>I want to build an application which takes user/pass information from user and use it on an https webpage and extract the returned raw html code from that page.</p><p>I want to know is this possible?</p><p>If so, what sort of class i should use. Can it be done with some hidden webview mechanism. Sine i think we can access the java script variable in a webview from our application. So is this possible. Or i am just wasting my time in this direction.</p>","519087","","","","","2012-03-24 04:42:11","android hidden webview, Is it possible?","<android>","2","0","1","",""
"4294440","1","","","2010-11-27 23:14:07","1","658","<p>I've noticed that there are several applications which have been developed within the last 6 months or so which share a common design.  I can think of 4 off the top of my head, Twitter, Google IO, Evernote and Facebook (new version).  They all have a ""home"" screen with a grid of icons for various app areas.  And a top bar with the app logo in the top left, then global/common functions in the top right.</p><p>I'm sure the newer apps were inspired by the earlier ones (Twitter was the first I can remember to use this style).  My question is: are they all just happening to use this style or is there templates out there to make my app look similarly?</p>","522605","","","","","2010-11-27 23:20:26","Android interface design","<android><design>","2","0","1","",""
"4294449","1","4294997","","2010-11-27 23:17:05","4","4255","<p>I'm listening for sensor values, and getting them OK in my handler with</p><pre><code>    if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {       for (i=0;i&lt;3; i++) mag[i] = event.values[i];</code></pre><p>The developer docs say for Sensor.TYPE_MAGNETIC_FIELD you get:""All values are in micro-Tesla (uT) and measure the ambient magnetic field in the X, Y and Z axis.""</p><p>How can I turn that info into azimuth, pitch, and roll?    How do I turn it into compass magnetic heading?</p><p>Does just provide the same info you can get from the ORIENTATION sensor, and from the ACCELEROMETER sensor once you have done the matrix transforms?</p><p>Thanks,Peter</p>","253661","","","","","2010-11-29 05:34:10","getting info from magnetic sensors","<android><sensor><magnetic>","1","0","","",""
"4294621","1","4294842","","2010-11-28 00:07:06","1","15193","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/6068803/how-turn-on-only-camera-flash-light-programmatically-in-android"">How Turn on only Camera flash light programmatically in android?</a>  </p></blockquote><p>okay guys, I have been looking for a little while and I cant seem to find this anywhere, I would like to grant my camera application access to the flash bulbs or whatever you want to call them, If anyone knows and would like to share that would be greatly appreciated. Or if anyone can point me into the right direction that would be great. </p>","500028","","21234","","2010-11-28 00:32:28","2010-11-28 01:37:25","Android Camera Flash Control","<android><android-camera>","1","1","2","2011-09-28 11:14:13",""
"4294664","1","","","2010-11-28 00:24:30","0","73","<p>I have 5 applications that look the same, but have some nuances.I sold quite a few of each.Now I would like to create ONE application instead of all 5, and give it for free for all customers that already bought one of the 5 apps.</p><p>How do I replace the customer's old application with new one, without the need of refund, exchange etc.?</p>","380490","","","","","2010-11-28 02:42:58","5 applications into 1","<android><google-play>","1","0","1","",""
"4294687","1","4295015","","2010-11-28 00:32:00","2","2128","<p>(It's quite late here, so could be overseeing something really simple..)</p><p>I've got the following class : </p><pre><code>public class GlobalState extends Application {    private Stub stub = new Stub();    public Stub getStub() {        return stub;    }}</code></pre><p>and this in my application tag on android manifest..</p><pre><code>&lt;application android:name=""com.jameselsey.observerpattern.GlobalState""...&gt;</code></pre><p>Now, whenever I try to grab this, such as in a Service class, I get a null pointer (gs is null), I'm using the following</p><pre><code>private GlobalState gs = (GlobalState) getApplication();private Stub stub = gs.getStub();</code></pre><p>I've got a similar setup working in another app, so I really can't see why this isn't working since I've based this on the one that does work.</p><p>Any ideas?</p>","155695","","750987","","2011-05-29 06:32:09","2011-05-29 06:32:09","Android; getApplication() returning null, can't see why","<android><android-2.1-eclair>","2","0","","",""
"4294754","1","4295378","","2010-11-28 00:53:35","5","535","<p>I am developing an application that will behave slightly different depending on the type of screen. Is there any way to detect it? </p>","217527","","411022","","2013-10-26 20:37:45","2013-10-26 20:37:45","how to detect if the screen is capacitive or resistive in an Android device?","<android><touchscreen>","2","0","2","",""
"4294782","1","4298905","","2010-11-28 00:59:37","2","2218","<p>I am trying to send data from android to Django app. I want to store the data in a table in sqlite database called ""mytable"". Here is the android code:</p><pre><code>    try {        ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();        HttpClient httpclient = new DefaultHttpClient();        HttpPost httppost = new HttpPost(""http://localhost:8000/androidweb/edit/"");        JSONObject j = new JSONObject();        try {            j.put(""name"", ""david"");        } catch (JSONException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        nameValuePairs.add(new BasicNameValuePair(""year"", j.toString()));        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));    //  myTextView.setText(j.toString());        HttpResponse response = httpclient.execute(httppost);        myTextView.setText(response.getStatusLine().toString());    //  myTextView.setText(response.toString());    }catch(Exception e) {        myTextView.setText(""Error in http connection ""+e.toString());}</code></pre><p>The issue is resolved now. I only needed to have a return value</p>","522559","","522559","","2010-11-28 22:18:53","2010-11-28 22:18:53","403 FORBIDDEN message when I use HttpPost to send data to Django","<android><django><sqlite3><http-post><http-status-code-403>","1","9","1","",""
"4294789","1","","","2010-11-28 01:01:40","0","1058","<p>I'm new to Android and I have this problem I'm trying to make a program that will get my location from the best available provider. After that it gets me the image from the link and I don't know where the error is in the code.</p><p>those are the errors i get</p><p>at line 102Multiple markers at this line    - Syntax error, insert ""}"" to complete Statement    - Syntax error, insert ""else Statement"" to complete     IfStatement</p><p>at line 142Syntax error on tokens, delete these tokens</p><p>at line 159:Multiple markers at this line    - Syntax error on token ""setText"", = expected after this     token</p><p>at line 162:Syntax error on token ""}"", delete this token</p><p>Thank you in advance </p><p><strong>this is the manifest file:</strong></p><p><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""          package=""com.paad.whereami""&gt;  &lt;application     android:icon=""@drawable/icon""&gt;    &lt;activity       android:name="".WhereAmI""       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;android:name=""android.permission.INTERNET&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt;</code></p><p><strong>Main.xml:</strong></p><p>' </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout   xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;TextView      android:id=""@+id/myLocationText""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""/&gt;  &lt;ImageView     android:id=""@+id/img""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_gravity=""center""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>'</p><p><strong>and this is the code:</strong></p><pre><code>package com.paad.whereami;import java.io.IOException;import java.util.List;import java.util.Locale;import android.app.Activity;import android.content.Context;import android.location.Address;import android.location.Criteria;import android.location.Geocoder;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.os.Bundle;import android.widget.TextView;import android.app.Activity;import android.os.Bundle;import java.io.InputStream;import java.io.InputStreamReader;import java.net.HttpURLConnection;import java.net.URL;import java.net.URLConnection;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.text.format.Time;import android.widget.ImageView;import android.widget.Toast;import java.util.Timer;import android.os.SystemClock;public class WhereAmI extends Activity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    LocationManager locationManager;    String context = Context.LOCATION_SERVICE;    locationManager = (LocationManager)getSystemService(context);    Criteria criteria = new Criteria();    criteria.setAccuracy(Criteria.ACCURACY_FINE);    criteria.setAltitudeRequired(false);    criteria.setBearingRequired(false);    criteria.setCostAllowed(true);    criteria.setPowerRequirement(Criteria.POWER_LOW);    criteria.setSpeedRequired(true);    String provider = locationManager.getBestProvider(criteria, true);          Location location = locationManager.getLastKnownLocation(provider);    updateWithNewLocation(location);    locationManager.requestLocationUpdates(provider, 2000, 1,                                            locationListener);  }  private final LocationListener locationListener = new LocationListener() {    public void onLocationChanged(Location location) {      updateWithNewLocation(location);    }    public void onProviderDisabled(String provider){      updateWithNewLocation(null);    }    public void onProviderEnabled(String provider){ }    public void onStatusChanged(String provider, int status,                                 Bundle extras){ }  };  private void updateWithNewLocation(Location location) {    String latLongString;    TextView myLocationText;    myLocationText = (TextView)findViewById(R.id.myLocationText);    String addressString = ""No address found"";    if (location != null) {      double lat = location.getLatitude();      double lng = location.getLongitude();      latLongString = ""Lat:"" + lat + ""\nLong:"" + lng;      setContentView(R.layout.main);        Bitmap bitmap = DownloadImage(        ""http://blogs.ocweekly.com/navelgazing/boston.jpg"");        ImageView img = (ImageView) findViewById(R.id.img);      img.setImageBitmap(bitmap);      private Bitmap DownloadImage(String URL) {          Bitmap bitmap = null;          InputStream in = null;          try {            in = OpenHttpConnection(URL);            bitmap = BitmapFactory.decodeStream(in);            in.close();          } catch (IOException e1) {              e1.printStackTrace();          }          return bitmap;                        }      private InputStream OpenHttpConnection(String urlString) throws IOException {        InputStream in = null;        int response = -1;        URL url = new URL(urlString);         URLConnection conn = url.openConnection();        if (!(conn instanceof HttpURLConnection))                               throw new IOException(""Not an HTTP connection"");        try{            HttpURLConnection httpConn = (HttpURLConnection) conn;            httpConn.setAllowUserInteraction(false);            httpConn.setInstanceFollowRedirects(true);            httpConn.setRequestMethod(""GET"");            httpConn.connect();             response = httpConn.getResponseCode();                             if (response == HttpURLConnection.HTTP_OK) {              in = httpConn.getInputStream();                                             }                               } catch (Exception ex) {              throw new IOException(""Error connecting"");                        }            return in;             }        }          }    else {      latLongString = ""No location found"";    }    myLocationText.setText(""Your Current Position is:\n"" +                             latLongString + ""\n"" + addressString);  }}</code></pre>","522222","","522222","","2010-11-28 01:17:37","2011-11-16 02:49:56","Android location search error","<android><geolocation>","1","6","","",""
"4294875","1","4294890","","2010-11-28 01:34:21","3","967","<p>I'm trying to develop a photo geotagging app.How do I extract GPS information from geotagged photos, so that i can Tag it into MapView?Photos are geotagged, which methods and classes should I call to retrieve the information?</p><p>Please do tell me if the my question is not clear.</p><p>Thanks in advance :)</p>","211071","","","","","2010-11-28 01:39:35","Extract location information from photos","<android>","1","0","","",""
"4294879","1","","","2010-11-28 01:34:53","0","2695","<p>My problem is probably going to be simple and awkward at the same time, but I am a little stuck.</p><p>I have a Main.java class, that extends Activity.</p><p>Inside that class, I do the following:</p><pre><code>ringerServer = new Thread(new RingerServer());ringerServer.start();</code></pre><p>What I want to do is have the RingerServer thread running continously.</p><p>Inside that thread, I listen for a TCP connection. If I get one, I start another class, which sends and receives UDP packet.</p><pre><code>public class RingerServer implements Runnable {    public static final int SERVERPORT = 4445; // Default port to connect to    @Override    public void run() {        try {            // Create a socket for handling incoming requests            ServerSocket server = new ServerSocket(SERVERPORT);            while (!VoIPCall.onCall) {                // Wait for an incoming connection                Socket clientSocket = server.accept();                // TODO: Display a message for the user to accept or decline                // For now, automatically accept the call                Intent myIntent = new Intent(null, VoIPCall.class);                // Put the IP as a parameter                myIntent.putExtra(""inetAddress"", clientSocket.getInetAddress());                startActivity(myIntent);            }        } catch (IOException e) {            Log.e(""TCP"", ""S: Error"", e);        }    }}</code></pre><p>My problem has to do with the lines:</p><pre><code>Intent myIntent = new Intent(null, VoIPCall.class);myIntent.putExtra(""inetAddress"", clientSocket.getInetAddress());startActivity(myIntent);</code></pre><p>Those lines would work fine inside an Activity but it doesn't to complain as it is a Thread, it doesn't know about the Activity class, because it doesn't extend it, but implements Runnable.</p><p>I am not sure how I can make my program keep running the RingerServer but have the main thread go to VoIPCall class. Any ideas please?</p><p>I really appreciate your help.</p><p>Thank you very much,</p><p>Jary</p>","505281","","","","","2010-11-28 01:51:40","Android: Calling an activity from a Thread","<android><multithreading><activity><android-intent>","1","1","2","",""
"4294929","1","9411586","","2010-11-28 01:59:37","0","1406","<pre><code>//case 1:post to main thread's handlermHandler.post(new Runnable(){    public void run(){      dosomething();  //update UI    });//case 2:run in main threaddosomething();</code></pre>","787182","","","","","2012-02-23 10:53:05","What's the difference between in post(Runnable r) to main thread's handler and running in main thread","<android><handler>","2","0","","",""
"4295059","1","4295065","","2010-11-28 02:46:17","0","690","<p>i found <a href=""http://stackoverflow.com/questions/775188/add-an-array-of-buttons-to-a-gridview-in-an-android-application"">this helpful</a> post for adding buttons dynamically to a layout, however i am can't understand how to reference those buttons by id (or some other way) to use them in the program.  can anyone help me?</p>","486086","","","","","2011-12-06 08:08:09","dynamically add array of buttons and reference those buttons by id in android","<android>","2","0","","",""
"4295130","1","4295159","","2010-11-28 03:12:23","0","4992","<p>I'm doing some research on how to pull information from a MySQL DB to display information in an application but I'm wondering what would be a good way to do this? Right now I'm thinking something like...</p><p>ANDROID APP &lt;--> HTTP (display XML to pull and display on app) &lt;--> DB Server. </p><p>I read about JSON and some other ways to do this, but I just was wondering if anyone knows the best way to do this. </p>","508902","","","","","2010-11-28 03:22:43","Connecting android application to a web server database","<android><xml><json><communication>","2","0","2","",""
"4295147","1","","","2010-11-28 03:18:57","4","4070","<p>Normally in the Gridview, while you are pressing on an element in the grid, it highlights the specific squares background with a nice orange'ish well defined. I want to make it stay highlighted after you let go as well, basically turn it into a toggle on/off for the highlights. I want to use the android highlight color that's built in automatically but I have so far been unsuccessful in any attempt to get this to work. Any help would be greatly appreciated.</p><p>Thanks!</p>","522696","","","","","2012-04-05 12:53:58","Android GridView Background Highlights","<android><android-gridview>","2","0","","",""
"4295151","1","4965674","","2010-11-28 03:19:56","0","3711","<p>Hi everyoneI found this is working.</p><pre><code>                    Bundle parameters = new Bundle();                    parameters.putString(""message"", ""This is a test message."");                    mFacebook.request(""me/feed"", parameters, ""POST"");</code></pre>","224505","","","","","2011-06-30 13:14:07","How to post message to facebook wall from android fb sdk","<android><facebook>","1","1","2","2012-10-23 11:52:39",""
"4295166","1","4295247","","2010-11-28 03:25:35","1","3529","<p>i have some pictures and i want to store it in sqlite </p><p>what i need to do</p>","510992","","135152","","2011-05-25 03:06:51","2011-09-24 05:13:36","insert image sqlite","<android><sqlite>","2","5","2","",""
"4295204","1","4296589","","2010-11-28 03:36:18","2","3162","<p>I can find several examples of how to build a service, but I'm having a difficult time finding a working example of how to send messages between an Activity and a Service. From what I can find, I think my options are to use Intents, AIDL, or to use the service object itself as per <a href=""http://stackoverflow.com/questions/2463175/how-to-have-android-service-communicate-with-activity"">this question</a>.</p><p>In my case, my activity is the only activity that will ever access the service, so a local service will do. When the activity is open, I want to see some status messages from the service, which will be coming in at up to 20 Hz. Are there any limitations on how many messages per second those communications methods will support? Basically, which method is going to be best for my situation?</p><p>Thanks.</p>","127287","","840973","","2011-12-29 17:47:59","2011-12-29 17:47:59","Android service-to-activity communication performance","<android>","2","0","1","",""
"4295216","1","4295251","","2010-11-28 03:39:06","0","598","<p>I have a an app that starts with a <code>MapActivity</code> showing some POI's on the map.  There is a button to take you to a list of the POI's.  In the <code>ListActivity</code> there is a button to take you to the map.  If you start the app and click the ""List"" button and then the ""Map"" button, then the ""List"" button, then the ""Map"" button, etc.  Then you have to back out past all of those Activities in order to get to the Home screen again.  I have both activities defined as <code>android:launchMode=""singleTop""</code> and I use <code>startActivityIfNeeded(intent, 0);</code> in the OnClickListener.  Is there a way around this?</p>","236136","","","","","2010-11-28 03:53:06","Bring up existing Activity","<android><loops><activity>","1","0","","",""
"4295238","1","4295325","","2010-11-28 03:48:58","0","2131","<p>I followed the instructions in the Android WebView tutorial (at <a href=""http://developer.android.com/resources/tutorials/views/hello-webview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-webview.html</a>).  When I deploy it to the emulator, it just displays a blank (white) page.  The 3G icon is present in the emulator.  I have the ""INTERNET"" permission set in my manifest, exactly as described in the tutorial.</p><p>And to more clearly confirm that I did it right, when I deploy it to my device (Droid2), it works perfectly fine. immediately displaying the web page specified in the app (www.google.com).</p><p>Following this is the relevant Android console output. I would think the last line might be relevant, but I don't know what it means.</p><blockquote>  <p>[2010-11-27 19:45:18 - HelloWebView]  Android Launch! [2010-11-27 19:45:18 -  HelloWebView] adb is running normally.  [2010-11-27 19:45:18 - HelloWebView]  Performing  com.example.hellowebview.HelloWebView  activity launch [2010-11-27 19:45:18 -  HelloWebView] Automatic Target Mode:  Several compatible targets. Please  select a target device. [2010-11-27  19:45:20 - HelloWebView] WARNING:  Application does not specify an API  level requirement! [2010-11-27  19:45:20 - HelloWebView] Device API  version is 8 (Android 2.2) [2010-11-27  19:45:23 - HelloWebView] Application  already deployed. No need to  reinstall. [2010-11-27 19:45:23 -  HelloWebView] Starting activity  com.example.hellowebview.HelloWebView  on device emulator-5554 [2010-11-27  19:45:24 - HelloWebView]  ActivityManager: Starting: Intent {  act=android.intent.action.MAIN  cat=[android.intent.category.LAUNCHER]  cmp=com.example.hellowebview/.HelloWebView  } [2010-11-27 19:45:24 - HelloWebView]  ActivityManager: Warning: Activity not  started, its current task has been  brought to the front</p></blockquote>","10508","","","","","2010-11-28 04:13:39","WebView tutorial presents blank (white) page in emulator, but works fine on device","<android><android-emulator>","1","0","","",""
"4295242","1","4696725","","2010-11-28 03:50:37","0","651","<p>I am wondering where the default ContextMenu style is defined... to copy/use it!</p><p>I have few ListView in my app, using the provided TexView layout android.R.layout.simple_list_item_1. My listings are looking odd (black background) compare to the default ones like the ContextMenu (white background).</p><p>So if you know where it is, or how to make my ListView having a ""standard"" style, I would be glad to know about it ;)</p><p>Thanksjo</p>","474411","","474411","","2010-11-29 11:58:39","2011-01-14 22:38:01","style a ListView as a standard ContextMenu","<android><coding-style><contextmenu>","1","1","1","",""
"4295271","1","","","2010-11-28 03:58:25","1","538","<p>I wrote the following function in order to drag around an ImageView on the screen. Seems to work alright except while dragging the image jumps around like crazy. </p><p>Looking at the log the problem seems to be I'm getting incorrect values for X and Y in between every correct value. I'm not sure why though. Can anyone help me fix this?</p><pre><code>hereOnTouchListener imageListener = new OnTouchListener(){@Overridepublic boolean onTouch(View v, MotionEvent event) {  // TODO Auto-generated method stub  int eventAction = event.getAction();  int X = (int)event.getX();  int Y = (int)event.getY();  if (eventAction == MotionEvent.ACTION_DOWN){   dragging = true;   tempParams = new RelativeLayout.LayoutParams(v.getWidth(), v.getHeight());Log.i(""v width and height"", v.getWidth() + "" "" + v.getHeight());  }       if (eventAction == MotionEvent.ACTION_UP){   Log.i(""dragging up"",""dragging up"" + X + "" "" + Y);   dragging = false;  } else if (eventAction == MotionEvent.ACTION_MOVE){   if (dragging){    Log.i(""dragging"",""dragging "" + X + "" "" + Y);    tempParams.leftMargin = X;    tempParams.topMargin = Y;    v.setLayoutParams(tempParams);   // v.setPadding(X, Y, 0, 0);    v.invalidate();   }  }  return true; }};</code></pre><p>sample of log output:</p><pre><code>11-27 19:43:34.484: INFO/dragging(3530): dragging 131 13111-27 19:43:34.504: INFO/dragging(3530): dragging 84 28811-27 19:43:34.519: INFO/dragging(3530): dragging 132 13411-27 19:43:34.539: INFO/dragging(3530): dragging 84 29211-27 19:43:34.554: INFO/dragging(3530): dragging 132 13911-27 19:43:34.574: INFO/dragging(3530): dragging 84 29411-27 19:43:34.594: INFO/dragging(3530): dragging 132 14211-27 19:43:34.609: INFO/dragging(3530): dragging 84 294</code></pre>","522710","","155392","","2010-11-29 14:18:43","2013-12-05 06:47:50","Strange jumping values for onTouchListener using a RelativeLayout in Android","<android>","3","1","1","",""
"4295333","1","4295359","","2010-11-28 04:16:53","2","4487","<p>So in my application, I have a seekbar that allows the user to set the ringer volume (0 - 100). I can't seem to find a way to set the ringer volume to a specified number. I looked through the <a href=""http://d.android.com/reference/android/media/AudioManager.html"" rel=""nofollow"">AudioManager</a> class but it tells me to either set ringermode to normal/silent/vibrate. That is <strong>NOT</strong> what I want. I want the volume to be a <strong><em>specific number</em></strong>. Here's an example of what I'm looking for:</p><pre><code>private void setRinger (int volume) // volume = 0 - 100{    setRingVolume (volume); // Whenever a person gets a call/sms/warning/anything etc., it should be this volume.}</code></pre><p>Is this possible in Android? If so, how? Can you give me an example of how I can do this?</p><p>Thank you.</p>","484881","","484881","","2010-11-28 05:13:33","2010-11-28 05:13:33","In Android (using Java), how can I set the ring volume (to a specified number)?","<java><android><settings><volume><vibrate>","1","0","","",""
"4295370","1","4295575","","2010-11-28 04:25:38","1","6666","<p>I am creating an android application using Eclipse. I want to ask on how to create a database using SQLite. The database will only have 3 tables which is user_id, user_name, and user_password.</p>","516160","","229106","","2010-11-28 09:54:50","2011-02-10 08:38:56","Create database using SQLite on Eclipse","<sql><android><sqlite>","2","0","1","",""
"4295417","1","4296214","","2010-11-28 04:45:19","1","10688","<p>I am trying to upload file to a php server from my android device. There is thread with same question but he is using a different method. My Android side code works fine and shows no error message but server is not receiving any file. here is my sample code, I found it online. </p><pre><code>import java.io.FileInputStream;import android.app.Activity;import android.os.Bundle;import java.io.DataInputStream;import java.io.DataOutputStream;import java.io.File;import java.io.IOException;import java.net.HttpURLConnection;import java.net.MalformedURLException;import java.net.URL;import android.util.Log;public class uploadfile extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    doFileUpload();}private void doFileUpload(){HttpURLConnection conn =    null;DataOutputStream dos = null;DataInputStream inStream = null;    String exsistingFileName = ""/sdcard/def.jpg"";// Is this the place are you doing something wrong.String lineEnd = ""rn"";String twoHyphens = ""--"";String boundary =  ""*****"";int bytesRead, bytesAvailable, bufferSize;byte[] buffer;int maxBufferSize = 1*1024*1024;String responseFromServer = """";String urlString = ""http://192.168.1.6/index.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);                                        // 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><p>and my php server side code is as follows</p><pre><code>&lt;?php $target_path = ""uploads/""; $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>Apache is running. When i run server, this error msg appears There was an error uploading the file, please try again!. I have checked the log data in eclipse and what i think is the socket problem but i am not sure. Please help if anyone knows the solution. </p><pre><code>11-28 05:37:55.310: DEBUG/SntpClient(59): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre>","367121","","223992","","2010-12-03 11:08:01","2013-06-06 02:37:04","Upload a picture from Android to PHP server","<java><android><http><file-upload>","2","7","5","",""
"4295423","1","4295437","","2010-11-28 04:46:44","0","480","<p>Ok, I currently have an app on the MarketPlace and today I release its first update.  Will the SQLite database used by my app be overwritten by the update, thus calling the onCreate once again?  Or will it simply not touch the database?  What happens to the SharedPreferences?</p><p>Sorry for the seemingly simple questions, I've been googling for an hour now and haven't found anything on what happens to a package when the user updates the app.  Does it totally wiped out and reinstalled?  Dunno.  Any help will be highly appreciated.  Thank you!</p>","496174","","","","","2010-11-28 04:51:51","What happens to my Android app and database when a user updates through Market Place?","<android><database><sqlite><sharedpreferences><marketplace>","1","0","1","",""
"4295610","1","4295628","","2010-11-28 05:58:10","4","3845","<p>I'm a relatively new programmer, and I haven't really worked with xml before other than writing layouts for android applications.</p><p>I want to be able to have a user save an int value (figured it'd be easier to save the int as a string, however), so that way it is usable whenever they use my app.  (For example, I have a start time and end time I want them to be able to save instead of inserting everytime they open the app).</p><p>I was thinking the easiest way to go about this would be to save the file to an xml file, but after looking at android tutorials, the only coding I could understand about xml files was how to load the resource files from the files, but nothing on how to save (or edit) these strings.</p><p>I don't have access to a database for this project, so it needs to be able to be saved directly on the phone.</p><p>What's the easiest way to save 2 strings for an android app?</p>","513014","","","","","2010-11-28 06:12:19","How to save 2 strings on an android app?","<java><android><save><saving>","2","0","1","",""
"4295660","1","4295705","","2010-11-28 06:17:43","0","119","<p>I am developing on Windows 7 platform using my HTC HERO. </p><p>The original firmware is 1.5. I've heard that 2.2 is new and is faster than 1.5, so I updated the firmware to 2.2. (There are quiet a few concepts here, like SPL, Recovery, ROM, Radio) I think I only upgraded ROM. </p><p>The phone works fine. However, my windows 7 cannot find the device anymore. Also <code>adb devices</code> cannot find the device either. </p><p>(I didn't backup my old ROM, and I've tried to flash a few 2.2 ROMs available online, none of them could be found by Windows 7.)</p><p>Can anyone give me some hint on solving this problem. Thanks a lot. </p><p>UPDATE:</p><p>I try to find the official ROM. E.g. <a href=""http://www.htc.com/uk/SupportViewNews.aspx?dl_id=671&amp;news_id=254"" rel=""nofollow"">http://www.htc.com/uk/SupportViewNews.aspx?dl_id=671&amp;news_id=254</a>. But when I input my SN number, it says that this update does not work for my phone. It seems that there are a lot of HEROs there and I don't know which HERO is my phone.</p><p>In Windows 7, the system can find the device, but says that cannot install the driver correctly. </p><p>When I press BACK + Power Off key, I can enter recover mode and Windows can connects to the phone correctly. And also <code>adb devices</code> displays:</p><pre><code>D:\android\android-sdk-windows-old\tools&gt;adb devicesList of devices attachedHT9BJL904379    recovery</code></pre><p><img src=""http://i.stack.imgur.com/7rx4h.png"" alt=""alt text""></p><p>USB VID:</p><p><img src=""http://i.stack.imgur.com/9zOIk.png"" alt=""alt text""></p><p><strong>Finally</strong> I am done! Thanks for @Chris Stratton's hint!I use the solution here: </p><p><a href=""http://alt236.blogspot.com/2010/09/adb-will-not-detect-phone-after-rom.html"" rel=""nofollow"">http://alt236.blogspot.com/2010/09/adb-will-not-detect-phone-after-rom.html</a></p>","183828","","1288","","2012-01-12 13:01:03","2012-01-12 13:01:03","Cannot connect to phone after upgrading the firm ware","<android><firmware>","1","0","","",""
"4295662","1","","","2010-11-28 06:18:30","0","219","<p>Currently I'm working on an Android application that accesses data from a .Net web service using SOAP and display a pie chart employing the achartengine APIs. However, i've difficulty of accessing the Soap class i've already defined and tested to be working just fine within the Intent method that produces the pie chart. The intent method is called from another activity; and the calling works fine. The only problem i've right now is accessing the soap class and it's methods from the PieChart class. Thanks for ur time. </p><p>Here is the class that produces the pie chart and a call to the soap class methods:</p><pre><code>package com.testchart;import org.achartengine.ChartFactory;import org.achartengine.model.CategorySeries;import org.achartengine.renderer.DefaultRenderer;import org.achartengine.renderer.SimpleSeriesRenderer;import android.content.Context;import android.content.Intent;import android.graphics.Color;import android.app.*;public class PieChart extends Activity{ SoapConnection sn;  public Intent execute(Context context)    {  sn = ((SoapConnection)getApplicationContext());  sn.setSoapConnection(""eStatus"");   sn.setStockFlag(true);            sn.addParameter(""2"");            sn.soapEnveloping();  double[] values=new double[4];  int i=0;  for(double value : sn.eStatus())  {   values[i]=value;   i++;  }  int[] colors = new int[] {Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW};  DefaultRenderer renderer = buildCategoryRenderer(colors);         renderer.setLabelsTextSize(10);         return ChartFactory.getPieChartIntent(context, buildCategoryDataset(""Project budget"", values), renderer);   }   protected CategorySeries buildCategoryDataset(String title, double[] values)    {      CategorySeries series = new CategorySeries(title);      int k = 0;      for (double value : values)       {        series.add(""Project "" + ++k, value);      }      return series;   }   protected DefaultRenderer buildCategoryRenderer(int[] colors)    {      DefaultRenderer renderer = new DefaultRenderer();      for (int color : colors)       {        SimpleSeriesRenderer r = new SimpleSeriesRenderer();        r.setColor(color);        renderer.addSeriesRenderer(r);      }      return renderer;   }}</code></pre><p>Here is the 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.testchart""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true"" android:name=""SoapConnection""&gt;        &lt;activity android:name="".eStatusChart""                  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=""org.achartengine.chartdemo.demo.chart.XYChartBuilder"" /&gt;        &lt;activity android:name=""org.achartengine.GraphicalActivity"" /&gt;        &lt;activity android:name=""SStatus"" android:label=""@string/stock_status"" /&gt;        &lt;activity android:name=""PieChart"" android:label=""@string/app_name"" /&gt;      &lt;/application&gt; &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre>","522784","","","","","2010-11-28 06:18:30","Couldn't access a SOAP class from an Intent method","<android><soap><android-layout><android-manifest><ksoap2>","0","2","","",""
"4295847","1","4296115","","2010-11-28 07:41:42","0","729","<p>I am building an android application which has a listview and when the user clicks on the listview item then  a new activity is started. I want to pass some data to the new activity. I have two local variables titles and descriptions which I want to use inside that method. Compiler is throwing an error saying that descriptions should be a final type to use in there. Because the descriptions array is generated dynamically I cant make it final. </p><p>Is there something that I am missing or is there any other way to work with this?</p><pre><code>String[] titles = someClass.getTitles();String[] descriptions = someClass.getDescriptions();setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, titles));ListView lv = getListView();lv.setTextFilterEnabled(true);lv.setOnItemClickListener(new OnItemClickListener() {   public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id){      Intent i = new Intent(TitleView.this, DetailView.class);      i.putExtra(""title"", ((TextView) view).getText());      i.putExtra(""description"", descriptions[new Long(id).intValue()]);      startActivity(i);   }});</code></pre><p>Thanks</p>","420556","","","","","2010-11-28 09:09:32","Android-ListView- access local variables in onitemclick method","<android><variables><listview><local><listviewitem>","1","0","","",""
"4295931","1","4295944","","2010-11-28 08:09:11","0","772","<p>Okay, so I have a code, that take an image of the current view, and turns it into a bitmap, then I end up here,</p><pre><code>Bitmap bm = view.getDrawingCache();BitmapDrawable bitmapDrawable = new BitmapDrawable(bm);</code></pre><p>now, what I'm trying to do, is take a picture of what the current view looks like, but from here, I can easily put <code>bitmapDrawable</code> into an ImageView, but thats not what I want, I'd like to go from here, to saving it. What can I do? I found out one way, using</p><pre><code>FileOutputStream fos;  try {   fos = super.openFileOutput(""output.png"",MODE_WORLD_READABLE);   bm.compress(CompressFormat.PNG, 75, fos);      fos.flush();      fos.close();  } catch (FileNotFoundException e) {   e.printStackTrace();  } catch (IOException e) {   e.printStackTrace();</code></pre><p>}<br>but when I do this, I end up with a NullPointerException at</p><pre><code>bm.compress(CompressFormat.PNG, 75, fos);</code></pre><p>am I missing something?</p><p>Okay, now it makes it through the above code, then makes it past <code>fos.close();</code> to finish, but then nothing happens, its not saved, not on my phone, nothing</p>","481082","","481082","","2010-11-28 08:44:11","2010-11-28 08:44:11","Saving a BitmapDrawable or Bitmap","<android><bitmap><bitmapdata>","1","0","","",""
"4296037","1","","","2010-11-28 08:46:20","0","264","<p>a have trowble in my listing program. How to show list objek data on web in android?? this is my code:<pre></p><p>public void loadData() {        String data = txtSeach.getText().toString();        textView = (TextView) findViewById(R.id.mytextView);        String result = """";        // the year data to send        ArrayList nameValuePairs = new ArrayList();        nameValuePairs.add(new BasicNameValuePair(""search"", data));        InputStream is = null;        // http post        try {            URL url = new URL(""http://www.grouprecipes.com/search"");            URLConnection connection = url.openConnection();            connection.connect();            HttpClient httpclient = new DefaultHttpClient();            HttpPost httppost = new HttpPost(""http://www.grouprecipes.com/""                    + data + ""/"");            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));            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();</p><code>        result = sb.toString();        textView.append(result);    } 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);            JSONObject jsonObject = new JSONObject(result);            // textView.setTag(json_data);            // textView.getContext();            /*             * Log.i(""log_tag"",""id: ""+json_data.getInt(""id"")+             * "", name: ""+json_data.getString(""name"")+             * "", sex: ""+json_data.getInt(""sex"")+             * "", birthyear: ""+json_data.getInt(""birthyear"")             *              * );             */        }    } catch (JSONException e) {        Log.e(""log_tag"", ""Error parsing data "" + e.toString());    }}`</code></pre>","519411","","","","","2010-11-28 09:53:32","how to show list object page in android?","<android>","1","1","","",""
"4296087","1","4296186","","2010-11-28 09:01:20","2","1326","<p>I have a thread that listens for a TCP connection. When a connection is made, I would like to basically stop what the current activity is doing, and move to another activity that runs different threads and display a different layout.</p><p>For now I would also like to keep that thread running (waiting for a TCP connection).</p><p>I can change activity from one to another using startActivity() on an Intent, but that doesn't work while within my thread.</p><p>How can I please achieve that behavior?</p><p>Thanks a lot,</p><p>James</p>","522835","","","","","2010-11-28 09:36:09","Getting current activity from thread","<android><multithreading><activity>","1","0","1","",""
"4296175","1","","","2010-11-28 09:32:43","4","2273","<p>The NYTimes has a very interesting page turning feature. You can swipe left to right / right to left to view other items (which is easy to implement). Even if you don't cross the threshold values the view moves with your finger and roll back to the initial view once you lift your finger. How do they do this?</p><p>Second: can this be done on a TabActivity?</p><p>Thanks</p>","356580","","","","","2011-02-21 17:51:55","Android NYTimes Swipe Animation/Gesture","<android><animation><transition><viewflipper>","2","0","2","",""
"4296262","1","","","2010-11-28 09:59:52","0","1568","<p>I'm trying to render a texture with alpha to a frame buffer with alpha. I need the texture's transparency to be controlled by a combination of its own alpha, and the alpha already rendered to the frame buffer.</p><p>ie:</p><p>Normal transparency:</p><p>(src_colour * src_alpha) + (dst_colour * 1-src_alpha)</p><p>Required transparency:</p><p>(src_colour * src_alpha * dst_alphe) + (dst_colour * 1-(src_alpha * dst_alpha))</p><p>Can anyone figure out how to do this?</p><p>I've been working on it for 9 hours now :-)</p><p>I'm using OpenGL 1.0 with GL11ExtensionPack on Android, so I have access to glBlendFunc and glBlendFuncSeparate. I would prefer not to go the GLES20 route with shaders as that would require a lot of code to be rewritten.</p><p>Thanks,Andrew</p>","522858","","44729","","2010-11-28 19:05:07","2010-11-30 08:26:06","OpenGL blending with source and destination alpha","<android><opengl-es><alpha><blend>","1","2","2","",""
"4296306","1","","","2010-11-28 10:13:50","0","329","<p>I'm very new to Android development and Java. This is probably a simple answer but I cant seem to find the info anywhere. I know I can pull data from my XML by using:</p><pre><code>Double.parseDouble(example.getText().toString());</code></pre><p>but what I need to to is then extract the data and add it together. </p><p>Example: I pull the data and its <code>1234</code> then I need to add <code>1+2+3+4</code>. Thanks for the help.</p>","522865","","127013","","2010-11-28 15:27:29","2011-05-11 21:34:17","How to pull data from XML and then extract the data","<java><android><xml>","1","2","","",""
"4296319","1","","","2010-11-28 10:19:01","1","264","<p>I am making a game in Android where i am generating random number for different colored balls. Currently i am generating buttons dynamically and settings the background resource. </p><p>I am using some high resolution icons as images. However when they render on screen, all of them gets slightly pixelated and don't look good on screen. I tried it with different sizes of icons but it was of no use.</p><p>Can anyone suggest where i can be going wrong and what can be the best way to take care of these things. I am new to game programming so any help would be appreciated.</p>","282826","","","","","2010-11-28 11:08:34","Generating Balls for Android Game","<android>","1","2","","",""
"4296364","1","4297500","","2010-11-28 10:31:54","2","3564","<p>I have followed this tutorial<a href=""http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/"" rel=""nofollow"">http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/</a>and like to add an on click for the listview.</p><p>now 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:layout_width=""fill_parent""           android:layout_height=""fill_parent""           android:orientation=""vertical"" &gt;&lt;ListView    android:id=""@+id/android:list""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""     android:divider=""@drawable/list_divider""    android:dividerHeight=""1px""    android:cacheColorHint=""#00000000""/&gt;&lt;/LinearLayout&gt;</code></pre><p>and here is my code:</p><pre><code>setContentView(R.layout.main);    steden = new ArrayList&lt;voorDeLijst&gt;();this.m_adapter = new StedenAdapter(this, R.layout.list_item, steden);setListAdapter(this.m_adapter);ListView lv = (ListView)findViewById(R.id.List);lv.setOnItemSelectedListener(new OnItemSelectedListener() {     public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {         AlertDialog.Builder adb = new AlertDialog.Builder(HelloAndroid.this);         adb.setTitle(""LVSelectedItemExample"");         adb.setMessage(""Selected Item is = "");         adb.setPositiveButton(""Ok"", null);         adb.show();    }    public void onNothingSelected(AdapterView&lt;?&gt; arg0) {    // TODO Auto-generated method stub          }});</code></pre><p>The thing is that I am a beginner and with the code above I get an error because It cannot locate the listview. So I can't attach a OnItemClick Listener to it.but when I change <code>&lt;ListView android:id=""@+id/android:list""</code> to <code>&lt;ListView android:id=""@+id/List""</code>Then I can find the listview. but it gives an exception at the line: <code>setContentView(R.layout.main);</code></p><p>So how do I attach an onClick/onItemClick to a Listview which has a custom adapter to bind objects to the listitems?</p><p>Thanks in advanced!JP</p>","169714","","","","","2010-11-28 15:30:50","OnClick ListView problem android","<android><listview>","2","2","","",""
"4296390","1","","","2010-11-28 10:42:03","0","285","<p>I want to create a Alert Dialog after the animation ends. I used AlertDialog.Builder in onAnimationEnd method but i did'nt get any alert.So, please help me out with this.</p><p>The Code looks something like this</p><p>onAnimationEnd (){    // Code Here}</p>","419844","","419844","","2010-11-28 21:33:05","2010-11-28 21:33:05","Creating a Alert Dialog after the animation ends in onAnimationEnd method","<android>","0","2","","",""
"4296441","1","","","2010-11-28 11:07:05","8","9348","<p>I just found out something and I was wondering about how and why.I'm developing a small arcade game for Android. I decided to ignore OpenGL and use the standard SurfaceView and Drawables to do it, since it's suppose to be light (10 sprites or so).I have drawables that I load, and I use the method Draw and passing them my canvas. This how every sprite is drawn to the screen.Well it turns out that drawing 4-5 big sprites (200X400 or so) takes a long time on less-than-brand-new phone models. Long enough to make my game unplayable. We're talking about 50-60 milliseconds to draw a single frame using this method. And I really don't do anything there apart from drawing, nowhere I can cut costs. So I decided to try and use Bitmaps instead. Here, however, I need to pre-set the size, since there's no 'setBounds' method in a bitmap. No prob, I resize them to fit my current screen on load, problem solved.</p><p>OK. So I got bitmaps. I use Canvas.DrawBitmap now to draw. I bench the new draw method.. and I get a whooping <strong>400% performance boost!</strong> Instead of 50-60ms, the entire draw loop now takes 8-12ms. <strong>What the hell??</strong> To rule it out, I timed the setBounds too, it takes &lt;1ms so it's not too blame. It's the actual Drawable.Draw that slows things down.</p><p>For me this is great news, since I really didn't want to learn OpenGL to make my game playable, but I can't stop wondering about it - Is it fine? are there problems with my method? Why isn't it mentioned anywhere?</p>","365581","","","","","2010-11-28 12:22:43","Android: Canvas.DrawBitmap VS Drawable.Draw - Huge performance boost","<android>","1","0","4","",""
"4296471","1","4298069","","2010-11-28 11:16:51","2","4231","<p>Hello EverybodyI am relatively new to Android Development and I am creating an RSS Reader for a news site.The problem I have is that site with the rss feed of which I want to get images is of a type ""&lt; img src=""http......""""<strong>What I have done for the code on android is ...2 classes ...RssItem and RssItem Displayer</strong></p><pre><code>public class RssItem {private String title;private String description;private Date pubDate;private String link;private static ImageView image;public RssItem(String title, String description,ImageView image, Date pubDate, String link) {    this.title = title;    this.description = description;    RssItem.image = image;    this.pubDate = pubDate;    this.link = link;}public String getTitle() {    return title;}public void setTitle(String title) {    this.title = title;}public String getDescription() {    return description;}public void setDescription(String description) {    this.description = description;}public ImageView getImage(ImageView image) {      return this.image = image;}     public void setImage(ImageView image) {          this.image = image;     }public Date getPubDate() {    return pubDate;}public void setPubDate(Date pubDate) {    this.pubDate = pubDate;}public String getLink() {    return link;}public void setLink(String link) {    this.link = link;}@Overridepublic String toString() {    SimpleDateFormat sdf = new SimpleDateFormat(""MM/dd - hh:mm:ss"");    String result = getTitle() + ""   ( "" + sdf.format(this.getPubDate()) + "" )"";    return result;}public static ArrayList&lt;RssItem&gt; getRssItems(String feedUrl) {    ArrayList&lt;RssItem&gt; rssItems = new ArrayList&lt;RssItem&gt;();    try {        //open an URL connection make GET to the server and         //take xml RSS data        URL url = new URL(feedUrl);        HttpURLConnection conn = (HttpURLConnection) url.openConnection();        if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {            InputStream is = conn.getInputStream();            //DocumentBuilderFactory, DocumentBuilder are used for             //xml parsing            DocumentBuilderFactory dbf = DocumentBuilderFactory                    .newInstance();            DocumentBuilder db = dbf.newDocumentBuilder();            //using db (Document Builder) parse xml data and assign            //it to Element            Document document = db.parse(is);            Element element = document.getDocumentElement();            //take rss nodes to NodeList            NodeList nodeList = element.getElementsByTagName(""item"");            if (nodeList.getLength() &gt; 0) {                for (int i = 0; i &lt; nodeList.getLength(); i++) {                    //take each entry (corresponds to &lt;item&gt;&lt;/item&gt; tags in                     //xml data                    Element entry = (Element) nodeList.item(i);                    Element _titleE = (Element) entry.getElementsByTagName(                            ""title"").item(0);                    Element _descriptionE = (Element) entry                            .getElementsByTagName(""description"").item(0);                    Element _imageE = (Element) entry                            .getElementsByTagName(""image"").item(0);                    Element _pubDateE = (Element) entry                            .getElementsByTagName(""pubDate"").item(0);                    Element _linkE = (Element) entry.getElementsByTagName(                            ""link"").item(0);                    String _title = _titleE.getFirstChild().getNodeValue();                    String _description = _descriptionE.getFirstChild().getNodeValue();                     // ImageView image = (ImageView)findViewbyId(R.id.MyImage);                     // Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(feedUrl).getContent());                     // image.setImageBitmap(bitmap);                     //} catch (MalformedURLException e) {                    /*try {                          //where imageUrl is what you pulled out from the rss feed                          Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(feedUrl).getContent());                          image.setImageBitmap(bitmap);                         } catch (MalformedURLException e) {                         //log exception here                        } catch (IOException e) {                          //log exception here                        }                    */                    Date _pubDate = new Date(_pubDateE.getFirstChild().getNodeValue());                    String _link = _linkE.getFirstChild().getNodeValue();                    //create RssItemObject and add it to the ArrayList                    RssItem rssItem = new RssItem(_title, _description, image,                            _pubDate, _link);                    rssItems.add(rssItem);                }            }        }    } catch (Exception e) {        e.printStackTrace();    }    return rssItems;}      </code></pre><p><strong>but I do not know how to put the src image element</strong> </p><p>I also create an imageview that will show it on the layout xml</p><p>In the other class that shows <strong>RSS item displayer</strong> I have </p><pre><code>public class RssItemDisplayer extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.rss_item_displayer);    RssItem selectedRssItem = com.AndroidRSSReader.AndroidRSSReader.selectedRssItem;    //Bundle extras = getIntent().getExtras();    TextView titleTv = (TextView)findViewById(R.id.titleTextView);      TextView contentTv = (TextView)findViewById(R.id.contentTextView);      ImageView image=(ImageView)findViewById(R.id.MyImage);      String title = """";    SimpleDateFormat sdf = new SimpleDateFormat(""MM/dd - hh:mm:ss"");    title = ""\n"" + selectedRssItem.getTitle() + ""   ( ""     + sdf.format(selectedRssItem.getPubDate()) + "" )\n\n"";    String content = """";    content += selectedRssItem.getDescription() + ""\n""            + selectedRssItem.getLink();    titleTv.setText(title);    contentTv.setText(content);    image=selectedRssItem.getImage(image);    try {          String feedUrl = null;        //where imageUrl is what you pulled out from the rss feed          Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(feedUrl).getContent());          image.setImageBitmap(bitmap);         } catch (MalformedURLException e) {         //log exception here        } catch (IOException e) {          //log exception here        }</code></pre><p>the <strong>logcat gave me warnins to the line of rss item that bitmap is get in the code</strong></p><pre><code>11-29 00:13:44.593: WARN/System.err(2997): java.net.MalformedURLException: Protocol not found: 11-29 00:13:44.593: WARN/System.err(2997):     at java.net.URL.&lt;init&gt;(URL.java:275)11-29 00:13:44.593: WARN/System.err(2997):     at java.net.URL.&lt;init&gt;(URL.java:159)11-29 00:13:44.593: WARN/System.err(2997):     at com.AndroidRSSReader.RssItem.getRssItems(RssItem.java:92)11-29 00:13:44.593: WARN/System.err(2997):     at com.AndroidRSSReader.AndroidRSSReader.refressRssList(AndroidRSSReader.java:301)11-29 00:13:44.593: WARN/System.err(2997):     at com.AndroidRSSReader.AndroidRSSReader.onCreate(AndroidRSSReader.java:229)11-29 00:13:44.593: WARN/System.err(2997):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)11-29 00:13:44.593: WARN/System.err(2997):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)11-29 00:13:44.593: WARN/System.err(2997):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)11-29 00:13:44.593: WARN/System.err(2997):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)11-29 00:13:44.603: WARN/System.err(2997):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)11-29 00:13:44.603: WARN/System.err(2997):     at android.os.Handler.dispatchMessage(Handler.java:99)11-29 00:13:44.613: WARN/System.err(2997):     at android.os.Looper.loop(Looper.java:123)11-29 00:13:44.613: WARN/System.err(2997):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-29 00:13:44.613: WARN/System.err(2997):     at java.lang.reflect.Method.invokeNative(Native Method)11-29 00:13:44.613: WARN/System.err(2997):     at java.lang.reflect.Method.invoke(Method.java:521)11-29 00:13:44.613: WARN/System.err(2997):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)11-29 00:13:44.613: WARN/System.err(2997):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)11-29 00:13:44.613: WARN/System.err(2997):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>What should I put in those two things to grub the image and especially to rss item classAnyway If someone can help i will be grateful</p>","522866","","321697","","2010-12-03 15:22:36","2010-12-03 15:22:36","Android Rss Image Problem","<java><android><image><rss>","1","13","1","",""
"4296481","1","","","2010-11-28 11:19:39","1","1185","<p>I would like to import a project in to Eclipse without having to ""create a new project from the source"". So that I can use folder and files with subversion from a project that is already in development that I have checked out. Eclipse with import the project but leaves out the androidmanifest.xml and the R.java is not generated.  </p><p>This doesn't work for me:     </p><p>Solved: If you want to ""Create project from existing source"", you need to create a new directory and then put the project directory tree into that new directory. Then point to the new directory when importing.*I found the solution on a Korean website, that's why I missed my first search with google.</p>","190282","","","","","2010-11-29 06:30:51","How to import an Android project in to eclipse with out creating a new one from source?","<android><eclipse><svn>","1","0","1","",""
"4296496","1","4296892","","2010-11-28 11:24:13","17","4050","<p>My problem comes from getting an Iterator from a JSONObject.</p><p>Code generating error in its simplest form:</p><pre><code>String json = client.retrieveList();JSONObject jsonList = new JSONObject(json);Iterator&lt;String&gt; i = jsonList.keys();while(i.hasNext()){    String next = i.next();    JSONArray jsonArray = jsonList.getJSONArray(next);    // Do stuff with jsonArray, example: jsonArray.getString(0), jsonArray.getString(1);}</code></pre><p>The exact warning is:Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator</p><p>So the question is how can I eradicate this warning?</p><p>Many thanks!</p>","503508","","","","","2012-02-07 17:48:36","Type Safety warning with JSON Iterator","<java><android><json>","2","0","1","",""
"4296516","1","","","2010-11-28 11:29:37","1","310","<p>I need to somehow obtain the top level View object of the current application being run. My program is a service that needs to monitor the current application (another application of Activity type) in some way, in order to get its View hierarchy. Any suggestions?</p>","522893","","","","","2010-12-22 16:00:25","How can I obtain the current View object on Android OS?","<android>","1","0","","",""
"4296519","1","4296672","","2010-11-28 11:30:16","2","8563","<p>I am creating an Android Application and I recently downloaded a SQLite Database Browser. I have created a database which has 3 tables. Now I'm wondering on how to import the created database into Eclpise IDE.</p><p>I hope someone could help..</p>","516160","","135152","","2011-05-25 03:06:34","2011-05-25 03:06:34","How to import SQLite database in Eclipse IDE","<android><eclipse><sqlite><database-connection>","2","0","","",""
"4296618","1","4296725","","2010-11-28 11:56:23","0","655","<p>I am working for manufacture of cell phones. we develop for the Android platform, therefore we can sign our applications and have system permissions, for example we can use</p><p>the packagemanager.installPackage(|..) method, which gives us the ability to install APK's without the user involvement.</p><p>I would like to know, if any one you know about an Un-instantiation method which would uninstall apk's silently without user-involvement?</p><p>thanks,</p><p>ray.</p>","260511","","","","","2011-01-28 23:41:28","Silent Uninstallation","<android>","1","0","","",""
"4296802","1","4297759","","2010-11-28 12:49:13","0","735","<p>Can anyone give a short overview of the cases when and how an activity is killed by the runtime? I'd like to know the difference between the paused and stopped state. What could force the system to destroy a paused activity, exactly the same (low memory) reason as if it was stopped?</p><p>I think if an activity is paused because of an incoming phone call (which suddenly causes a low memory situation) the system simply prefers to release ressources of stopped activities. But how is that done? When does the system ""kindly ask"" the activity by calling finish() and when not, and when does onDestroy() still get called?</p>","474326","","474326","","2010-11-28 15:13:36","2011-06-05 22:30:39","Overview of how Activities are killed by the system","<android><runtime><kill><activity-lifecycle>","2","5","1","",""
"4296828","1","","","2010-11-28 12:56:54","0","666","<p>I'm currently writing a game on Android using a design inspired by <a href=""http://code.google.com/p/replicaisland/"" rel=""nofollow"">Replica Island</a>. That is, a dual thread approach, one logic thread and one render thread.</p><p>I have this set up with a lightweight render module sitting in the logic thread where it will basically just handle game objects that wants to be renderable. It sends render commands to the render thread, like ""render sprite f at x,y"".</p><p>I like this design but the problem for me currently lies in resource creation. Say sprite f needs a texture, this will be requested by it IN the logic thread on loading. Problem is that because the OpenGL context is in the render thread the texture can only be created by in the renderer thread. Currently the only sync point between the logic thread and the render thread is when they exchange render queues at the end of a frame and I'd like to keep it that way.</p><p>How can I solve the problem of wanting to create textures, vbo's etc on the logic thread while still only rendering stuff on the render thread? Would sharing OpenGL contexts be a good approach? Or some other design of the engine maybe?</p><p>EDIT: One alternativ would be to have another queue where you would put requests from the logic thread. Like ""create texture"" etc. The render thread would iterate this queue and process it before starting rendering the other queue. I'm starting to like this solution.</p>","253583","","44729","","2010-11-28 19:03:53","2011-03-03 03:02:37","Android concurrent renderer design","<java><android><multithreading><opengl-es><rendering>","1","0","","",""
"4296871","1","","","2010-11-28 13:05:56","0","179","<p>I want to create a custom spinner.I could show the dialog including the list view,when a button is cliked. But my problem is that I want interaction to both Dialog and the views behind it at the same time. ie I should be able to select one item from the list view in the Dialog and also I should be able to click that button again.Is that possible.Pls help  </p>","522834","","","","","2011-04-14 10:01:08","Android: Dialog Interaction","<android><dialog>","1","3","","",""
"4296980","1","","","2010-11-28 13:32:50","1","517","<p>I want to have a SQLite database for my android application. Anyone knows how to create a database and add information not going through an application class. Is there some user interfaces allow create a SQLite database, add tables, information and later use in the application.                           thanks.</p>","522970","","296231","","2010-11-28 13:36:41","2013-05-03 12:32:48","Android SQLite databases","<android><sqlite>","2","1","1","",""
"4297009","1","","","2010-11-28 13:39:46","0","284","<p>I am trying to display the name and number of a contact from android phone book, i have one contact stored in my AVD. can anyone tell me whats wrong with this code please...it is showing application stopped working Please try again...thanks in advance...</p><pre><code>public class get extends Activity {        private void getColumnData(Cursor cur)    {        if(cur.moveToFirst())        {            int numi=cur.getColumnIndex(People.NUMBER);            int namei=cur.getColumnIndex(People.NAME);            String name,num;            do{                name=cur.getString(namei);                num=cur.getString(numi);            }while(cur.moveToNext());        }    }    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Uri u=People.CONTENT_URI;        String[] proj=new String[]{People.NAME,People.NUMBER};        Cursor cur=managedQuery(u, proj, null, null, null);        getColumnData(cur);        TextView tv=new TextView(this);        tv.setText(""First step"");        setContentView(tv);    }}</code></pre>","522973","","185541","","2010-11-28 14:48:13","2011-02-14 21:25:25","Application stopped working unexpectedly. Please try again","<java><android>","2","1","","",""
"4297043","1","4297451","","2010-11-28 13:49:40","1","725","<p><strong>What I'm trying to accomplish:</strong> create a clickabel hyperlink in the message text displayed by a DialogPreference.</p><p><strong>My solution so far:</strong> follow this topic: <a href=""http://stackoverflow.com/questions/1997328/android-clickable-hyperlinks-in-alertdialog"">link</a> , and I am accomplished a formating hyperlink displayed in the DialogPreference, but this hyperlink not clickable. </p><p><strong>Question</strong>:How to make the hyperlink clickable in the DialogPreference.</p><p>my code:</p><pre><code>public class AboutDialog extends DialogPreference {public AboutDialog(Context oContext, AttributeSet attrs){    super(oContext, attrs);    final SpannableString s = new SpannableString(oContext.getText(R.string.about_text));    Linkify.addLinks(s, Linkify.ALL);    this.setDialogMessage(s);}}</code></pre>","522915","","522915","","2010-11-28 15:08:43","2010-12-11 06:08:58","Android: Clickable hyperlinks in DialogPreference","<android><gui><hyperlink>","1","0","","",""
"4297056","1","4297950","","2010-11-28 13:51:17","1","506","<p>When I used to program for the iphone I used structs to store my vertices using a nested for loop for tiling.Now in java I cannot seem to find a way to do this.Can anyone help me out on this one?Thanks.</p>","507007","","44729","","2010-11-28 19:02:59","2010-11-28 20:28:58","Android Java Vertex Array?","<java><android><opengl-es><vertex>","2","0","0","",""
"4297147","1","4299430","","2010-11-28 14:14:15","1","635","<p>I'm new to android programming, but one thing that I can't seem to get down is writing the XML files.  I use a program called droiddraw to help generate the xml code.  This program is very simple because it lets me add buttons and DRAG them where I want them.  Once I get the screen/form (or whatever it's called) setup the say I like, it will generate the the xml file for me.  My question is this:  ""Does eclipse have a plugin  that will do that too?""  I know that I can view the form/screen that I can designing, and add buttons and such, but I can't drag them to where I want them.  I always have to edit the layout values manually.</p>","522983","","213269","","2010-11-28 15:05:15","2010-11-28 22:14:56","XML layout editor","<android><layout><eclipse-plugin>","2","0","","",""
"4297261","1","4297268","","2010-11-28 14:37:26","13","11836","<p>I have the following :</p><pre><code>Runnable done = new Runnable()    {        public void run()        {            System.out.println(""Hello"");        }    };</code></pre><p>And then in my Android activity I'll call something like : </p><pre><code>runOnUIThread(done);</code></pre><p>Which I then call. However, I want that <code>""Hello""</code> not to be hardcoded, so I can pass it in. Otherwise I'll have to have one of these declarations for every String I want to print.</p><p>(This is actually an android question, but slimmed it down to basic Java so its easier to answer)</p><p>Thanks</p>","155695","","","","","2012-10-12 12:03:00","how can I pass a variable into a new Runnable declaration?","<java><android><runnable><android-2.1-eclair>","3","0","4","",""
"4297264","1","4297828","","2010-11-28 14:38:17","0","5187","<p>I am trying to develop small application for Android which computes users concentration. My idea is to show a matrix of images where user is forced to select given images in amount of time and compute how accurate user was. </p><p>The problem is that I do not know, how to design a layout which combines TextViews and GridViews. </p><p>I tried to make UI like this  but I was not succesfull.</p><p>I thought that it is enough to place TextView1 into LinearLayout, then GridView1, TextView2, GridView2 and button. I tried more combinations which led to my failure. </p><p>Could you give me a hint how to desing this layout, please?</p><p>This is my layout:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/root""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView android:text=""@+id/TextView01""         android:id=""@+id/TextView01""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""&gt;        &lt;/TextView&gt;&lt;LinearLayout  android:orientation=""horizontal""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;    &lt;ImageView android:id=""@+id/ImageView01""     android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;/ImageView&gt;    &lt;ImageView android:id=""@+id/ImageView02""     android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;/ImageView&gt;    &lt;ImageView android:id=""@+id/ImageView03""     android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;/ImageView&gt;&lt;/LinearLayout&gt;&lt;TextView android:text=""@+id/TextView02""         android:id=""@+id/TextView02""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;LinearLayout  android:orientation=""horizontal""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:layout_weight=""0.4""&gt;    &lt;GridView android:id=""@+id/GridView01""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:numColumns=""auto_fit""        android:columnWidth=""25px""        android:stretchMode=""none""&gt;    &lt;/GridView&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""&gt;          &lt;Button android:text=""@+id/Button01""                   android:id=""@+id/Button01""                   android:layout_width=""wrap_content""                   android:layout_height=""wrap_content""&gt;&lt;/Button&gt;          &lt;Button android:text=""@+id/Button02""                   android:id=""@+id/Button02""                   android:layout_width=""wrap_content""                   android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>I've managed to have more columns in gridview and get there to a single row as many images as I can. But I can't set the height of a row, only width of a column. Images in gridview are magnified and I can't see a method to set them to their original size.</p>","522996","","1454316","","2013-10-14 16:17:45","2013-10-14 16:17:45","GridView with TextView in LinearLayout","<android><gridview><textview>","2","0","","",""
"4297266","1","4297751","","2010-11-28 14:38:40","2","126","<p>My bitmap editor app uses the SD card to store application data where e.g. I autosave the document state to the SD card every 30 seconds. I know that when the user plugs their phone into their computer, the SD card cannot be accessed by applications any more if the SD card gets mounted on the computer. I need to make sure my application behaves predictably when this happens. I have a couple of queries:</p><ul><li><p>What happens if I'm in the middle of a function call that is writing to a file when the phone is plugged in? Does Android give me a chance to finish up writing to the file or does the transfer get interrupted?</p></li><li><p>Is there any way to get a warning that SD card access is about to be lost to give my app a chance to save its state to disk?</p></li></ul>","483701","","","","","2010-11-28 16:27:00","Coping with losing SD card access while app is running","<java><android><mobile>","1","0","","",""
"4297292","1","","","2010-11-28 14:43:44","2","216","<p>I have an architecture which simulates a treeview structure using a spinner supported by a tabhost. The first spinner is not enabled and the first tabhost shows up to 10 tabs. Selecting any one of the tabs exposes a spinner filled with selectable items and a subordinate tabhost with tabs unique to that selection 'thread'. This structure is repeatable ad infinitum.</p><p>The display of this structure is working flawlessly, as far as I can tell. I say that because my application goes to a forced close whenever I click on a 3rd-level spinner. The error log reports a message from WindowManager: 'Attempted to add a window with unknown token. Aborting' </p><p>I believe it is notable that this spinner is the first control element that is located in the 2nd FrameLayout!</p><p>Does anyone have an idea how to work around this apparent addressability problem?</p><p>PS: This application is an attempt to port a web application to the android platform. A demonstration is available at georgiansoftware.com [username:Guest / password:Guest2009]</p>","353616","","","","","2010-11-28 14:43:44","Cascading tabhosts: how do I maintain addressability?","<android><android-tabhost>","0","3","1","",""
"4297327","1","4297535","","2010-11-28 14:50:33","2","5548","<p>I got a G7 Desire recently that didn't has Google Map Api Lib in it.When I installed an app that use google map api on my phone, the adb console showed INSTALL_FAILED_MISSING_SHARED_LIBRARY error. So how can I install Google Map Api to my new G7? </p><p>PS. Is there a device list of what android devices do not have Google Map Api Lib? </p>","523002","","523002","","2010-11-28 15:44:15","2012-02-09 05:13:13","How can I install Google Map Api to my new Android Device?","<android><google-maps>","3","0","","",""
"4297458","1","6066066","","2010-11-28 15:22:25","6","1282","<p>In the JavaDoc of <a href=""http://developer.android.com/reference/android/test/ActivityUnitTestCase.html#startActivity%28android.content.Intent,%20android.os.Bundle,%20java.lang.Object%29"" rel=""nofollow"">ActivityUnitTestCase</a> it says:</p><blockquote>  <p>Do not call from your setUp() method. You must call this method from each of your test methods.</p></blockquote><p>Isn't putting something in every test method equivalent to putting it in <code>setUp</code>, considering that the whole idea behind that method is to do just that, i.e. executing something before every test?</p><p>Also, why are we not allowed to do that? I tried it, and it works just fine.</p>","127013","","","","","2011-09-16 20:08:47","ActivityUnitTestCase and startActivity","<android><unit-testing>","3","0","1","",""
"4297620","1","4298599","","2010-11-28 15:57:55","0","1008","<p>Android - when getting images from Gallery, they are with wrong orientation.</p><p>For example, if they are landscape images, they are ok, but if they are portrait, they are rotated 90 degrees and again shown as landscape.</p><p>This is how I start the activity for picking images:</p><pre><code>    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);    intent.setType(""image/*"");</code></pre><p>And when I get the path, this is how I decode the image:</p><pre><code>    userPic = BitmapFactory.decodeFile(path);</code></pre><p>How can I workaround/fix this issue? Is there anything I am doing wrong?</p>","232798","","","","","2010-11-28 19:30:51","Android - when getting images from Gallery, portraid images come back as landscape (rotated 90 degrees)","<android><android-image>","1","0","","",""
"4297647","1","6170413","","2010-11-28 16:03:34","5","4641","<p>What are the intents that are broadcasted in the following events,</p><ol><li>Wifi state change</li><li>Bluetooth state change</li><li>Ringer mode change</li></ol>","421372","","","","","2011-05-29 21:05:28","Broadcast intents for bluetooth, wifi and ringer mode","<android><bluetooth><android-intent><intentfilter><android-wifi>","1","0","3","",""
"4297667","1","4305432","","2010-11-28 16:09:13","-2","87","<p>how i can create the this layout  <img src=""http://i.stack.imgur.com/iI0N0.png"" alt=""alt text""></p>","510992","","1149919","","2012-03-31 02:04:13","2012-03-31 02:04:13","layout in android","<android><android-layout><android-listview>","2","0","","2013-01-21 15:12:22",""
"4297714","1","4297830","","2010-11-28 16:20:50","0","339","<p>I'm new to develop Android Apps and writing java. But, I only want to make a simple app that will give a different output on TextView depending on what time of the day it is.</p><p>F.ex. If the time is between 06:45 and 08:45 I want it to say ""Good Morning"", and so forth.</p><p>I have been playing with Eclipse and created a simple WebView-app but I can't seem to find any information to either choose which TextView I want shown on a specific time or show a different layout.</p><p>Do you have any tips?This is my .java file in src for now.</p><pre><code>package com.wao.texttime;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class TextTime extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView tv1 = (TextView) findViewById(R.id.TextView01);        tv1.setText(""Good Morning"");     }}</code></pre>","523053","","523053","","2010-11-28 21:31:03","2010-11-28 21:31:03","Show different TextView's depending on the time of the day","<android>","1","0","","",""
"4297739","1","4297891","","2010-11-28 16:24:39","0","936","<p>I've drawn 5 bitmaps from .png files on a canvas - a head, a body and two arms and legs.</p><p>How can I detect which of these has been touched on an OnTouch?  And, more specifically, can I detect if the OnTouch was within the actual shape of the body part touched?</p><p>What I mean is, obviously, the .pngs themselves are rectangular, but does Android know, or can I tell it, to ignore the transparency within the image?</p>","442912","","244296","","2010-11-28 16:44:05","2010-11-30 22:21:12","Android Bitmap OnTouch Questions","<android><bitmap><touch>","1","0","","",""
"4297763","1","4297791","","2010-11-28 16:29:36","22","43592","<p>In my application I have an EditText. I want my client just have read access not write.In code I set <code>android:enabled=""false""</code>. Although the background of EditText changed to dark, when I click on it the keyboard pops up up and I can change text.</p><p>What should I do?Thanks</p>","513413","","741249","","2012-05-03 12:00:04","2013-09-25 12:59:47","Disabling of EditText in android","<android><edittext>","6","0","7","",""
"4297792","1","4381580","","2010-11-28 16:35:11","4","4270","<p>I have been trying to create a simple application that will let the user customize the behavior of airplane mode in Android.  The motivation for this is from a relative who has a Samsung Fascinate, and during calls he will accidentally turn on airplane mode.  This happens when he holds the phone, accidentally holds down the side power/lock button, which opens a dialog with a menu for “Silent Mode”, “Airplane Mode”, and “Power Off”.  He  accidentally triggers airplane mode by a touch of the phone to his cheek.  This drops the call and is an annoyance to him. </p><p>Ultimately, I would like to create an app that prevents the cellular radio from being turned off while the user is in the middle of a call.  But, for a first iteration I thought it made sense to let the user manually choose which radios would <strong>not</strong> get turned off by airplane mode.</p><p>I am <strong>not</strong> looking to modify the Android source code or do something that would require rooting. I am looking for a solution within the standard framework</p><p>My first attempt to solve this was to create an application that would modify <code>System.AIRPLANE_MODE_RADIOS</code> like so:</p><pre><code>System.putString(getApplication().getContentResolver(), System.AIRPLANE_MODE_RADIOS, """");</code></pre><p><a href=""http://developer.android.com/reference/android/provider/Settings.System.html#AIRPLANE_MODE_RADIOS"" rel=""nofollow"">According to the API docs</a>, this constant is ""A comma separated list of radios that need to be disabled when airplane mode is on"".  It seems that airplane mode does not actually use this constant, and it continues to work as normal after the change is made.  </p><p>My next attempt was to create a BroadCastReceiver, receive the AIRPLANE_MODE action, and send out an Intent to reverse it:</p><pre><code>Intent am = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);intent.putExtra(""state"", 0);context.sendBroadcast(am);</code></pre><p>This does turn off airplane mode after it has been activated.  However, if the user was in the middle of a call, it will still be dropped (which makes sense).  So, this is not quite the solution to my problem.</p><p>Does anyone know how to prevent airplane mode from disabling the cellular radio?</p>","3767","","3767","","2010-12-03 16:26:27","2010-12-07 21:37:59","How can I change the behavior of Android's airplane mode so that it will not turn off the cellular radio?","<java><android><android-intent><action>","6","4","3","",""
"4297838","1","","","2010-11-28 16:45:56","4","2484","<p>I've looked and looked, but Eclipse (3.6, with the 2.2 Android SDK) just won't do anything with the AIDL file I created. The AIDL file is in the same place as the other source, following the Java style. I've read that Eclipse <em>should</em> just generate the stub for the interface declared in the AIDL file, but it doesn't appear in the gen folder, nor anywhere else i've seen, and the project doesn't build because the interface specified in the AIDL isn't found. I suspect i'm doing something silly or not understanding something, but as much as i've looked and tried, I still don't get it and Eclipse still fails.</p><p>My AIDL:</p><p>package com.example.helloandroid;</p><p>interface HOSPlayerInterface{ public void playURL(String url); public boolean pause(); public boolean resume(); public void stop();}</p><p>... and said AIDL lives in the com/example/helloandroid directory. Eclipse isn't recognizing it, highlighting syntax, running AIDL, etc. I'm at a loss. The Android plugin is installed and working, as i'm able to build and run simple Android projects that don't require AIDL. Any help would be appreciated.</p>","523066","","","","","2012-02-17 01:39:23","Android:Eclipse won't recognize AIDL file","<android><eclipse><aidl>","2","2","","",""
"4297851","1","","","2010-11-28 16:49:21","5","2969","<p>I'm seeing some interesting activity flow when android turns off the screen and locks the screen... my app goes through the regular flow, onCreate, onStart and onResume. Then, I let my phone sit there. When the screen goes black, onPause is called. That's fine. Then 5 seconds later, the app is killed (onStop, onDestroy). That's fine too. But <em>immediately</em> after onDestroy is called, onCreate, onStart and onResume are called, restarting the app even though the screen is blank. The app has a load time, and it plays a sound when it starts, so it's kind of creepy when the phone you set down 30 seconds ago starts playing sounds. Why does android kill the app then restart it? Target is 2.1-update, and the phone is a Samsung Captivate. Anyone else seeing this, and know a way to stop it?</p>","492271","","","","","2013-04-26 09:14:56","Funky android activity behavior when screen turns off?","<android><activity><screen><flow>","2","0","2","",""
"4297858","1","4297886","","2010-11-28 16:52:03","0","1030","<p>I would like to perform a REST API request every X mins to update the database my application uses. </p><p>That should happen whether my application is running or not. That also means, if the user restarts their mobile, the polling should start straightaway, without the need to run the application first.</p><p>Basically I want to implement kind of this Unix cronjob</p><pre><code>*/5 * * * * /usr/local/bin/update_something.sh</code></pre><p>Is that possible via the Android Services? If so, can you please give me some basic directions?</p><p>Thanks.</p>","354742","","","","","2010-11-28 17:12:28","Android - implement something like a Unix cronjob","<android><web-services>","3","0","1","",""
"4297965","1","4430499","","2010-11-28 17:15:54","0","590","<p>What the application does is very simple. It loads two RSS feeds and on each RSS feed, it contains two items with a title, an image and a link. And then it downloads the images, saves it on to local folder and display them. So two RSS feeds, and 4 images downloading.</p><p>I use AsyncTask to do this. So, two AsyncTasks objects are called to load two RSS feeds and 4 AsyncTasks to load 4 images. The problems happens when it tries to download images. For the first run, it works fine. but if I keep reloading them, sometimes AsyncTask doesn't do anything. And sometimes it fails to read inputstream... very weird.</p><p>Is there any rule that I am missing to use AsyncTask?</p><p>Below is the snippets of my code.</p><pre><code>public class TunesAppsWidgetProvider extends AppWidgetProvider {private Intent taService = null;private static boolean widgetEnabled = false;@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    taService = new Intent(context, UpdateService.class);    context.startService(taService);}public static class UpdateService extends Service {    @Override    public void onStart(Intent intent, int startId) {        Log.d(Constants.TAG, ""Service: onStart()"");        Context context = getApplicationContext();        mViews = new RemoteViews(context.getPackageName(), R.layout.tunesappswidget);        thisWidget = new ComponentName(this, TunesAppsWidgetProvider.class);        manager = AppWidgetManager.getInstance(this);        buildFeedUpdate();        this.stopSelf();        Log.d(Constants.TAG, ""Stop Service"");    }    public void buildFeedUpdate() {        Log.d(Constants.TAG, ""buildFeedUpdate"");        Context context = getApplicationContext();        feedParser_0 = new FeedParser(context, Constants.FEED_ID_0);        feedParser_1 = new FeedParser(context, Constants.FEED_ID_1);        feedTask_0 = new LoadFeedTask();        feedTask_0.execute(                new LoadFeedTask.Payload(                        feedParser_0,                        UpdateService.this                )        );        feedTask_1 = new LoadFeedTask();        feedTask_1.execute(                new LoadFeedTask.Payload(                        feedParser_1,                        UpdateService.this                )        );    }    public void buildCoverUpdate(byte feedID, List&lt;Message&gt; feedRSS, String operator) {        Context context = getApplicationContext();        Log.d(Constants.TAG, ""buildCoverUpdate: "" + feedID);        try {            switch(feedID) {                case Constants.FEED_ID_0:                        coverImage_0 = new CoverImage(context, feedRSS.get(Constants.ITEM_IDX_0).getImageLink(), Constants.SLOT_0);            coverImageTask_0 = new LoadCoverImageTask();                        coverImageTask_0.execute(                            new LoadCoverImageTask.Payload(                                    coverImage_0,                                    UpdateService.this                            )                        );                        coverImage_1 = new CoverImage(context, feedRSS.get(Constants.ITEM_IDX_1).getImageLink(), Constants.SLOT_1);                        coverImageTask_1 = new LoadCoverImageTask();                            coverImageTask_1.execute(                                new LoadCoverImageTask.Payload(                                    coverImage_1,                                    UpdateService.this                                )                        );                    break;                case Constants.FEED_ID_1:                        coverImage_2 = new CoverImage(context, feedRSS.get(Constants.ITEM_IDX_0).getImageLink(), Constants.SLOT_2, operator);                    coverImageTask_2 = new LoadCoverImageTask();                        coverImageTask_2.execute(                                new LoadCoverImageTask.Payload(                                        coverImage_2,                                        UpdateService.this                                )                        );                        coverImage_3 = new CoverImage(context, feedRSS.get(Constants.ITEM_IDX_1).getImageLink(), Constants.SLOT_3, operator);                        bm_3 = coverImage_3.getDefaultCoverImage();                            coverImageTask_3 = new LoadCoverImageTask();                            coverImageTask_3.execute(                                new LoadCoverImageTask.Payload(                                    coverImage_3,                                    UpdateService.this                                )                        );                    break;                default:                    break;            }        }        catch(Exception e) {            Log.d(Constants.TAG, ""buildCoverUpdate: "" + e.toString());        }    }</code></pre><p>}</p><p>And below code is for loading image. Sometimes this doInBackground never being called even though 'execute' is called. Sometimes it's stuck on 'Bitmap bitmap = BitmapFactory.decodeStream(in)' here and never escape. </p><pre><code>    protected LoadCoverImageTask.Payload doInBackground(LoadCoverImageTask.Payload... param) {    HttpURLConnection httpConn = null;    InputStream in;    File imageFile;    FileOutputStream fos;    int slotIdx = param[0].coverImage.getSlotIndex();    System.setProperty(""http.keepAlive"", ""false"");    try{        URL fileURL = new URL(param[0].coverImage.getFileURL());        httpConn = (HttpURLConnection) fileURL.openConnection();        Log.d(Constants.TAG , ""openConn: Slot "" + slotIdx);        httpConn.setConnectTimeout(10000);        if(httpConn.getResponseCode() == HttpURLConnection.HTTP_OK) {            Log.d(Constants.TAG , ""200OK: Slot "" + slotIdx + "": "" + fileURL.toString());            in = httpConn.getInputStream();            imageFile = new File(param[0].coverImage.getFullFilePath());            fos = new FileOutputStream(imageFile);            try {                Bitmap bitmap = BitmapFactory.decodeStream(in);                Log.d(Constants.TAG , ""200OK: Slot "" + slotIdx + "" decodeStream(in);"");                if(bitmap.compress(Bitmap.CompressFormat.JPEG, 80, fos) == true) {                    fos.flush();                    fos.close();                    in.close();                    Log.d(Constants.TAG , ""200OK-decodeOK: Slot "" + slotIdx);                    param[0].result = Constants.TRUE;                }                else {                    fos.flush();                    fos.close();                    in.close();                    Log.d(Constants.TAG , ""200OK-decodeFail: Slot "" + slotIdx);                    param[0].result = Constants.FALSE;                }            }            catch(NullPointerException e) {                Log.d(Constants.TAG , ""Slot "" + slotIdx + "":"" + e.toString());                param[0].result = Constants.RETRY;            }        }        else {            Log.d(Constants.TAG , ""Slot "" + slotIdx + "":"" + httpConn.getResponseCode());            param[0].result = Constants.FALSE;        }    } catch(SocketTimeoutException e) {        Log.d(Constants.TAG , ""Time Out: "" + slotIdx + "":"" + e.toString());    } catch(Exception e) {        Log.d(Constants.TAG , ""Slot "" + slotIdx + "":"" + e.toString());        param[0].result = Constants.FALSE;    }    finally {        if(httpConn != null) httpConn.disconnect();        Log.d(Constants.TAG , ""Slot "" + slotIdx + "":httpConn.disconnect"");    }    return param[0];}</code></pre><p>I am stuck on this for a couple of days.. please help...</p>","419893","","","","","2010-12-15 14:28:25","Inconsistent behavior on loading images using AsyncTask","<android><widget><android-asynctask><loadimage>","1","0","","",""
"4298017","1","4298692","","2010-11-28 17:29:48","0","302","<p>this is my java code and i really can not find where is my wrong</p><pre><code>  package com.example.RateMates;      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.RadioButton;      import android.widget.Toast;  public class RateMates extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final RadioButton radio_red = (RadioButton) findViewById(R.id.radio_red);    final RadioButton radio_blue = (RadioButton) findViewById(R.id.radio_blue);    radio_red.setOnClickListener(radio_listener);    radio_blue.setOnClickListener(radio_listener);} private OnClickListener radio_listener = new OnClickListener() {    public void onClick(View v) {        // Perform action on clicks        RadioButton rb = (RadioButton) v;        Toast.makeText(RateMates.this, rb.getText(), Toast.LENGTH_SHORT).show();    }};Button next = (Button) findViewById(R.id.button);next.setOnClickListener(new View.OnClickListener() {    public void onClick(View view) {        Intent myIntent = new Intent(view.getContext(), RateMates2.class);        startActivityForResult(myIntent, 0);    }});</code></pre><p>}}</p>","519526","","","","","2010-11-28 20:19:05","problem in .java","<android>","2","6","","2010-11-30 07:17:02",""
"4298056","1","6387856","","2010-11-28 17:37:14","3","1495","<p>I have an Android java library that uses some native code. I have added this java library to a client project.</p><p>May I have to add script that copy the native library to libs folder on my client project? Or this native library is included inside the java library's jar?</p><p>If you need more details or if you don't understand anything, tell me.</p><p>Thanks.</p>","68571","","68571","","2010-11-29 07:21:31","2012-10-09 07:21:59","Packing an android library on a JAR that uses JNI","<android><android-ndk><java-libraries>","2","0","1","",""
"4298060","1","","","2010-11-28 17:38:03","6","2681","<p>I have a custom gallery with 'fullscreen' items and I have overridden the onFling() method of Gallery. In this overridden function, I check if the user had 'flinged' to the left or right, and act accordingly with</p><pre><code>onKeyDown(KeyEvent.KEYCODE_DPAD_RIGHT, event); // ORonKeyDown(KeyEvent.KEYCODE_DPAD_LEFT, event);</code></pre><p>This works great, but there is some sort of 'bounce' animation when I scroll. The new image comes in and moves just too far, then moves back to the final position. Because the images I use are far too big, the bounce animation looks horrible and therefor I want to disable it.</p><p>Any suggestions?</p><p>Thanks a lot!</p><p>Erik</p>","419625","","","","","2011-02-23 08:54:46","Android: Disable 'bounce' effect in custom Gallery","<android><gallery>","1","1","5","",""
"4298155","1","4638908","","2010-11-28 18:02:47","10","9936","<p>I'm trying to compile Google's ApiDemos that come with the Android SDK.But I just CANT GET IT TO RUN! It makes me crazy already!!</p><p>When I create a new project in Eclipse based on the sample (target 1.5 or 1.6) and try to compile and run, I get almost a thousand errors. Not what I'd expect from a tutorial app!</p><pre><code>Description Resource Path Location TypeIRemoteService cannot be resolved RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 84 Java ProblemIRemoteService cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 92 Java ProblemIRemoteService cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 104 Java ProblemIRemoteService cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 104 Java ProblemIRemoteService cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 41 Java ProblemIRemoteService cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 84 Java ProblemIRemoteService cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 91 Java ProblemIRemoteService cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 107 Java ProblemIRemoteService cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 141 Java ProblemIRemoteService cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 155 Java ProblemIRemoteService cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 157 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 51 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 52 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 79 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 105 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 106 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 108 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 109 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 142 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 145 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 151 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 91 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 157 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 212 Java ProblemIRemoteServiceCallback cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 212 Java ProblemISecondary cannot be resolved RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 125 Java ProblemISecondary cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 95 Java ProblemISecondary cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 116 Java ProblemISecondary cannot be resolved to a type RemoteService.java /ApiDemos/src/com/example/android/apis/app line 116 Java ProblemISecondary cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 43 Java ProblemISecondary cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 125 Java ProblemISecondary cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 130 Java ProblemISecondary cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 143 Java ProblemISecondary cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 179 Java ProblemISecondary cannot be resolved to a type RemoteServiceBinding.java /ApiDemos/src/com/example/android/apis/app line 181 Java ProblemR cannot be resolved to a variable AdvancedPreferences.java /ApiDemos/src/com/example/android/apis/app line 58 Java ProblemR cannot be resolved to a variable AlarmController.java /ApiDemos/src/com/example/android/apis/app line 73 Java ProblemR cannot be resolved to a variable AlarmController.java /ApiDemos/src/com/example/android/apis/app line 76 Java ProblemR cannot be resolved to a variable AlarmController.java /ApiDemos/src/com/example/android/apis/app line 78 Java ProblemR cannot be resolved to a variable AlarmController.java /ApiDemos/src/com/example/android/apis/app line 80 Java ProblemR cannot be resolved to a variable AlarmController.java /ApiDemos/src/com/example/android/apis/app line 108 Java ProblemR cannot be resolved to a variable AlarmController.java /ApiDemos/src/com/example/android/apis/app line 140 Java ProblemR cannot be resolved to a variable AlarmController.java /ApiDemos/src/com/example/android/apis/app line 162 Java ProblemR cannot be resolved to a variable AlarmService.java /ApiDemos/src/com/example/android/apis/app line 52 Java ProblemR cannot be resolved to a variable AlarmService.java /ApiDemos/src/com/example/android/apis/app line 55 Java ProblemR cannot be resolved to a variable AlarmService.java /ApiDemos/src/com/example/android/apis/app line 57 Java ProblemR cannot be resolved to a variable AlarmService.java /ApiDemos/src/com/example/android/apis/app line 72 Java ProblemR cannot be resolved to a variable AlarmService.java /ApiDemos/src/com/example/android/apis/app line 84 Java ProblemR cannot be resolved to a variable AlarmService_Service.java /ApiDemos/src/com/example/android/apis/app line 62 Java ProblemR cannot be resolved to a variable AlarmService_Service.java /ApiDemos/src/com/example/android/apis/app line 65 Java ProblemR cannot be resolved to a variable AlarmService_Service.java /ApiDemos/src/com/example/android/apis/app line 100 Java ProblemR cannot be resolved to a variable AlarmService_Service.java /ApiDemos/src/com/example/android/apis/app line 103 Java ProblemR cannot be resolved to a variable AlarmService_Service.java /ApiDemos/src/com/example/android/apis/app line 111 Java ProblemR cannot be resolved to a variable AlarmService_Service.java /ApiDemos/src/com/example/android/apis/app line 116 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 75 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 76 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 77 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 83 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 92 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 93 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 94 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 95 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 101 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 107 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 116 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 117 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 121 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 130 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 131 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 134 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 140 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 149 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 150 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 151 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 157 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 163 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 172 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 173 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 174 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 183 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 189 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 199 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 201 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 202 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 204 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 210 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 230 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 233 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 241 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 250 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 258 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 269 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 277 Java ProblemR cannot be resolved to a variable AlertDialogSamples.java /ApiDemos/src/com/example/android/apis/app line 285 Java ProblemR cannot be resolved to a variable AlphaBitmap.java /ApiDemos/src/com/example/android/apis/graphics line 67 Java ProblemR cannot be resolved to a variable AnimateDrawables.java /ApiDemos/src/com/example/android/apis/graphics line 46 Java ProblemR cannot be resolved to a variable Animation1.java /ApiDemos/src/com/example/android/apis/view line 34 Java ProblemR cannot be resolved to a variable Animation1.java /ApiDemos/src/com/example/android/apis/view line 36 Java ProblemR cannot be resolved to a variable Animation1.java /ApiDemos/src/com/example/android/apis/view line 41 Java ProblemR cannot be resolved to a variable Animation1.java /ApiDemos/src/com/example/android/apis/view line 42 Java Problem...and 841 more.</code></pre><p>What am I doing wrong??</p>","523100","","244296","","2010-11-28 18:07:31","2013-06-05 19:32:36","Compiling and running ApiDemos","<android><eclipse>","9","1","","",""
"4298172","1","4298588","","2010-11-28 18:06:18","3","3875","<p>I am writing an Android App in which I am using Spinner Control. I customized my spinner control by creating my own list. I want to change the drop down arrow present beside the spinner control . Can anyone help me how to change the drop down arrow of spinner control . I want to replace that arrow by own arrow Image.</p>","429501","","244296","","2010-11-28 18:09:28","2010-11-28 19:28:42","How to Change drop down arrow Arrow for Spinner Control in Android?","<android>","1","0","","",""
"4298225","1","4298374","","2010-11-28 18:19:39","34","43274","<p>I have a map view activity that shows a few <code>OverlayItems</code>. In the <code>onTap</code> method of an overlay, I want to trigger a new activity that shows this overlay photo as a fullscreen, for example.</p><p>When I do this inside my overlay class:</p><pre><code>Intent intent = new Intent();intent.setClass(getApplicationContext, FullscreenView.class);startActivity(intent);</code></pre><p>.. it can't find an application context, as I am not in the scope of an activity.</p><p>When I add a method to my main activity, let's say <code>startFullscreen</code>:</p><pre><code>public static void startFullscreen() {    if (sCurrentPhoto != null) {        Intent intent = new Intent();        intent.setClass(getApplicationContext(), FullscreenView.class);        startActivity(intent);              }}</code></pre><p>I can not call <code>getApplicationContext()</code> and <code>startActivity()</code>, because I am in a static context. I need the static method however to call it in the Overlay class like <code>MainView.startFullscreen()</code>.</p><p>Put simply: <strong>How can I start an Activity from a non-Activity class?</strong></p>","435093","","435093","","2011-09-30 10:59:49","2013-06-14 05:05:31","How can I start an Activity from a non-Activity class?","<android><activity><android-intent>","4","0","12","",""
"4298254","1","4298871","","2010-11-28 18:25:05","0","2640","<p>Is there any sample application which demonstrates the capabilities of Telephony API of android? I am interested in getting the call notifications / caller number etc(I understand its doable with PhoneStateListener). Also, Is it possible for 3rd party application to change the incoming call window / outgoing call window (basically to give the user an extra button to search the incoming number from a REST service) ? </p><p>Any useful links  or sample application would be very much helpful. Any suggestions ? </p>","321098","","","","","2010-11-28 20:22:49","Sample android app demonstrating telephony api?","<android>","1","0","","",""
"4298334","1","","","2010-11-28 18:39:57","0","3412","<p>I'm realizing that one problem I had with an app in the emulator is because the emulator wasn't working with my proxy.  I have to set a proxy host, port, user, and password.  I don't see any options for setting this from the ADT.  I noticed that if you run the emulator from the command line, there is a ""-http-proxy"" option, but that's not available from the AVD Manager that is started from Eclipse.  I also noticed that when I run the ""SDK Manager"" outside of Eclipse, there is an additional settings section labeled ""Settings"" which has proxy settings, but that's only the host and port, not user and password.</p><p>Did no one realize that some people would be running this from behind an authenticated proxy?</p>","10508","","","","","2010-11-29 16:28:04","How to start emulator from ADT plugin with proxy host/port/user/password?","<android><android-emulator>","4","0","","",""
"4298358","1","4298428","","2010-11-28 18:43:28","0","475","<p>I am building an android app and I have an SQL database stored on a server. I need to either pull the database into android or query the database and have it return information from the tables. I have searched all over the internet but I haven't found anything that explains how to connect to the server from android. How can I do this?</p>","515377","","","","","2010-12-20 02:12:22","querying database in android","<sql><mysql><android><android-emulator>","3","0","0","",""
"4298458","1","4514620","","2010-11-28 19:04:25","3","2333","<p>I have a Live Wallpaper that uses various screen touches to trigger certain events.  At the moment it is working but I seem to get all touch events.  For example, when the user touches an icon to launch an app, I seem to get that event too. </p><p>Is it possible to determine whether the user has touched the background screen (i.e. the inter-icon gaps.) so that I can only take my actions at that time and ignore the others.</p><p>Failing that, (and assuming – possibly erroneously – that if I am first in the queue than there is no other application on top of me on the screen) can I determine where I am in the touch event queue so that I can only take actions when I am the first one in the queue?<br>Or any other suggestions please.Thanks Richard</p>","523126","","19750","","2011-03-31 15:41:57","2012-11-15 03:57:58","Android Live Wallpaper Touch Event Hierarchy","<android><touch><live-wallpaper>","1","0","1","",""
"4298542","1","","","2010-11-28 19:20:47","15","9179","<p>My Android app works by using a SQLite database that is generated on the user's PC and transferred to the device. It all works, but I had not anticipated the number of users who would have really huge amounts of data. In these cases, the UI is very sluggish as it waits for the data to be fetched.</p><p>I've tried a number of tricks that I was ""sure"" would speed things up, but nothing seems to have any noticeable effect. My queries are almost all very simple, being usually a single ""col=val"" for the WHERE clause, and INTEGER data in the column.  So I can't do much with the queries.</p><p>The latest, and I am not an SQL expert by any means, was to use ""CREATE INDEX"" commands on the PC, believing that these indexes are used to speed up database searches. The indexes increased the size of the database file significantly, so I was then surprised that it seemed to have no effect whatsoever on the speed of my app! A screen that was taking 8 seconds to fill without indexes still takes about 8 seconds even with them. I was hoping to get things down to at least half that.</p><p>What I am wondering at this point is if the SQLite implementation on Android uses database indexes at all, or if I'm just wasting space by generating them. Can anyone answer this?</p><p>Also, any other things to try to speed up access?</p><p>(For what it's worth, on an absolute basis the users have nothing to complain about. My worst-case user so far has data that generates 630,000 records (15 tables), so there's only so much that's possible!)</p><p>Doug Gordon  GHCS Systems</p>","446874","","33252","","2010-11-28 21:26:09","2013-10-23 13:51:21","Android SQLite Performance with Indexes","<android><sqlite>","3","1","7","",""
"4298824","1","4299348","","2010-11-28 20:16:03","1","1232","<p>OK I have an app the uses the magneometer to display a graphic that rotates with the phone (basically a compass).</p><p>I have a check that subtracts 90 degrees if it is in landscape mode, but this only works if it is in the default landscape mode. With 2.1 we now have a universal landscape that you can rotate both ways so I now don't know how to figure out which landscape mode it is in.</p><p>Here is my code:</p><pre><code> int test = getResources().getConfiguration().orientation; if(Configuration.ORIENTATION_LANDSCAPE == test) {            rotation = -90f;        }        else {            rotation = 0f;        }canvas.rotate((float) (-Math.toDegrees(mOrientation[0]) + rotation ));</code></pre><p>Any suggestions on how to tell which landscape mode the phone is in?</p>","428979","","991737","","2012-01-12 18:57:21","2012-01-12 18:57:21","android universal landscape check","<android><screen-orientation>","2","0","","",""
"4298888","1","4299970","","2010-11-28 20:25:32","1","3172","<p>I'm working on a music player-widget (home screen widget)..It only needs to play 1 song, (Preferably with the MediaPlayer class). But I'm not sure how to implement it. I'm kind of inexperienced with Android development, just so that's mentioned.</p><p>The class I have so far extends <code>AppWidgetProvider</code>, and I guess it is not a good idea to let this class handle the music-playing part, but rather a <code>Service</code>. And if so, how?</p><p>Furthermore, I have 3 buttons: play, pause and stop, and I can distinguish which one has been pressed in <code>onReceive(...)</code>.</p><p>Thanks in advance!</p><hr><p>Here is the class.</p><pre><code>public class MusicManager extends AppWidgetProvider {    private final String ACTION_WIDGET_PLAY = ""PlaySong"";    private final String ACTION_WIDGET_PAUSE = ""PauseSong"";    private final String ACTION_WIDGET_STOP = ""StopSong"";       private final int INTENT_FLAGS = 0;    private final int REQUEST_CODE = 0;    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager,            int[] appWidgetIds) {        RemoteViews controlButtons = new RemoteViews(context.getPackageName(),                R.layout.main);        Intent playIntent = new Intent(context, MusicService.class);        Intent pauseIntent = new Intent(context, MusicService.class);        Intent stopIntent = new Intent(context, MusicService.class);        PendingIntent playPendingIntent = PendingIntent.getService(                context, REQUEST_CODE, playIntent, INTENT_FLAGS);        PendingIntent pausePendingIntent = PendingIntent.getService(                context, REQUEST_CODE, pauseIntent, INTENT_FLAGS);        PendingIntent stopPendingIntent = PendingIntent.getService(                context, REQUEST_CODE, stopIntent, INTENT_FLAGS);        controlButtons.setOnClickPendingIntent(                R.id.btnPlay, playPendingIntent);        controlButtons.setOnClickPendingIntent(                R.id.btnPause, pausePendingIntent);        controlButtons.setOnClickPendingIntent(                R.id.btnStop, stopPendingIntent);        appWidgetManager.updateAppWidget(appWidgetIds, controlButtons);             }}</code></pre>","490315","","1465910","","2012-09-29 08:29:03","2013-05-24 21:07:42","Android music player widget","<android><widget><android-music-player>","2","0","2","",""
"4298893","1","4298941","","2010-11-28 20:26:55","3","915","<p>How can i create a function that will be run only once, on first installation? I am trying to create an information that displays one time.</p><p>thanks in advance.</p>","513407","","21234","","2010-11-28 20:33:41","2010-11-28 20:36:57","Android: How do I create a function that will be executed only once?","<android>","1","2","0","",""
"4298928","1","4299075","","2010-11-28 20:35:12","1","654","<p>Is there a way to clear activity stack from widget?</p><p>I have following situation:From widget user presses button what starts new activity A. Next user move from A to new activity B. After that he presses home button which takes him back to home screen. Now if he presses button again, he will be moved directly to the activity B.</p><p>I thought ACTIVITY_FLAG_CLEAR_TOP would help, but it didn't.</p>","419308","","213269","","2010-12-21 16:38:45","2010-12-21 16:38:45","Android: How to clear activity stack from widget","<android><activity><widget>","1","0","","",""
"4299024","1","","","2010-11-28 20:54:43","1","590","<p>I'm trying to figure out the best way to store map objects on a 2d side scrolling game.</p><p>For example, in the game Doodle Jump, how do the platforms you jump on get stored?</p><p>I've had a few thoughts about how it is possibly done..</p><p>Are the platforms stored in a string or other object that defines where each platform is going to be placed? For example if I defined a string like 0,10,5,8,6,2,3,4,2,..... and so on, I could interpret those as x-coordinates of each game piece in the game. I guess the problem with this is that could potentially be A LOT of game pieces to define. The game appears to be endless, so pre-defining the map seems like a bad idea.</p><p>I also thought that maybe the pieces are just random. So whenever the map calls for a new map piece, it randomly gets an x-coordinate. I thought this seemed pretty feasible but when playing DoodleJump it doesn't appear that they are all random.</p><p>Does anyone have any idea on how these map objects could be stored to lead me in the right direction?</p><p>Thanks!</p>","67510","","","","","2010-12-03 20:04:35","How to store screen objects for a 2d side scrolling game?","<android><game-engine>","3","0","1","",""
"4299104","1","","","2010-11-28 21:11:16","0","900","<p>I can get a working connection from a Bluetooth device if my application is waiting on an 'accept' call prior to the ACTION_ACL_CONNECTED broadcast being received.  If I issue the 'accept' call in response to the broadcast being received I can't make the socket connection.   </p><p>Is there a way to make this happen so I can setup the socket connection in response to the Bluetooth event?</p>","512676","","881229","","2014-04-01 19:53:27","2014-04-01 19:53:27","Create socket connection with Bluetooth device after ACTION_ACL_CONNECTED","<android><sockets><bluetooth><broadcastreceiver>","1","1","1","",""
"4299216","1","4299455","","2010-11-28 21:34:00","1","1821","<p>im fairly new to developing in android and im not shure how to solve this problem. I released my app and started to get reports from some ppl with android 2.1 that it crashes. Worked fine in my HTC Desire 2.2 and seems to work in simulated 1.6</p><p>and it does crashes in simulated 2.1 if i do not quickly send some gps with eclipse DDMS.</p><p>And it do not crash if i change some code not to ask for gps position... </p><p>I search google alot on it and it seems the error is that ""getLastKnownLocatio"" sometimes retrns null and that makes it crash, but i cant find a workaround for that to fit in my code.... im not the best programmer in the world :)</p><p>Please help me...</p><p>Here is my java:</p><pre><code>public class WebPageLoader extends Activity implements LocationListener{public static String Android_ID = null;final Activity activity = this;private Location mostRecentLocation;private void getLocation() {    LocationManager locationManager =      (LocationManager)getSystemService(Context.LOCATION_SERVICE);    Criteria criteria = new Criteria();    criteria.setAccuracy(Criteria.ACCURACY_FINE);    String provider = locationManager.getBestProvider(criteria,true);    //In order to make sure the device is getting the location, request updates.    //locationManager.requestLocationUpdates(provider, 10, 1, this);    //mostRecentLocation = locationManager.getLastKnownLocation(provider);    locationManager.requestLocationUpdates(provider, 1000, 500, this);          mostRecentLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);  }@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    this.getWindow().requestFeature(Window.FEATURE_PROGRESS);    setContentView(R.layout.main);    //getLocation();    Android_ID = Secure.getString(getContentResolver(), Secure.ANDROID_ID);    WebView webView = (WebView) findViewById(R.id.webView);    webView.getSettings().setJavaScriptEnabled(true);    /** Allows JavaScript calls to access application resources **/    webView.addJavascriptInterface(new JavaScriptInterface(), ""android16"");    webView.setWebChromeClient(new WebChromeClient() {        public void onProgressChanged(WebView view, int progress)        {            activity.setTitle(""Letar poliskontroller"");            activity.setProgress(progress * 100);            if(progress == 100)                activity.setTitle(R.string.app_name);        }    });    getLocation();    webView.setWebViewClient(new WebViewClient() {        @Override        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)        {            // Handle the error        }        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url)        {            view.loadUrl(url);            return true;        }    });    webView.loadUrl(""http://m.domain.se/android/file.php"");}    /** Sets up the interface for getting access to Latitude and Longitude data from device     **/private class JavaScriptInterface {    public double getLatitude(){      return mostRecentLocation.getLatitude();    }    public double getLongitude(){      return mostRecentLocation.getLongitude();    }    public String getAndroid_ID(){        return Android_ID;    }  }@Overridepublic void onLocationChanged(Location location) {    // TODO Auto-generated method stub    getLocation();    //android16();}@Overridepublic void onProviderDisabled(String provider) {    // TODO Auto-generated method stub}@Overridepublic void onProviderEnabled(String provider) {    // TODO Auto-generated method stub}@Overridepublic void onStatusChanged(String provider, int status, Bundle extras) {    // TODO Auto-generated method stub}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    MenuItem item = menu.add(""Meny"");    item = menu.add(""Stäng app"");    item.setIcon(R.drawable.exit);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    if (item.getTitle() == ""Stäng app"") {        finish();    }    return true;}</code></pre><p>}</p><p><strong>UPDATE</strong> </p><p>With your sugestion for the javacall wich prevents the crashing, I also added this in the java of the reciving google map </p><pre><code>      latitude = window.android16.getLatitude();  longitude = window.android16.getLongitude();  if ( isNaN(latitude) ) {      latitude = 61.72680992165949;  } else {      latitude = latitude;  }      if ( isNaN(longitude) ) {      longitude = 17.10124969482422;  } else {      longitude = longitude;  }</code></pre><p>Now it seems to work... Cheers and thanks alot, ill try this some and get back to report when i bugtested it some. </p>","523221","","523221","","2010-12-06 23:51:51","2010-12-06 23:51:51","getLastKnownLocation crashes android 2.1","<android>","2","0","","",""
"4299234","1","4299428","","2010-11-28 21:38:12","1","363","<p>This is my .java file in src:</p><pre><code>package com.wao.texttime;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class TextTime extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView tv1 = (TextView) findViewById(R.id.TextView01);        tv1.setText(""Good Morning"");         TextView tv2 = (TextView) findViewById(R.id.TextView02);        tv1.setText(""Good Afternoon"");    }}</code></pre><p>I want the TextView to display the different texts depending on what time it is. F.ex. between 08:45-10:45 and so forth. I am very new to coding both for android and in java and I'm trying to figure out how I can make the rules for which text to display. Do you have any suggestions?</p>","523053","","","","","2010-11-28 22:14:28","Using setText with rules regarding the current time","<android><textview><settext>","3","0","","",""
"4299270","1","","","2010-11-28 21:44:44","0","638","<p>This layout for some reason doesn't work as expected.  The two text boxes are overlapping, despite the fact that I'm using the layout_below tag.  What am I doing wrong?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@android:color/white""&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/actionbar""        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;TextView android:id=""@+id/homeButton""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:text=""Dashboard"" /&gt;    &lt;/LinearLayout&gt;    &lt;RelativeLayout android:id=""@+id/dashboard""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_below=""@id/actionbar""&gt;        &lt;TextView android:id=""@+id/libraryButton""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:text=""Dashboard Area"" /&gt;    &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre>","522605","","244296","","2010-11-28 23:25:12","2010-11-28 23:25:12","Nesting layouts","<android><design>","1","0","","",""
"4299306","1","","","2010-11-28 21:51:55","3","1355","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1400782/android-scale-a-drawable-or-background-image"">Android: Scale a Drawable or background image?</a>  </p></blockquote><p>Is it possible to set a scaleType to the background like in a imageview?</p>","440212","","","","","2010-11-29 01:32:11","android:background and android scaleType","<android><background>","0","1","","2011-10-27 14:45:11",""
"4299636","1","4299843","","2010-11-28 23:01:05","1","650","<p>I have two layout files, one for landscape (layout-land) and one for portrait (layout-port).  When I run my application the correct layout is grabbed initially dependent upon how I am holding my phone. If I am holding landscape, landscape is grabbed and visa versa.  BUT, once I initially launch my application, if I change orientation the first layout grabbed at launch is used when switching orientation.</p><p>How do I get Android to changed layout xml per orientation change after initial launch of applicaiton? </p><p>In my manifest I have android:configChanges=""orientation/keyboardHidden"" </p>","2186261","","","","","2010-11-28 23:50:13","Orientation Change not Grabbing Correct layout","<android>","1","0","","",""
"4299648","1","","","2010-11-28 23:04:03","1","48","<p>I have a question. I want to test a theory with an app and i am trying to figure out how to setup a certain parameter. I want to have an object rotate on the screen but as it hit certain points on the screen, information is automatically filled inside message boxes at the bottom of the app screen. How can i set this up?</p>","474026","","11530","","2010-11-28 23:29:19","2010-11-28 23:29:19","Information based on app position","<android><collision-detection>","0","1","","",""
"4299871","1","4299930","","2010-11-28 23:58:27","0","1130","<p>I want to build an application where an android phone would control a desktop application.I only need to send coordinates from the phone to the desktop when user's finger is on the phone screen.But I am kinda confused on the networking side if i should use bluetooth, usb, or wifi (intranet). </p><p>I did some research on bluetooth, doing bluetooth socket programming on an android phone shouldn't be a problem, but on the desktop side there are only a few free SDK/library. any suggestion on what to use?</p><p>If I were to use USB/cable, What API on the android side I need to use? </p><p>I am actually more familiar with general socket programming (wifi), but I think it's going to be slow (correct me if Im wrong) so this would be my last option.</p><p>PS: I am using Java for the desktop application too</p><p>any suggestions on what method to use? or even maybe I should use .net on the desktop side?</p><p>Thanks</p>","500833","","","","","2010-11-29 01:08:00","Control a desktop application using an android phone","<java><.net><android><network-programming><bluetooth>","2","1","","",""
"4299882","1","4300103","","2010-11-29 00:00:33","0","1222","<p>This is my .java file in src:</p><pre><code>package com.wao.texttime;import java.util.Calendar;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class TextTime extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView textView = (TextView) findViewById(R.id.TextView01);        Calendar cal = Calendar.getInstance();        cal.setTimeInMillis(System.currentTimeMillis());        cal.set(Calendar.HOUR_OF_DAY, 6);        cal.set(Calendar.MINUTE, 15);        cal.set(Calendar.SECOND, 0);        long vask_1 = cal.getTimeInMillis();        cal.set(Calendar.HOUR_OF_DAY, 10);        cal.set(Calendar.MINUTE, 0);        cal.set(Calendar.SECOND, 0);        long vask_2 = cal.getTimeInMillis();        cal.set(Calendar.HOUR_OF_DAY, 14);        cal.set(Calendar.MINUTE, 0);        cal.set(Calendar.SECOND, 0);        long vask_3 = cal.getTimeInMillis();        cal.set(Calendar.HOUR_OF_DAY, 16);        cal.set(Calendar.MINUTE, 0);        cal.set(Calendar.SECOND, 0);        long vask_4 = cal.getTimeInMillis();        cal.set(Calendar.HOUR_OF_DAY, 19);        cal.set(Calendar.MINUTE, 0);        cal.set(Calendar.SECOND, 0);        long vask_5 = cal.getTimeInMillis();        long now = System.currentTimeMillis();        if(now &gt; vask_1 &amp;&amp; now &lt; vask_2)        {            textView.setText(""5"");        }        else if(now &gt; vask_2 &amp;&amp; now &lt; vask_3)        {            textView.setText(""1"");        }        else if(now &gt; vask_3 &amp;&amp; now &lt; vask_4)        {            textView.setText(""2"");        }        else if(now &gt; vask_4 &amp;&amp; now &lt; vask_5)        {            textView.setText(""3"");    }    }    }</code></pre><p>I've been told I can use the OnResume to reload the current time to update the text in the TextView. But, I don't know how to use it in the file. Do you have any suggestions?</p>","523053","","523053","","2010-11-29 00:18:40","2010-11-29 00:59:39","Using the OnResume() to reload the current time","<android><onresume>","1","0","","",""
"4299899","1","4300288","","2010-11-29 00:04:40","4","7375","<p>There is something I don't quite understand right now.</p><p>My main activity class creates a Service, which creates a new thread that waits for a TCP connection. Once one comes in, it will start a new activity:</p><pre><code>Intent dialogIntent = new Intent(getBaseContext(), VoIPCall.class);dialogIntent.putExtra(""inetAddress"", clientSocket.getInetAddress());dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);getApplication().startActivity(dialogIntent);</code></pre><p>After that, the onCreate() method of that class gets run. It will create 2 threads: one records and send data, the other one receive and plays data. Those threads have a forever while loop.</p><p>For some reason, I notice that the onCreate() of that last class gets called again, which makes my program crash. I do not understand why it is called again as only the 2 threads are running, there is no user interaction. The documentation says: ""Called when the activity is first created."". The activity is already running and I am not trying to create it.</p><p>Could someone please explain me this behavior? I do not get it.</p><p>Thank you very much,</p><p>James</p>","522835","","","","","2013-06-06 15:47:20","Android: onCreate() getting called multiple times (and not by me)","<android><multithreading><oncreate>","2","0","2","",""
"4299924","1","4300312","","2010-11-29 00:11:41","4","4802","<p>My app is about creating surveys. In order to do so, the user should be able to create new fields dynamically.</p><p>So, when creating a new survey, an Activity is shown with only 2 buttons (add and delete). When a user clicks the add button, a row appears containing a EditText(so he can write the question), a Spinner(that enables user to select the type of field: text, RadioButton, CheckBox, etc..) and another EditText (in which the different available answer choices are written, if applicable).</p><p>To accomplish this I created a XML file containing these Widgets and each time the user clicks in the add button, the XML is inflated. It works the first time I press the button, but after that... nothing happens.</p><p>I read somewhere that you cannot inflate the same child 2 times in a parent unless it is done in a loop.</p><p>So, my questions are:</p><p>-> How can I get around this and obtain the desired effect?</p><p>-> Why doesn't this apply in a Loop?</p><p>Any help or hint is appreciated. Once again, thank you very much for all the support the community has given me.</p><p>NOTE: In the android documentation they speak about cloning an inflator but the information there is scarce and I couldn't find any other info about it.</p><p>SOurce code:</p><p>XML - Main cointainer:</p><pre><code>&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;LinearLayout        android:id=""@+id/wrapper""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""    /&gt;    &lt;Button        android:id=""@+id/mds_new_addfield_button""        android:tag=""new""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Add Field""        android:layout_alignParentBottom=""true""        android:layout_alignParentLeft=""true""    /&gt;    &lt;Button        android:id=""@+id/mds_new_deletefield_button""        android:tag=""delete""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Delete Field""        android:layout_alignParentBottom=""true""        android:layout_alignParentRight=""true""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>XML -Inflated:</p><pre><code>&lt;TableLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TableRow&gt;        &lt;TextView            android:id=""@+id/mdsnew_field_tv""            style=""@style/dsn_field""            android:text=""Field Name    ""         /&gt;        &lt;TextView            android:id=""@+id/mdsnew_type_tv""            style=""@style/dsn_field""            android:text=""Type of Field   ""         /&gt;        &lt;TextView            android:id=""@+id/mdsnew_choices_tv""            style=""@style/dsn_field""            android:text=""Choices""          /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;EditText            android:id=""@+id/mdsnew_fieldname_et""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Field Name""            android:textSize=""18sp""        /&gt;        &lt;Spinner            android:id=""@+id/mdsnew_type_sp""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""        /&gt;        &lt;EditText            android:id=""@+id/mdsnew_choices_et""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Choices    ""            android:textSize=""18sp""        /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>Add Button:</p><pre><code>LinearLayout myRoot = (LinearLayout) findViewById(R.id.wrapper);LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);inflater.inflate(R.layout.mds_new_row, myRoot);</code></pre>","295342","","295342","","2010-11-29 00:55:02","2010-11-29 01:56:01","Inflating a view multiple times in the same parent when a button is clicked","<android><listview><inflate>","1","2","3","",""
"4300012","1","4300043","","2010-11-29 00:34:24","1","2600","<p>I may need to display a dialog box, depending upon a certain condition. This condition will have to be resolved before the application can continue. Basically, I need to ""pause"" the execution of my program until this dialog box has been destroyed. I have tried a bunch of different methods but I am running into a problem where the application continues to execute. Currently, the showDialog is in the onCreate() method of my main activity.</p><p>Any suggestions would be greatly appreciated. </p>","485438","","","","","2010-11-29 01:01:17","displaying a dialog in onCreate()","<android><dialog>","1","0","0","",""
"4300014","1","4300305","","2010-11-29 00:35:03","8","917","<p>Does anyone know of any tools (besides DroidDraw) that can help me create the basics of my projects a bit quicker? I'm looking for something that will allow me to very quickly generate the XML for my layouts so I don't have to sit there typing like a robot for so long. </p><p>Thanks!</p>","479180","","","","","2010-11-29 01:53:19","Tools for rapid layout/interface creations?","<java><android>","3","3","2","",""
"4300101","1","","","2010-11-29 00:59:17","1","642","<p>If you develop for Android in Eclipse, you can choose from a list of display types (i.e. 5.4in FWVGA, 3.7in FWVGA, and so on...). I wonder if someone already made a list that matches each Android phone to its display type so I don't have to. Something like </p><ul><li>Nexus One -> 3.7in QVGA slider </li><li>Samsung Galaxy S ->  ...</li></ul><p>I alrady tried some Google queries but couldn't find anything. Someone got a link? Thanks</p>","2555491","","","","","2010-11-29 01:28:25","List that matches Android Phones to its Display Types","<android><android-emulator><smartphone>","1","1","","",""
"4300170","1","11761457","","2010-11-29 01:14:39","6","9467","<p>I have a problem with the ListView in Android.When I set <code>android:layout_height=""wrap_content""</code>, ListView stays just one or two rows long and I can't find a way to make him ""wrapped"".</p><pre><code>&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;ScrollView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;LinearLayout            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:orientation=""vertical""            android:gravity=""center""&gt;            &lt;TextView                android:id=""@+id/question""                 android:layout_width=""fill_parent""                  android:layout_height=""wrap_content"" /&gt;            &lt;ListView android:id=""@+id/ListView01""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" /&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;&lt;/FrameLayout&gt;</code></pre><p>Is there any way to accomplish this? Thanks in advance!</p>","523100","","515205","","2013-06-19 22:27:30","2013-06-19 22:27:30","ListView ignoring wrap_content","<android><android-layout>","3","2","2","",""
"4300198","1","4409912","","2010-11-29 01:22:52","1","981","<p>I am using a method to add an event to an internal calendar on the phone.  Context has always confused me and this time is no different.  The method contract wants the application context.  The method call is:</p><pre><code>addToCalendar(Context context, String title, long dtstart, long dtend);</code></pre><p>This is my code to call the method when a button is pressed:</p><pre><code>public class DateAdder extends Activity {String shiftType;Date d = new Date();/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);     Button AShift = (Button) findViewById(R.id.AShift);    AShift.setOnClickListener(new View.OnClickListener(){        public void onClick(View v) {            TextView BtmTxt = (TextView) findViewById(R.id.BtmTxt);            shiftType=""A Shift"";            addToCalendar(DateAdder.this.getApplicationContext(), shiftType, d.getDate(), d.getDate()+1000);                            BtmTxt.setText(""Done"");        }});} //END of onCreate/** * Adds the event to a calendar. It lets the user choose the calendar * @param ctx Context ( Please use the application context ) * @param title title of the event * @param dtstart Start time: The value is the number of milliseconds since Jan. 1, 1970, midnight GMT. * @param dtend End time: The value is the number of milliseconds since Jan. 1, 1970, midnight GMT. */private static void addToCalendar(Context ctx, final String title, final long dtstart, final long dtend) {    final ContentResolver cr = ctx.getContentResolver();    Cursor cursor ;    if (Integer.parseInt(Build.VERSION.SDK) == 8 )        cursor = cr.query(Uri.parse(""content://com.android.calendar/calendars""), new String[]{ ""_id"", ""displayname"" }, null, null, null);    else        cursor = cr.query(Uri.parse(""content://calendar/calendars""), new String[]{ ""_id"", ""displayname"" }, null, null, null);    if ( cursor.moveToFirst() ) {        final String[] calNames = new String[cursor.getCount()];        final int[] calIds = new int[cursor.getCount()];        for (int i = 0; i &lt; calNames.length; i++) {            calIds[i] = cursor.getInt(0);            calNames[i] = cursor.getString(1);            cursor.moveToNext();        }        AlertDialog.Builder builder = new AlertDialog.Builder(ctx);        builder.setSingleChoiceItems(calNames, -1, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int which) {                ContentValues cv = new ContentValues();                cv.put(""calendar_id"", calIds[which]);                cv.put(""title"", title);                cv.put(""dtstart"", dtstart );                cv.put(""dtend"", dtend);                cv.put(""allday"", 1);                cv.put(""hasAlarm"", 0);                Uri newEvent ;                if (Integer.parseInt(Build.VERSION.SDK) == 8 )                    newEvent = cr.insert(Uri.parse(""content://com.android.calendar/events""), cv);                else                    newEvent = cr.insert(Uri.parse(""content://com.android.calendar/events""), cv);                if (newEvent != null) {                    long id = Long.parseLong( newEvent.getLastPathSegment() );                    ContentValues values = new ContentValues();                    values.put( ""event_id"", id );                    values.put( ""method"", 1 );                    values.put( ""minutes"", 15 ); // 15 minuti                    if (Integer.parseInt(Build.VERSION.SDK) == 8 )                        cr.insert( Uri.parse( ""content://com.android.calendar/reminders"" ), values );                    else                        cr.insert( Uri.parse( ""content://calendar/reminders"" ), values );                }                dialog.cancel();            }        });        builder.create().show();    }    cursor.close();}</code></pre><p>}</p><p>When I call this from my code I get a force close.  The logcat reads:</p><pre><code>android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application</code></pre><p>Any help with this would be greatly appreciated.</p>","440968","","440968","","2010-12-10 14:12:48","2010-12-10 22:09:28","Context and Calendar","<android><calendar><context>","4","2","","",""
"4300276","1","4300295","","2010-11-29 01:44:29","3","713","<p>I've spent a while scouring the net for some sort of information on this, but to no avail.</p><p>I'm working on an app for which I needed to create some components, some of which would be likely to have other applications, so I'd like to put them in their own package or project, but am not sure what the correct way to do this is.</p><p>So my main project is called something like...</p><p>&lt;companyname&gt;.&lt;productname&gt;</p><p>And I've called the package for my widgets...</p><p>&lt;companyname&gt;.widget</p><p>I created a separate project for the widgets and moved the relevant code, layout, resources etc over. That project seems to compile properly, but the main project no longer recognises any references to the widgets.</p><p>I added the new widget project to the main project's Project References, but that made no difference.</p><p>Any ideas or links to tutorial on how to do this correctly would be much appreciated.</p>","519654","","519654","","2010-11-29 02:04:25","2010-11-29 02:04:25","Android: How do I create reusable components?","<android><widget><package>","1","0","","",""
"4300291","1","","","2010-11-29 01:50:21","282","127919","<p>I couldn't find any examples of how to send messages between an activity and a service, and spent far too many hours figuring this out. Here is an example project for others to reference.</p><p>This example allows you to start or stop a service directly, and separately bind/unbind from the service. When the service is running, it increments a number at 10Hz. If the activity is bound to the service, it will display the current value. Data is transferred as an Integer and as a String so you can see how to do that two different ways. There are also buttons in the activity to send messages to the service (changes the increment-by value).</p><p>Screenshot:</p><p><img src=""http://i.stack.imgur.com/CMPS7.png"" alt=""screenshot of android service messaging example""></p><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.exampleservice""      android:versionCode=""1""      android:versionName=""1.0""&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;service android:name="".MyService""&gt;&lt;/service&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>res\values\strings.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""app_name""&gt;ExampleService&lt;/string&gt;    &lt;string name=""service_started""&gt;Example Service started&lt;/string&gt;     &lt;string name=""service_label""&gt;Example Service Label&lt;/string&gt; &lt;/resources&gt;</code></pre><p>res\layout\main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout01"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;Button android:id=""@+id/btnStart"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Start Service""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/btnStop"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Stop Service"" android:layout_alignParentRight=""true""&gt;&lt;/Button&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout02"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;Button android:id=""@+id/btnBind"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Bind to Service""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/btnUnbind"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Unbind from Service"" android:layout_alignParentRight=""true""&gt;&lt;/Button&gt;&lt;/RelativeLayout&gt;&lt;TextView android:id=""@+id/textStatus"" android:textSize=""24sp"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""Status Goes Here"" /&gt;&lt;TextView android:id=""@+id/textIntValue"" android:textSize=""24sp"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""Integer Value Goes Here"" /&gt;&lt;TextView android:id=""@+id/textStrValue"" android:textSize=""24sp"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""String Value Goes Here"" /&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout03"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;Button android:id=""@+id/btnUpby1"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Increment by 1""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/btnUpby10"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Increment by 10"" android:layout_alignParentRight=""true""&gt;&lt;/Button&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>src\com.exampleservice\MainActivity.java:</p><pre><code>package com.exampleservice;import android.app.Activity;import android.content.ComponentName;import android.content.Context;import android.content.Intent;import android.content.ServiceConnection;import android.os.Bundle;import android.os.Handler;import android.os.IBinder;import android.os.Message;import android.os.Messenger;import android.os.RemoteException;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;public class MainActivity extends Activity {    Button btnStart, btnStop, btnBind, btnUnbind, btnUpby1, btnUpby10;    TextView textStatus, textIntValue, textStrValue;    Messenger mService = null;    boolean mIsBound;    final Messenger mMessenger = new Messenger(new IncomingHandler());    class IncomingHandler extends Handler {        @Override        public void handleMessage(Message msg) {            switch (msg.what) {            case MyService.MSG_SET_INT_VALUE:                textIntValue.setText(""Int Message: "" + msg.arg1);                break;            case MyService.MSG_SET_STRING_VALUE:                String str1 = msg.getData().getString(""str1"");                textStrValue.setText(""Str Message: "" + str1);                break;            default:                super.handleMessage(msg);            }        }    }    private ServiceConnection mConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName className, IBinder service) {            mService = new Messenger(service);            textStatus.setText(""Attached."");            try {                Message msg = Message.obtain(null, MyService.MSG_REGISTER_CLIENT);                msg.replyTo = mMessenger;                mService.send(msg);            } catch (RemoteException e) {                // In this case the service has crashed before we could even do anything with it            }        }        public void onServiceDisconnected(ComponentName className) {            // This is called when the connection with the service has been unexpectedly disconnected - process crashed.            mService = null;            textStatus.setText(""Disconnected."");        }    };    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        btnStart = (Button)findViewById(R.id.btnStart);        btnStop = (Button)findViewById(R.id.btnStop);        btnBind = (Button)findViewById(R.id.btnBind);        btnUnbind = (Button)findViewById(R.id.btnUnbind);        textStatus = (TextView)findViewById(R.id.textStatus);        textIntValue = (TextView)findViewById(R.id.textIntValue);        textStrValue = (TextView)findViewById(R.id.textStrValue);        btnUpby1 = (Button)findViewById(R.id.btnUpby1);        btnUpby10 = (Button)findViewById(R.id.btnUpby10);        btnStart.setOnClickListener(btnStartListener);        btnStop.setOnClickListener(btnStopListener);        btnBind.setOnClickListener(btnBindListener);        btnUnbind.setOnClickListener(btnUnbindListener);        btnUpby1.setOnClickListener(btnUpby1Listener);        btnUpby10.setOnClickListener(btnUpby10Listener);        restoreMe(savedInstanceState);        CheckIfServiceIsRunning();    }    @Override    protected void onSaveInstanceState(Bundle outState) {        super.onSaveInstanceState(outState);        outState.putString(""textStatus"", textStatus.getText().toString());        outState.putString(""textIntValue"", textIntValue.getText().toString());        outState.putString(""textStrValue"", textStrValue.getText().toString());    }    private void restoreMe(Bundle state) {        if (state!=null) {            textStatus.setText(state.getString(""textStatus""));            textIntValue.setText(state.getString(""textIntValue""));            textStrValue.setText(state.getString(""textStrValue""));        }    }    private void CheckIfServiceIsRunning() {        //If the service is running when the activity starts, we want to automatically bind to it.        if (MyService.isRunning()) {            doBindService();        }    }    private OnClickListener btnStartListener = new OnClickListener() {        public void onClick(View v){            startService(new Intent(MainActivity.this, MyService.class));        }    };    private OnClickListener btnStopListener = new OnClickListener() {        public void onClick(View v){            doUnbindService();            stopService(new Intent(MainActivity.this, MyService.class));        }    };    private OnClickListener btnBindListener = new OnClickListener() {        public void onClick(View v){            doBindService();        }    };    private OnClickListener btnUnbindListener = new OnClickListener() {        public void onClick(View v){            doUnbindService();        }    };    private OnClickListener btnUpby1Listener = new OnClickListener() {        public void onClick(View v){            sendMessageToService(1);        }    };    private OnClickListener btnUpby10Listener = new OnClickListener() {        public void onClick(View v){            sendMessageToService(10);        }    };    private void sendMessageToService(int intvaluetosend) {        if (mIsBound) {            if (mService != null) {                try {                    Message msg = Message.obtain(null, MyService.MSG_SET_INT_VALUE, intvaluetosend, 0);                    msg.replyTo = mMessenger;                    mService.send(msg);                } catch (RemoteException e) {                }            }        }    }    void doBindService() {        bindService(new Intent(this, MyService.class), mConnection, Context.BIND_AUTO_CREATE);        mIsBound = true;        textStatus.setText(""Binding."");    }    void doUnbindService() {        if (mIsBound) {            // If we have received the service, and hence registered with it, then now is the time to unregister.            if (mService != null) {                try {                    Message msg = Message.obtain(null, MyService.MSG_UNREGISTER_CLIENT);                    msg.replyTo = mMessenger;                    mService.send(msg);                } catch (RemoteException e) {                    // There is nothing special we need to do if the service has crashed.                }            }            // Detach our existing connection.            unbindService(mConnection);            mIsBound = false;            textStatus.setText(""Unbinding."");        }    }    @Override    protected void onDestroy() {        super.onDestroy();        try {            doUnbindService();        } catch (Throwable t) {            Log.e(""MainActivity"", ""Failed to unbind from the service"", t);        }    }}</code></pre><p>src\com.exampleservice\MyService.java:</p><pre><code>package com.exampleservice;import java.util.ArrayList;import java.util.Timer;import java.util.TimerTask;import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.app.Service;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.os.IBinder;import android.os.Message;import android.os.Messenger;import android.os.RemoteException;import android.util.Log;public class MyService extends Service {    private NotificationManager nm;    private Timer timer = new Timer();    private int counter = 0, incrementby = 1;    private static boolean isRunning = false;    ArrayList&lt;Messenger&gt; mClients = new ArrayList&lt;Messenger&gt;(); // Keeps track of all current registered clients.    int mValue = 0; // Holds last value set by a client.    static final int MSG_REGISTER_CLIENT = 1;    static final int MSG_UNREGISTER_CLIENT = 2;    static final int MSG_SET_INT_VALUE = 3;    static final int MSG_SET_STRING_VALUE = 4;    final Messenger mMessenger = new Messenger(new IncomingHandler()); // Target we publish for clients to send messages to IncomingHandler.    @Override    public IBinder onBind(Intent intent) {        return mMessenger.getBinder();    }    class IncomingHandler extends Handler { // Handler of incoming messages from clients.        @Override        public void handleMessage(Message msg) {            switch (msg.what) {            case MSG_REGISTER_CLIENT:                mClients.add(msg.replyTo);                break;            case MSG_UNREGISTER_CLIENT:                mClients.remove(msg.replyTo);                break;            case MSG_SET_INT_VALUE:                incrementby = msg.arg1;                break;            default:                super.handleMessage(msg);            }        }    }    private void sendMessageToUI(int intvaluetosend) {        for (int i=mClients.size()-1; i&gt;=0; i--) {            try {                // Send data as an Integer                mClients.get(i).send(Message.obtain(null, MSG_SET_INT_VALUE, intvaluetosend, 0));                //Send data as a String                Bundle b = new Bundle();                b.putString(""str1"", ""ab"" + intvaluetosend + ""cd"");                Message msg = Message.obtain(null, MSG_SET_STRING_VALUE);                msg.setData(b);                mClients.get(i).send(msg);            } catch (RemoteException e) {                // The client is dead. Remove it from the list; we are going through the list from back to front so this is safe to do inside the loop.                mClients.remove(i);            }        }    }    @Override    public void onCreate() {        super.onCreate();        Log.i(""MyService"", ""Service Started."");        showNotification();        timer.scheduleAtFixedRate(new TimerTask(){ public void run() {onTimerTick();}}, 0, 100L);        isRunning = true;    }    private void showNotification() {        nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);        // In this sample, we'll use the same text for the ticker and the expanded notification        CharSequence text = getText(R.string.service_started);        // Set the icon, scrolling text and timestamp        Notification notification = new Notification(R.drawable.icon, text, System.currentTimeMillis());        // The PendingIntent to launch our activity if the user selects this notification        PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0);        // Set the info for the views that show in the notification panel.        notification.setLatestEventInfo(this, getText(R.string.service_label), text, contentIntent);        // Send the notification.        // We use a layout id because it is a unique number.  We use it later to cancel.        nm.notify(R.string.service_started, notification);    }    @Override    public int onStartCommand(Intent intent, int flags, int startId) {        Log.i(""MyService"", ""Received start id "" + startId + "": "" + intent);        return START_STICKY; // run until explicitly stopped.    }    public static boolean isRunning()    {        return isRunning;    }    private void onTimerTick() {        Log.i(""TimerTick"", ""Timer doing work."" + counter);        try {            counter += incrementby;            sendMessageToUI(counter);        } catch (Throwable t) { //you should always ultimately catch all exceptions in timer tasks.            Log.e(""TimerTick"", ""Timer Tick Failed."", t);                    }    }    @Override    public void onDestroy() {        super.onDestroy();        if (timer != null) {timer.cancel();}        counter=0;        nm.cancel(R.string.service_started); // Cancel the persistent notification.        Log.i(""MyService"", ""Service Stopped."");        isRunning = false;    }}</code></pre>","127287","","2458234","","2013-10-03 00:06:11","2014-02-04 23:38:52","Example: Communication between Activity and Service using Messaging","<android><android-activity><android-service>","7","12","209","",""
"4300371","1","","","2010-11-29 02:16:29","0","533","<p>I'm currently trying to get Androids' repo to download when I start with a clean ~/bin/repo file and directory, it successfully downloads the repo then I get a:</p><pre><code>Getting manifest ...from git://android.git.kernel.org/platform/maifest.gitfatal: The remote end hung up unexpectedlyfatal: cannot obtain manifest git://android.git.kernel.org/platform/maifest.git</code></pre><p>I have Python3.1, 2.7, 2.4.6currently /usr/bin/python is pointed at python2.4 </p><p>I know its not the servers busy because I can run <code>git clone</code> with no issues</p><p>I am not a Python programmer but I think it is these functions or a combination of them causing the issues from:</p><p>git_command.py</p><pre><code>try:      p = subprocess.Popen(command,                           cwd = cwd,                           env = env,                           stdin = stdin,                           stdout = stdout,                           stderr = stderr)</code></pre><p>and the .wait() command</p><pre><code>def Wait(self):    p = self.process    if p.stdin:...    try:      rc = p.wait()    finally:      _remove_ssh_client(p)    return rc</code></pre><p>Any thoughts? This has been getting to me for a while now?Thanks</p><p>{EDIT}guess I should ask a bit differently are there issues with having 2.7 and 3.1 on my system (3.1 is the default version) when I've changed the symbolic link the the command <code>python</code> to point to the <code>python2.4</code> ?</p>","523366","","523366","","2010-11-29 19:10:33","2010-11-29 19:10:33","Python 2.4 errors in android repo?","<python><android><repository>","0","4","","",""
"4300372","1","4300477","","2010-11-29 02:16:32","0","1028","<p>I have the following code:</p><pre><code>    public Map&lt;String,?&gt; createItem(String title, String caption) {              Map&lt;String,String&gt; item = new HashMap&lt;String,String&gt;();                           item.put(ITEM_TITLE, title);                          item.put(ITEM_CAPTION, caption);            (***)      item.put(ITEM_NUM, NUM);</code></pre><p>in line (<em>*</em>) i have error what i need to do to add the integer </p>","510992","","","","","2010-11-29 03:20:48","store integer and string in map","<android>","3","0","","",""
"4300399","1","4300876","","2010-11-29 02:24:30","9","27820","<p>I'm new to android.</p><p>What I want to do is draw a line that will follow my finger.  I've created a custom view, and I have an <code>onTouchEvent()</code> that works.</p><p>I can draw a static line in the <code>onDraw()</code> method without much trouble.  </p><p>I'm not really sure how to get the line to draw as my finger moves though.</p><pre><code>  public boolean onTouchEvent(MotionEvent event) {        super.onTouchEvent(event);        switch (event.getAction()) {        case MotionEvent.ACTION_DOWN: {            Log.e(TAG, "" - DOWN -"");            Log.e(TAG, "" getX: "" + event.getX());            break;        }        case MotionEvent.ACTION_UP: {            Log.e(TAG, "" - UP -"");            Log.e(TAG, "" getX: "" + event.getX());            break;        }        }        return true;    }</code></pre><p>Any hints you guys who have been doing it a while can give?  </p><p>Do I need to set coordinates on the <code>onTouchEvent()</code> and constantly invalidate the viewso the little line segments draw?</p><p>In the end I just want to be able to basically doodle on the screen using my finger for this experiment.  </p>","215708","","592025","","2013-05-08 04:01:06","2013-05-08 04:01:06","Android drawing a line to follow your finger","<android><drawing><ontouchevent>","5","1","8","",""
"4300482","1","4300684","","2010-11-29 02:49:37","0","113","<p><img src=""http://i.stack.imgur.com/IaNcN.png"" alt=""alt text""></p><p>I ran my app in the emulator. Where do I even begin?</p><p>First line from LogCat:</p><p>11-28 23:41:03.912: ERROR/AndroidRuntime(391): FATAL EXCEPTION: main</p>","479180","","479180","","2010-11-29 04:51:33","2010-11-29 19:45:22","uh oh - app stopped unexpectedly","<java><android>","2","5","","",""
"4300572","1","4300765","","2010-11-29 03:14:01","3","4817","<p>Is there any way to check if the Android GPS is on or off without any permission, just the state I don't need to toggle it.</p><p>Thanks</p>","398148","","","","","2014-03-05 09:40:21","Android GPS on or off state","<android><gps><toggle><state><android-manifest>","3","0","1","",""
"4300630","1","4302074","","2010-11-29 03:30:49","1","585","<p>I would like to run a piece of code every time any activity or service is started.  In this piece of code, I might do things such as set the default uncaught exception handler and manage log levels.</p><p>The problem is that I have an activity which starts with the user clicking the application icon.  I have another which starts if a certain intent is broadcasted, possibly from another app and possibly called before the user click the launch icon.  Same goes for services.</p><p>I need to guarantee that a certain piece of code will be run while keeping the code clean; that is to say, without having to manually add that snippet of code to every activity and service class that I have.</p>","481009","","","","","2010-11-29 08:43:15","How to always run some piece of code in android regardless of which activity or service run first in android?","<android>","5","0","","",""
"4300661","1","","","2010-11-29 03:38:34","6","14937","<p>Better yet can someone explain this program point by point?</p><pre><code>package com.paad.todolist;import java.util.ArrayList;import android.app.Activity;import android.os.Bundle;import android.view.KeyEvent;import android.view.View;import android.view.View.OnKeyListener;import android.widget.ArrayAdapter;import android.widget.EditText;import android.widget.ListView;public class ToDoList extends Activity {  /** Called when the activity is first created. */  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Inflate your view    setContentView(R.layout.main);    // Get references to UI widgets    ListView myListView = (ListView)findViewById(R.id.myListView);    final EditText myEditText = (EditText)findViewById(R.id.myEditText);    // Create the array list of to do items    final ArrayList&lt;String&gt; todoItems = new ArrayList&lt;String&gt;();    // Create the array adapter to bind the array to the listview    final ArrayAdapter&lt;String&gt; aa;    aa = new ArrayAdapter&lt;String&gt;(this,                                  android.R.layout.simple_list_item_1,                                  todoItems);    // Bind the array adapter to the listview.    myListView.setAdapter(aa);    myEditText.setOnKeyListener(new OnKeyListener() {        public boolean onKey(View v, int keyCode, KeyEvent event) {          if (event.getAction() == KeyEvent.ACTION_DOWN)            if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER)            {              todoItems.add(0, myEditText.getText().toString());              aa.notifyDataSetChanged();              myEditText.setText("""");              return true;            }          return false;        }      });  }}</code></pre>","434716","","618465","","2011-06-01 22:20:19","2013-08-16 06:48:54","Please explain Array Adapters and their purpose. Even better","<android>","4","0","2","",""
"4300673","1","4300711","","2010-11-29 03:41:52","4","1891","<p>i added a lot of images into a linearlayout with horizontal orientation.</p><p>now i wanna set a gap between each image , is that possible??</p><p>thanks</p>","422405","","","","","2010-11-29 03:50:29","android set linearlayout horizontal gap?","<android>","1","0","1","",""
"4300763","1","4301191","","2010-11-29 04:02:12","0","714","<p>I am getting confused with all the different terminology when using Android: Activity, Service...</p><p>Right now I create a service:</p><pre><code>startService(new Intent(this, RingerServer.class));</code></pre><p>And this service starts a thread:</p><pre><code>public class RingerServer extends Service {    public void onCreate() {        super.onCreate();        new Thread(new Ringer()).start();    }    public class Ringer implements Runnable { ... }    public void refuseConnection() { ... }}</code></pre><p>In this service, the RingerServer, I also have methods that I want to use. I would like to keep a reference to the RingerServer. I would basically like the Activity that created the service to be able to call refuseConnection(), but not make that method static.</p><p>startService returns a ComponentName, so I've been trying to cast it back to RingerServer but that doesn't seem to work. I see that it has getClass() and I've checked and getClassName() gives me the correct class. I haven't been able to use getClass() properly though.</p><p>Is there any way I can please keep a reference to the newly created RingerServer class? I am sure this is trivial, but I am stuck right now.</p><p>Thank you very much,</p><p>James</p>","522835","","522835","","2010-11-29 04:09:27","2010-11-29 22:56:11","Android: Obtaining a class after a call to startService()","<android><service><activity>","2","2","","",""
"4300779","1","","","2010-11-29 04:05:13","3","2621","<p>The current Android YouTube application provides helpful hints for navigating the user interface. For example: the first time the user switches between tabs while a video is playing, a small ""tooltip"" with an arrow pops up and says ""You can also switch between tabs by swiping left and right."" or something to that effect. Is there a way to mimic the look and functionality of this tooltip?</p>","508912","","508912","","2010-11-29 05:00:57","2010-11-29 05:00:57","Android ""Tooltip""","<android>","1","0","1","",""
"4300798","1","","","2010-11-29 04:10:01","1","5742","<p>I have implemented a Java web service WelcomMsg and it is running on Apache Axis.The web service has only one method greetUs(). It returns a string ""Greetings"":When I call using the HttpTransport object, I get an exception and always get ""false"".</p><p>I guess the namespace is here. Please look into the code and tell me what is missing/incorrect. I have given the method on service, wsdl contents,and Android soap client contents.</p><p>The method in the service is as follows:</p><pre><code>public class WelcomeMsg {public String greetUs(){    return ""Greetings!!!"";}</code></pre><p>}</p><p>Here is the wsdl:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;</code></pre><p>                                                                  </p><p></p><pre><code>  &lt;wsdl:part element=""impl:greetUsResponse"" name=""parameters""&gt;  &lt;/wsdl:part&gt;</code></pre><p></p><p></p><pre><code>  &lt;wsdl:part element=""impl:greetUs"" name=""parameters""&gt;  &lt;/wsdl:part&gt;</code></pre><p></p><p></p><pre><code>  &lt;wsdl:operation name=""greetUs""&gt;     &lt;wsdl:input message=""impl:greetUsRequest"" name=""greetUsRequest""&gt;   &lt;/wsdl:input&gt;     &lt;wsdl:output message=""impl:greetUsResponse"" name=""greetUsResponse""&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;</code></pre><p></p><p></p><pre><code>  &lt;wsdlsoap:binding style=""document"" transport=""http://schemas.xmlsoap.org/soap/http""/&gt;  &lt;wsdl:operation name=""greetUs""&gt;     &lt;wsdlsoap:operation soapAction=""""/&gt;     &lt;wsdl:input name=""greetUsRequest""&gt;        &lt;wsdlsoap:body use=""literal""/&gt;     &lt;/wsdl:input&gt;     &lt;wsdl:output name=""greetUsResponse""&gt;        &lt;wsdlsoap:body use=""literal""/&gt;     &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;</code></pre><p></p><p></p><pre><code>  &lt;wsdl:port binding=""impl:WelcomeMsgSoapBinding"" name=""WelcomeMsg""&gt;     &lt;wsdlsoap:address location=""http://localhost:8080/NewWebService/services/WelcomeMsg""/&gt;  &lt;/wsdl:port&gt;</code></pre><p></p><p></p><p>The Android Soap Client is as follows:</p><pre><code>package com.example.HelloDroid;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.*;import org.ksoap2.transport.HttpTransportSE;public class Droid extends Activity {    /** Called when the activity is first created. */     private static final String SOAP_ACTION = ""DefaultNamespace"";     private static final String METHOD_NAME = ""greetUs"";     private static final String NAMESPACE = ""urn:DefaultNamespace"";     private static final String URL = ""http://192.168.186.136:12733/NewWebService/services/WelcomeMsg"";     TextView tv;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        tv=(TextView) findViewById(R.id.TextView01);        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);                   SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);        envelope.dotNet=false;        envelope.setOutputSoapObject(request);        HttpTransportSE ht = new HttpTransportSE(URL);        try{            ht.call(SOAP_ACTION, envelope);            //tv.setText(""http set"");            SoapPrimitive sp= (SoapPrimitive) envelope.getResponse();            tv.setText(""Msg from service: ""+sp);        }        catch(Exception e)        {            e.printStackTrace();        }    }}</code></pre>","356711","","","","","2012-02-13 18:31:28","Calling a Java Web Service from Android via ksoap2","<java><android><service><ksoap2>","1","0","0","",""
"4300839","1","5278060","","2010-11-29 04:21:21","1","2085","<p><img src=""http://i.stack.imgur.com/xKt8j.jpg"" alt=""alt text""></p><p>Hi, I have seen the above control in a few Android applications. I know it is not native to Android, what is the name of the control and how do I implement it in Android? Could it be done using a ListView including the behavior?</p>","421372","","421372","","2011-04-13 11:16:46","2013-06-18 06:21:10","UIPickerView look-alike on Android","<iphone><android><custom-view>","4","4","3","",""
"4300881","1","4300985","","2010-11-29 04:31:09","1","759","<p>i want to store some element String.XML's array. Values are given bellow</p><pre><code>&lt;string-array name=""values""&gt;    &lt;item&gt;Bupivicaine+Fentanyl&lt;/item&gt;    &lt;item&gt;Bupivicaine&gt;Diamorphine&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>Now how can i store these values in array. because when i use ""+"" in elements this doesn't display. i have to show it ""Bupivicaine+Fentanyl"" format... and at the point of "">"" it is giving error in string.xml file.</p>","304961","","494543","","2010-11-29 04:33:33","2010-11-29 05:02:32","android array data store problem","<android>","1","0","","",""
"4300930","1","","","2010-11-29 04:47:45","0","194","<p>I am working on a GPS-enabled application and I need to record a point each N meters. However, I can't see how I can use onLocationChanged() method in the LocationListener or any other method/class. The onLocationChanged() method gives a point each second, and I need to store each N-meter point.  </p><p>I believe that this has a simple solution, but since I am beginner in Android, cant find it.</p><p>Any help will be much appreciated.</p>","483375","","","","","2010-12-09 10:08:11","Android gps how to skip distance?","<android><gps><distance><skip>","3","0","","",""
"4300993","1","4483285","","2010-11-29 05:05:44","3","912","<p>I am facing an issue while trying to use the spring android framework. I have tried the samples according to <a href=""http://static.springsource.org/spring-android/docs/1.0.x/reference/html/rest-template.html"" rel=""nofollow"">this</a> link. Actually I can't get it to work. Because when I try to import the <code>spring-android-rest-template-1.0.0.M1.jar</code> and <code>spring-android-commons-logging-1.0.0.M1.jar</code> it gives an error saying </p><blockquote>  <p>Conversion to Dalvik format failed with error 1</p></blockquote><p>Therefore I was not able to complete the sample program.</p><p>I have downloaded the the jar files separately. It gives no errors in the code. But a top level error is generating. </p><p>Why is this error occurring, has anyone else got the same issue ?</p>","511737","","844923","","2013-04-06 21:16:27","2013-04-06 21:16:27","Android Spring Integration","<java><android><spring><mobile>","1","0","2","",""
"4301020","1","4301039","","2010-11-29 05:12:48","0","1577","<p>I am new to Android and I don't know much about Android. Well I have created a layout named button-layout.xml and the very firstly I added a relative layout to and and named it too button-layout.</p><p>What happens is that it created R.java and crated a reference to my layout with name <strong>public static final int button-layout=0x7f060000;</strong> as you people know that you can not use <strong>-</strong> in your variable name as it is illegal.</p><p>Now I want to clean my R.java do any body knows solution of this problem?</p><p>Pasting my code below<strong>button-layout.xml</strong></p><pre><code>    &lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;RelativeLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/button-layout""&gt;    &lt;LinearLayout android:id=""@+id/button-layout""        android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;        &lt;TextView android:id=""@+id/TextView01""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""First Name""&gt;&lt;/TextView&gt;        &lt;EditText android:id=""@+id/EditText01""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:width=""100px""&gt;&lt;/EditText&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout02""        android:layout_below=""@id/LinearLayout01"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;        &lt;TextView android:id=""@+id/TextView02""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Last Name""&gt;&lt;/TextView&gt;        &lt;EditText android:id=""@+id/EditText02""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:width=""100px""&gt;&lt;/EditText&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout03""        android:layout_below=""@id/LinearLayout02"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:layout_centerInParent=""true""&gt;        &lt;Button android:id=""@+id/Button01""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Submit""&gt;&lt;/Button&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p><strong>R.java</strong></p><pre><code>/* AUTO-GENERATED FILE.  DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found.  It * should not be modified by hand. */package com.geniteam.mytest;public final class R {    public static final class attr {    }    public static final class color {        public static final int blue=0x7f050000;    }    public static final class drawable {        public static final int golden_gate=0x7f020000;        public static final int icon=0x7f020001;    }    public static final class id {        public static final int Button01=0x7f060008;        public static final int Button02=0x7f060010;        public static final int EditText01=0x7f060003;        public static final int EditText02=0x7f060006;        public static final int LinearLayout01=0x7f060001;        public static final int LinearLayout02=0x7f060004;        public static final int LinearLayout03=0x7f060007;        public static final int RelativeLayout01=0x7f06000e;        public static final int TextView01=0x7f060002;        public static final int TextView02=0x7f060005;        public static final int backbutton=0x7f060014;        public static final int btn_FNname=0x7f060011;        public static final int btn_cancel=0x7f06000c;        public static final int btn_shahzad=0x7f060012;</code></pre><h2>public static final int button-layout=0x7f060000; //here is error</h2><pre><code>        public static final int editFirstName=0x7f060016;        public static final int editLastName=0x7f060017;        public static final int entry=0x7f06001a;        public static final int firstName=0x7f060015;        public static final int image=0x7f06000a;        public static final int label=0x7f060019;        public static final int lastName=0x7f060018;        public static final int layout_root=0x7f060009;        public static final int layout_shahzad=0x7f06000d;        public static final int ok=0x7f06001b;        public static final int relative_layout=0x7f060013;        public static final int text=0x7f06000b;        public static final int txt_label=0x7f06000f;    }    public static final class layout {        public static final int abc=0x7f030000;        public static final int custom_dialog=0x7f030001;        public static final int frame_layout=0x7f030002;        public static final int layout_shahzad=0x7f030003;        public static final int main=0x7f030004;        public static final int next_screen=0x7f030005;        public static final int relative_layout=0x7f030006;        public static final int relative_test_layout=0x7f030007;    }    public static final class string {        public static final int app_name=0x7f040000;        public static final int hello=0x7f040001;        public static final int hello_new=0x7f040002;    }}</code></pre>","185022","","213269","","2010-11-30 13:00:19","2010-11-30 13:00:19","Android: How to remove old references in R.java?","<android><resolution><android-layout><r.java-file>","2","2","","",""
"4301048","1","4301927","","2010-11-29 05:22:09","0","734","<p>I am new in android development. I want to make and attach one soft keyboard for android and want to open it on edittext's click. I have gone through with soft keyboard sample given by android sdk but not really able to attach it with android. How can I do this ?Please help me...</p><p>Thanks in advance</p>","523477","","","","","2010-11-30 20:46:35","How to create and attach softkeyboard in android","<android><eclipse>","2","0","","",""
"4301064","1","4301130","","2010-11-29 05:26:15","10","16392","<p>How to get the following fields from Android contacts? I used Android 2.2. </p><ol><li>Name prefix</li><li>First name</li><li>Middle name</li><li>Last name</li><li>Name prefix</li><li>Phonetic given name</li><li>Phonetic middle name</li><li>Phonetic family name</li></ol>","488433","","815724","","2012-10-27 21:36:09","2013-03-15 13:18:15","How to get the first name and last name from Android contacts?","<android><android-contacts>","6","0","5","",""
"4301099","1","4301146","","2010-11-29 05:32:13","1","7679","<p>Is there any built-in method available in Android for validations like Email validation, empty string validation etc..??</p>","523058","","","","","2012-10-29 07:32:41","Empty Field and other Validations in android","<android><validation>","3","3","1","",""
"4301111","1","","","2010-11-29 05:35:35","0","616","<p>I'm using only an application that uses SMS_Receive Intent Filter and based on receiving an SMS , and it does few calculations , the problem is when going back or home , the application still responds to the incoming SMS which has a special tag and it shows the toasts to the desktop of the android screen , how do I close the application completely ?</p>","375666","","","","","2010-11-29 06:55:08","Android Application is still working after exit","<android>","2","1","","",""
"4301320","1","4301878","","2010-11-29 06:24:06","1","3646","<p>How can I count the number of columns in a table in a sqlite database in Android?</p>","512192","","18061","","2012-08-27 08:02:44","2012-08-27 08:02:44","How to count number of columns in a table in SQLITE?","<android><sqlite>","4","0","","",""
"4301322","1","4323070","","2010-11-29 06:24:10","0","1748","<p>I have a set of images inside horizontal scrollview. I want to perform click event on these images. I have added onClickListener to the images. But its not working. I think since images are inside scrollview the problem arises. Can anyone help on this issue?</p>","504162","","","","","2010-12-01 09:52:12","handle click event for image inside scrollview","<android>","1","0","","",""
"4301343","1","","","2010-11-29 06:28:10","0","4039","<p>I cannot get a nine patch drawable to work (i.e. it is stretching the nine patch image) when loading from either Drawable.createFromPath or from a number of other methods using an InputStream.</p><p>Loading the same nine patch works fine when loading from when resources.  Here's the methods I am trying:</p><pre><code>Button b = (Button) findViewById(R.id.Button01);Drawable d = null;//From Resources (WORKS!)d = getResources().getDrawable(R.drawable.test);//From Raw Resources (Doesn't Work)InputStream is = getResources().openRawResource(R.raw.test);d = Drawable.createFromStream(is, null);//From Assets (Doesn't Work)try {InputStream is = getResources().getAssets().open(""test.9.png"");d = Drawable.createFromStream(is, null);} catch (Exception e) {e.printStackTrace();}//From FileInputStream (Doesn't Work)try {FileInputStream is = openFileInput(""test.9.png"");d = Drawable.createFromStream(is, null);} catch (Exception e) {e.printStackTrace();}//From File path (Doesn't Work)d = Drawable.createFromPath(getFilesDir() + ""/test.9.png"");if (d != null) b.setBackgroundDrawable(d);</code></pre>","190303","","","","","2013-01-25 17:01:34","NinePatchDrawable from Drawable.createFromPath or FileInputStream","<android><drawable><nine-patch>","2","0","","",""
"4301392","1","4327775","","2010-11-29 06:36:10","2","937","<p><strong>Scenario</strong></p><p>I have a problem that starts to drive me nuts. In one activity I have the following scenario. On create:- create a GPS Listner- create a Location Listener- Start GPS listner and location listener- Start a asyncTask that downloads a map from the web / or load it from cache- play a wav file which is a raw resource, very small (around 63 Kilo) which is short, basically it says: ""Let's head to the start point"" and it makes visible a textview for 10 seconds.</p><p><strong>Problem</strong></p><p>Rarely the sound gets play fully. Sometimes I hear only ""Let's head"", sometimes ""Let's head to the star"", sometimes no play at all. It's like something else is blocking the sound. I moved the sound in its own thread but still no success:</p><p><strong>Code</strong></p><pre><code>private void ShowTextPlayVoice(String message, int soundResId)    {        txtProceed.setText(message);        txtProceed.setVisibility(View.VISIBLE);        final int soundId = soundResId;        Handler splashHandler = new Handler() {            @Override            public void handleMessage(Message msg) {                    switch (msg.what) {                    case 0:                            txtProceed.setVisibility(View.INVISIBLE);                            break;                    }                    super.handleMessage(msg);            }        };            Message msg = new Message();            msg.what = 0;            splashHandler.sendMessageDelayed(msg, 10000);            Thread thread = new Thread() {                public void run() {                    MediaPlayer mp = MediaPlayer.create(ctx, soundId);                    mp.start();                    mp.setOnCompletionListener(new OnCompletionListener() {                                    public void onCompletion(MediaPlayer mp) {                                        mp.release();                                    }                                });                }            };            thread.start();    }</code></pre><p>Thank you all for help. </p>","379865","","379865","","2010-11-29 08:09:13","2010-12-01 18:34:29","Android sound file not playing fully, gets brutally interupted","<android><media-player>","1","0","1","",""
"4301395","1","","","2010-11-29 06:36:32","0","341","<pre><code>public class SnowflakeWallpaper extends WallpaperService {// Limit of snowflakes per snowflake type; 4 types * 4 snowflake = 16 total// Should keep memory usage at a minimalstatic int SNOWFLAKE_AMOUNT = 4;Drawable drawWall;Rect wallBounds;// Draw all snowflakes off screen due to not knowing size of canvas at creationstatic int SNOW_START = -90;ArrayList&lt;Snowflakes&gt; snow = new ArrayList&lt;Snowflakes&gt;();private final Handler mHandler = new Handler();@Overridepublic void onCreate() {    super.onCreate(); //WallpaperManager to pull current wallpaper WallpaperManager wManager = WallpaperManager.getInstance(this); drawWall = wManager.getFastDrawable(); wallBounds = drawWall.copyBounds();}@Overridepublic void onDestroy() {    super.onDestroy();}@Overridepublic Engine onCreateEngine() {    return new SnowEngine();}class SnowEngine extends Engine {    private final Runnable mDrawSnow = new Runnable() {        public void run() {            drawFrame();        }    };    private boolean mVisible;    SnowEngine() {        if(snow.size() &lt; 16){     //Back snowflakes  for(int i = 0; i &lt; SNOWFLAKE_AMOUNT; i++){   snow.add(new Snowflakes(     BitmapFactory.decodeResource(getResources(),      R.drawable.snowflakeback),     SNOW_START,     SNOW_START,     ((float)(Math.random() * 2) + 1)) // Fall speed initial setup, back slowest to front fastest potentially    );  }  //MidBack snowflakes  for(int i = 0; i &lt; SNOWFLAKE_AMOUNT; i++){   snow.add(new Snowflakes(     BitmapFactory.decodeResource(getResources(),     R.drawable.snowflakemid),     SNOW_START,     SNOW_START,     ((float)(Math.random() * 4) + 1)   ));  }  // Mid snowflakes  for(int i = 0; i &lt; SNOWFLAKE_AMOUNT; i++){   snow.add(new Snowflakes(     BitmapFactory.decodeResource(getResources(),     R.drawable.snowflakemidfront),     SNOW_START,     SNOW_START,     ((float)(Math.random() * 8) + 1))   );  }  // Front snowflakes  for(int i = 0; i &lt; SNOWFLAKE_AMOUNT; i++){   snow.add(new Snowflakes(     BitmapFactory.decodeResource(getResources(),      R.drawable.snowflake),     SNOW_START,      SNOW_START,      ((float)(Math.random() * 16) + 1))   );  }         }    }    @Override    public void onCreate(SurfaceHolder surfaceHolder) {        super.onCreate(surfaceHolder);    }    @Override    public void onDestroy() {        super.onDestroy();        mHandler.removeCallbacks(mDrawSnow);    }    @Override    public void onVisibilityChanged(boolean visible) {        mVisible = visible;        if (visible) {            drawFrame();        } else {            mHandler.removeCallbacks(mDrawSnow);        }    }    @Override    public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int  height) {        super.onSurfaceChanged(holder, format, width, height);        drawFrame();    }    @Override    public void onSurfaceCreated(SurfaceHolder holder) {        super.onSurfaceCreated(holder);    }    @Override    public void onSurfaceDestroyed(SurfaceHolder holder) {        super.onSurfaceDestroyed(holder);        mVisible = false;        mHandler.removeCallbacks(mDrawSnow);    }    /*     * Update the screen with a new frame     */    void drawFrame() {        final SurfaceHolder holder = getSurfaceHolder();        /*         * if the snow goes too low or too right, reset;         */        for(int i = 0; i &lt; snow.size(); i++){         if(snow.get(i).getX() &gt; holder.getSurfaceFrame().width()){          snow.get(i).setX(-65);         }         if(snow.get(i).getY() &gt; holder.getSurfaceFrame().height()){          snow.get(i).setY(-69);         }        }        // Test if the array was just create; true - randomly populate snowflakes on screen        if(snow.get(1).getX() &lt; -70){         for(int i = 0; i &lt; snow.size(); i++){          snow.get(i).setX((int)(Math.random() * getSurfaceHolder().getSurfaceFrame().width() +1));          snow.get(i).setY((int)(Math.random() * getSurfaceHolder().getSurfaceFrame().height() + 1));         }        }        // Change snowflake x &amp; y        for(int i = 0; i &lt; snow.size(); i++){         snow.get(i).delta();        }        Canvas c = null;        try {            c = holder.lockCanvas();            if (c != null) {                // call to draw new snow position                drawSnow(c);            }        } finally {            if (c != null) holder.unlockCanvasAndPost(c);        }        // Reschedule the next redraw        mHandler.removeCallbacks(mDrawSnow);        if (mVisible) {            mHandler.postDelayed(mDrawSnow, 1000 / 100);        }    }    /*     * Draw the snowflakes     */    void drawSnow(Canvas c) {        c.save();        // Draw bg        //********** add code to pull current bg and draw that instead of black. Maybe set this in config?        if(drawWall == null){         c.drawColor(Color.BLACK);        }else{         drawWall.copyBounds(wallBounds);         drawWall.draw(c);        }        /*         * draw up the snow         */        for(int i = 0; i &lt; snow.size(); i++){         c.drawBitmap(snow.get(i).getImage(), snow.get(i).getX(), snow.get(i).getY(), null);        }        c.restore();    }}</code></pre><p>}</p>","520058","","19750","","2011-03-31 15:42:58","2011-03-31 15:42:58","Any ideas on how to optimize this code? I cant seem to come up with anything that works","<java><android><live-wallpaper>","1","1","","",""
"4301422","1","4302632","","2010-11-29 06:41:16","13","7699","<p>I have added a LinearLayOut having some buttons My screen is RelativeLayOut it self</p><p>Here is the code for that linear layout manager</p><pre><code>&lt;LinearLayout android:orientation=""horizontal""  android:gravity=""bottom"" android:layout_alignParentBottom=""true""  android:layout_height=""wrap_content"" android:layout_width=""fill_parent""  android:id=""@+id/Footer"" android:layout_marginBottom=""5dp""&gt;</code></pre><p>Here is the problem:</p><p>There is an EditText component on the top and it pops a soft keyboard on the screen , and brings my Footer manager on top of the keyboard and eventually SHATTERS my whole UI.</p><p>What is the exact solution? </p><p>P.S. I have removed <code>android:gravity=""bottom""</code> and  <code>android:layout_alignParentBottom=""true""</code> one by one but with hard luck i did not get desired result.</p><p>Thanks</p>","246942","","418183","","2010-11-29 10:06:13","2013-07-22 14:15:07","Android : Showing keyboard moves my components up, i want to hide them instead","<android><android-layout>","1","2","7","",""
"4301432","1","","","2010-11-29 06:42:17","0","136","<p>My requirment is there will be a india map and some imageview or buttons will be there on top of that map.when i drag and drop the button on that top of map color of some areas has to change ..</p><p>Please let me know how to do that.</p>","523549","","","","","2012-05-04 15:14:51","how to place overlapped images either on canvas or layout","<android>","1","0","","",""
"4301439","1","","","2010-11-29 06:43:12","2","954","<p>I am working on an android application which supports android 2.1 and 2.2 version. And I do not want my app to get installed on any of the android tablet devices. Is there any way to achieve this in android like if we do any changes in manifest file of the app, something like that. Any help greatly appreciated... Or is there any way to prevent our app not to get listed in the market of tablet devices once we release the app. But It should be listed in the market of android mobile phones.</p>","404196","","","","","2010-11-29 21:46:24","Avoid application to be installed on tablet devices","<android><tablet>","1","0","2","",""
"4301453","1","","","2010-11-29 06:45:45","13","7073","<p>I have a block of text coming from a webservice, and depending on some tags which I have predefined, I want to style the text before setting it to my TextView.  For bold, italics, and underline, I was able to do this easily with the replaceAll command:</p><pre><code>PageText = PageText.replaceAll(""\\*([a-zA-Z0-9]+)\\*"", ""&lt;b&gt;$1&lt;/b&gt;"");        PageText = PageText.replaceAll(""=([a-zA-Z0-9]+)="", ""&lt;i&gt;$1&lt;/i&gt;"");                    PageText = PageText.replaceAll(""_([a-zA-Z0-9]+)_"", ""&lt;u&gt;$1&lt;/u&gt;"");txtPage.setText(Html.fromHtml(PageText), TextView.BufferType.SPANNABLE);</code></pre><p>So, to bold a word, surround it with *'s, for italics, surround with _.</p><p>But, for strikethrough, Html.fromHtml does not support the ""strike"" tag, so it can't be done this same way.  I've seen examples of using Spannable to set the styling on one section of text, but it requires positional numbers.  So, I guess I could loop through the text, searching for - (the tag to represent the strike), then searching for the next one, spanning the text in between, and repeating for all such strings.  It will end up being 10 lines of looping code as opposed to 1 for the others, so I'm wondering if there is a more elegant solution out there.</p>","434574","","","","","2013-05-16 20:22:45","Specifying ""strikethrough"" on a section of TextView text","<android><textview>","4","0","5","",""
"4301519","1","","","2010-11-29 06:57:09","0","2089","<p>I have the following objective:</p><p>I have a ListView , where each list item will contain an ImageView &amp; a TextView.</p><p>The ImageView data is fetched from an URL , so it will be lazily loaded .I have already implemented the code my creating my own Adapter which extends the BaseAdapter &amp; overriden the method getView().</p><p>I am calling my own created Adapter from an Activity.</p><p>Kindly provide me hints/sample source code on how to implement the same using the ArrayAdapter since I now need to implement pagination of the listitems .Whenever the no of listitems exceeds a specific value , a progressbar will start &amp; a webservice call will be made to fetch the response for the next set of listitems from the server which needs to be appended to the existing list.</p><p>I am providing the code which I have implemented using the BaseAdapter.Kindly help.</p><pre><code>public class SampleListActivity extends Activity implements OnKeyListener {CustomAdapter adap;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.list_structure);    String imageStr[] = (String[]) listVec.toArray(new String[listVec            .size()]);    adap = new CustomAdapter (this, imageStr,listVec);    setListAdapter(adap);}}public class CustomAdapter extends BaseAdapter implements Filterable, OnClickListener {int count = 0; private Activity activity; private String[] data; private LayoutInflater inflater = null; public ImageLoader imageLoader; public LazyListAdapter(Activity a, String[] d) {     activity = a;     data = d;     inflater = (LayoutInflater) activity             .getSystemService(Context.LAYOUT_INFLATER_SERVICE);     imageLoader = new ImageLoader(activity.getApplicationContext()); } public int getCount() {     return data.length; } public Object getItem(int position) {     return position; } public long getItemId(int position) {     return position; } public class ViewHolder {     public TextView textTitle;     public ImageView image;     public ImageView addImage; } public View getView(final int position, View convertView,         ViewGroup parent) {     View vi = convertView;      ViewHolder holder;     if (vi == null) {         vi = inflater.inflate(R.layout.list_videos_content, null);         holder = new ViewHolder();         holder.image = (ImageView) vi.findViewById(R.id.iconLine);         holder.textTitle = (TextView)          vi.findViewById(R.id.textLine);        holder.addImage = (ImageView)          vi.findViewById(R.id.buttonLine);        vi.setTag(holder);     } else holder = (ViewHolder) vi.getTag();    String textStr =tempVec.elementAt(1)     holder.textTitle.setText(textStr);     // Icons bound to the rows.     // Bind the data efficiently with the holder.     holder.image.setTag(data[position]);     holder.addImage.setImageResource(R.id.buttonLine);     imageLoader.DisplayImage(data[position], activity, holder.image);     return vi; } } public Filter getFilter() {     return null; }  public void onClick(View v) {     int i = v.getId(); } </code></pre>","443141","","89806","","2011-02-27 00:08:51","2011-02-27 00:08:51","Implement loading of Images using ArrayAdapter","<java><android>","0","3","","",""
"4301565","1","4301598","","2010-11-29 07:07:02","3","8420","<p>I have created 5 TextView programmatically, now i want to set few Parameters/Attributes of their such as Gravity, Layout_Gravity, etc.</p><p>I know we can set it in XML layout at Design-time:</p><pre><code>android:gravity=""center|center_horizontal|center_vertical""android:layout_gravity=""center|center_horizontal|center_vertical""</code></pre><p>But, How can we set Gravity/Layout_Gravity kinds of Attributes <strong>programmatically</strong>?</p>","379693","","21234","","2010-11-30 17:29:03","2010-11-30 17:29:03","Setting Textview's Attributes Programmatically","<android><textview><android-layout>","2","0","","",""
"4301577","1","","","2010-11-29 07:09:39","0","651","<p>To resize the Egl surface, i am destroying current surface and creating new surface with new size, but in-between these operation, it shows black screen after the destroy operation.</p><p>How can i avoid this behaviour ?i am using opengles 2.0 lib on android.</p>","350600","","21234","","2010-12-08 11:00:33","2010-12-08 11:00:33","Opengles Surface(EglSurface) resizing causes black screen on android","<android><graphics><opengl-es>","1","0","","",""
"4301636","1","","","2010-11-29 07:21:04","1","1626","<p>Usually, in Android, we read the accelerometer data in an ""Activity"", by overriding the OnSensorChanged function.</p><p>I am curious how we can do it in a ""Service"".</p><p>Thanks,Vincent</p>","523597","","","","","2012-04-22 00:00:35","How to read accelerometer data in Service with Android","<android><service><accelerometer>","1","0","","",""
"4301641","1","4301773","","2010-11-29 07:22:23","2","8550","<p>I tried to display date picker using xml code. But it did not display anything. Can I display DatePicker only through java code?</p><h2>datePickerExample.java</h2><pre><code>public class datePickerExample extends Activity{    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.date_picker_example);     }}</code></pre><h2>date_picker_example.xml</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/lay_main""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:background=""@drawable/bg"" &gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""Date : "" &gt;    &lt;/TextView&gt;    &lt;DatePicker        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:endYear=""2100""        android:startYear=""1900"" &gt;    &lt;/DatePicker&gt;&lt;/LinearLayout&gt;</code></pre><p>Thank you...</p>","523058","","1134705","","2012-09-27 14:26:04","2012-09-27 14:26:04","Android: Date Picker using xml layout","<android><datepicker>","1","0","1","",""
"4301643","1","","","2010-11-29 07:22:33","0","604","<p>I am reading data from hyperterminal passed over bluetooth in Android.</p><p>The problem that is coming is that there are some bytes that are read as 128 instead of 0. And some bytes are read as 0 perfectly. So, I do not understand the reason of some bytes being read falsely. Why is the data being read as 128 instead of 0?</p><pre><code>        while (true)         {            try             {             for(int i = 0; i &lt; 32; i++)             {              //bytes = mmInStream.read();              bytes = bis.read();               buffer[i] = bytes; //buffer is the integer array                Log.d(TAG, ""Data Received ====&gt; "" + buffer[i]);             }             }             catch(IOException e) {}         }</code></pre><p>I have pasted the code that I am using for reading the data. Again, the problem occurs with some bytes only and some bytes are read properly as 0.</p><p>Can someone help me out in this?</p>","261566","","","","","2010-11-29 07:22:33","Problem in reading data from binary file over hyperterminal in Android?","<android><data><binary>","0","3","","",""
"4301725","1","4301839","","2010-11-29 07:39:35","0","1856","<p>How do i parse json by removing the xml tag </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""&gt;&lt;soap:Body&gt;&lt;AddUserResponse xmlns=""http://abcd.com/""&gt;&lt;AddUserResult&gt;{""clsError"":{""ErrorCode"":110,""ErrorDescription"":""Email Already Exist""},""UserID"":-1}&lt;/AddUserResult&gt;&lt;/AddUserResponse&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre><p>I tried this code in it result is taken as response string which is in the above xml format </p><pre><code>String temp = result.substring(282, (length - 62));System.out.println(temp);JSONObject object = (JSONObject) new JSONTokener(temp).nextValue();String query = object.getString(""ErrorDescription"");</code></pre><p>in ddms it says:org.json.JSONException: No value for ErrorDescription</p>","501859","","501859","","2010-11-29 07:53:21","2011-09-02 19:06:38","how to parse json from xml response","<android><xml><json><soap>","1","1","1","",""
"4301763","1","4308848","","2010-11-29 07:46:45","0","823","<blockquote>  <p>onRestoreInstanceState(Bundle savedInstanceState) </p></blockquote><p>is not geting called, I am pasting my code below. Actually I want to redraw all the points that are saved when my activity went in background.</p><pre><code>    package com.geniteam.mytest;import java.util.ArrayList;import android.app.Activity;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Color;import android.os.Bundle;import android.view.MotionEvent;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.view.Window;public class Tutorial2D extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(new Panel(this));    }    @Override    protected void onSaveInstanceState(Bundle outState) {          super.onSaveInstanceState(outState);     Panel panel = new Panel(this);     outState.putSerializable(""test"", panel._graphics);         }    @Override    protected void onRestoreInstanceState(Bundle savedInstanceState) {          super.onRestoreInstanceState(savedInstanceState);     Panel panel = new Panel(this);     panel.set_graphics((ArrayList&lt;GraphicObject&gt;) savedInstanceState.getSerializable(""test""));         }    class Panel extends SurfaceView implements SurfaceHolder.Callback {        private TutorialThread _thread;                private ArrayList&lt;GraphicObject&gt; _graphics = new ArrayList&lt;GraphicObject&gt;();        public ArrayList&lt;GraphicObject&gt; get_graphics() {   return _graphics;     }  public void set_graphics(ArrayList&lt;GraphicObject&gt; graphics) {   _graphics = graphics;  }  public Panel(Context context) {            super(context);            getHolder().addCallback(this);            _thread = new TutorialThread(getHolder(), this);            setFocusable(true);        }        @Override        public boolean onTouchEvent(MotionEvent event) {            synchronized (_thread.getSurfaceHolder()) {               // if (event.getAction() == MotionEvent.ACTION_DOWN) {                    GraphicObject graphic = new GraphicObject(BitmapFactory.decodeResource(getResources(), R.drawable.icon));                    graphic.getCoordinates().setX((int) event.getX() - graphic.getGraphic().getWidth() / 2);                    graphic.getCoordinates().setY((int) event.getY() - graphic.getGraphic().getHeight() / 2);                    _graphics.add(graphic);                //}                return true;            }        }        @Override        public void onDraw(Canvas canvas) {            canvas.drawColor(Color.BLACK);            Bitmap bitmap;            GraphicObject.Coordinates coords;            for (GraphicObject graphic : _graphics) {                bitmap = graphic.getGraphic();                coords = graphic.getCoordinates();                canvas.drawBitmap(bitmap, coords.getX(), coords.getY(), null);            }        }        public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {            // TODO Auto-generated method stub        }        public void surfaceCreated(SurfaceHolder holder) {            try{         _thread.setRunning(true);            _thread.start();            }catch(Exception ex){             _thread = new TutorialThread(getHolder(), this);             _thread.start();            }        }        public void surfaceDestroyed(SurfaceHolder holder) {            // simply copied from sample application LunarLander:            // we have to tell thread to shut down &amp; wait for it to finish, or else            // it might touch the Surface after we return and explode            boolean retry = true;            _thread.setRunning(false);            while (retry) {                try {                    _thread.join();                    retry = false;                } catch (InterruptedException e) {                    // we will try it again and again...                }            }        }    }    class TutorialThread extends Thread {        private SurfaceHolder _surfaceHolder;        private Panel _panel;        private boolean _run = false;        public TutorialThread(SurfaceHolder surfaceHolder, Panel panel) {            _surfaceHolder = surfaceHolder;            _panel = panel;        }        public void setRunning(boolean run) {            _run = run;        }        public SurfaceHolder getSurfaceHolder() {            return _surfaceHolder;        }        @Override        public void run() {            Canvas c;            while (_run) {                c = null;                try {                    c = _surfaceHolder.lockCanvas(null);                    synchronized (_surfaceHolder) {                        _panel.onDraw(c);                    }                } finally {                    // do this in a finally so that if an exception is thrown                    // during the above, we don't leave the Surface in an                    // inconsistent state                    if (c != null) {                        _surfaceHolder.unlockCanvasAndPost(c);                    }                }            }        }    }    class GraphicObject {        /**         * Contains the coordinates of the graphic.         */        public class Coordinates {            private int _x = 100;            private int _y = 0;            public int getX() {                return _x + _bitmap.getWidth() / 2;            }            public void setX(int value) {                _x = value - _bitmap.getWidth() / 2;            }            public int getY() {                return _y + _bitmap.getHeight() / 2;            }            public void setY(int value) {                _y = value - _bitmap.getHeight() / 2;            }            public String toString() {                return ""Coordinates: ("" + _x + ""/"" + _y + "")"";            }        }        private Bitmap _bitmap;        private Coordinates _coordinates;        public GraphicObject(Bitmap bitmap) {            _bitmap = bitmap;            _coordinates = new Coordinates();        }        public Bitmap getGraphic() {            return _bitmap;        }        public Coordinates getCoordinates() {            return _coordinates;        }    }}</code></pre>","185022","","","","","2010-11-29 22:43:29","Save object Android not working","<android><object><save><lifecycle>","1","4","","",""
"4301795","1","","","2010-11-29 07:53:59","1","414","<p>Hey,I am writing a small application that puts my phone (nexus one) tosleep and on a particular key press wake up the phone and  forward meto the default pattern lock screen. (writing this app since the powerbutton on my nexus one is not working)</p><p>Problem Faced:</p><p>I have a button in my activity that on click will set thescreenBrightness to 0.0. In my class i have also overridden theonTouchEvent,dispatchTouchEvent,dispatchKeyEvent since I want tocapture a particular key press and then set the screenBrightness to1.0 to wake up the phone. Ive also used flags</p><p>getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKEDgetWindow().addFlags(WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING);getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);</p><p>My broadcast receiver indicated to me that the screen has beenswitched off when i click the above mentioned button. After this Ikeep getting the exception</p><p>EXCEPTION :: No window to dispatch pointer action 0 and   No focuswindow, dropping: KeyEvent{action=1...</p><p>Is there something I am missing here in order for the activity whichis set to FLAG_SHOW_WHEN_LOCKED  to listen to key events when thephone is asleep. ?</p><p>Thanks</p>","523611","","","","","2010-11-29 07:53:59","How to capture KeyEvents when the phone is asleep?","<android><locking><sleep>","0","0","1","",""
"4301850","1","4301863","","2010-11-29 08:06:37","0","384","<p>I am new to live wallpapers. I have an animation for 2 seconds which will be looping as the live wallpaper. The problem which I face seems to be a very bad design. There are about 48 images and they are around 18 MB. Is it ok to create a simple animation using the images I have?</p>","421372","","","","","2012-10-11 03:38:51","Android live wallpapers","<android><animation>","1","0","1","",""
"4301856","1","","","2010-11-29 08:07:52","0","534","<p>I am getting  Can't update stat BROWSER_SNAP_CENTER  illegal argument exception in android .I am using webview in gesture detector and  activity group manager in android at the time of swipe I am getting error   Can't update stat BROWSER_SNAP_CENTER  illegal argument exception can any body tell what is the problem?</p><p>my code </p><pre><code>import java.util.ArrayList;import java.util.HashMap;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.text.Html;import android.text.Spanned;import android.util.Log;import android.view.GestureDetector;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.view.ViewGroup.LayoutParams;import android.webkit.WebView;import android.widget.LinearLayout;import android.widget.Toast;import android.view.GestureDetector;import android.view.MotionEvent;import android.view.View;import android.view.GestureDetector.OnDoubleTapListener;import android.view.View.OnClickListener;import android.view.View.OnTouchListener;public class ArticleDisplayActivity extends Activity  {    private static final String SOAP_ACTION = ""http://tempuri.org/QuestIPhoneWebService/QuestIPhoneWebService/getData"";     private static final String METHOD_NAME = ""getData"";     private static final String NAMESPACE =""http://tempuri.org/"";     private static String URL=""http://10.113.73.61/QUEST/QuestIPhoneWebService.asmx"";    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  gestureScanner;        String strUsername="""";    String strPassWord="""";    String questGroupId="""";    String articleid="""";    String userid="""";    String systemuserid="""";    String tableservicevalue="""";    String webservicevalue="""";    String checking="""";    ArrayList parsedValue=new ArrayList();    ArrayList articleDetailParsedValue=new ArrayList();    ArrayList articleParsedValue=new ArrayList();     LinearLayout mainlinear2;     public void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             setContentView(R.layout.articledisplay);             mainlinear2=(LinearLayout)findViewById(R.id.mainlinear2);            Bundle articleBundle=getIntent().getExtras();            strUsername=articleBundle.get(""strUserName"").toString();             strPassWord=articleBundle.get(""strPassWord"").toString();             questGroupId=articleBundle.get(""questGroupId"").toString();             userid=articleBundle.getString(""userid"").toString();             articleid=articleBundle.get(""articleid"").toString();             systemuserid=articleBundle.get(""systemuserid"").toString();             checking=articleBundle.get(""checking"").toString();             checking=""two"";             parsedValue=articleBundle.getStringArrayList(""parsedValue"");             articleParsedValue=articleBundle.getStringArrayList(""articleParsedValue"");             //parsedValue=articleBundle.get             //tableservicevalue=articleBundle.get(""tableservicevalue"").toString();             //webservicevalue=articleBundle.get(""webservicevalue"").toString();            WebService1  articledisplayservice=new WebService1();             //  String tableservicevalue=tableservice.callTableServer(SOAP_ACTION,"""",strUsername,strPassWord,questGroupId,URL);           String articledisplayservicevalue=articledisplayservice.articleDisplayServer(SOAP_ACTION, """", strUsername, strPassWord, articleid, systemuserid, URL);           //String articledisplayservicevalue=articledisplayservice.articleDisplayServer(SOAP_ACTION, """", strUsername, strPassWord,questGroupId, URL);         //articledisplayservicevalue=decodeXMLData(articledisplayservicevalue);         //System.out.println(""article web service decode value is""+articledisplayservicevalue);                  //Log.d(""article  webservice value decode value is "",articledisplayservicevalue);                 //articledisplayservicevalue=Html.            articledisplayservicevalue=unescapeXML(articledisplayservicevalue);        System.out.println(""article web service decode value is""+articledisplayservicevalue);                 // ArticleParser articleParser=new ArticleParser();                ArticleDetailParser articleDetailParser=new ArticleDetailParser();                  articleDetailParsedValue=articleDetailParser.parseXmlArticle(articledisplayservicevalue);            for(int i=0;i&lt;articleDetailParsedValue.size();i++)                {                       ArticleDetailDataset articleDetailDataset=(ArticleDetailDataset)articleDetailParsedValue.get(i);                            HashMap&lt;String, String&gt; mapValue=new HashMap&lt;String, String&gt;();                     //WebView webviewcontent=new WebView(this);                       MyWebView webviewcontent= new MyWebView(this);                              //WebView  webviewcontent=(WebView)findViewById(R.id.webview_compontent);                         webviewcontent.setId(i);                   //webviewcontent.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));                  String body=articleDetailDataset.getBody();                   System.out.println(""body1 is ""+body);                       //body=decodeXMLData(body);                    String html =""&lt;html&gt;&lt;body&gt;&lt;div&gt;&lt;label style=\""font:bold 17.5px verdana; color:#C1002B\""&gt;""+articleDetailDataset.getArticle_title()+""&lt;label style=\""font:13px verdana; color:#000000\""&gt;""+""|""+""&lt;/label&gt;""+""&lt;label style=\""font:bold 13px verdana; color:#000000\""&gt;""+articleDetailDataset.getArticle_type()+""&lt;/label&gt;&lt;br&gt;&lt;label style=\""font:13px verdana; color:#AAAAAA\""&gt; &lt;/label&gt; &lt;/div&gt;"";                   html=html+""&lt;div&gt;&lt;label style=\""font:13px verdana; color:#000000\""&gt;""+body+""&lt;/label&gt;&lt;/div&gt;"";                   html=html+""&lt;div&gt;&lt;label style=\""font:13px verdana; color:#000000\""&gt;""+articleDetailDataset.getArticle_summary()+""&lt;/label&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;"" ;                   webviewcontent.getSettings().setJavaScriptEnabled(true);                   webviewcontent.clearCache(true);                   //webviewcontent.loadData(html, ""text/html"", ""utf-8"");                   webviewcontent.loadDataWithBaseURL(null, html, ""text/html"", ""UTF-8"", null);                  //webviewcontent.setOnTouchListener( this);                    mainlinear2.addView(webviewcontent);                }           }        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();          }     public  String decodeXMLData(String s)     {           /*s = replace(s,""&amp;gt;"",""&gt;"", 0);             s = replace(s,""&amp;lt;"",""&lt;"", 0);             s=replace(s,""&amp;amp;"",""&amp;"",0);             s=replace(s,""&amp;quot;"",""\"""",0);             s=replace(s,""&amp;nbsp;"","" "",0);             s=replace(s,""&amp;apos;"",""'"",0);           */             /*s=replace(s,""&amp;amp;lt;"",""&lt;"",0);             s=replace(s,""&amp;amp;quot;"",""\"""",0);             s=replace(s,""&amp;amp;gt;"",""&gt;"",0);             s=replace(s,""&amp;amp;amp;"",""&amp;"",0);             */             s=replace(s,""&amp;amp;lt;"",""&lt;"",0);             s=replace(s,""&amp;amp;quot;"",""\"""",0);             s=replace(s,""&amp;amp;gt;"",""&gt;"",0);             s=replace(s,""&amp;amp;amp;"",""&amp;"",0);             s=replace(s,""&amp;lt;"",""&lt;"", 0);             s=replace(s,""&amp;gt;"",""&gt;"", 0);             s=replace(s,""&amp;lt;a href"",""&amp;"", 0);             s=replace(s,""/a&amp;gt"",""&amp;"",0);             s=replace(s,""&amp;amp;"",""&amp;"",0);             s=replace(s,""&amp;quot;"",""\"""",0);             s=replace(s,""&amp;nbsp;"","" "",0);             s=replace(s,""&amp;apos;"",""'"",0);            /* s=replace(s,""&amp;lt;span"",""&lt;span"",0);             s=replace(s,""&amp;lt;/span&amp;gt;&amp;amp;"",""&lt;/span&gt;"",0);             s=replace(s,""&amp;lt;p"",""&lt;p"",0);             s=replace(s,""&amp;lt;/p&amp;gt;"",""&lt;/p&gt;"",0);             */       /*  s = replace(s,""&amp;gt;"",""&gt;"", 0);         s = replace(s,""&amp;lt;"",""&lt;"", 0);         s=replace(s,""&amp;amp;"",""&amp;"",0);         s=replace(s,""&amp;quot;"",""\"""",0);         s=replace(s,""&amp;nbsp;"","" "",0);         s=replace(s,""&amp;apos;"",""'"",0);         s=replace(s,""&amp;lt;span"",""&lt;span&gt;"",0);         s=replace(s,""&amp;lt;/span"",""&lt;/span&gt;"",0);         s=replace(s,""&amp;lt;p span"",""&lt;p span&gt;"",0);         s=replace(s,""&amp;lt;/p"",""&lt;/p&gt;"",0);         s=replace(s,""lt;"",""&lt;"",0);         s=replace(s,""gt;"",""&gt;"",0);*/         return s;        /* s = replace(s,""&amp;gt;"",""&gt;"", 0);         s = replace(s,""&amp;lt;"",""&lt;"", 0);          s=replace(s,""&amp;amp;"",""&amp;"",0);          s=replace(s,""&amp;quot;"",""\"""",0);          s=replace(s,""&amp;nbsp;"","" "",0);          s=replace(s,""&amp;apos;"",""'"",0);         return s;*/     }      public  String replace(String source, String search, String replace,int n) {       while (true) {             n = source.indexOf(search, n);             System.out.println(""n is ""+n);             if (n == -1) {                   break;             }           source = source.substring(0, n) + replace                         + source.substring(n + search.length(), source.length());           //System.out.println(""source is""+source);             n += replace.length();       }       return source;    }    class MyWebView extends WebView {          Context context;          GestureDetector gd;         public MyWebView(Context context) {         super(context);         this.context = context;              gd = new GestureDetector(context, sogl);         }         @Override         public boolean onTouchEvent(MotionEvent event) {         return gd.onTouchEvent(event);         }          GestureDetector.SimpleOnGestureListener sogl = new GestureDetector.SimpleOnGestureListener() {           public boolean onDown(MotionEvent event) {            return true;           }           public boolean onFling(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) {            if (event1.getRawX() &gt; event2.getRawX()) {               Intent newIntent=new Intent(context,HomeActivity.class);                newIntent.putExtra(""strUserName"", strUsername);                newIntent.putExtra(""strPassWord"",strPassWord);                newIntent.putExtra(""questGroupId"",questGroupId);                newIntent.putExtra(""userid"", userid);                newIntent.putExtra(""systemuserid"", ""systemuserid"");                newIntent.putExtra(""checking"", checking);                //newIntent.putExtra(""tableservicevalue"", tableservicevalue);                //newIntent.putExtra(""webservicevalue"", webservicevalue);                newIntent.putStringArrayListExtra(""parsedValue"", parsedValue);                newIntent.putStringArrayListExtra(""articleParsedValue"",articleParsedValue);                newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                View view = HomeActivityGroup.group.getLocalActivityManager().startActivity(""Homeactivity"",newIntent).getDecorView();                setContentView(view);           }            else {               Intent newIntent=new Intent(context,HomeActivity.class);               newIntent.putExtra(""strUserName"", strUsername);                newIntent.putExtra(""strPassWord"",strPassWord);                newIntent.putExtra(""questGroupId"",questGroupId);                newIntent.putExtra(""userid"", userid);                newIntent.putExtra(""systemuserid"", systemuserid);                //newIntent.putExtra(""tableservicevalue"", tableservicevalue);                //newIntent.putExtra(""webservicevalue"", webservicevalue);                    newIntent.putExtra(""checking"", checking);                newIntent.putStringArrayListExtra(""parsedValue"", parsedValue);                newIntent.putStringArrayListExtra(""articleParsedValue"",articleParsedValue);               newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);      View view = HomeActivityGroup.group.getLocalActivityManager().startActivity(""Homeactivity"",newIntent).getDecorView();                setContentView(view);             }         return true;           }          };         }     }</code></pre>","426344","","","","","2010-11-29 08:07:52","Can't update stat BROWSER_SNAP_CENTER illegal argument exception in android","<android>","0","2","","",""
"4301903","1","","","2010-11-29 08:15:54","3","876","<p>I've been trying to use Monkey to stress test the UI of my application.</p><p>What I've noticed is that the random key strokes are not able to traverse all the Activities of my application. It instead just keeps looping between a few of them.</p><p>Is there any strategy which you guys use to help Monkey traverse all the Activities?</p>","80303","","","","","2010-11-29 08:30:10","Android UI testing: Monkey stuck in just a couple of Activities","<android><testing><monkey>","1","1","1","",""
"4301959","1","4302655","","2010-11-29 08:25:14","2","6787","<p>I my project I have a class that in this class I want to have access to properties of a picture. But I don't want to show it through this class. In this class I just want to know width and height of image and do some mathematical functions to return something.</p><p>My problem is that I don't know how should I address this picture. My picture is in drawable folder. The code that I have written is, the problem is image = (ImageView)findViewById(R.id.imViewRaw); :</p><pre><code>import android.view.View;import android.widget.ImageView;public class Stego{    private ImageView image;    private int imWidth, imHeight;    public Stego()    {        // Instantiate an ImageView and define its properties        image = (ImageView)findViewById(R.id.imViewRaw);        image.setImageResource(R.drawable.tasnim);        imWidth  = image.getWidth();        imHeight = image.getHeight();    }    public int getImageWidth(){        return imWidth;    }    public int getImageHeight(){        return imHeight;    }    public int getMaxMessageChars(){        int i = imWidth * imHeight; //Number of Pixels        i *= 3; //Number of bytes. (Each pixel includes of three RGB bytes)        i /= 4; //Maximum number of characters to store in the picture        return i;    }}</code></pre>","513413","","","","","2010-11-29 10:07:19","android: Loading Image in a class","<android><image><class><load>","1","0","","",""
"4301960","1","4302344","","2010-11-29 08:25:24","0","1245","<p>I have a problem i cant resolve with EditText boxes in my views.If i preview any of my views in eclipse, the EditText boxes look fine in small and larger screens, and appear to scale as expected. But in small screens they appear larger in height on the screen. They appear to scale on the width ok, but grow in height, leaving more margin between the text and the border.</p><p>The xml is very small:</p><pre><code>&lt;EditText android:id=""@+id/width"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:hint=""Slab Width (mm)"" android:inputType=""phone""&gt;&lt;/EditText&gt;</code></pre><p>I would have expected the box to be scaled in height to suit the screen.I am surprised it does not scale in height.I am shocked it gets larger in physical height...????</p><p>Small screen: <a href=""http://www.doobox.co.uk/rapidimages/smallscreen.png"" rel=""nofollow"">http://www.doobox.co.uk/rapidimages/smallscreen.png</a></p><p>edit: Its actually QVGA &amp; WQVGA screens that have this problem..!</p><p>I think your going to need full xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayoutandroid:id=""@+id/widget36""android:background=""@drawable/linen_bg""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;LinearLayoutandroid:id=""@+id/main_linear""android:layout_width=""fill_parent""android:orientation=""vertical""android:layout_alignParentTop=""true""android:layout_alignParentLeft=""true""android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip"" android:layout_height=""wrap_content""&gt;&lt;ImageViewandroid:id=""@+id/logo""android:background=""@drawable/conc_logo""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""center_horizontal"" android:layout_marginTop=""15dip""&gt;&lt;/ImageView&gt;&lt;TextView android:text=""Slab Calculator"" android:id=""@+id/TextView01"" android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""center_horizontal""android:textSize=""20sp"" android:textColor=""#333333"" android:layout_marginTop=""20dip""&gt;&lt;/TextView&gt;&lt;EditText android:id=""@+id/length"" android:layout_width=""fill_parent"" android:inputType=""phone"" android:fitsSystemWindows=""true"" android:hint=""Height of Slab (mm)"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;TextView android:text=""**.** Cubic Meter's"" android:id=""@+id/slab_result"" android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:textSize=""20sp"" android:textColor=""#333333"" android:layout_marginTop=""5dip""&gt;&lt;/TextView&gt;&lt;TextView android:text=""£**.** Total"" android:id=""@+id/slab_cost"" android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:textSize=""20sp"" android:textColor=""#333333"" android:layout_marginTop=""5dip""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;RelativeLayout android:id=""@+id/bottom_container""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:padding=""20dip""android:layout_alignParentBottom=""true""android:layout_centerHorizontal=""true""&gt;&lt;Buttonandroid:id=""@+id/calculate_button""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_alignParentTop=""true""android:layout_alignParentRight=""true""android:drawableTop=""@drawable/calculate"" android:text=""Calculate"" android:background=""@android:color/transparent""&gt;&lt;/Button&gt;&lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","515080","","515080","","2010-11-29 09:08:42","2011-01-18 14:34:57","EditText boxes do not scale on small screens","<android>","2","5","","",""
"4301989","1","4302095","","2010-11-29 08:29:47","0","398","<p>hii i want to create a ui in which as i select a radio button there should come a textview.when that button is not selected text view should not be visible. and as button got selected it should be visible..can i implement this??</p>","450601","","","","","2010-11-29 09:23:17","Bring a view on selecting one view","<android>","3","0","","",""
"4302060","1","5303413","","2010-11-29 08:40:50","2","2031","<p>I'm trying to make work a self-updating functionality in an Android widget, something simple as changing two TextViews of it every 10 seconds. The ideal solution would be to make it similar to the genie widget (news &amp; weather). And so far, it works okay: it updates every 10 seconds via Handler.postDelayed's Runnable.</p><pre><code>Runnable updateWidgetText = new Runnable(){    @Override    public void run() {        if (screenEnabled) {            AppWidgetManager gm = AppWidgetManager.getInstance(ctx);                                    ComponentName thisWidget = new ComponentName(ctx,AnimeUndergroundWidget.class);                     int index = (int)(REFRESH_COUNT % WIDGET_NEWS_TO_SHOW);            Noticia n = AUnder.single().getNoticiaByIndex(index);            if (n!=null)            {                last = n;                RemoteViews views = new RemoteViews(ctx.getPackageName(),R.layout.auwidget);                    views.setTextViewText(R.id.widget_textview, n.getTitulo());                views.setTextViewText(R.id.widget_textototal, n.getTexto().replace(""\n"", """"));                  Intent clickintent = new Intent(INTENT_GO_TO_NEW);                PendingIntent pendingIntentClick = PendingIntent.getBroadcast(ctx, 0, clickintent, 0);                views.setOnClickPendingIntent(R.id.widget_fondo_titulo, pendingIntentClick);                Intent click2intent = new Intent(INTENT_GO_TO_NEW);                PendingIntent pendingIntentClick2 = PendingIntent.getBroadcast(ctx, 0, click2intent, 0);                views.setOnClickPendingIntent(R.id.widget_fondo_Texto, pendingIntentClick2);                gm.updateAppWidget(thisWidget, views);            }            REFRESH_COUNT++;        }        handler.removeCallbacks(this);        handler.postDelayed(this, WIDGET_REFRESH_TIME*1000);    }   };  </code></pre><p>The runnable is initially launched in the onUpdate method of my Widget class:</p><pre><code>    @Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    ctx = context;    context.startService(new Intent(context, UpdateWidgetService.class));       handler.postDelayed(updateWidgetText,WIDGET_REFRESH_TIME*1000);// here goes some more code, updating the views and refreshing click intents}</code></pre><p>I put this in case someone finds it useful. </p><p>But let me go straight to the point: when I get the phone out of sleep (turn on the screen), the widget goes crazy and starts changing the TextViews with a fastforward-like effect. I assume it is because there are some postDelayed events in queue, or may be in the updateAppWidget queue. I've already tried a workaround using the code shown in here: <a href=""http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/"" rel=""nofollow"">http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/</a> You can see it in the first snippet in my code, I check a boolean variable that has stored screen state to avoid using postDelayed when the screen is turned off. But that doesn't seem to fix it.</p><p>This problem is driving me crazy for one week now, so I ask out of despair: is there any way to do this properly? </p>","523664","","","","","2011-03-14 19:25:35","Self-updating every 10 seconds widget Handler.postDelayed problem","<android><android-widget><postdelayed>","1","1","","",""
"4302092","1","4303334","","2010-11-29 08:45:48","2","5760","<p>How can I reduce the size (height and width) of a DatePicker? Is there any built-in method available for this?</p>","523058","","523058","","2010-11-29 11:23:10","2012-10-16 10:56:46","Resizing of DatePicker in android","<android><datepicker>","2","0","1","",""
"4302168","1","","","2010-11-29 09:00:19","1","3595","<p>i have the folloing code :</p><pre><code>final Gallery g = (Gallery) findViewById(R.id.gallery);g.setAdapter(new ImageAdapter(this));g.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView parent, View v, int position, long id) {        final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();        Bitmap b = null;        b=BitmapFactory.decodeResource(getResources(),*********);        b.compress(CompressFormat.PNG, 0, outputStream);           AlertDialog.Builder builder = new AlertDialog.Builder(Edit.this);        builder.setTitle(""Comfirm"");        builder.setMessage(""Do you want to choose this picture?"");        builder.setPositiveButton(""Continue"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int which) {                                          image = outputStream.toByteArray();                     }                                      });</code></pre><p>As you see <code>*****</code> needs to be a int like <code>android.R.drawble.icon</code>. I want to store the picture when users clicks on the picture. How can I get the picture when the user clicks it?</p>","510992","","1544250","","2012-04-16 09:19:31","2013-08-25 12:48:06","store image in sqlite","<android><android-gallery>","2","0","1","",""
"4302208","1","4302946","","2010-11-29 09:05:18","0","425","<pre><code>public String[] getdata()    {        try           {            myDB = this.openOrCreateDatabase(""Task"", MODE_PRIVATE, null);            Cursor c=myDB.rawQuery(""SELECT * from ""+TableName+"";"",null);            c.moveToFirst();            for(int i=0;i&lt;c.getCount();++i)            {                 String str0=c.getString(0);             System.out.println(str0);                 arr[i]=str0;                c.moveToNext();            }               }           catch(Exception e)           {               e.printStackTrace();           }           finally           {               myDB.close();           }           return arr;    }</code></pre><p>this is my function whats wrong in it ..it is showing the apllication has stopped unexpectedly please help.. err is</p><pre><code>11-29 14:47:07.443: WARN/SQLiteDirectCursorDriver(716): Found SQL string that ends in ; -- SELECT * from Task;11-29 14:47:07.453: INFO/System.out(716): ghgf11-29 14:47:07.453: INFO/System.out(716): ghgf11-29 14:47:07.453: INFO/System.out(716): ghgf11-29 14:47:07.463: INFO/System.out(716): ghgf11-29 14:47:07.463: INFO/System.out(716): ghgf11-29 14:47:07.744: DEBUG/AndroidRuntime(716): Shutting down VM11-29 14:47:07.744: WARN/dalvikvm(716): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)11-29 14:47:07.754: ERROR/AndroidRuntime(716): Uncaught handler: thread main exiting due to uncaught exception11-29 14:47:07.773: ERROR/AndroidRuntime(716): java.lang.NullPointerException11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.AbsListView.obtainView(AbsListView.java:1273)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ListView.makeAndAddView(ListView.java:1658)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ListView.fillDown(ListView.java:637)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ListView.fillFromTop(ListView.java:694)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ListView.layoutChildren(ListView.java:1516)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.AbsListView.onLayout(AbsListView.java:1112)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.View.layout(View.java:6569)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.View.layout(View.java:6569)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.View.layout(View.java:6569)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.View.layout(View.java:6569)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.ViewRoot.performTraversals(ViewRoot.java:979)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.os.Handler.dispatchMessage(Handler.java:99)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.os.Looper.loop(Looper.java:123)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.app.ActivityThread.main(ActivityThread.java:4203)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at java.lang.reflect.Method.invokeNative(Native Method)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at java.lang.reflect.Method.invoke(Method.java:521)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at dalvik.system.NativeStart.main(Native Method)11-29 14:47:07.793: INFO/Process(63): Sending signal. PID: 716 SIG: 3</code></pre>","510553","","418183","","2010-11-29 09:45:47","2012-06-18 10:06:45","data from Database access error in android","<android>","2","6","","",""
"4302209","1","4302421","","2010-11-29 09:05:20","4","12937","<p>I am just making an operation with Calendar Content Provider, now I am failing at the point to display events for the particular date. </p><p>I know the Events URI for the &lt; 2.1 version and 2.2 version, as below:</p><pre><code>eventsUri = Uri.parse(""content://calendar/events"");    // &lt; Android 2.1 versioneventsUri = Uri.parse(""content://com.android.calendar/events"");  // For Android Froyo 2.2 and later version</code></pre><p>My doubts are:</p><ol><li>How do I Fetch all the events? </li><li>How do I fetch events for the particular date?</li></ol><p>So please, somebody with knowledge about the Calendar please help me and share your knowledge regarding this.</p><p>Thanx</p>","379693","","1167780","","2012-02-27 16:57:55","2013-11-28 05:26:12","Android Calendar Events","<android><calendar>","2","0","1","",""
"4302210","1","","","2010-11-29 09:05:47","1","552","<p>I am getting following error while building the project with ANT INSTALL command</p><hr><p>BUILD FAILED</p><p>Target ""INSTALL"" does not exist in the project ""debug"".</p><hr><p>Please inform if anything else is needed...</p><p>Thanks</p><p>here is the build.xml:</p><p>/*</p>                                                                            [This is typically used for code obfuscation.     Compiled code location: ${out.classes.absolute.dir}     If this is not done in place, override ${out.dex.input.absolute.dir}]        --><pre><code>&lt;!-- Execute the Android Setup task that will setup some properties     specific to the target, and import the build rules files.     The rules file is imported from        &lt;SDK&gt;/platforms/&lt;target_platform&gt;/ant/ant_rules_r#.xml     To customize existing targets, there are two options:     - Customize only one target:         - copy/paste the target into this file, *before* the           &lt;setup&gt; task.         - customize it to your needs.     - Customize the whole script.         - copy/paste the content of the rules files (minus the top node)           into this file, *after* the &lt;setup&gt; task         - disable the import of the rules by changing the setup task           below to &lt;setup import=""false"" /&gt;.          - customize to your needs.--&gt;&lt;setup /&gt;</code></pre><p>*/</p>","515791","","515791","","2010-11-29 10:16:53","2012-07-24 13:52:47","build failed: while using ant","<android>","1","2","","",""
"4302222","1","4305783","","2010-11-29 09:07:59","1","692","<p>How do I use <a href=""http://bouncycastle.org/java.html"" rel=""nofollow"">bouncy castle</a> encryption and decryption?</p>","1746300","","75204","","2010-11-29 16:29:34","2010-11-29 16:31:11","Legion of the Bouncy Castle","<android><blackberry><bouncycastle>","1","0","","",""
"4302279","1","4303876","","2010-11-29 09:16:53","5","2249","<p>I am using a contact picker as follows:</p><pre><code>Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,                                        Contacts.CONTENT_URI);startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT)</code></pre><p>What I want to know is whether the last path segment of the returned URI is the <code>CONTACT_ID</code> or the <code>RAW_CONTACT_ID</code>.</p><p>In case it is the <code>CONTACT_ID</code>, how do I retrieve all <code>RAW_CONTACT_ID</code>s from this contact?</p>","513267","","283078","","2012-12-17 20:21:19","2013-06-23 13:51:49","Android Contacts RAW_CONTACT_ID vs CONTACT_ID","<android><contacts>","2","0","2","",""
"4302286","1","4311238","","2010-11-29 09:18:05","3","3810","<p>I'm writing an application with an ""online mode"", that is, data is downloaded, parsed and inserted into a SQLite database as needed. All this is performed by a service. The app consists of several activities that ask the service for a data update (different data depending on the activity).</p><p>When the user navigates through the activities (without waiting for the service to finish), it's very easy to get SQLiteExceptions (message: <strong>database is locked</strong>).</p><p>I thought about using <strong>synchronized</strong> blocks, but that would force the user to wait while loading a new activity (that needs database access to load) while the service finishes updating. So that seems a dead end.</p><p>Another option might be to <strong>stop the update</strong> when in the onStop method of each activity. Of course, the update will be interrupted, but that's not a big issue. Problem with this is that I'm not sure how to approach it.</p><p>My question is, how can/should I handle this?</p>","279363","","","","","2010-11-30 06:50:47","Android simultaneous db operations -- ""database is locked""","<android><database><simultaneous>","1","0","","",""
"4302304","1","4302388","","2010-11-29 09:21:00","1","2700","<p>Perhaps very simple, but not for me ;)</p><p>How do i change the Picture of a Framelayout in my sourcecode?</p><p>My first intention was:</p><pre><code>mBackgroundDrawable = getResources().getDrawable(R.drawable.picture);main.setBackgroundDrawable(mBackgroundDrawable);</code></pre><p>but there i only can add pictures from my ""RES/DRAWABLE-HDPI"" folder.I want to use my SD-Card as the destinated source.</p><p>Whats the right way?</p>","517198","","418183","","2010-11-29 10:05:41","2010-11-29 10:13:53","Set Background - Picture in Framelayout","<android><background><image>","1","0","","",""
"4302439","1","4302648","","2010-11-29 09:36:41","2","1022","<p>I made a AlertDialog which let users choose 1 of the 4 options I display.</p><p>The first 3 let's them directly call a number when they click it and the 4th one displays a different view.</p><p>This is how it looks right now:</p><p><img src=""http://i.stack.imgur.com/qlz23.png"" alt=""alt text""></p><p>As the 4th option purposes a different task I want to make it look different because users can get confused.</p><p>I thought of putting an 'call-icon' next to the first 3 option and an arrow next to the 4th option.</p><p>Now remains my question; <strong>how do I put an image next to the first 3 options?</strong></p><p>Here is the code that creates the dialog:</p><pre><code> public void AlarmMenu(){ final CharSequence[] items = {""Politie"", ""Ambulance"", ""Brandweer"", ""Tips                                   &gt;""}; AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setItems(items, new DialogInterface.OnClickListener() {     public void onClick(DialogInterface dialog, int item) {            switch (item){                case 0:                    break;                case 1:                    break;                case 2:                    break;                case 3:                 break;            }     } }); AlertDialog alert = builder.create(); alert.show();}</code></pre>","517460","","418183","","2010-11-29 10:04:24","2010-11-29 10:06:34","Adding Image to Custom AlertDialog","<java><android><dialog>","1","4","1","",""
"4302709","1","4538318","","2010-11-29 10:14:11","2","7346","<p>I am trying to do the following from a live wallpaper tutorial I found <a href=""http://blog.androgames.net/58/android-live-wallpaper-tutorial/"" rel=""nofollow"">here</a>.</p><pre><code>/** * Do the actual drawing stuff */private void doDraw(Canvas canvas) {    Bitmap b = BitmapFactory.decodeResource(context.getResources(), IMAGES[current]);    canvas.drawColor(Color.BLACK);    canvas.drawBitmap(b, 0, 0, null);    Log.d(TAG, ""Drawing finished."");}/** * Update the animation, sprites or whatever. * If there is nothing to animate set the wait * attribute of the thread to true */private void updatePhysics() {    // if nothing was updated :    // this.wait = true;    if(previousTime - System.currentTimeMillis() &gt;= 41) { //24 FPS        current = current &lt; IMAGES.length ? current++ : 0;    }    Log.d(TAG, ""Updated physics."");}</code></pre><p>But it doesn't seem to work. What  am I doing wrong. The ""Drawing finished."" and ""Updated physics."" messages are getting printed. But I see the first image only. I'm testing it on the emulator.</p><p>Any help would be appreciated. Thanks</p>","421372","","19750","","2011-08-31 14:25:14","2013-08-28 10:10:39","Live Wallpaper Tutorial","<android><graphics><canvas><sprite><live-wallpaper>","2","2","6","",""
"4302717","1","4302750","","2010-11-29 10:14:51","0","1633","<p>I am newbie in creating android app. I have created a database using SQLite and a simple login layout using eclipse. Now I want to connect my login page and the database I created so that when the user enters his/her username and password it will then open the main menu of the application. I am hoping for someone who could help me on how to do this. Thanks in advance. </p>","516160","","","","","2010-11-29 11:48:08","How to connect database and login layout in Android?","<android><database><eclipse><sqlite><login>","2","0","","",""
"4302736","1","4303454","","2010-11-29 10:16:45","0","606","<p>I am confused in changing the background colour of a particular row in an list view, below is the code I tried. Different rows gets highlighted as i scroll the list, I could like to understand the reason behind this. The logic seems to quite simple, but the results are unpredictable. How am I supposed to achieve this.  </p><pre><code> @Override     public View getView(int position, View convertView, ViewGroup parent) {      ViewHolder holder;      if (convertView == null) {             convertView = mInflater.inflate(R.layout.rows_for_layout, null);             holder = new ViewHolder();              holder.name = (TextView)convertView.findViewById(R.id.name);             holder.rated=(ImageView)convertView.findViewById(R.id.rated);              convertView.setTag(holder);               }else {              holder = (ViewHolder) convertView.getTag();            }           //selected_position is the position where the list has to be highlighted              if(position==selected_position){              holder.name.setText(elements.get(position).get(""name""));            convertView.setBackgroundResource(R.drawable.highlight_this);            holder.rated.setBackgroundResource(R.drawable.star_image);             }else{               holder.name.setText(elements.get(position).get(""name""));             }      return convertView;     }//getView ![alt text][1]</code></pre>","286044","","286044","","2010-11-29 11:16:29","2010-11-29 11:55:06","Difficulty in changing the background color of a particular row in an Android Custom ListView","<android><listview><colors><background>","1","3","","",""
"4302778","1","4302854","","2010-11-29 10:23:00","4","9027","<p>I am trying to create a method to retrieve the max id of a specific table.</p><p>This is the code that doesn't work:</p><pre><code>private long getMaxId(){    String query = ""SELECT MAX(id) AS max_id FROM mytable"";    Cursor cursor = db.rawQuery(query, new String[] {""max_id""});    int id = 0;         if (cursor.moveToFirst())    {        do        {                       id = cursor.getInt(0);                          } while(cursor.moveToNext());               }    return id;}</code></pre><p>The exception being thrown is this:</p><pre><code>E/AndroidRuntime(24624): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x200408</code></pre><p>I suppose the problem is this line:</p><pre><code>            id = cursor.getInt(0); </code></pre><p>Does anybody have an idea of how to fix this?</p><p>Thanks.</p>","354742","","","","","2010-11-29 10:31:18","Android and SQLite - retrieve max id of a table","<android><sqlite>","1","0","2","",""
"4302813","1","","","2010-11-29 10:26:58","0","692","<p>how to run dmtracedump in android.what is the exact command to run it in linux.</p>","366916","","","","","2010-11-29 23:16:45","Android-Command to run dmtracedump","<android>","1","0","","",""
"4302840","1","4304560","","2010-11-29 10:29:51","0","639","<p>I use twitter4j on my Android 1.6 phone to request user related data such as all new direct messages or follower ids. It works fine if I only request trends or other user <strong>unrelated</strong> information (trends for example) but if I try to query information such as the follower ids or new direct messages twitter4j throws an TwitterException with the following cause </p><pre><code>java.io.FileNotFoundException: http://api.twitter.com/1/direct_messages.json</code></pre><p>I create an instance of twitter with the following code:</p><pre><code>TwitterFactory twitterFax = new TwitterFactory();twitterInstance = twitterFax.getInstance(USERNAME, USER_PASSWORD);</code></pre><p>The exception throws here:</p><pre><code>try {     ResponseList&lt;DirectMessage&gt; directMessages = twitterInstance.getDirectMessages();     if(directMessages.size() &gt; 0){        publishProgress(directMessages.toArray());     }} catch (TwitterException e) {    // TODO Auto-generated catch block    e.printStackTrace();}</code></pre><p>Why does it not work?</p>","504648","","104117","","2010-11-29 15:12:29","2010-11-29 15:12:29","Twitter4j Android FileNotFoundException by executing ""getFollowersIDs"" or ""getDirectMessages""","<android><basic-authentication><filenotfoundexception><twitter4j>","1","0","","",""
"4302869","1","4305503","","2010-11-29 10:32:54","0","301","<p>I want to know how to convert jpeg files to svg files in android?Thank you in advance. Or can I convert pdf into svg format?</p>","493244","","241475","","2010-11-29 10:42:43","2010-11-29 15:59:46","conversion of jpeg to svg in android","<android>","1","0","","",""
"4302912","1","4303028","","2010-11-29 10:39:15","9","8410","<p>Is there a way to set the timeout value in WebView?I want the WebView to be timeouted if the url is too slow to response. </p>","430926","","","","","2012-01-07 03:39:22","Android WebView TimeOut","<android><android-webview>","1","1","1","",""
"4303064","1","","","2010-11-29 10:57:31","0","366","<p>I am trying to use the help example of ProgressDialog.show(Context, message, message, boolean).Target Android 2.1 level 7 and using Eclipse.The code is refused with message that new View.onClickListener is the first parameter.I cant find any reference or example of this form in the Android developer help or by googling.  Can anyone help please?Ron</p>","479505","","","","","2010-11-29 11:18:59","android ProgressDialog - needs onClickListener?","<android>","1","0","","",""
"4303070","1","4303773","","2010-11-29 10:58:00","0","448","<p>I have an Android application in the market which connects and send POST and GET queries to a REST API, and then stores the results in a DB which are then queries and displayed in an appropriate manner in the application.</p><p>I'm interested in speeding up the application and have noticed quite a lot of lag between the time of receiving the data back from the api and the data being ready to use.  I'd like to investigate if and how I can write similar code in c++ using the NDK to connect to the REST API, process the results and store in a DB or raise an error.  I've no previous c++ experience and need to know firstly if I can access the same DB in the C++ as the Java, secondly if there are any other caveats which I should be aware of? </p><p>Also I guess I should ask - is it worth doing this?  Will I notice any difference?  </p><p>Any links to similar code, or an overview of where I should look to get started in c++ would be greatly appreciated.</p>","264276","","264276","","2010-11-29 11:11:35","2010-11-29 12:39:50","Porting REST API connection code to Android NDK in c++","<c++><android><rest><android-ndk>","1","0","","",""
"4303084","1","","","2010-11-29 11:00:16","1","3685","<p>I have a web application that has to be run on Android. </p><p>There are images on the web page that have <code>onClick</code> event listener(javascript).<br>For some reason, the <code>onClick</code> event works only after <strong>A LOT</strong> of touches on the image. </p><p>Does anyone know how to fix this problem?</p>","523810","","507810","","2012-06-19 17:15:37","2012-06-19 17:15:37","android browser javascript onclick event not receiving callbacks","<javascript><android><javascript-events>","1","0","","",""
"4303127","1","","","2010-11-29 11:04:18","0","319","<p>Currently <a href=""http://appinventor.googlelabs.com"" rel=""nofollow"">App Inventor</a> doesn't have the functionality to disable a specific orientation for a particular app. Some apps behave better in one specific orientation, maybe a quiz show would look better on vertical orientation.</p><p>Is there a specific set of values for OrientationChanged function for us to know that the app layout changed to a different orientation so that we can notify the users (say throw a page with a label on it) that this app can only be used in this (Horizontal/Vertical) orientation?</p>","37740","","","","","2010-11-29 11:27:05","Detecting Orientation","<android><app-inventor>","1","0","","",""
"4303160","1","4303608","","2010-11-29 11:08:12","20","7151","<p>This seems like a trivial problem, but is has me kind of stumped. I want to load an HTML string using Html.fromHtml(), and have any links in the string to be clickable and open in the browser.</p><p>Basic example:</p><pre><code>textView.setText(Html.fromHtml(""&lt;a href=\""http://www.google.com\""&gt;This is a link&lt;/a&gt;""));</code></pre><p>With this snippet, the text is formatted as if it were a link (blue, underlined), but it's not clickable. I tried Linkify, but it only seems to work with links that are not HTML-based.</p><p>Any suggestions?</p>","184844","","","","","2013-06-05 19:21:43","How can I make links in fromHTML clickable? (Android)","<html><android><links>","4","0","11","",""
"4303278","1","4308013","","2010-11-29 11:26:23","3","2384","<p>i set backgroud image to relativelayout and add some text in that layer. now i want to save the image into bitmap.so give me idea about this?.</p><p>Thanks..</p>","233044","","473070","","2010-11-29 11:33:44","2010-11-29 20:55:08","Relative layout to Bitmap image convetion","<android><bitmap><android-layout>","1","0","2","",""
"4303375","1","5191228","","2010-11-29 11:43:17","0","1887","<p>I am trying to sending mail by using following code. I want to make my title and text bold, I use HTML tag but its dot working, can any one help? I also want to make b date at the center of screen in body.</p><pre><code>Intent msg = new Intent(Intent.ACTION_SEND);String[] address = new String[] { """" };msg.putExtra(Intent.EXTRA_EMAIL, address);String subject = """";        subject = ""iVillage: ""+storyTitle;msg.putExtra(Intent.EXTRA_SUBJECT, subject);// This next line puts in the body of the messageString[] Content = new String[] { ""HEllo There"" };msg.setType(""text/html"");msg.putExtra(Intent.EXTRA_TEXT, ""&lt;b&gt;&lt;i&gt;""+storyTitle+"" \n\n ""+storyPubDate+""&lt;/b&gt;&lt;/i&gt; \n\n""+storyURL+""\n\n...\nSent From from Android"");startActivity(msg);</code></pre>","486139","","243245","","2010-11-29 11:47:55","2011-09-28 06:05:40","How to use HTML tag in Email Body in android or to bold Title of body?","<android><email>","2","0","","",""
"4303433","1","","","2010-11-29 11:51:33","0","946","<p>In my application I have a layout with 3 image views with different heights (apple, wine, fish), bottom aligned. The layout height is constant. This layout looks good on hdpi screens, but I want to use the same images on mdpi. The problem is that on mdpi some of the image views might be down scaled and the proportion between the image views won't be the same. So, if the wine is down scaled, the apple might be tall as the wine bottle. What is the best way to avoid this? I thought about setting the same height for the images (the largest height), at run time. Then, they will all be scaled, and the proportion will be kept. Is this posible. I hope this is clear. Thank you.</p>","460611","","","","","2010-11-29 17:04:28","Keep sizes proportion between image views for different screens","<android>","1","0","1","",""
"4303524","1","","","2010-11-29 12:06:03","1","93","<p>I have a problem on running my app but i cant find out where is the problem! I have created a first screen that has two buttons. This ""home"" screen is chordsApp.java. I want to go to the track1.java if I press the first button and to track2.java if I press the second! The program runs but when I'm trying to press the first or the second button it pops up an error and tells me to force down!! Here is the code:</p><p><strong>ChordApp.java</strong></p><pre><code>package com.example.ChordsApp;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;public class ChordsApp 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.button);        next.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                Intent myIntent = new Intent(view.getContext(), track1.class);                startActivityForResult(myIntent,0);            }        });        Button next1 = (Button) findViewById(R.id.button1);        next1.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                Intent myIntent = new Intent(view.getContext(), track2.class);                startActivityForResult(myIntent, 0);            }        });    }}</code></pre><p><strong>track1.java</strong></p><pre><code>package com.example.ChordsApp;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;public class track1 extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main2);        Button next = (Button) findViewById(R.id.button3);        next.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {                Intent intent = new Intent();                setResult(RESULT_OK, intent);                finish();           }       });    }}</code></pre><p><strong>track2.java</strong></p><pre><code>package com.example.ChordsApp;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;public class track2 extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main3);        Button next1 = (Button) findViewById(R.id.button4);        next1.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {                Intent intent = new Intent();                setResult(RESULT_OK, intent);                finish();           }       });    }}</code></pre><p><strong>main.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;LinearLayout         xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;        &lt;ImageView             android:id=""@+id/pic""            android:adjustViewBounds=""true""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:src=""@drawable/guitar""            android:layout_gravity=""center""       /&gt;        &lt;TextView              android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:text=""@string/hello""            /&gt;      &lt;LinearLayout       android:orientation=""vertical""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""center_horizontal"" &gt;            &lt;Button                android:text=""track1""                android:id=""@+id/button""                android:layout_width=""250px""                android:textSize=""18px""                android:layout_height=""55px"" /&gt;           &lt;Button                 android:text=""track2""                android:id=""@+id/button1""                android:layout_width=""250px""                android:textSize=""18px""                android:layout_height=""55px"" /&gt;     &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>main2.xml</strong></p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextViewandroid:layout_width=""fill_parent""android:layout_height=""fill_parent""android:text=""hi""/&gt;&lt;Button android:text=""Home""    android:id=""@+id/button3""    android:layout_width=""250px""        android:textSize=""18px""    android:layout_height=""55px""    android:layout_gravity=""center_horizontal""    &gt;    &lt;/Button&gt;  &lt;/LinearLayout&gt;</code></pre><p><strong>main3.xml</strong></p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextViewandroid:layout_width=""fill_parent""android:layout_height=""fill_parent""android:text=""hi""/&gt;&lt;Button android:text=""Home""    android:id=""@+id/button4""    android:layout_width=""250px""        android:textSize=""18px""    android:layout_height=""55px""    android:layout_gravity=""center_horizontal""    &gt; &lt;/Button&gt;  &lt;/LinearLayout&gt;</code></pre>","519526","","321697","","2010-12-03 15:20:37","2010-12-03 15:20:37","force down error in app","<android><android-widget>","0","2","","",""
"4303525","1","4314358","","2010-11-29 12:06:22","1","1995","<p>I have a button that must show a popup window. And the popup window must be aligned with the right side of the button. That's how I do it.</p><pre><code>button.setOnClickListener( new View.OnClickListener() {    @Override    public void onClick( final View view ) {        if(popup == null) {            final View view = getLayoutInflater().inflate(R.layout.popup, null);            popup = new PopupWindow(view);        }        if(popup.isShowing()) {            popup.dismiss();        } else {            popup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);            popup.setFocusable(true);            popup.setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT,                ViewGroup.LayoutParams.WRAP_CONTENT);            popup.showAsDropDown(button, 0, 0);        }    }} );</code></pre><p>This code works fine but the popup window is aligned with the left side of the button. Is there an easy way to change gravity of PopupWindow?</p>","170842","","","","","2011-02-23 15:19:08","Change gravity of PopupWindow","<android><popupwindow><gravity>","2","0","3","",""
"4303568","1","4304122","","2010-11-29 12:11:28","3","214","<p>I can't decide where I should take my android coding problems online. There's stackoverflow, but only specific questions seem appropriate whereas I'm really <strong>looking for somewhere to get mentoring and where there are patient people happy to take the time to actually look through your code and help you identify problems.</strong></p><p>Many forums that seemed like likely subjects look pretty inactive to me or seem to have a ratio of one expert to hundreds of newbies.</p><p>So what would you recommend? I'm open to non-android specific sites too (of which their are many I know) if you think they would have what i'm looking for. And any other invlauable resource sites too.</p><p>Hope this kind of question is appropriate for stackoverflow, If not, apologies!</p>","523874","","523874","","2010-11-29 13:58:46","2011-09-28 19:29:10","What's the best site to get thorough help with android app development?","<android><forum>","3","2","","",""
"4303609","1","","","2010-11-29 12:16:47","1","1053","<p>I tried to write a simple google map application to display simple map but doesn't give me any output.</p><p>I pasted my code below:</p><h2>AnroidManifest.xml</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""org.HelloGoogleMaps""      android:versionCode=""1""      android:versionName=""1.0""&gt;&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;        &lt;activity android:name="".HelloGoogleMaps""                  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>My layout file is:</p><h2>map.xml</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;  &lt;com.google.android.maps.MapView    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/mapview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:clickable=""true""    android:apiKey=""0Z1oyeAgSpj4FSEtenPqiL7RsCXA_pVPQhvtpdA""/&gt;&lt;/LinearLayout&gt;</code></pre><p>And my java class file is:</p><h2>HelloGoogleMaps.java</h2><pre><code>package org.HelloGoogleMaps;import com.google.android.maps.MapView;import android.app.Activity;import android.os.Bundle;public class HelloGoogleMaps extends Activity {      @Override      public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.map);        MapView mapView = (MapView) findViewById(R.id.mapview);        mapView.setBuiltInZoomControls(true);    }    protected boolean isRouteDisplayed() {     return false;    }}</code></pre>","274097","","78845","","2011-06-11 22:04:21","2013-10-04 06:06:40","How do I display a Simple Google Map in my emulator in android?","<java><android><google-maps>","1","1","","",""
"4303632","1","4303651","","2010-11-29 12:21:32","1","789","<p>abcd+xyz</p><p>i want to split the string and get left and right components with respect to ""+""</p><p>that is i need to get abcd and xyz seperatly.I tried the below code.</p><pre><code>String org  = ""abcd+xyz"";   String splits[] = org.split(""+"");</code></pre><p>But i am getting null value for splits[0] and splits[1]...</p><p>Please help..</p>","450487","","105224","","2010-11-29 12:26:49","2012-03-24 21:30:31","Split the string","<java><android><string>","4","0","1","",""
"4303686","1","4326423","","2010-11-29 12:28:46","2","592","<p>i have a widget which needs to listen to BATTERY_CHANGED event, however, since this event is protected and cannot be declared from the manifest i create a new BroadcastReceiver from the Application constructor:</p><pre><code>public void onCreate() {    super.onCreate();    if (DEBUG) Log.d(TAG, ""onCreate()"");    // Register receivers            if (receiver == null) {        receiver = new MYReceiver(this);    }    // Create new intentfilter    IntentFilter intentFilter = new IntentFilter();    intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);    registerReceiver(receiver, intentFilter);}</code></pre><p>Then, from the Receiver i call a static method of the AppWidgetProvider which actually update the widget using RemoteViews. Everything works flawlessy until 1 hour as passed, after that time my Receiver disappears and the widget does not update anymore. I'm testing this on a Droid with 2.2.1 firmware-</p><p>What i'm doing wrong? Is this the correct way to update the widget (i just need that event so i don't want to have a service if its not needed). Should i use an AlarmManager to be sure from time to time that my receiver is still there? I can i do this?</p><p>Thanks.</p>","376579","","376579","","2010-11-29 16:57:37","2012-12-06 21:45:20","Keep widget BroadcastReceiver alive even if not instantiated from Manifest","<android><widget><broadcastreceiver><battery><intentfilter>","1","0","2","",""
"4303800","1","4303924","","2010-11-29 12:43:22","3","12515","<p>can any body tell how to store and retrieve array list value in bundle in android give example </p><p>Thanks</p>","426344","","","","","2010-11-29 12:56:20","how to store and retrieve array list value in bundle in android","<android>","3","0","","",""
"4303871","1","","","2010-11-29 12:51:30","1","804","<p>Windows XP.  Experienced Java developer.  Just started with Android development.  Emulator (started with Eclipse, NetBeans or command line) works properly until I try to close it.  Then, it hangs and the workstation must be rebooted.  Some observations and data: java is version 1.6.0_23-ea. The emulator shows as 'Not responding' in the task manager.  Every time the emulator is started, it always has two entries in the task manager.  If the emulator was started from command line, the command box is also frozen.  Have tried different avds, always the same.  Eclipse and NetBeans are both the latest version.  Cannot stop the emulator from the task manager or Control-C in the command dialog.  The rest of the workstation continues to respond (mostly) but can send nothing to the emulator.  The workstation can not be rebotted, it must be powered off and powered on.</p><p>Anyone have any ideas?</p><p>TIA.</p>","523914","","523914","","2010-11-29 13:02:10","2011-05-06 02:47:27","Emulator won't shutdown - Windows XP","<android>","1","0","1","",""
"4303908","1","4304332","","2010-11-29 12:55:15","0","961","<p>I want to stay the button pressed when clicked on that button. Button's background is done using <code>StateList</code></p>","482604","","244296","","2010-11-29 13:51:57","2010-11-29 13:51:57","how to stay the button pressed","<android><android-layout>","2","0","0","",""
"4304075","1","4304125","","2010-11-29 13:14:24","5","15438","<p>I have a EditText and I want to inform each time text changes (with entering each character). What implementation should I use and what function should I override? </p><p>Thanks </p>","513413","","","","","2013-02-12 06:35:04","Android: How can I get EditText change?","<android><listener><edittext>","2","0","0","",""
"4304101","1","","","2010-11-29 13:16:45","1","602","<p>How to develop a <strong>Vimeo-like Media player</strong> on Android?</p><p>What I like about Vimeo is </p><blockquote>  <p>their <strong>translucent</strong> Play, Pause, Scrollbar shown <strong>only when needed</strong> i.e. on <strong>Mouseover</strong> - which ensure that the full screen size is occupied by the video.</p></blockquote><p>Any links, tutorials greatly appreciated.</p><p>Thanks.</p>","476216","","","","","2010-11-29 13:16:45","Vimeo-like Video Player - Android","<android><media-player><vimeo>","0","4","","",""
"4304386","1","","","2010-11-29 13:53:02","1","1416","<p>I have a task to periodically read the phone sensors (e.g. WiFi, accelerometer) in the backend.</p><p>My current solution is to use an AlarmManager.</p><p>Specifically, we have:</p><p>In the ""main"" program (an activity), we use PendingIntent.getService:</p><pre>public class Main extends Activity {...Intent intent = new Intent(this, AutoLogging.class);mAlarmSender = PendingIntent.getService(this, 0, intent, 0);am = (AlarmManager)getSystemService(ALARM_SERVICE);am.setRepeating(AlarmManager.RTC, 0, 5*1000, mAlarmSender);}</pre><p>In the ""AutoLogging"" program (a service), we respond to the alarm periodically:</p><pre>public class AutoLogging extends Service {...@Overridepublic void onCreate() {   Toast.makeText(this, ""onCreate"", Toast.LENGTH_SHORT).show();}@Overridepublic void onDestroy() {   super.onDestroy();   Toast.makeText(this, ""onDestroy"", Toast.LENGTH_SHORT).show();}@Overridepublic boolean onUnbind(Intent intent) {   Toast.makeText(this, ""onUnbind"", Toast.LENGTH_SHORT).show()   return super.onUnbind(intent);}@Overridepublic void onStart(Intent intent, int startId) {   super.onStart(intent, startId);   Toast.makeText(this, ""onStart"", Toast.LENGTH_SHORT).show();   // Read sensor data here}@Override   public IBinder onBind(Intent intent) {   Toast.makeText(this, ""onBind"", Toast.LENGTH_SHORT).show();   return null;}}</pre><p>My problem is:</p><p>When I use this alarm service, only OnCreate and OnStart are called at each alarm. </p><p>My questions are:</p><p>(1) Do we need to call OnDestroy (or onBind, onUnbind)?</p><p>(2) Is this a correct way to use AlarmManager (compared with ""broadcase receiver"")? </p><p>Thanks!Vincent</p>","523597","","","","","2010-11-29 14:58:50","Android AlarmManager for periodical sensor reading","<android><alarmmanager>","1","0","1","",""
"4304387","1","4304546","","2010-11-29 13:53:03","0","503","<p>I have been using the images in the drawable folder to display images In my Android Application. Is there any way to access the images outside the drawable folder? Or images in another through a url?</p>","523058","","","","","2013-05-31 06:19:52","Accessing an image outside the drawable folder in android","<android><image>","2","0","","",""
"4304466","1","4304518","","2010-11-29 14:01:56","0","718","<p>I need to write a helper method which I can use in various places in the app to essentially make it 'sleep' for N milliseconds.It looks like Handler.postAtTime may be one way to do it, but I'd like any code snippets if available.  </p>","523968","","","","","2010-11-29 20:07:26","Android 2.2: How can you write a helper method to have your app 'sleep' for N milliseconds?","<android><sleep>","3","3","","",""
"4304569","1","4304649","","2010-11-29 14:15:26","4","11614","<p>So I have a listView on Android which I create in code like so:</p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.menuitem, menuitems));ListView lv = getListView();lv.setTextFilterEnabled(true);lv.setBackgroundColor(Color.RED);lv.setOnItemClickListener(new OnItemClickListener() { ... });</code></pre><p>Is there a way to change the selection colour in code from the default orange colour to another one?</p>","143979","","143979","","2010-11-29 14:52:48","2011-11-05 14:26:59","Change ListView selected colour on Android","<java><android><listview><colors><android-listview>","1","0","0","",""
"4304643","1","","","2010-11-29 14:23:27","0","109","<p>I am looking to compress a number of files into a master compressed file which I can then de-compress individual files as required.  I am running on an Android platform, so I have performance/memory restraints.  I was thinking of something along the lines of the file being a streamed map of keys vs compressed streams which I could then decompress when required.<br>However if I just simply stream in such a map I am going to load in all the compressed files into memory which I cant afford to do.  Has anyone any suggestions on how to setup a lazy de-compression scheme similar to this (in java)?</p><p>Thanks, </p>","468854","","","","","2010-11-29 14:23:27","Lazy decompression","<java><android><gzip>","0","3","1","",""
"4304660","1","4333367","","2010-11-29 14:25:47","0","1456","<p>I am developing a simple widget and I would like to change the background at runtime from a png file (or similar). Is this possible to do and if so, how? Can someone provide some simple example?</p><p>Thanks</p>","501223","","","","","2012-01-23 01:01:11","Changing widget background at runtime","<android><background><widget>","3","0","","",""
"4304736","1","","","2010-11-29 14:35:40","1","376","<p>I am using gesture detector using swipe action in webview and using activity group manager I am getting the below exception  </p><pre><code>11-29 20:01:04.418: ERROR/ActivityThread(4236): Failed to find provider info for android.server.checkin11-29 20:01:04.438: WARN/Checkin(4236): Can't update stat BROWSER_SNAP_CENTER: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats</code></pre><p>can anybody tell what is the problem?</p>","426344","","","","","2010-11-29 14:51:32","exception in android","<android>","0","2","","",""
"4304807","1","","","2010-11-29 14:47:14","0","180","<p>Is it possible to recognize sign language (like American Sign Language, ASL) in an iPhone or Android application?  </p><p>Are there libraries that are available to do this?  If not, how would you suggest I get started in writing an application that could recognize sign language?</p>","524021","","19679","","2010-11-29 19:45:52","2010-11-29 19:45:52","How can you recognize sign language in a mobile application?","<iphone><android>","1","0","","",""
"4304927","1","4305121","","2010-11-29 15:00:08","1","4604","<p>Good afternoon.</p><p>I am unfamiliar with the activity life cycle in android and have been reading up as best as possible but I cannot figure how to solve the following in a nice manner.</p><p>I have an activity with a GLSurfaceView to draw various things on the screen. In the renderering thread for this GLSurfaceView I perform all the rendering as well as the actual update logic (I will seperate this out eventually).</p><p>The trouble I am having is from one of the ""screens"" drawn within the renderer I wish to end the Activity and have it call the various lifecycle methods. </p><p>Normally I might do this with System.exit(0); however ending the activity in this way does not seem to call the OnStop(); OnDestroy(); methods.</p><p>This might just be me being silly and not seeing an easy way of doing this but is there a way to access the Activity and call activity.finish(); without having to pass the reference to it all the way down?</p><p>This is probably less of an android question and more a general java problem? Sorry I am a little rusty at both. Maybe if someone could explain roughly how they handle an issue like this in their app.</p>","432272","","","","","2013-12-16 06:10:05","Android - Ending activity from within rendering thread","<java><android><activity><lifecycle><renderer>","3","0","2","",""
"4305046","1","4305078","","2010-11-29 15:14:26","0","890","<p>I am newbie in Android programming, so I have a trouble with adding rows to TableLayout dynamically. Please, see a code below:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    TableLayout layout = (TableLayout) findViewById(R.layout.main);    Game game = new Game();    Square[][] field = game.getField();    int ii = 0;    for (Square[] sq : field) {        TableRow row = new TableRow(this);        row.setId(100 + ii);        for (Square square : sq) {            ii++;            Button button = new Button(this);            String str = ""button"" + Integer.toString(ii);            CharSequence text = str;            button.setId(ii);            button.setText(text);            row.addView(button, new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT,                    TableRow.LayoutParams.WRAP_CONTENT));        }        layout.addView(row, new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT,                TableLayout.LayoutParams.WRAP_CONTENT));    }}</code></pre><p>log:</p><pre><code>11-29 14:54:40.939: DEBUG/AndroidRuntime(337): --- registering native functions ---11-29 14:54:41.669: INFO/ActivityManager(59): Starting activity: Intent { flg=0x10000000 cmp=com.example/.KrestikinolikiActivity }11-29 14:54:41.809: DEBUG/AndroidRuntime(337): Shutting down VM11-29 14:54:41.839: DEBUG/dalvikvm(337): Debugger has detached; object registry had 1 entries11-29 14:54:41.879: INFO/ActivityManager(59): Start proc com.example for activity com.example/.KrestikinolikiActivity: pid=344 uid=10031 gids={1015}11-29 14:54:41.919: INFO/AndroidRuntime(337): NOTE: attach of thread 'Binder Thread #3' failed11-29 14:54:42.729: ERROR/dalvikvm(344): Could not find class 'sun.reflect.generics.reflectiveObjects.NotImplementedException', referenced from method com.example.Game.getCurrentActivePlayer11-29 14:54:42.729: WARN/dalvikvm(344): VFY: unable to resolve new-instance 30 (Lsun/reflect/generics/reflectiveObjects/NotImplementedException;) in Lcom/example/Game;11-29 14:54:42.739: DEBUG/dalvikvm(344): VFY: replacing opcode 0x22 at 0x000011-29 14:54:42.739: DEBUG/dalvikvm(344): VFY: dead code 0x0002-0005 in Lcom/example/Game;.getCurrentActivePlayer ()Lcom/example/Player;11-29 14:54:42.759: DEBUG/AndroidRuntime(344): Shutting down VM11-29 14:54:42.759: WARN/dalvikvm(344): threadid=1: thread exiting with uncaught exception (group=0x4001d800)11-29 14:54:42.768: ERROR/AndroidRuntime(344): FATAL EXCEPTION: main        java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.KrestikinolikiActivity}: java.lang.NullPointerException        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)        at android.app.ActivityThread.access$2300(ActivityThread.java:125)        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)        at android.os.Handler.dispatchMessage(Handler.java:99)        at android.os.Looper.loop(Looper.java:123)        at android.app.ActivityThread.main(ActivityThread.java:4627)        at java.lang.reflect.Method.invokeNative(Native Method)        at java.lang.reflect.Method.invoke(Method.java:521)        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)        at dalvik.system.NativeStart.main(Native Method)        Caused by: java.lang.NullPointerException        at com.example.KrestikinolikiActivity.onCreate(KrestikinolikiActivity.java:41)        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)        ... 11 more11-29 14:54:42.789: WARN/ActivityManager(59): Force finishing activity com.example/.KrestikinolikiActivity11-29 14:54:43.288: WARN/ActivityManager(59): Activity pause timeout for HistoryRecord{44f993c0 com.example/.KrestikinolikiActivity}</code></pre><p>What I doing wrong? Thanks a lot! And I'm sorry that my english is not so good.</p>","524034","","","","","2010-11-29 15:30:47","NullPointerException when adding rows","<android><uitableview><table><android-layout>","1","2","","",""
"4305079","1","4305252","","2010-11-29 15:18:32","2","1589","<p>I have a webview on an android phone that is a registration form and it contains some fields such as first name, last name, user name, password, etc...  When focus on the first name input field for example, the keyboard pops up, but the input goes out of view, it still has focus though.  Is there a way to keep it in view or is this a bug?</p>","33690","","","","","2012-09-29 20:38:54","Text Input on android phone is not in view when the keyboard for webview comes up?","<android><android-webview>","2","0","","",""
"4305081","1","","","2010-11-29 15:18:35","2","1326","<p>I'm fairly new to Android so be gentle!</p><p>I have the following code, which should (I think) just play ""developersshort"".</p><pre><code>public constructor(Context context){    this.context = context;    soundPool = new SoundPool(2, AudioManager.STREAM_MUSIC,0);    soundPoolMap = new HashMap&lt;Integer, Integer&gt;();    soundPoolMap.put(1, soundPool.load(this.context,         R.raw.developersshort, 1));         }public void run() {    soundPool.play(soundPoolMap.get(1), 1, 1, 1, 0, 1f);}</code></pre><p>[To try to figure out what's going on, it currently plays that remix of Steve Ballmer shouting ""developers"" repeatedly! The sound file is ~90KB in size.]</p><p>When I run my app in the emulator, and press the button to trigger the sound, it says ""developers developers developers..."" etc etc, like I would expect.</p><p>However, when I deploy it to my phone, all I hear something like ""velop"" once, and then the sound stops.</p><p>I have NO idea what is going on, any ideas?</p><p>Thanks a lot!</p>","524043","","894284","","2011-11-18 03:35:14","2012-10-29 11:22:11","Android SoundPool cutting sound file short","<android><soundpool>","3","0","","",""
"4305182","1","4305744","","2010-11-29 15:30:08","4","3456","<p>I'm very new to android development and I'm working on an application where I have 4 activities. Each activity needs to be able to navigate to any of the other 3. So I created 4 buttons at the top of each activity that allow for this. The XML code looks like this:</p><pre><code>&lt;Button ... android:onClick=""loadProfileLayout""/&gt;  &lt;Button ... android:onClick=""loadRulesLayout""/&gt;  &lt;Button ... android:onClick=""loadSettingsLayout""/&gt;  &lt;Button ... android:onClick=""loadHelpLayout""/&gt;</code></pre><p>the manifest has an activity tag for each:</p><pre><code>    &lt;activity android:name="".Profiler"" 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=""Rules""&gt;&lt;/activity&gt;    &lt;activity android:name=""Settings""&gt;&lt;/activity&gt;    &lt;activity android:name=""Help""&gt;&lt;/activity&gt;</code></pre><p>And the functions called are these:</p><pre><code>public void loadProfileLayout()        { startActivity(new Intent(this, Profiler.class)); }public void loadRulesLayout(View v)    { startActivity(new Intent(this, Rules.class)); }public void loadSettingsLayout(View v) { startActivity(new Intent(this, Settings.class)); }public void loadHelpLayout(View v)   { startActivity(new Intent(this, Help.class)); }</code></pre><p>So initially this works. From the main ""Profile"" activity I am able to navigate to any of the other 3. And from the other 3 I can navigate anywhere but back to the main one. When I press the main activity button the application crashes. I try and debug, but it doesn't even appear to be executing loadProfileLayout(). Eclipse opens a ""View.class"" file with the contents of basically ""Source not found"". If I press F8 to continue debugging it loads ""ZygoteInit$MethodAndArgsCaller.run()""... again, ""Source not found"". Pressing F8 again will load the error message in the emulator ""Sorry! The application has stopped unexpectedly. Please try again.""</p><p>Again, I am new to Android and all I know of activities is what I've been reading on the dev website. Am I making a fundamental mistake here I am not aware of?</p><p>Thanks,<br>Nate</p>","450780","","","","","2010-11-29 16:47:47","Android Activity Navigation","<android><android-layout><android-manifest>","1","1","","",""
"4305211","1","","","2010-11-29 15:33:24","2","178","<p>It would have been nice to see an example of how to combine onTap with Gestures and how to determine the tap position in a zoomed image. (I have used each of them separately, but I suspect some interference here, and I am not sure what kind of x-y coordinates are given for a scaled image.  I need the tap-position in the image)</p>","524066","","524066","","2010-11-29 15:38:45","2010-11-29 15:38:45","How to combine onTap with Gestures?","<android><gestures>","0","0","","",""
"4305342","1","","","2010-11-29 15:45:58","0","1386","<p>I have the following Json string, resulting from a google search query:</p><pre><code>{""responseData"":{""results"":[{""region"":""IL"",""streetAddress"":""1611 South Randall Road"",""titleNoFormatting"":""Brunswick Zone XL Randall Road"",""staticMapUrl"":""http:\/\/maps.google.com\/maps\/api\/staticmap?maptype=roadmap&amp;format=gif&amp;sensor=false&amp;size=150x100&amp;zoom=13&amp;markers=42.162958,-88.334155"",""listingType"":""local"",""addressLines"":[""1611 South Randall Road"",""Algonquin, IL""],""lng"":""-88.334155"",""phoneNumbers"":[{""type"":"""",""number"":""(847) 658-2257""}],""url"":""http:\/\/www.google.com\/maps\/place?source=uds&amp;q=brunswick+zone&amp;cid=8286591317090502839"",""country"":""United States"",""city"":""Algonquin"",""content"":"""",""GsearchResultClass"":""GlocalSearch"",""maxAge"":604800,""title"":""&lt;b&gt;Brunswick Zone&lt;\/b&gt; XL Randall Road"",""ddUrlToHere"":""http:\/\/www.google.com\/maps?source=uds&amp;daddr=1611+South+Randall+Road,+Algonquin,+IL+(Brunswick+Zone+XL+Randall+Road)+@42.162958,-88.334155&amp;iwstate1=dir:to"",""ddUrl"":""http:\/\/www.google.com\/maps?source=uds&amp;daddr=1611+South+Randall+Road,+Algonquin,+IL+(Brunswick+Zone+XL+Randall+Road)+@42.162958,-88.334155&amp;saddr=60102"",""ddUrlFromHere"":""http:\/\/www.google.com\/maps?source=uds&amp;saddr=1611+South+Randall+Road,+Algonquin,+IL+(Brunswick+Zone+XL+Randall+Road)+@42.162958,-88.334155&amp;iwstate1=dir:from"",""accuracy"":""8"",""lat"":""42.162958"",""viewportmode"":""explicit""},{""region"":""IL"",""streetAddress"":""2075 East Algonquin Road"",""titleNoFormatting"":""Brunswick Zone Algonquin"",""staticMapUrl"":""http:\/\/maps.google.com\/maps\/api\/staticmap?maptype=roadmap&amp;format=gif&amp;sensor=false&amp;size=150x100&amp;zoom=13&amp;markers=42.154629,-88.265871"",""listingType"":""local"",""addressLines"":[""2075 East Algonquin Road"",""Algonquin, IL""],""lng"":""-88.265871"",""phoneNumbers"":[{""type"":"""",""number"":""(847) 658-9200""}],""url"":""http:\/\/www.google.com\/maps\/place?source=uds&amp;q=brunswick+zone&amp;cid=7798335569608325784"",""country"":""United States"",""city"":""Algonquin"",""content"":"""",""GsearchResultClass"":""GlocalSearch"",""maxAge"":604800,""title"":""&lt;b&gt;Brunswick Zone&lt;\/b&gt; Algonquin"",""ddUrlToHere"":""http:\/\/www.google.com\/maps?source=uds&amp;daddr=2075+East+Algonquin+Road,+Algonquin,+IL+(Brunswick+Zone+Algonquin)+@42.154629,-88.265871&amp;iwstate1=dir:to"",""ddUrl"":""http:\/\/www.google.com\/maps?source=uds&amp;daddr=2075+East+Algonquin+Road,+Algonquin,+IL+(Brunswick+Zone+Algonquin)+@42.154629,-88.265871&amp;saddr=60102"",""ddUrlFromHere"":""http:\/\/www.google.com\/maps?source=uds&amp;saddr=2075+East+Algonquin+Road,+Algonquin,+IL+(Brunswick+Zone+Algonquin)+@42.154629,-88.265871&amp;iwstate1=dir:from"",""accuracy"":""8"",""lat"":""42.154629"",""viewportmode"":""explicit""}],""viewport"":{""center"":{""lng"":""-88.48145"",""lat"":""42.281384""},""sw"":{""lng"":""-88.74015"",""lat"":""42.129276""},""ne"":{""lng"":""-88.222755"",""lat"":""42.43349""},""span"":{""lng"":""0.51739"",""lat"":""0.304211""}},""cursor"":{""moreResultsUrl"":""http:\/\/www.google.com\/local?oe=utf8&amp;ie=utf8&amp;num=4&amp;mrt=yp,loc&amp;sll=37.779160,-122.420090&amp;start=0&amp;hl=en&amp;q=brunswick+zone+60102"",""currentPageIndex"":0,""estimatedResultCount"":""258"",""pages"":[{""start"":""0"",""label"":1},{""start"":""4"",""label"":2},{""start"":""8"",""label"":3},{""start"":""12"",""label"":4}]}},""responseStatus"":200,""responseDetails"":null}</code></pre><p>The outer-most (single) label is ""responseData""The first (also single) nested label is ""results""Within the ""results"" object, I have 2 identical netsed data sets, each representing a single complete google search result, which contain the elements, that I needs, such as:""titleNoFormatting"", ""addressLines"" and ""phoneNumbers"".</p><p>I'm writing my first Android java app, and really struggling with extracting the values I need. I have looked into Gson and Jackson, but, was unable to conceive a solution for myself. I think, part of the issue may have to do with a fact, that these inner data sets do not have explicit container names, they just have identical structure: the outer label ""results"" is present only once and contains both identical data sets.Could anyone, please, provide an example of how to deal with this?</p>","518012","","104117","","2010-12-10 16:37:01","2010-12-10 16:37:01","Json: How to extract inner Json objects from a single outer Json object using java","<java><android><json><gson><google-search-api>","2","0","","",""
"4305385","1","4305419","","2010-11-29 15:50:16","1","488","<p>I am a university student.  I have been working a lot with Android lately on my own time, and I cannot help but to feel that what I’ve been taught about good programming practices such as the importance of logging and writing unit tests don’t hold true.</p><p>The reason I am saying this is because Android apps are <strong>usually</strong> small apps that are not complex (a couple of activities, maybe a service, and perhaps a few other classes).  Therefore, the effort and time spent on these ‘good practices’ don’t produce much better code.</p><p>In other words, I understand the importance of these practices when developing applications with large amount of classes, but when it comes to android apps, I find it much better to just write ‘not-so-good’ code and then just test by actually using the app on my own time on real devices for a few days or weeks.</p><p>Am I wrong about this?  Why?</p>","481009","","","","","2011-05-06 00:30:30","Are programming practices such as unit testing and logging important on android?","<android><unit-testing><logging>","4","1","","",""
"4305424","1","","","2010-11-29 15:53:14","0","431","<p>I trying to get Google's Hello World app for Android working in Eclipse. The first time the AVD indeed displays ""Hello World"", but when I click it away and restart the application from Eclipse, nothing happens - however long I wait.</p><p>Killing adb.exe in the process list does not help.</p><p>I actually see a stacktrace when just launching the AVD itself. Unfortunately, launching an AVD apparently takes 3 command prompts which all disappear before you can read what is outut to them.</p>","524090","","213269","","2011-03-22 08:36:45","2011-03-22 08:36:45","Android Hello World stops working after first launch","<android><hello-world><avd>","1","1","","",""
"4305480","1","","","2010-11-29 15:57:55","0","3566","<p>I'm working in a project that parses and write a kml file and stores in sd card, but I have a problem, for google maps trace the path i need that the coordinates are all together, and my <code>Activity</code> just do like this kml output:</p><pre><code>&lt;?xml version=""1.0""?&gt;&lt;kml xmlns=""http://www.opengis.net/kml/2.2""&gt;    &lt;Placemark&gt;      &lt;name&gt;Untitled Path&lt;/name&gt;       &lt;Style id=""RedLine""&gt;        &lt;LineStyle&gt;          &lt;color&gt;7f0000ff&lt;/color&gt;          &lt;width&gt;4&lt;/width&gt;        &lt;/LineStyle&gt;      &lt;/Style&gt;      &lt;styleUrl&gt;#RedLine&lt;/styleUrl&gt;      &lt;LineString&gt;        &lt;tessellate&gt;1&lt;/tessellate&gt;       &lt;altitudeMode&gt;absolute&lt;/altitudeMode&gt;        &lt;coordinates&gt;         -7.178449630737305,41.48063600063324,274.0        &lt;/coordinates&gt;      &lt;/LineString&gt;      &lt;/Placemark&gt;      &lt;Placemark&gt;      &lt;name&gt;Untitled Path&lt;/name&gt;       &lt;Style id=""RedLine""&gt;        &lt;LineStyle&gt;          &lt;color&gt;7f0000ff&lt;/color&gt;          &lt;width&gt;4&lt;/width&gt;        &lt;/LineStyle&gt;      &lt;/Style&gt;      &lt;styleUrl&gt;#RedLine&lt;/styleUrl&gt;      &lt;LineString&gt;        &lt;tessellate&gt;1&lt;/tessellate&gt;       &lt;altitudeMode&gt;absolute&lt;/altitudeMode&gt;        &lt;coordinates&gt;         -7.178449630737305,41.48063600063324,274.0              &lt;/coordinates&gt;      &lt;/LineString&gt;      &lt;/Placemark&gt;    &lt;/kml&gt;</code></pre><p>And My Main Class:</p><pre><code>private void WriteToFile(Location loc) {  if (!logToGpx &amp;&amp; !logToKml) {   return;  }  try {   boolean brandNewFile = false;   // if (root.canWrite()){   // File gpxFolder = new File(""/sdcard/GPSLogger"");   File gpxFolder = new File(     Environment.getExternalStorageDirectory(), ""GPSLogger"");   Log.i(""MAIN"", String.valueOf(gpxFolder.canWrite()));   if (!gpxFolder.exists()) {    gpxFolder.mkdirs();    brandNewFile = true;   }   if (logToGpx) {    WriteToGpxFile(loc, gpxFolder, brandNewFile);   }   if (logToKml) {    WriteToKmlFile(loc, gpxFolder, brandNewFile);   }  } catch (Exception e) {   Log.e(""Main"", ""Nao foi possivel criar o ficheiro "" + e.getMessage());   SetStatus(""Nao e possivel escrever no ficheiro. "" + e.getMessage());  } } private void WriteToKmlFile(Location loc, File gpxFolder,   boolean brandNewFile) {  // TODO Auto-generated method stub  try {   File kmlFile = new File(gpxFolder.getPath(), currentFileName     + "".kml"");   if (!kmlFile.exists()) {    kmlFile.createNewFile();    brandNewFile = true;   }   Date now = new Date();   //SimpleDateFormat sdf = new SimpleDateFormat(""yyyy-MM-dd'T'HH:mm:ss"");   //String dateTimeString = sdf.format(now);   if (brandNewFile) {    FileOutputStream initialWriter = new FileOutputStream(kmlFile,      true);    BufferedOutputStream initialOutput = new BufferedOutputStream(      initialWriter);    String initialXml = ""&lt;?xml version=\""1.0\""?&gt;""      + ""&lt;kml xmlns=\""http://www.opengis.net/kml/2.2\""&gt;""      + ""&lt;/kml&gt;"";    initialOutput.write(initialXml.getBytes());    // initialOutput.write(""\n"".getBytes());    initialOutput.flush();    initialOutput.close();   }   long startPosition = kmlFile.length() - 6;   String placemark = ""&lt;Placemark&gt;&lt;name&gt;"" + now.toLocaleString()     + ""&lt;/name&gt;&lt;description&gt;"" + now.toLocaleString()     + ""&lt;/description&gt;"" + ""&lt;Point&gt;&lt;coordinates&gt;""     + String.valueOf(loc.getLongitude()) + "",""
     + String.valueOf(loc.getLatitude()) + "",""
     + String.valueOf(loc.getAltitude())     + ""&lt;/coordinates&gt;&lt;/Point&gt;&lt;/Placemark&gt;&lt;/kml&gt;"";   RandomAccessFile raf = new RandomAccessFile(kmlFile, ""rw"");   raf.seek(startPosition);   raf.write(placemark.getBytes());   raf.close();  } catch (IOException e) {   Log.e(""Main"", ""Error in writting "" + e.getMessage());   SetStatus(""Error in writting. "" + e.getMessage());  }</code></pre><p>What i'm doing wrong?</p>","524092","","213269","","2010-12-11 12:45:20","2010-12-11 13:05:33","Kml Parsing in Android","<android><xml><parsing><kml>","2","0","","",""
"4305564","1","4305648","","2010-11-29 16:05:01","24","54555","<p>I have the following layout in place</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;        &lt;WebView xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/webview"" android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:orientation=""horizontal""  android:layout_width=""fill_parent"" android:layout_height=""fill_parent""  android:layout_weight=""13""&gt;        &lt;LinearLayout android:id=""@+id/LinearLayout01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;            &lt;LinearLayout android:orientation=""horizontal"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:layout_weight=""1""&gt;                    &lt;ImageButton android:background=""@null"" android:id=""@+id/back"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:src=""@drawable/back"" android:padding=""10dip"" /&gt;            &lt;/LinearLayout&gt;            &lt;LinearLayout android:orientation=""horizontal"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:layout_weight=""1""&gt;                &lt;ImageButton android:background=""@null"" android:id=""@+id/forward"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:src=""@drawable/forward"" android:padding=""10dip"" /&gt;            &lt;/LinearLayout&gt;        &lt;/LinearLayout&gt;        &lt;RelativeLayout android:orientation=""horizontal"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent""    android:layout_weight=""1"" &gt;                &lt;ImageButton android:background=""@null"" android:id=""@+id/special""   android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:src=""@drawable/barcode"" android:padding=""10dip"" android:layout_gravity=""right""/&gt;        &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>For the purpose of this question, I am only concerned about the lower half of the layout. Right now it contains 3 imagebuttons. The first 2, I want right next to each other left aligned. The third one, I want to be aligned to the right side.</p><p>As is, the first 2 buttons are where I want them to be, but the 3rd is stubbernly staying left-aligned. How would I make it right aligned.</p>","122105","","244296","","2010-11-29 16:08:30","2013-11-19 11:17:38","Android Layout Right Align","<android><layout><right-align>","4","0","4","",""
"4305713","1","","","2010-11-29 16:22:48","0","616","<p>I am trying to play audio file in android. Here is my code:</p><pre><code>    MediaPlayer mp = new MediaPlayer();    mp.reset();    mp.create(this, R.raw.beep);    mp.start();</code></pre><p>But I keep on getting following error:android.content.res.Resources$NotFoundException: File res/raw/sound.ogg from drawable resource ID #0x7f030002</p><p>I have a beep.ogg file in res/raw/ . I also tried it with mp3 and wav files. Still the same error.</p><p>Whats the issue?</p>","215399","","","","","2011-04-05 12:33:45","Android Audio issue","<android>","3","3","","",""
"4305717","1","4306380","","2010-11-29 16:23:29","2","2166","<p>I'm trying to make a query where I get data from two tables but it won't show me any result. I know there is a result because in SQLite3 it displays at least one, e.g.</p><pre><code>sqlite&gt; select eventthemename, eventtypename from event_type, event_theme   ...&gt; where event_type.eventthemes = event_theme._id        ...&gt; and event_type._id = '2';Tribal | Dance</code></pre><p>I'm using a content provider. Does anyone have an idea on how to make this?</p>","508479","","356895","","2012-08-15 00:04:14","2014-01-31 13:42:19","How to join multiple tables with managedQuery?","<android><sqlite3><android-contentprovider>","2","0","","",""
"4305894","1","4306110","","2010-11-29 16:42:35","1","1448","<p>I have a toast in a slave thread which needs to tell a user wen a connection is established. To do this I know I need to use Async to make the toast happen, but I'm not sure where or how to implements the extended async. If I understand it, I think I can just create a MyAsync with the  and just onProgressUpdate() the toast?</p><pre><code>@Overridepublic void onProgressUpdate(String... args) {         Toast.makeText(context, args, Toast.LENGTH_SHORT).show();}</code></pre><p>Thanks for your time~Aedon</p>","480691","","244296","","2010-11-29 16:47:06","2011-09-09 05:37:16","Toast and Async","<android><multithreading><asynchronous><toast>","1","1","","",""
"4306020","1","4838204","","2010-11-29 16:58:47","18","4921","<p>I have an application, which has to listen for specific SMS. So far easy. </p><p>But when I receive the message, it's multipart. Is there a proper way to receive the SMS as one message?</p><p>Now my activity starts two times, for each part of the sms. Should I concatenate the SMS by hand?</p>","232798","","","","","2011-02-16 14:45:19","Android - receiving long SMS (multipart)","<android><sms>","4","2","8","",""
"4306082","1","4306171","","2010-11-29 17:04:48","2","796","<p>I my project I have a class that in this class I want to have access to properties of a picture. But I don't want to show it through this class. In this class I just want to know width and height of image and do some mathematical functions to return something.</p><p>My problem is I can't have access to resources. for example, when I write </p><pre><code>image = BitmapFactory.decodeResource(this.getResources(), R.drawable.tasnim);</code></pre><p>It says the method getResources() in undefined for the type Stego (stego is my class name).</p><p>Please tell me what should I do?</p><pre><code>public class Stego(){    Public Stego(){        image = BitmapFactory.decodeResource(this.getResources(), R.drawable.tasnim);        imWidth  = image.getWidth();        imHeight = image.getHeight();    }}</code></pre>","513413","","","","","2010-11-29 17:21:49","Android: Shall I have access to resources from my own class?","<android><resources><bitmap>","1","0","","",""
"4306120","1","4306359","","2010-11-29 17:09:10","2","1835","<p>Trying to get an Android 2.2 application to start up with a SurfaceView as the base view with a button placed atop it located near the bottom of the screen.  So far, no luck.  It crashes every time it attempts to launch.  I've checked to make sure that the activity is registered in the manifest.</p><p>Here's my java code:</p><pre><code>public class Dragable 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>and here's my <code>main.xml</code>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;SurfaceView 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/surface_home""    &gt;    &lt;Button        android:id=""@+id/add_new""        android:text=""@string/add_new""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""    /&gt;&lt;/SurfaceView&gt;</code></pre><p>and 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.example""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Dragable""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>and here's my error:</p><p><code>11-29 11:58:52.620: ERROR/AndroidRuntime(512): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.Dragable}: java.lang.ClassCastException: android.view.SurfaceView</code></p><p>Can't seem to find anything related doing searches on SO.  My appologies if this has been asked before.</p>","178060","","178060","","2010-11-29 17:29:50","2010-11-29 17:38:56","SurfaceView: ClassCastException, unable to start activity","<android><android-layout><surfaceview>","2","2","","",""
"4306129","1","","","2010-11-29 17:10:20","1","585","<p>I have </p><pre><code>WebView engine = (WebView) findViewById(R.id.web_engine);                  engine.getSettings().setJavaScriptEnabled(true);                 engine.loadUrl(""http://www.fgcu.edu/search/directory-results.asp?V_LAST="" + inputName); </code></pre><p>If you go to that url and look at the html source code, you will see that the results of the search all are with in the . I want to know if it is possible to not load everything out side of the table ID and just load the table. </p><p>Can i some how save the html code to a java list and search for the  id, and then delete everything else in the list? Not sure how i could do that.</p><p>Thanks!</p>","196055","","","","","2010-11-29 18:06:46","Android webview display only <table> id of website","<android><android-webview>","1","0","","",""
"4306215","1","4823811","","2010-11-29 17:19:29","0","908","<p>I'm attempting to integrate JTwitter into an Android application, and I have been completely successful up until the point where I decided to regression test on older Android versions.  In Android 2.x my code works great, but in Android 1.5/1.6 Dalvik throws a VerifyError on the following line:</p><pre><code>OAuthSignpostClient oauthClient        = new OAuthSignpostClient(KEY_TWITTER, SECRET_TWITTER, ""oob"");</code></pre><p>and provides this logcat output and stack trace:</p><pre><code>Could not find method javax.swing.JOptionPane.showInputDialog, referenced from method winterwell.jtwitter.OAuthSignpostClient.askUserVFY: unable to resolve static method 1703: Ljavax/swing/JOptionPane;.showInputDialog (Ljava/lang/Object;)Ljava/lang/String;VFY:  rejecting opcode 0x71 at 0x0000VFY:  rejected Lwinterwell/jtwitter/OAuthSignpostClient;.askUser (Ljava/lang/String;)Ljava/lang/String;Verifier rejected class Lwinterwell/jtwitter/OAuthSignpostClient;Shutting down VMthreadid=3: thread exiting with uncaught exception (group=0x4001aa28)Uncaught handler: thread main exiting due to uncaught exceptionjava.lang.VerifyError: winterwell.jtwitter.OAuthSignpostClient  at com.wirelessdesigns.android.AuthActivity.onCreate(AuthActivity.java:37)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)  at android.app.ActivityThread.access$2100(ActivityThread.java:116)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:123)  at android.app.ActivityThread.main(ActivityThread.java:4203)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:521)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)  at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I'm trying to figure out what may have changed in the underlying implementation between the Android versions that would affect this and what the workaround might be?  <a href=""http://stackoverflow.com/questions/3306792/android-jtwitter-oauthsignpostclient"">A similar question</a> was answered a while back, but the answer was in the form of a now-dead link to a forum post.</p><p>Any thoughts?</p>","246461","","246461","","2011-01-27 20:15:50","2011-01-28 01:11:10","JTwitter VerifyError in Android pre-2.0","<android><jtwitter>","1","3","0","",""
"4306324","1","4731552","","2010-11-29 17:29:12","2","4840","<p>This is my first question on StackOverflow so be kind :)</p><p>I'm looking into writing a custom adapter to populate a listview with 3 textviews per line.  I've found quite a bit of examplte code to do this, but the one that seemed the best was at: <a href=""http://www.anddev.org/custom_widget_adapters-t1796.html"" rel=""nofollow"">http://www.anddev.org/custom_widget_adapters-t1796.html</a></p><p>After a few minor tweaks to fix some compiler issues with the latest android sdk, i got it running, only to get the exception:</p><p>ERROR/AndroidRuntime(281): java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView</p><p>So I did a lot of research and found lots of possible reasons and fixes for this.  None of which changed a thing.  My adapter code is currently:</p><pre><code>public class WeatherAdapter extends BaseAdapter {private Context context;private List&lt;Weather&gt; weatherList;public WeatherAdapter(Context context, int rowResID,                    List&lt;Weather&gt; weatherList ) {     this.context = context;    this.weatherList = weatherList;}public int getCount() {                            return weatherList.size();}public Object getItem(int position) {         return weatherList.get(position);}public long getItemId(int position) {      return position;}public View getView(int position, View convertView, ViewGroup parent) {     Weather weather = weatherList.get(position);    //LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    LayoutInflater inflater = LayoutInflater.from(context);    View v = inflater.inflate(R.layout.weather_row, null, true);    TextView cityControl = (TextView)v.findViewById( R.id.city );    TextView temperatureControl = (TextView)v.findViewById( R.id.temperature );    ImageView skyControl = (ImageView)v.findViewById( R.id.sky );    return v;}</code></pre><p>}</p><p>So I have tried the commented out way of getting the inflater, and the currently uncommented out.  I have tried passing ""parent"" to inflate as well as null, and passing ""true"", ""false"" and ommitting completely the last parameter.  None of them have worked, and all examples I've found so far have been from 2008 which I get the feeling are a bit outdated.</p><p>If anyone could help with this then I would love to resolve the issue.  Something seemingly trivial at first has caused me several hours of frustration!</p>","524147","","750987","","2011-05-28 13:02:46","2013-09-18 16:02:48","Unable to use LayoutInflater in custom adapter","<android><android-layout><android-listview><android-xml><android-adapter>","4","0","1","",""
"4306367","1","4306496","","2010-11-29 17:33:26","0","1829","<p>I want to change the look of my Android app's preference screen to white background and dark text color. It seems that I can change background color in the code. Is there a similar way to change text color of preferences in the code?</p><pre><code>getListView().setBackgroundColor(Color.TRANSPARENT);getListView().setCacheColorHint(Color.TRANSPARENT);getListView().setBackgroundColor(Color.rgb(255, 255, 255));</code></pre><p>The other way could be setting the activity's theme to light in the app's manifest:</p><pre><code>android:theme=""@android:style/Theme.Light""</code></pre><p>However, this overrides the application's style, which currently is set to</p><pre><code>android:theme=""@android:style/Theme.NoTitleBar""</code></pre><p>Thus, title bar is displayed in the preferences screen. I can try to remove the bar by</p><pre><code>requestWindowFeature(Window.FEATURE_NO_TITLE);</code></pre><p>The app then crashes (<code>AndroidRuntimeException: requestFeature() must be called before adding content</code>) when trying to open preferences.</p>","519908","","","","","2010-11-29 17:47:35","How to change text color of Android's preferences?","<android><text><coding-style><preferences><titlebar>","1","0","","",""
"4306431","1","4306462","","2010-11-29 17:40:32","0","62","<p>this is the log on a specific project:[2010-11-29 18:18:39 - A_world] Uploading A_world.apk onto device 'HT057PL10308'[2010-11-29 18:18:39 - A_world] Installing A_world.apk...[2010-11-29 18:18:44 - A_world] Success![2010-11-29 18:18:44 - A_world] \A_world\bin\A_world.apk installed on device[2010-11-29 18:18:44 - A_world] Done!</p><p>on every project except this one it will compile and open the project on the phone but this do nothing on my phone and i cant find the app on my phone. (this failure is only on this project)</p><p>why isnt the app installed or open on the phone (on this specific proj)?</p><p>thank you!</p>","502419","","","","","2010-11-29 17:44:25","Android Development: compile weird thing","<android>","1","0","","",""
"4306529","1","","","2010-11-29 17:53:12","0","604","<p>I am writing an andriod testing application which automates testing on device. </p><p>I am targeting  facebook as my base application and writing an app using Robotium framework in order to accomplish my requirement. </p><p>Till now i could successfully implemented few features and stuck at one point very badly. I want to automate upload picture functionality but as soon as upload button clicked device builtin application gets activated and i couldn't control the default app using robotium.</p><p>Is there any way by which i can overcome this impediment by writing some code using robotium or writing a layer between OS &amp; Robotim which can generate key stokes.</p><p>Quick help would be much much appreciated.</p><p>Thanks</p>","524196","","21234","","2010-11-29 17:58:01","2010-11-29 19:11:23","Android - issue in controlling builtin app using Robotium","<android><robotium>","1","0","","",""
"4306576","1","4308213","","2010-11-29 18:00:04","1","565","<p>I'm thinking about using OpenGL for part of my app, speciffically tile based London tube map. What is the most minimalistic and simplest OpenGL framework that I could use?</p>","243225","","44729","","2010-11-29 18:34:38","2012-11-19 13:36:43","Simple OpenGL engine","<android><opengl-es>","2","0","","",""
"4306931","1","4306986","","2010-11-29 18:45:24","0","351","<p>i'm new to opengl. as a learning exercise i started manually building some basic shapes, then moved to writing a generic .off file viewer.</p><p>my question is how ""size"" the ""window"" to fit arbitrarily sized models. i had been trying to ""pull back"" from the model by translating in the -z direction by some factor based on the range of x, y, or z coords, and this works, usually, but not always and seems like the wrong approach. sorry for the quotes, like i said i'm new and am lacking some terminology.</p><p>this happens to be on an android platform using opengl es 1.0 if that makes a difference.</p><p>can anyone point me to a best practice for achieving this?thank you.</p>","337455","","44729","","2010-11-29 20:20:48","2011-05-25 17:44:46","opengl fit an arbitrary shape","<android><opengl-es>","2","1","","",""
"4306953","1","4307437","","2010-11-29 18:47:42","4","9456","<p>I have a program that is creating an ItemizedOverlay and a map. Everything works fine upon startup. </p><p>When you close ande re-open the app, I am using onRestart() to get updated information from my server and update the map. The problem is that at this point, the ItemizedOverlay still contains the old items, and then proceeds to add the new data to the existing data. </p><p>I am looking for a way to clear out the ItemizedOverlay. There does not appear to be an ItemizedOveraly.clear, or any similar function. </p><p>Ideas about how I can do this / why is it not obvious ?</p>","300129","","","","","2010-11-29 19:49:44","How to clear / reset an ItemizedOverlay in Android?","<android><google-maps><clear><itemizedoverlay>","2","0","7","",""
"4306981","1","","","2010-11-29 18:50:56","1","2911","<pre><code>package com.converter;import java.io.IOException;import java.net.URI;import java.net.URL;import java.util.StringTokenizer;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import org.w3c.dom.Document;import org.w3c.dom.Node;import org.w3c.dom.NodeList;import org.xml.sax.SAXParseException;//import XmlReader.java;public class XMLReader { public  Float value = 25f;public XMLReader(){ String parseString = """"; try {     DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();  //  dbf.setFeature(""http://apache.org/xml/features/nonvalidating/load-external-dtd"", false);    DocumentBuilder db = dbf.newDocumentBuilder();      URI uri = new URI(""http://themoneyconverter.com/USD/rss.xml"");    ****Document doc = db.parse(uri.toString());****          doc.getDocumentElement().normalize();     NodeList nodeLst = doc.getElementsByTagName(""description"");   int length = nodeLst.getLength();     for (int s = 0; s &lt; length; s++) {     Node fstNode = nodeLst.item(s);        parseString = fstNode.getTextContent();     if(parseString.contains(""Indian Rupee"")){      System.out.println(parseString);      StringTokenizer parser = new StringTokenizer(parseString,""="");      parser.nextToken();      StringTokenizer parser1 = new StringTokenizer(parser.nextToken());          value = Float.valueOf(parser1.nextToken());      System.out.println(value);     }      }    } catch (SAXParseException e) {     value = 30f;      e.printStackTrace();    }catch (IOException e) {     value = 33f;       e.printStackTrace();   }catch (Exception e) {      value = 32f;      e.printStackTrace();   }}}</code></pre>","524243","","284354","","2011-04-29 12:14:53","2011-04-29 12:14:53","DocumentBuilder.parse(String Uri) is returning the IOException","<java><android>","1","2","1","",""
"4307118","1","","","2010-11-29 19:09:47","3","2658","<p>I've a JSONArray and I need to get the hashmap with the values, because I need to populate a stream, like twitter done.What you suggest to do?</p>","496371","","","","","2013-11-12 00:25:29","JSONArray to HashMap","<android><json>","1","2","3","",""
"4307156","1","4307198","","2010-11-29 19:14:32","0","1260","<p>I have four checkboxpreferences in my preferencescreen that I would like to interact like a radiobuttongroup, meaning that you can only check one of them! If lets say the first is checked, and you like to check another one, its just the desired one checked, and the other ones is unchecked.</p>","442691","","","","","2012-10-05 08:29:42","Android: CheckboxPreferences act like RadioButtons","<android><checkbox><preferenceactivity>","2","0","1","",""
"4307175","1","4844589","","2010-11-29 19:17:17","4","919","<p>I had a perfectly working widget as part of my project. Then I decided to extract common code (including the widget) into the library project. After doing this everything works except the widget. It appears in the list of widgets available for addition but when I place it on the desktop all I get is this toast message: ""Application is not installed on your phone"". Can someone shed light on this? </p><p>Neither configuration nor code has changed. Widget definition exists in both meta files (project and lib) with project metafile containing absolute (including path) names and all permissions.</p>","135946","","815724","","2012-10-26 16:02:02","2012-10-26 16:02:02","After extracting code to lib widget is no longer working","<android><appwidget><library-project>","2","0","","",""
"4307235","1","4307253","","2010-11-29 19:23:44","0","1009","<p>I have a TabHost and have set an onTabChangeListener. In onTabChange() is it possible to determine the previous tab?</p>","297762","","","","","2010-11-29 19:25:40","TabHost obtaining previous tab after a tab change","<android><android-tabhost>","1","0","","",""
"4307238","1","4336096","","2010-11-29 19:23:51","6","2932","<p>I have been battling with an issue in my Android app. I have been reading Android docs, my book on Android (Andriod Pro 2) and have looked at almost each and every example I could get my hands on but could not figure out how to implement <strong>storing of files (images, binary data) against records in Sqlite table exposed by the content provider</strong>.</p><p>Here is what I have done (almost similar to Notepad sample app):</p><ul><li>Implemented <code>ContentProvider</code> in my provider. It all works for CRUD operations. Internally it uses an implementation <code>SQLiteOpenHelper</code> (pretty standard stuff)</li><li>I have added a <code>_data</code> column of type text</li><li>I insert a record and get the Uri back</li><li>Call openOutputStream on the content provider and start writing the data</li></ul><p>This is exactly according to the Android Pro 2 book.Here is the snippet of that part of code:</p><pre><code>Uri uri = getContentResolver().insert(MyAuthority.CONTENT_URI, contentValues);OutputStream s = getContentResolver().openOutputStream(uri);</code></pre><p>But I get the error below:</p><blockquote>  <p>11-29 01:07:30.717:  WARN/System.err(1490):  java.io.FileNotFoundException: No  files supported by provider at  content://myproviderauthority/podcasts/1</p></blockquote><p>What do I need to do? I read Android <a href=""http://developer.android.com/guide/topics/providers/content-providers.html#creating"" rel=""nofollow"">documentation</a> but they are very vague:</p><blockquote>  <p>the field that exposes the data to  clients should actually contain a  content: URI string.</p></blockquote><p><strong>1) So does the field type need to be TEXT or is there a special <code>content: URI string</code> data type?</strong></p><p><strong>2) At the time of inserting I do not have the URI. Do I need to get the URI after insert and then update that field in the record?</strong></p><blockquote>  <p>The record should also have another  field, named ""_data"" that lists the  exact file path on the device for that  file. This field is not intended to be  read by the client, but by the  ContentResolver.</p></blockquote><p><strong>3) So what should be the type of this field be? TEXT - I assume?</strong></p><blockquote>  <p>The client will call  ContentResolver.openInputStream() on  the user-facing field holding the URI  for the item.</p></blockquote><p><strong>4) This is utter rubbish! How can I call <code>ContentResolver.openInputStream()</code> on the field?? You can only call this on the record and passing the Uri.</strong> </p><p>Thank you for your time and I hope you can help me. I have also reviewed these SO questions (<a href=""http://stackoverflow.com/questions/3883211/how-to-store-large-blobs-in-an-android-content-provider"">this</a> and <a href=""http://stackoverflow.com/questions/3926553/getcontentresolver-openoutputstreamuri-no-files-supported-by-provider"">this</a>) and they did not help.</p><p><em>By the way I am building against Level 4 of the API (version 1.6).</em></p>","440502","","440502","","2010-11-29 20:10:43","2011-08-29 13:11:44","Storing file in Android Database (Custom Content Provider) using _data field - v1.6","<android><file><sqlite><content><android-contentprovider>","1","0","3","",""
"4307257","1","4308865","","2010-11-29 19:26:26","0","1123","<p>My main class look like this:</p><pre><code>public class Soundboard extends Activity {     SharedPreferences preferences; @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);      // Initialize preferences        preferences = PreferenceManager.getDefaultSharedPreferences(this);}private void loadButtonText() {        startPlayerBtn.setText(preferences.getString(""buttontext1"", ""n/a""));}</code></pre><p>This i workning but I have change my code a litte bit with a <a href=""http://www.stealthcopter.com/blog/2010/09/android-creating-a-custom-adapter-for-gridview-buttonadapter/"" rel=""nofollow"">ButtonAdapter</a> (extra class) but cant find my Preferences there. I you look att the link I have an array that look like this in ButtonAdapter.java:</p><pre><code> public String[] filesnames = {             ""Text button 1"",            ""Text button 2"",              ""Text button 3""            };</code></pre><p>How can I but my settings into the array? Something like this that is not working:</p><pre><code>     public String[] filesnames = {            preferences.getString(""buttontext1"", ""n/a"",            preferences.getString(""buttontext2"", ""n/a"",              preferences.getString(""buttontext3"", ""n/a""            };</code></pre><p>Please help me, I am really stuck.</p>","450019","","450019","","2010-11-29 19:35:49","2010-11-29 22:46:07","How can i get my Preferences in a other class than the main (Android)?","<android><button><preferences><adapter>","3","0","","",""
"4307270","1","4334008","","2010-11-29 19:28:29","1","401","<p>I have created a <code>BroadcastReceiver</code>. Now how can I launch my custom <code>Intent</code> to test the receiver? AFAIK I cannot use Android JUnit test since the test does not have the application <code>Context</code> needed to launch an <code>Intent</code>!</p>","384598","","844882","","2012-03-22 03:32:05","2012-03-22 03:32:05","How to fire a custom intent?","<java><android>","2","0","","",""
"4307380","1","4307441","","2010-11-29 19:43:09","4","10998","<p>I am writing a httpget request for android that queries the foursquare api for nearby event. The JSON responce I receive back is </p><pre><code>{""groups"": [{  ""type"": ""Nearby"",  ""venues"": [    {      ""id"": 2587838,      ""name"": ""Marriott Druids Glen Hotel Newtownmountkennedy"",      ""primarycategory"": {        ""id"": 79281,        ""fullpathname"": ""Travel:Resort"",        ""nodename"": ""Resort"",        ""iconurl"": ""http://foursquare.com/img/categories/travel/resort.png""      },      ""address"": ""Newtownmountkennedy"",      ""city"": ""Newtownmountkennedy"",      ""state"": """",      ""verified"": false,      ""geolat"": 53.091717,      ""geolong"": -6.079162,      ""stats"": {        ""herenow"": ""0""      },      ""distance"": 5596    },</code></pre><p>There can be many of these venues. I can get it to print out the venues information using this code </p><pre><code>InputStream instream = entity.getContent();String result= convertStreamToString(instream);Log.i(""Hoosheer0"",result);// A Simple JSONObject CreationJSONObject json=new JSONObject(result);JSONArray venues = json.getJSONArray(""groups"");//JSONArray docsArray = jObject.getJSONArray(""docs"");for (int i = 0; i&lt;venues.length();i++){    String name = venues.getJSONObject(i).optString(""venues"");    //String venueName = name.    Log.i(""This is a name... pleasse"", name);}instream.close();</code></pre><p>How can I access the geolat &amp; geolong values? </p>","475803","","475803","","2010-11-30 11:50:02","2012-05-22 06:39:51","Parsing JSON response in Android","<android><json><foursquare>","2","0","1","",""
"4307443","1","","","2010-11-29 19:50:39","6","286","<p>I'm working on an android widget and it works great in API Level 5 or greater.  It's not supported at all in API Level 1 or 2.  It should work absolutely fine in 3 and 4 but for some reason the widget doesn't update.</p><p>The onUpdate method gets called and executes without errors; however, in 3 and 4 it doesn't change the text of the widget.  I'm pretty much at a loss.  Any thoughts?</p><pre><code>@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);    DataAccess helper = new DataAccess(context);    String text = helper.getCurrentText();    helper.close();    if (text != null)        views.setTextViewText(R.id.widget_text, text);    Intent intent = new Intent(context, WidgetDetailsActivity.class);    PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0);    views.setOnClickPendingIntent(R.id.widget, pending);    appWidgetManager.updateAppWidget(appWidgetIds, views);}</code></pre>","103075","","","","","2012-04-02 06:09:58","Why doesn't my app widget update in API 3 or 4?","<java><android><android-widget><appwidget>","2","5","","",""
"4307457","1","4307489","","2010-11-29 19:53:07","1","241","<p>I am an android novice and have been experimenting with SQLite and Android.  I am able to get queries and use the cursor results, but I can't seem to get this the following code to work:</p><p>This is my Query statement, where queryWhere = ""MyObject=""1"""" and DATABASE_TABLE_TOQUERY = ""FavoriteObjects"".  These are all okay when viewed in an SQLite database viewer and it also returns a correct result if I execute the query using my SQLite database viewer.</p><pre><code>public long findObject(String[] keys, String[] values,String DATABASE_TABLE_TOQUERY){    try {        if(keys.length&lt;0 || keys.length!=values.length)            System.exit(-1);        String queryWhere = keys[0]+""=\""""+values[0]+""\"""";        for(int i=1;i&lt;keys.length;i++) {            queryWhere+="" AND ""+keys[i]+""=\""""+values[i]+""\"""";        }        Cursor mCursor = mDb.query(true, DATABASE_TABLE_TOQUERY, null,                     queryWhere, null, null, null, null, null);        if (mCursor != null &amp;&amp; mCursor.getCount()&gt;0)            return Long.parseLong(mCursor.getString(mCursor.getColumnIndex(KEY_ROWID)));    }catch (SQLException e) {        return -1;    }    return -1;}</code></pre><p>When I get the results after executing the query statement, Cursor mCursor has at least one row, but when I access that row using mCursor.getString(X), it throws a weird error:</p><pre><code>android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1</code></pre><p>If I check mCursor.getColumnIndex(KEY_ROWID), I get a 0 value (which is correct). Anyone have any suggestions?</p><p>Thanks!Jon</p>","524307","","","","","2010-11-29 19:57:47","Help please! Error when accessing Data within a cursor returned by SQLite for android","<android><sqlite><cursor>","1","0","1","",""
"4307461","1","4307529","","2010-11-29 19:53:40","0","2608","<p>i'm building an android app and i want to add a history function. I heard that i can serialize a list to be able to save and retrieve data instead of using a Database, i have no idea how it works so i come here and ask for advice, is there somewhere i could get started with this. Some good links could be useful. </p><p>Thanks</p>","499488","","","","","2010-11-29 23:00:25","how to serialize HashSet","<java><android>","3","0","","",""
"4307599","1","4308240","","2010-11-29 20:08:25","0","458","<p>How can i do that? </p><p>When i click on a POI, i want to draw a button in the bottom of my mapview, with a setonclicklistener. </p>","472537","","","","","2010-11-29 21:22:31","Android MapView Draw Button on POI click","<android><android-mapview>","1","0","","2012-11-16 10:10:40",""
"4307698","1","4312261","","2010-11-29 20:18:39","0","650","<p>I am interested in your opinions on the best way to keep a robust reference to a contact starting android 2.0. I have read a lot regarding this issue but i don't know which technique is advisable and if there's any new ones. Below are the 3 options i found so far:</p><p>1- Don't use your own db. Extend the contacts.contract to write your data</p><p>2 - Use ContentObserver to keep track of any changes made to the contacts. This technique would however require your application to be running</p><p>3- Store all RAW contact IDs related to a CONTACT_ID in your db and infer the content of the aggregate contact from all its constituent RAW contacts</p><p>In my case i need to keep a separate db and i was wondering if there's any other new technique of keeping the CONTACT_ID current after aggregations and dis-aggregations...</p><p>Please advise</p>","513267","","513267","","2010-11-30 06:41:07","2010-11-30 09:37:42","CONTACT_ID - Keeping it in sync","<android><contacts>","1","1","3","",""
"4307767","1","4307810","","2010-11-29 20:25:46","3","3066","<p>This is the weirdest thing I've seen in Eclipse. When I ran my Android project, I forgot to select the Main view class and the one selected was the <code>main.xml</code>, so as you may know I got the file <code>main.out.xml</code> generated by Eclipse. To solve this, I selected ""Project > Clean,"" but after that my <code>R</code> class under <code>gen/</code> disappeared. Does anyone know how to get it back and/or how to avoid this? Thanks in advance.</p>","499488","","121493","","2010-11-29 20:28:09","2014-02-21 13:01:36","R class been removed by Eclipse after Clean Project","<android><eclipse>","3","2","1","",""
"4307887","1","4307902","","2010-11-29 20:39:04","2","152","<p>I am using Eclipse to develop a couple of apps for Android phones.  I want to experiment with one app starting the other via startActivity().  What is unclear to me, is how to I get both apps loaded onto the emulator.  How do I get both apps onto the emulator so, I can test their ability to start each other?</p>","500964","","","","","2010-11-29 20:41:50","How do you load two apps onto the android emulator?","<android><android-emulator>","1","0","","",""
"4307938","1","4308543","","2010-11-29 20:46:29","2","1237","<p>I use opengl to draw values from an array. The values are from the 3 Android sensors. I want to turn of the renderer during I collect the values. It seems that drawing and gathering at the same time have differenet results, so I want to turn off rendering while I gathering sensorvalues. At the moment I use a boolean in the ondraw() to stop drawing. But is there a better way to do this? There happen freaky things when I stop drawing , like the stuff I draw jittering a little bit some times, but it can't be because there are no drawing( ondraw(){ if(boolean){.........}} </p><p>Thank you so much for your help :-)</p>","372021","","477771","","2010-11-29 21:14:50","2010-11-29 22:03:43","best way to stop ondraw() opengl for a time","<android><opengl-es>","2","1","1","",""
"4308053","1","","","2010-11-29 20:59:58","0","2076","<p>I am looking for a way to show the options menu when the app starts up.</p><p>I've tried using openOptionsMenu() in my onCreate() function, but that throws a null error.</p><p>So I tried simulating the menu button keypress with:        KeyEvent eventDown = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK);        KeyEvent eventUp = new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK);        dispatchKeyEvent(eventDown);        dispatchKeyEvent(eventUp);  </p><p>but that doesn't seem to do anything at all.</p><p>Does anyone have any suggestions as to how I would be able to open the menu on start up, or at least simulate the menu button key press?</p>","1639706","","","","","2010-11-29 20:59:58","Simulating key press in android or creating showing options menu on start up","<android>","0","3","","",""
"4308061","1","4308136","","2010-11-29 21:01:04","2","2949","<p>I have a ListView that lists a set of books.<br>The user can add a new book and, after that, the set of books is shown again using the onActivityResult method.</p><p>I have been trying for hours to get the set of books to refresh after adding a new book but with no luck, at all.</p><p>This is the code I have tried:</p><pre><code>public class BookActivity extends Activity {    private ArrayList&lt;Book&gt; books = null;       private BookItemAdapter bookItemAdapter;    ListView booksSetView = null;        @Override    public void onCreate(Bundle savedInstanceState) {           books = new ArrayList&lt;Book&gt;();                booksSetView = (ListView)findViewById(R.id.booksSet);           Cursor booksCursor = null;        booksCursor = getBooksCursor();                              if (booksCursor.moveToFirst())        {            do            {                   books.add(getBookFromCursor(booksCursor));                              } while(booksCursor.moveToNext());        }        bookItemAdapter = new BookItemAdapter(this, R.layout.book_item, books, 0); // BookItemAdapter is a ArrayAdapter                booksSetView.setAdapter(bookItemAdapter);    }    @Override    public void onActivityResult(int requestCode, int resultCode, Intent data)    {        super.onActivityResult(requestCode, resultCode, data);            Log.e(""BOOKS MANAGER"", ""trying to refresh"");        bookItemAdapter.notifyDataSetChanged();        booksSetView.invalidate();        booksSetView.invalidateViews();         }}</code></pre><p>Please some help.<br>Thanks a lot!</p>","354742","","","","","2014-04-07 13:49:51","Android - I can't refresh / redraw a ListView","<android><listview>","4","0","1","",""
"4308084","1","","","2010-11-29 21:04:13","2","164","<p>Nothing is getting written to the TextView screen.</p><p>I'm not sure what I'm doing wrong here but this is my following code:</p><pre><code>&lt;?xml version=""1.0""?&gt;  &lt;news&gt;   &lt;article title=""TITLE HERE"" link=""*.php?showtopic=118"" date=""DATE HERE""&gt;&lt;/article&gt;  &lt;/news&gt;</code></pre><p>JAVA CODE:</p><pre><code>try {    //open an URL connection make GET to the server and    URL url = new URL(""http://.../m_news.xml"");    HttpURLConnection conn = (HttpURLConnection) url.openConnection();    if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {    InputStream is = conn.getInputStream();    //DocumentBuilderFactory, DocumentBuilder are used for    //xml parsing    DocumentBuilderFactory dbf = DocumentBuilderFactory        .newInstance();    DocumentBuilder db = dbf.newDocumentBuilder();    //using db (Document Builder) parse xml data and assign    //it to Element    Document document = db.parse(is);    Element element = document.getDocumentElement();    NodeList nodeList = element.getElementsByTagName(""news"");    NodeList nodeList2 = element.getElementsByTagName(""article"");        if (nodeList.getLength() &gt; 0) {            for (int i = 0; i &lt; nodeList2.getLength(); i++) {                Element entry = (Element) nodeList.item(0);                 Element _rowE = (Element) entry.getElementsByTagName(""article"").item(i);                  Node _rowTITLE = _rowE.getAttributes().getNamedItem(""title"");                Node _rowLINK = _rowE.getAttributes().getNamedItem(""link"");                TextView textview = new TextView(this);                textview.setMovementMethod(LinkMovementMethod.getInstance());                String text = ""&lt;a href='""+_rowLINK.getNodeValue()+""'&gt;""+_rowTITLE.getNodeValue()+""&lt;/a&gt;"";                textview.setText(Html.fromHtml(text));                setContentView(textview);            }        }        }} catch (Exception e) {    e.printStackTrace();}</code></pre>","524361","","311660","","2010-11-29 21:12:00","2010-11-29 21:25:44","pulling information from xml but wont display","<android><xml>","1","4","","",""
"4308232","1","4308270","","2010-11-29 21:21:52","2","12995","<p>I am trying to pass data through my Intent into the next activity so I can receive it and give a timer values.</p><pre><code>Button TimerButton = (Button)findViewById(R.id.TimerActivityButton);TimerButton.setOnClickListener(new View.OnClickListener(){     public void onClick(View v)     {          Intent timer = new Intent (BeefActivity.this,TimerActivity.class);          timer.putExtra(""beefType"", 5000);          timer.putExtra(""beefThickness"", 5000);          timer.putExtra(""grillTime"", 15000);          startActivity(timer);      }});</code></pre><p>I have tried different methods of receiving the values, and I keep getting a force close or compiler errors. I know this is simple so can somebody please show me how to do this. Thank you in advance!</p><hr><pre><code>This is force closing</code></pre><ul><li>I tried passing in int length = beefType and it force closed</li><li>I tried changing the -1 to 200, it still force closed</li><li>I put back int length = 20000 where it worked originally</li></ul><p>Just having <code>int beefType = getIntent().getIntExtra(""beefType"", -1);</code> at the top of my class makes it force close. No compiler errors. I am stuck :-( Here is how my code looks</p><hr><pre><code>package com.android.project1;import android.app.Activity;import android.os.Bundle;import android.os.CountDownTimer;import android.view.View;import android.widget.Button;import android.widget.TextView;public class TimerActivity extends Activity {    int beefType = getIntent().getIntExtra(""beefType"", 200);  TextView timeDisplay;  MyCount counter;  int state = 0;  int length = 20000;  long startTime = 0;  long currentTime = 0;  long timeElapsed = 0;  long timeRemaining = 0;  long prevTimeRemaining = 0;  Button control;  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.timer);    timeDisplay = (TextView) findViewById(R.id.timer);    control = (Button) findViewById(R.id.control);    counter = new MyCount(length, 100);  }  public String formatTime(long millis)   {      String output = ""00:00:00"";      long seconds = millis / 1000;      long minutes = seconds / 60;      long hours = minutes / 60;      seconds = seconds % 60;      minutes = minutes % 60;      hours = hours % 60;      String secondsD = String.valueOf(seconds);      String minutesD = String.valueOf(minutes);      String hoursD = String.valueOf(hours);       if (seconds &lt; 10)        secondsD = ""0"" + seconds;      if (minutes &lt; 10)        minutesD = ""0"" + minutes;      if (hours &lt; 10)        hoursD = ""0"" + hours;      output = hoursD + "" : "" + minutesD + "" : "" + secondsD;      return output;    }  public void control(View view) {    switch (state) {    case 0:      startTime = System.currentTimeMillis();      counter.start();      control.setText(R.string.pause);      state = 1;      break;    case 1:      // Pause      currentTime = System.currentTimeMillis();      timeElapsed = currentTime - startTime;      if (prevTimeRemaining == 0)        timeRemaining = length - timeElapsed;      else        timeRemaining = prevTimeRemaining - timeElapsed;      counter.cancel();      timeDisplay.setText(""Left: "" + String.valueOf(formatTime(timeRemaining)));      control.setText(R.string.resume);      prevTimeRemaining = timeRemaining;      // Resume      counter = new MyCount(timeRemaining, 100);      state = 0;      break;    case 2:      prevTimeRemaining = 0;      counter = new MyCount(length, 100);      control.setText(R.string.start);      timeDisplay.setText(R.string.timer);      state = 0;    }  }  public class MyCount extends CountDownTimer   {    public MyCount(long millisInFuture, long countDownInterval)     {      super(millisInFuture, countDownInterval);    }    public void onTick(long timeRemaining)     {        timeDisplay.setText(""Left: "" + formatTime(timeRemaining));    }    public void onFinish()     {      timeDisplay.setText(""Finished!"");      state = 2;      control.setText(R.string.restart);    }  }}</code></pre>","484707","","484707","","2010-11-30 18:46:45","2010-11-30 18:46:45","Passing data through Intent and receiving it","<android><activity><android-intent>","2","2","3","",""
"4308249","1","4308446","","2010-11-29 21:23:33","6","9694","<p>Under Android NDK, is there a sleep() function which sleeps for X miliseconds, but do not block the event loop?</p><p>We are writing API tests to work on Mac, Windows, and Android. So far, we have implemented some sort of sleep() for Mac and Windows, but we are all new to Android NDK and need some help there. Thank you in advance.</p>","459745","","","","","2010-11-30 03:37:11","Is there a sleep() function for Android NDK?","<c++><android><android-ndk>","3","0","1","",""
"4308262","1","4316717","","2010-11-29 21:25:09","22","30704","<p>I want to display an arrow at my location on a google map view that displays my direction relative to a destination location (instead of north).</p><p>a) I have calculated north using the sensor values from the magnetometer and accelerometer. I know this is correct because it lines up with the compass used on the Google Map view.</p><p>b) I have calculated the initial bearing from my location to the destination location by using myLocation.bearingTo(destLocation); </p><p>I'm missing the last step; from these two values (a &amp; b) what formula do I use to get the  direction in which the phone is pointing relative to the destination location?</p><p>Appreciate any help for an addled mind!   </p>","227228","","","","","2013-04-23 11:33:27","Calculate compass bearing / heading to location in Android","<android><location><compass-geolocation><heading><bearing>","7","3","31","",""
"4308334","1","4312167","","2010-11-29 21:34:59","1","432","<p>I have created a content provider (a word and its definition database). I also have an activity that will display a word and its definition, this activity requires two things: a custom Parcelable extra, and of course the word.</p><p>The goal is that in big texts in my app, Linkify will match some words, and when the user clicks on it it will display an activity with the word and its definition. The words are stored in a database, hence the content provider. The activity requires the word to be displayed, and an additional Parcelable. However Linkify does not provide access to the Intent. Currently the intent only contains the word to be defined.</p><p>What whould I do to be able to add the custom Parcelable to the Intent created implicitly by Linkify.addLinks?</p><p>Thank you for reading.</p>","334493","","","","","2010-11-30 18:19:15","How to add extras to an intent created by Linkify?","<android><android-intent><android-contentprovider>","1","0","","",""
"4308349","1","4308516","","2010-11-29 21:37:30","3","365","<p>I know that the + in @+id tells the compiler to add the id to the (R.id.???) resources. However i was wondering if there were performance benefits to be gained by not putting the + ?</p><p>Perhaps for example when dealing with complex list view layouts?</p>","468195","","","","","2010-11-30 00:54:35","Android: Are there any benefits to using @id over @+id performance wise?","<android><xml-schema>","4","2","1","",""
"4308427","1","","","2010-11-29 21:48:38","-1","2300","<p>I have tried Handler, got no accuracy at all, </p><p>CountDownTimer, accurate most of time and </p><p>TimerTask, always accurate but on first call.</p><p><strong>Scenario:</strong></p><p>I'm trying to stop sound playing after specific amount of time.</p><p><em>Calling code</em></p><pre><code>TimeTask task = new TimeTask();Timer timer = new Timer();task.setMediaPlayer(mediaPlayer);timer.schedule(task, 400);mediaPlayer.start();</code></pre><p>I have created MediaPlayer that I'm giving to class that extends TimerTask. It will release MediaPlayer after specific amount of time.</p><p><em>class that extends TimerTask</em></p><pre><code>private MediaPlayer mMediaPlayer = new MediaPlayer();public void setMediaPlayer(MediaPlayer mediaPlayer) {    this.mMediaPlayer = mediaPlayer;    mMediaPlayer.start();}@Overridepublic void run() {ListIterator&lt;MediaPlayer&gt; iterator = SoundboardMenu.mMediaPlayerList.listIterator();        while (iterator.hasNext()) {            MediaPlayer iteratedPlayer = iterator.next();            if (iteratedPlayer.equals(mMediaPlayer)) {                iteratedPlayer.release();                iterator.remove();                break;            }        }}</code></pre><p>It works fine but it's not always accurate enough.</p><p>If we wait over 5 seconds after calling class that extends TimerTask and call it again, then there will be slightly more delay and sound plays longer. If we call it repeatedly then we always get slightly shorter delay.</p>","524411","","524411","","2010-11-29 23:59:15","2010-11-30 00:49:06","How to make accurate timer on Android?","<android><timer>","1","1","","",""
"4308473","1","","","2010-11-29 21:54:41","34","13138","<p>I'm developing a non-public Android app, i.e. the app won't be available in the global Android Market. The app will be installed on a limited number of clients, e.g. by using an apk file.How can I enable an auto-update functionality in this app?</p><p>I see different potential options (I do not know if those are technically hard or even impossible to implement or if there are any existing functionalities that can be reused):</p><ul><li>On each launch the app tests if a new version exists (by requesting a server), if so downloads the new apk and replaces itself with the new version.</li><li>Use (or develop?) a separated app or service that undertakes the update-check and replacement-process.</li><li>Use (or develop?) a private market app which has an auto-update option. This option is similar to the second one, but more generic: The market app would be connected to a repository, i.e. it would handle an arbitrary number of (private) apps.</li></ul><p>I would prefer option one since the auto-update functionality is included in the app which needs less development efforts.</p>","516472","","1882129","","2013-07-03 07:00:35","2013-08-08 14:20:41","Auto-Update for (private) Android apps","<android><google-play><auto-update>","2","5","17","",""
"4308542","1","4308607","","2010-11-29 22:03:42","0","506","<p>I'd like to add a delay between the text to speech and the subsequent voice recognition but don't know enough about wait/sleep statements and the concept of not blocking the main thread.  Could I have suggestions on how to achieve a wait until the text to speech is finished speaking and the voice recognition starting.</p><pre><code>                String myText1 = ""Please speak the new speedlimit"";                mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, null);                speechSucess = true;                startVoiceRecognitionActivity();</code></pre>","414529","","","","","2010-11-29 22:12:16","Delay between speech and voice recognition","<android>","1","0","","",""
"4308598","1","4308706","","2010-11-29 22:11:36","1","677","<p>I am populating a spinner from a DB. It works great. Except that if that part of the DB has not been filled out yet and the spinner is empty. That is a problem when someone tries to append to that part of the DB with a blank spinner, you get a <code>nullpointerexception</code>. I have tried all kinds of variations of </p><pre><code>if (spinner == null) {warn the person and finish()}</code></pre><p>Or </p><pre><code>if (spinner.equals(""""){warn the person blah blah blah}.</code></pre><p>Any Solution?</p>","447560","","1369235","","2012-09-01 10:31:39","2012-09-01 10:31:39","How to prevent NULL spinner?","<android><sqlite><spinner>","1","1","","",""
"4309071","1","","","2010-11-29 23:15:24","0","506","<p>I have the following XML output:</p><pre><code>&lt;info&gt;   &lt;ip&gt;70.56.98.195&lt;/ip&gt;   &lt;host&gt;70-56-98-195.slkc.qwest.net&lt;/host&gt;   &lt;country&gt;UNITED STATES&lt;/country&gt;   &lt;cimg&gt;http://localhost/ip-to-country/country-flags/us.png&lt;/cimg&gt; &lt;/info&gt; &lt;searches&gt;   &lt;ips link=""http://www.stopforumspam.com/search?q=70.56.98.195"" title=""Stop Forum Spam""&gt;&lt;/ips&gt;   &lt;ips link=""http://openrbl.org/client/#70.56.98.195"" title=""Openrbl DNSBL RBL Blacklist""&gt;&lt;/ips&gt;   &lt;ips link=""http://www.afrinic.net/cgi-bin/whois?searchtext=70.56.98.195"" title=""AfriNIC (Africa)""&gt;&lt;/ips&gt;   &lt;ips link=""http://www.apnic.net/apnic-bin/whois2.pl?searchtext=70.56.98.195"" title=""APNIC (Asia Pacific region)""&gt;&lt;/ips&gt;    &lt;ips link=""http://ws.arin.net/cgi-bin/whois.pl?queryinput=70.56.98.195"" title=""ARIN (North America, a portion of the Caribbean and sub-Saharan Africa)""&gt;&lt;/ips&gt;   &lt;ips link=""http://lacnic.net/cgi-bin/lacnic/whois?query=70.56.98.195"" title=""LACNIC (Latin American and Caribbean region)""&gt;&lt;/ips&gt;   &lt;ips link=""http://www.ripe.net/perl/whois?searchtext=70.56.98.195"" title=""RIPE (Europe, the Middle East and parts of Africa and Asia)""&gt;&lt;/ips&gt;   &lt;ips link=""http://www.robtex.com/ip/70.56.98.195.html"" title=""Robtex""&gt;&lt;/ips&gt; &lt;/searches&gt;</code></pre><p>My question is, what is the best way to pull that data out and is there a better way I should be out putting my XML data?</p>","524478","","","","","2010-12-02 08:08:55","How would I extract this XML Data?","<java><android><xml><parsing><extract>","3","1","","",""
"4309075","1","","","2010-11-29 23:16:27","4","2606","<p>I have a big string that represents JSON feed. My app downloads this feed from remote web service.</p><p><strong>Questions:</strong></p><p>1) Once I download JSON feed, where should I store it? Right now I am storing it in app Preferences and it works fine. I am just interested if there is any reason not to do that, or if there are better/faster options, like Internal Storage or something else?</p><p>2) When I am about to show data from this feed in my activity, I do something like this:</p><pre><code>JSONObject jsonObj = new JSONObject(json_string);JSONArray jsonArr = jsonObj.getJSONArray(""root"");for (int m = 0; m &lt; jsonArr.length(); m++) {    ....}</code></pre><p>The problem is, the first line that parses JSON feed is sort of expensive. At my current size feed (that might grow in the future) it takes maybe half a second to complete, not much, but still a problem. For example, I click button to call activity (to show data) and this 1/2 sec pause is noticeable and not good.</p><p>To avoid this pause, I should probably parse JSON immediately after feed is downloaded. Then question is, where should I keep parsed JSON object?</p><p>i) I can't save JSON object to preferences since only primitive data can be stored there.</p><p>ii) Should I do parsing every time my app starts, and make my parsed JSON objects (I have more of them) global (on application level) so I can access them from all of my activities?</p><p>iii) Or, I believe my 3rd option would be to declare JSON objests static so they can be easy accessed from other activities?</p><p>What is the best way to do this?</p><p>THX.</p>","507153","","","","","2010-11-30 03:13:04","What is the best way to deal with JSON object?","<android><json><parsing><storage><preferences>","3","0","2","",""
"4309085","1","4309183","","2010-11-29 23:18:39","0","859","<p>I have an application with multiple activities. In the main class I open a database and create a list of the content like so:</p><pre><code>public class MyApplication extends Activity{    private List&lt;PhoneNumber&gt; numberList;    public void onCreate(Bundle savedInstanceState)    {        ...        numberList = new ArrayList&lt;PhoneNumber&gt;();        ...        loadDatabase()        ...    }    private void loadDatabase()    {        // File IO and parsing stuff        addNumber(thisNumber);   // executes for each entry    }    public void addNumber(PhoneNumber thisNumber)    {        numberList.add(thisNumber);    }}</code></pre><p>This works fine and I have a ListView in the main activity that is populated with this data. Now, moving on to the next step. I am trying to launch a form as a new activity that will add an entry to this list. The activity launches fine, and I was able to build a form easily. The problem is accessing the list to add to it.</p><pre><code>public class AddNumber extends Activity{    ...    // This function is called from the done button    // &lt;Button android:text=""Done"" android:onClick=""formDone""/&gt;    public void formDone(View v)    {        // findViewByIds here to get data from form.         // This is done correctly and I can see my data in memory        MyApplication access = new MyApplication();        PhoneNumber newNumber = new PhoneNumber();        // Fill newNumber object with data from form. Done correctly. Verified        access.addNumber(newNumber);    }</code></pre><p>The last line of <code>formDone()</code> executes correctly. Through debugging I can step through to the Application class and it executes <code>addNumber()</code>. Before executing <code>numberList.add(thisNumber);</code> I can look at the contents of memory for the <code>thisNumber</code> object it is trying to add to the list and that data is correct. Attempting to execute that line though crashes the application in standard Android format. (Loads View.class with 'Source not found' followed by ZygoteInit$MethodBlahBlah).</p><p>So I'm a little confused because it looks like the data being fed to <code>addNumber()</code> is correct, and the function works perfectly fine when the application first launches by building the list from the data in the database. Fundamentally, am I thinking about this correct? Should a form like this be it's own activity or is there a better way to do it? If it can be it's own activity, what am I doing wrong?</p><p>Thanks,<br>Nate</p>","450780","","450780","","2010-11-29 23:27:17","2010-11-29 23:36:51","Android Form as an Activity","<java><android><forms><activity>","2","2","","",""
"4309196","1","","","2010-11-29 23:36:58","0","317","<p>I'm starting my service with the BOOT_COMPLETED broadcast and then bring it to the front with startForeground. Using it in a closed system, so it won't bother any other apps. Anyhow, I have three questions that are pretty similar to each other :-) , they are:</p><ol><li><p>I usually make a thread inside my services, but do I need to do that in this case? Which thread is it blocking sins it's starting at boot-up? The UI-thread?</p></li><li><p>If I start a service with startForeground and I start a thread in that service, will the thread also be on foreground?</p></li><li><p>Will every service/activity that I start from the service (that's on foreground) automatically also be on foreground?</p></li></ol><p>Thanks!</p>","524468","","","","","2010-11-29 23:41:15","Do I need a thread in a boot_completed and startForeground started service?","<android><multithreading><service><foreground>","1","0","","",""
"4309198","1","","","2010-11-29 23:37:15","3","284","<p>I want to achieve android layout for text and image to be as shown on the left pic, however with ImageSpan and in-lining image into text at start gives me only what's on the right pic.</p><p>Are there any solutions to beautifully bypass large image with text?</p><pre><code>|-------------| texttexttexttexttext   |-------------| |             | texttexttexttexttext   |             | |   image     | texttexttexttexttext   |   image     | |             | texttexttexttexttext   |             ||-------------| texttexttexttexttext   |-------------| texttexttexttexttexttexttexttexttexttexttexttexttexttext    texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext    texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext    texttexttexttexttexttexttexttexttext|</code></pre>","366101","","","","","2011-12-11 10:19:08","Android layout bypass image with text","<android><layout>","1","1","","",""
"4309249","1","","","2010-11-29 23:45:55","5","5846","<p>I want to ask if Google Earth API is avaialble for developing android application.If google earth api is not available for android, are there any map api which can be used off network on android?</p>","524496","","","","","2010-11-30 00:58:04","Google Earth API for Android","<android><google-earth>","3","1","3","",""
"4309291","1","4309400","","2010-11-29 23:53:38","5","1218","<p>Suppose I want to <strong>render/present</strong> a text transmitted in the form of some <code>lightweight</code> <code>markup language</code>. Are there any ready-to-use libraries for <code>Android</code>, which take as input text in a lightweight markup language and present it nicely? When I say lightweight markup language, I mean Markdown (<a href=""http://en.wikipedia.org/wiki/Markdown"" rel=""nofollow"">http://en.wikipedia.org/wiki/Markdown</a>) or something similar.</p>","508019","","637517","","2013-02-22 08:35:10","2013-02-23 04:08:07","Does a lightweight markup language library for Android exist?","<java><android><markdown><bbcode><creole>","2","0","5","",""
"4309401","1","6759334","","2010-11-30 00:13:04","1","1556","<p>I have only used SQLiteOpenHelper and it's not that easy to use.</p><p>I wonder if there's an ORM similar to Django or Rails.</p>","112381","","179850","","2011-02-18 13:33:25","2013-07-15 10:14:46","Is there a framework/library to easily manage databases on Android aside from SQLiteOpenHelper?","<android><orm>","2","0","","",""
"4309470","1","4309730","","2010-11-30 00:26:52","2","89","<p>Good evening I am considering creating an application on the android platform and I want to know if it is possible to launch an application based on a particular system event, like pressing and holding a specific button for a period of time (i.e. 3 secs and launch application)?</p>","524530","","","","","2010-11-30 01:20:54","Is it possible to map a button and/or a system event to launch an android application?","<android>","2","1","","",""
"4309528","1","","","2010-11-30 00:38:41","0","903","<p>What mechanism let the (OS) daemons know that the phone enters the sleep/suspend mode in Android?</p><p>Does the init process (which is the parent of all daemons) send a kill signal when the phone switch to suspend mode?</p>","460153","","460153","","2010-11-30 01:53:45","2010-11-30 02:23:17","Android suspend mode","<android><linux>","1","0","","",""
"4309731","1","4310360","","2010-11-30 01:21:02","0","741","<p>I'm trying to set a custom background for the tabs in my TabWidget. They're pretty much all just a bunch of rectangle shape gradients, but I found out that by setting the background drawables, it removes the default divider between each tab. To remedy this, I used a layer-list drawable to layer a divider on top of the tabs. However, now, it's affecting the layout of the tab itself, causing the image and text label to move apart.</p><p><a href=""http://i377.photobucket.com/albums/oo211/wowforums/Stuff/gradient.png"" rel=""nofollow"">Intended result</a><br><a href=""http://i377.photobucket.com/albums/oo211/wowforums/Stuff/layerlist.png"" rel=""nofollow"">What I get by using a layer-list for the background</a></p><p>I'm just using this to setup the backgrounds:  </p><pre><code>TabWidget tw = mTabHost.getTabWidget(); for (int i = 0; i &lt; tw.getChildCount(); i++) {     View v = tw.getChildAt(i);     v.setBackgroundDrawable(getResources().getDrawable (R.drawable.tab_background)); }</code></pre><p>Any clues as to why this is happenings, or suggestions on what else I can do instead?</p>","295675","","","","","2010-11-30 03:49:20","Setting a tab's background with a layer-list drawable affecting layout","<android><tabwidget>","1","0","","",""
"4309748","1","","","2010-11-30 01:26:04","1","240","<p>i did a test that i made a global variable in application and i also made a service regularly output a variable increased progressively with the Activity by binded by the Activity.Then i assign a number to the global variable, and finish the Activity(the main Activity).But when i open the application again,the global variable is still exist and the variable in the service is still exist.When i finish the Activity ,i saw the task in android,the application is still exist.It sounds strange,can everybody can help me why it happened</p>","445611","","","","","2010-11-30 01:26:04","call finish but not finish","<android><service>","0","2","","",""
"4309780","1","4310515","","2010-11-30 01:34:10","0","103","<p>In android contacts application, if I set the 'Sort list by' options to 'Last name', when I scroll the contacts list view, the first name of that contact is invisible. But the scrolling stop, the first name of the contact is visible. </p><p>I have a list view in my application, how can i get notified when does my list view stops scrolling?</p><p>Thank you.</p>","286802","","","","","2010-11-30 04:24:59","How can i implement the first name of the contact disappear as i scroll the contacts","<android>","1","0","","",""
"4309797","1","","","2010-11-30 01:38:04","0","865","<p>I am new to android but not to programming. And the code below makes the icon.png that is available by default in android, go across the screen or at least it is supposed to. This doesn't work. Can anyone help?</p><pre><code>&gt; package com.android.test; import&gt; android.app.Activity; import&gt; android.content.Context; import&gt; android.graphics.Bitmap; import&gt; android.graphics.BitmapFactory; import&gt; android.graphics.Canvas; import&gt; android.graphics.Color; import&gt; android.os.Bundle;&gt; &gt; &gt; import android.view.View; import&gt; android.view.Window;&gt; &gt; public class Android extends Activity&gt; { int x,y=10;&gt; &gt; @Override public void onCreate(Bundle&gt; savedInstanceState) {&gt; super.onCreate(savedInstanceState);&gt; requestWindowFeature(Window.FEATURE_NO_TITLE);&gt; setContentView(new Panel(this)); }&gt; &gt; class Panel extends View { public&gt; Panel(Context context) {&gt; super(context); }&gt; &gt; @Override public void onDraw(Canvas&gt; canvas) { Bitmap _scratch =&gt; BitmapFactory.decodeResource(getResources(),&gt; R.drawable.icon);&gt; canvas.drawColor(Color.BLACK); int&gt; n=1;  while (n==1){ try {&gt; Thread.sleep(30);  } catch&gt; (InterruptedException e) { }&gt; canvas.drawBitmap(_scratch, x, y,&gt; null);  x+=2; y+=2;&gt; &gt; canvas.drawBitmap(_scratch, x, y,&gt; null);  } } } }</code></pre>","524570","","","","","2010-11-30 04:18:36","Android loop problem","<android><loops><icons>","3","1","1","",""
"4309806","1","4309822","","2010-11-30 01:41:00","2","326","<p>Can someone provide me with an example of how to perform an action when the user taps on a widget? The only example I have found launches an activity. I assume that it must still do it with some sort of pending intent and maybe a broadcast receiver, but I'm not sure how to do it.</p>","178014","","","","","2010-11-30 01:45:28","Android, perform action when widget is clicked","<android><widget><android-intent>","1","0","","",""
"4309840","1","4310488","","2010-11-30 01:50:11","3","2675","<p>When starting a certain activity of my app, the user is ""welcomed"" with a dialog that he must fill with some data in order to proceed. Then, in the activity per se, the user has 2 buttons that enable him to dynamically create and delete an infinite number of fields (that are composed by several views)</p><p>As you know, when the screen orientation changes, the activity is restarted so every information is lost. Obviously, this can be problematic.</p><p>In order to handle the screen orientation, android documentation advises developers to use <a href=""http://developer.android.com/resources/articles/faster-screen-orientation-change.html"" rel=""nofollow"">onRetainNonConfigurationInstance()</a>. The only problem is that if you use it to save objects in a context all the views tied will leak. This is further problematic in my case, since the data in that activity is inherently tied to its view, which, in turn, is tied with its context.</p><p>Android Documentation does not recommend developers to handle configuration changes themselves. They state (and I quote) ""in general, a short-term solution that will only complicate their lives later""</p><p>I can bypass the initial dialog easily, creating a hasBeenShown Boolean and set it to true, for instance. I can even bypass the ""dynamically created views"" problem by saving their metadata: in this case the number of fields generated, their type, their relative position to each other, their text or selection, and so on... (with some minor bugs, but nothing serious).</p><p>But since fields(views) are generated dynamically with layoutInflate(and thus we can have an infinite number of views), when re-generating those same fields after screen orientation change, the application gets really really slow even on emulator. With 20 fields (approximately 120 views) on a real device (Samsung Galaxy S) it took almost 1 minute to complete.</p><p>Strangely, when I passed views directly (and thus, leaking all that stuff), it took my Samsumg Galaxy S less than 10 seconds to complete.  </p><p>With this information, what do you think its the best approach?</p><p>(1) - Let the fields reset? (not really an option, I bet anyone would get pissed if they inadvertently tilt their screen =P)</p><p>(2) - Add a loading screen while android takes care of changing screen orientation?</p><p>(3) - Block screen orientation change</p><p>(4) - Handle screen orientation change myself, and hope the impeding Doom Android docs talk about never comes.</p><p>P.S: A bit offtopic, but when my activity finishes, all memory is released right?</p>","295342","","295342","","2011-05-14 15:55:06","2011-05-14 15:55:06","Best way of handling Screen Orientation Changing when working with dynamically created views?","<android><memory-leaks><screen-orientation>","1","0","4","",""
"4309849","1","","","2010-11-30 01:52:35","2","732","<p>My android application has a login screen that is launched as the main activity with intents as follows:</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>Nothing else is out of the ordinary (that I am aware of, concerning the other activities, etc, no additional intents set on those or anything).</p><p>With the emulator, if I login and the second activity is launched, then I press the home button, if I launch the app again from a homescreen shortcut the task returns to the second activity. This is the desired behavior, as I don't want the user to have to login over and over again.</p><p>With both an HTC Incredible and a Droid X (only phones I have access to), if I login and the second activity launches, then press the home button, if I relaunch the app from a homescreen shortcut, it always launches the login activity, which is not the desired result. I want it to resume at the second activity where I left off.</p><p>Does anyone have any insight as to why this works as intended with the emulator but not on the phones? Thank you very much.</p>","191528","","683261","","2012-01-18 05:06:09","2012-01-18 05:06:09","activities resume from homescreen launcher in emulator, but not on android device","<android><activity><android-intent><resume>","2","3","2","",""
"4309964","1","4310440","","2010-11-30 02:18:20","1","1083","<p>I am trying to make an app with tabs at the top that link a website too each one, such as a computer that uses tabs in safari or firefox. what i am trying to do is implement an add and delete class that will allow the user to delete a tab if wanted and add another that will link to a different website. Any help would be greatly appreciated.</p><p>here is the main java file.</p><pre><code>public class UniversityofColorado extends TabActivity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TabHost host=getTabHost();    host.addTab(host.newTabSpec(""one"")            .setIndicator(""Google"")            .setContent(new Intent(this, Hello.class)));    host.addTab(host.newTabSpec(""two"")                    .setIndicator(""Colorado Main Site"")                    .setContent(new Intent(this, ColoradoMainSiteBrowser.class)));    host.addTab(host.newTabSpec(""three"")                    .setIndicator(""CULearn"")                    .setContent(new Intent(this, CULearnBrowser.class)));    host.addTab(host.newTabSpec(""four"")            .setIndicator(""CULink"")            .setContent(new Intent(this, CULinkBrowser.class)));    host.addTab(host.newTabSpec(""five"")            .setIndicator(""MyCUInfo"")            .setContent(new Intent(this, MyCUInfoBrowser.class)));    host.addTab(host.newTabSpec(""six"")            .setIndicator(""Campus Map"")            .setContent(new Intent(this, CampusBrowser.class)));    host.addTab(host.newTabSpec(""Seven"")            .setIndicator(""Notes"")            .setContent(new Intent(this, Notepadv3.class)));}       // Inflates menu when ""menu Key"" is pressed    @Override    public boolean onCreateOptionsMenu(Menu menu) {        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.menu, menu);        return true;    }}</code></pre><p>This is one of the java files that the main java file uses</p><pre><code>public class ColoradoMainSiteBrowser extends Activity {WebView webview;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);webview = (WebView) findViewById(R.id.webview);webview.setWebViewClient(new HelloWebViewClient());webview.getSettings().setJavaScriptEnabled(true);webview.loadUrl(""http://colorado.edu/"");}private class HelloWebViewClient extends WebViewClient {@Overridepublic boolean shouldOverrideUrlLoading(WebView view, String url){view.loadUrl(url);return true;}}public boolean onKeyDown(int keyCode, KeyEvent event) {if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {webview.goBack();return true;}return super.onKeyDown(keyCode, event);}}</code></pre><p>how would i implement the add and delete buttons to have this same format when the new tabs were added</p>","524592","","524592","","2010-11-30 17:58:56","2013-02-07 18:50:25","how to implement a command that allows user to add and delete tabs in the application","<android><delete><tabs><add><android-webview>","1","7","1","",""
"4309992","1","","","2010-11-30 02:24:59","1","528","<p>I'm porting application from iPad to Galaxy Tab and, since I hadn't had much experience with programming for Android devices I'd like to know some ""general"" things.</p><p>I've used CoreText for all my ipad text drawing needs, what can I use in Android? How can I break large text apart dividing it in to frames/paths and then layout them on screen (think, columns in news application articles). It looks like that Paint class does some things related to what I need, but I don't know if that's the proper way to go. </p><p>Please, enlighten me :)</p>","90571","","","","","2010-11-30 07:16:50","Android: advanced text drawing (columns, fixed height, paging). How?","<android><android-layout>","2","0","3","",""
"4310088","1","4310125","","2010-11-30 02:45:12","7","42028","<p>Why is there a terminal emulator in the Android App Market?</p>","139284","","63550","","2012-07-04 19:53:59","2012-07-04 19:53:59","What do you use the Android Terminal Emulator for?","<android><terminal>","2","1","1","",""
"4310108","1","4310131","","2010-11-30 02:51:48","4","326","<p>I use an <code>EditText</code> with <code>android:password=""true""</code> to let the user type the password. Then I want to compare the password with a hard coded password when the user presses a button.</p><p>But I can't compare the password with a String ""mypassword"". Here is the code I use to check the password:</p><pre><code>EditText pw = (EditText) findViewById(R.id.pwdTxt);if(pw.getText().equals(""mypassword"")) {    Intent i = new Intent(LoginActivity.this, LinkpageActivity.class);    startActivity(i);} else {    // Wrong password}</code></pre><p>The comparison <code>pw.getText().equals(""mypassword"")</code> returns <code>false</code> even if I type the correct password. How should I check the password from an <code>EditText</code>?</p>","213269","","213269","","2010-11-30 09:35:40","2010-11-30 09:35:40","How to check the password from an EditView?","<java><android><passwords><equals><edittext>","1","1","","",""
"4310119","1","4310151","","2010-11-30 02:52:57","2","568","<p>I have a JSONArray:</p><p>myArray => [{""key1"" : ""value1"", ""key2"" : ""value2""}, {""key3"" : ""value3"", ""key4"" : ""value4""}]</p><p>If I do    myArray.get(1);I get a Object.</p><p>I want the single keys and values of myArray[1]. How can I do this?There is a way to have a HashMap that contains {""key3"" : ""value3"", ""key4"" : ""value4""} ?</p><p>Please help me, thanks.</p>","521887","","","","","2010-11-30 03:00:01","JSON and ANDROID","<android><json>","2","0","1","",""
"4310190","1","4384306","","2010-11-30 03:06:23","3","1344","<p>I have used ArrayAdapter to populate the Spinner. I want to know if it can be done using a SimpleAdapter? Please guide me in the right direction.Thanks in advance.</p>","476747","","71034","","2010-12-08 04:56:19","2010-12-08 16:56:08","Populating Spinner with SimpleAdapter in Android","<android><spinner><simpleadapter>","1","0","","",""
"4310345","1","","","2010-11-30 03:46:02","3","207","<pre><code>//row --&gt; 2int row = mCursor.getCount();for (int i = 0; i &lt; row; i++) { if (mCursor.moveToPosition(i)){  int val = mCursor.getInt(mCursor.getColumnIndexOrThrow(UTILI_COLLOC_ID_UTILI)) }}</code></pre><p><strong>I don't understand because I have 2 rows in my query. But when I want to read the seconde row with ""mCursor.moveToPosition(i)"", so it's false...Why ?</strong></p>","524559","","","","","2010-11-30 03:51:25","moveToNext() is false","<java><android><cursor-position>","2","0","","",""
"4310525","1","4310599","","2010-11-30 04:25:53","124","118656","<p>In my project I have an <code>EditText</code>. I want to count the characters in the <code>EditText</code>, and show that number it in a <code>TextView</code>. I have written following code and it works fine. However, my problem is when I click <kbd>Backspace</kbd> it counts up, but I need to decrement the number. How can I consider <kbd>Backspace</kbd>?</p><pre><code>    tv = (TextView)findViewById(R.id.charCounts);    textMessage = (EditText)findViewById(R.id.textMessage);    textMessage.addTextChangedListener(new TextWatcher(){        public void afterTextChanged(Editable s) {            i++;            tv.setText(String.valueOf(i) + "" / "" + String.valueOf(charCounts));        }        public void beforeTextChanged(CharSequence s, int start, int count, int after){}        public void onTextChanged(CharSequence s, int start, int before, int count){}    }); </code></pre>","513413","","2390083","","2013-11-18 08:48:09","2014-04-07 04:59:37","Android: On EditText Changed Listener","<android><listener><edittext><onchange>","3","2","23","",""
"4310536","1","4310582","","2010-11-30 04:28:13","0","271","<p>I put out an android app last week, and wanted to release an update to it that will include additional phrases to a specific aspect of the app.  It isn't a big release that serves as a bug fix (no known bugs actually - fingers crossed ;p) but it will certainly add to the entertainment value of the app and add a lot of flexibility.</p><p>Is this poor practice, as new releases should include a lot of content or is this accepted for the most part?</p><p>Thanks!</p>","496686","","","","","2010-11-30 05:57:43","Releasing updates to your android application","<android><version><release><google-play>","2","0","","",""
"4310584","1","4310597","","2010-11-30 04:37:31","2","199","<p>In the <strong>Avoid Creating Objects</strong> section of the page <a href=""http://developer.android.com/guide/practices/design/performance.html"" rel=""nofollow"">Designing for Performance</a> in the Android Developer documentation I read some paragraphs for which I am not able to visualize a code representation:</p><p><em>An array of ints is a much better than an array of Integers, but this also generalizes to the fact that two parallel arrays of ints are also a lot more efficient than an array of (int,int) objects. The same goes for any combination of primitive types.</em></p><ul><li>How would these 'parallel arrays of ints' look like? Would it be something like instead of having a method with a signature such as getData():int[][] returning <pre>   [a][b]   [c][d]   [e][f]</pre>... it would be better to have two methods, each returning one of the 'columns' of data? as in:getFirstDimensionData():int[]<pre>   [a]   [c]   [e]</pre>and a second one getSecondDimensionData():int[]<pre>   [b]   [d]   [f]</pre></li><li>What is an 'array of (int,int) objects? ... something like an array of objects of a-type-not-yet-defined that has two int member instances defining its state?</li></ul><p>The immediate next paragraph:</p><p><em>If you need to implement a container that stores tuples of (Foo,Bar) objects, try to remember that two parallel Foo[] and Bar[] arrays are generally much better than a single array of custom (Foo,Bar) objects.</em></p><p>... makes me think that the author is making up some sort of notation. I guess my key question is: is the author of the page using this <code>(somethingX, somethingY)</code> notation to refer to an arbitrary class that 'wraps' the elements inside the parentheses?</p><p>Finally, is this a standard notation or just something the author of the page created by himself and omitted to explain?</p><p>Can anyone, please, shed some light? :)</p><p>Thanks in advance,</p><p>Y</p>","193426","","","","","2010-11-30 05:20:55","Questions of 'Designing for Performance' document at Android Developer site","<android><performance><documentation>","2","0","1","",""
"4310628","1","4310671","","2010-11-30 04:49:20","1","951","<p>I want to load an image from an external folder of my system to my android application. I use the following code, but the image is not displaying. When I debugged it, the Bitmap object 'bitmap' is shown as null. How can I solve this problem?</p><pre><code>      ImageView img=(ImageView)findViewById(R.id.myImage);      String fname=""C:/Users/Public/Pictures/Garden.jpg"";      Bitmap bitmap = BitmapFactory.decodeFile(fname);      img.setImageBitmap(bitmap); </code></pre><p>My actual need is my andorid application (on real device) should display some images which is stored into one computer. The admin of this application will upload some images to a specific folder in that computer. And the android application will access these images using IP address, and will display these images. If these images should be pushed to sdcard path, then how can i do it at runtime?</p><p>Please help me..</p><p>Thank you to all..</p>","523058","","523058","","2010-11-30 05:20:52","2012-09-19 04:37:36","Display an image in real device from a computer in Android Application","<android><image><bitmap>","3","4","","",""
"4310657","1","","","2010-11-30 04:55:32","3","3385","<p>Assuming, my application need to access my web server using server certificate that is not supported by Nexus One (or other android devices), for example. </p><p>is it possible to 'embedded' the client certificate in the application? is this the same as signing the app with the client certificate?</p><p>Thanks</p>","477906","","","","","2010-11-30 13:13:39","android ssl certificate","<android><ssl><certificate><ssl-certificate><code-signing-certificate>","1","0","1","",""
"4310676","1","","","2010-11-30 05:00:56","0","1415","<p>My program checks if a specific file exists in the default cache folder. If the file exists, it opens it and reads the contents. If the file does not exist, the file gets pulled from the web and is stored in the cache folder. The problem I'm having is that, no matter if the file is in the cache folder or not, my file test always returns false. The funny thing is that, even though the file test returns false, I can still open the file from the cache folder and read it. I can pull a list of files in the cache folder and I can see the file is there, but when I do the file test to see if the file is there, it returns false, even though I know the file is there and I can open it and see it's contents.</p><p>I tried the regular exists() test and even reading each file in the cache directory one by one and comparing the name to the file I'm looking for and still returns false.</p><p>Thanks for any help in advance!</p><pre><code>String file = ""test.txt""String content = ""testing""; putFile(file, content); Boolean fileIsThere = checkFile(file); public Boolean checkFile(String file){  Boolean fileExists = false;  // regular file test - always returns false, even if the file is there  File f = new File(file);  if (f.exists())   fileExists = true;  // comparing each individual file in the directory - also returns false  String[] dirFiles = fileList();  for (int i = 0; i &lt; dirFiles.length; i++) {   if (dirFiles[i] == file){    fileExists = true;    break;   }  }  return fileExists; } public void putFile(String file, String content){  try {   FileOutputStream fos = openFileOutput(file, Context.MODE_PRIVATE);   fos.write(content.getBytes());   fos.close();  } catch (Exception e) {   Log.w(""putFile"", ""Error ("" + e.toString() + "") with: "" + file);  } }</code></pre><p>Any ideas? I'm thinking that since I'm putting the files in the cache folder, I will always get false on the file test. I just want to see if anyone else came across this and has a fix for it, or if I have to make a specific directory and store my files there, or something else. Could ""Context.MODE_PRIVATE"" in putFile() have anything to do with it?</p>","512669","","","","","2011-06-10 18:44:52","File exists test does not work on cache folder...?","<android><file><caching><testing><exists>","1","2","","",""
"4310695","1","4310733","","2010-11-30 05:04:17","16","20191","<p>I want to install some pre-created files when my Android application is installed. I would like to install the file in both the internal memory (data/data//files/) and in a newly created sdcard directories (/sdcard//data1/)</p><p>I know this can be done but my searches have turned up nothing.</p><p>Please help.</p>","496890","","","","","2012-07-26 12:36:53","How to include data files with my Android install apk?","<android><file><install><publishing>","2","0","","",""
"4310698","1","4310776","","2010-11-30 05:05:16","1","498","<p>I'm running Ubuntu 10.10</p><p>I'm NOT using the NDK</p><p>I compiled my ARM shared library in DS-5 (ARM's development toolset, <a href=""http://www.keil.com/arm/ds5/"" rel=""nofollow"">http://www.keil.com/arm/ds5/</a> ).  When I placed them under libs/armeabi and call System.loadLibrary() it can't find them.</p><p>Here's the class:</p><pre><code>package org.me.testds5;//a JNI wrapper classpublic class WrapMyNative{    static    {            //ERROR HERE            //note that calling            //System.loadLibrary(""libAddSub""); generates the same error        System.loadLibrary(""AddSub"");    }    //some native functions    public native int add(int a, int b);    public native int sub(int n, int m);}</code></pre><p>The library's exact name is libAddSub.so</p><p>The LogCat:</p><pre><code>11-30 04:54:11.273: ERROR/AndroidRuntime(372): FATAL EXCEPTION: main11-30 04:54:11.273: ERROR/AndroidRuntime(372): java.lang.ExceptionInInitializerError11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at org.me.testds5.TestDS5.onCreate(TestDS5.java:13)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at android.os.Handler.dispatchMessage(Handler.java:99)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at android.os.Looper.loop(Looper.java:123)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at java.lang.reflect.Method.invokeNative(Native Method)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at java.lang.reflect.Method.invoke(Method.java:521)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at dalvik.system.NativeStart.main(Native Method)11-30 04:54:11.273: ERROR/AndroidRuntime(372): Caused by: java.lang.UnsatisfiedLinkError: Library AddSub not found11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at java.lang.Runtime.loadLibrary(Runtime.java:461)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at java.lang.System.loadLibrary(System.java:557)11-30 04:54:11.273: ERROR/AndroidRuntime(372):     at org.me.testds5.WrapMyNative.&lt;clinit&gt;(WrapMyNative.java:7)</code></pre>","450153","","","","","2010-11-30 05:22:27","Android Link Error","<android><arm><loadlibrary>","1","0","","",""
"4310738","1","4310777","","2010-11-30 05:13:22","6","9643","<p>I have an xml file that has the layout in ASCII form:</p><pre><code>---------------| ImageView--------------| TextView--------------| List...--------------&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/com.some.app"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;ImageView android:id=""@+id/MovieCover""android:layout_width=""100dip""android:layout_height=""100dip""/&gt;  &lt;TextView    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:textSize=""16sp""    android:padding=""10dp""    android:id=""@+id/TextHeader""    android:background=""#000000""&gt;&lt;/TextView&gt;&lt;ListView android:id=""@+id/ListView02"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt; &lt;/ListView&gt; &lt;/LinearLayout&gt;</code></pre><p>I'm having a problem displaying the layout when my ImageView and TextView takes up more than 3/4 of the screen. How do I make ImageView and TextView scrollable with the ListView that is being displayed? At this point of time, only the ListView to be scrolled and I want the entire layout to be scrollable as though they are one page on its own.</p><p>How can I do that?</p>","188357","","","","","2012-12-10 03:35:07","Making android listview layout scrollable","<java><android><gui><listview><layout>","4","1","","",""
"4310779","1","4310794","","2010-11-30 05:23:27","3","911","<p>Hi allI would like to draw you attention to the following pictures</p><p>First the original image</p><p><img src=""http://i.stack.imgur.com/P3jAZ.png"" alt=""alt text""></p><p>then how it is rendered on the  screen</p><p><img src=""http://i.stack.imgur.com/BPNUE.png"" alt=""alt text""></p><p>as you can see on the original everything is nice and yellow, the edges have a slight transparency to look smooth.</p><p>but when I render I have some darkened pixels that appear.</p><p>To avoid the usual answer I get </p><p>I use </p><pre><code>gl.glTexImage2D(GL10.GL_TEXTURE_2D, level, GL10.GL_RGBA, width, height, 0, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, pixelBuffer);</code></pre><p>and not the glutil tool</p><p>also </p><pre><code>gl.glEnable(GL10.GL_BLEND);gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);</code></pre><p>Anybody has a solution for that ? </p><p>Thanks </p><p>Jason</p><hr><p>Edit</p><p>I did some digging. in the original image my background is already the same color as the coin and I use an alpha mask. I've also checked, when I load the bitmap it seems that all the bitmap who have an alpha 0 are automatically set to 0,0,0,0. this might be the problem.</p><hr><p>edit actually it seems to be the issue. I checked the values of the bitmap I open, the values for transparent pixels are 0,0,0,0 instead of the color I set. Is this a problem with Bitmap or how I created my image?</p><pre><code>// Load up, and flip the texture:            Bitmap temp = BitmapFactory.decodeResource(context.getResources(), resource, opts);            Bitmap bmp = Bitmap.createBitmap(temp, 0, 0, temp.getWidth(), temp.getHeight(), flip, true);            temp.recycle();</code></pre>","440336","","440336","","2010-11-30 06:45:58","2010-11-30 06:50:05","Android Opengl ES dark pixels on edge of objects","<android><opengl-es><textures><blend>","2","0","","",""
"4310862","1","","","2010-11-30 05:41:20","3","14595","<p>I created a list view.I need to increase the width of the vertical scrollbar. I changed android:scrollbarSize. But it is not working .Also want to decrease length of scrollbar thumb.Is it posiible. Please help me. </p><pre><code>&lt;LinearLayout android:id=""@+id/LinearLayout01""  android:layout_width=""fill_parent"" android:layout_height=""fill_parent""  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListView  android:id=""@+id/list_view"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:scrollbars=""vertical"" android:scrollbarAlwaysDrawVerticalTrack=""true"" android:scrollX=""0px"" android:scrollY=""0px"" android:background=""#515151"" android:layout_weight=""1"" android:scrollbarStyle=""outsideOverlay"" android:divider=""#FFF"" android:fadeScrollbars=""false"" android:scrollbarSize=""20dip""/&gt; &lt;/LinearLayout&gt;</code></pre>","522834","","241475","","2010-11-30 06:31:39","2012-04-30 07:13:23","Android ListView Scrollbar","<android><listview><scrollbar>","2","6","1","",""
"4310907","1","4315356","","2010-11-30 05:50:13","1","1117","<p>i have a problem that i am using web services and want that for example i have implemented facebook in my application and want that all the notification that arise in my facebook will get notified in my android phone even if application is installed but not opened in phone. So, to implement this into my application i think i have to use cloud computing but how can i do this i dont know. Can anyone help me out of this problem?</p><p>Thanks</p>","493193","","","","","2010-11-30 15:27:40","how can i implemented cloud computing in my application?","<android>","1","0","","",""
"4310938","1","4312751","","2010-11-30 05:56:13","1","280","<p>can anybody tell what is the equivalent component in android like uiindicator in iphone give example</p><p>Thanks</p>","426344","","175051","","2010-11-30 10:32:35","2010-11-30 10:36:59","what is the equivalent component in android like uiindicator in iphone","<iphone><android>","1","0","1","",""
"4311029","1","4311105","","2010-11-30 06:10:55","2","1971","<p>How to convert this json clsError and userId values</p><p><strong>String temp=""{""clsError"":{""ErrorCode"":110,""ErrorDescription"":"" Request Added""},""UserID"":36}""</strong></p><p>and pass them as parameters</p><p><strong>clsError errorObject=new clsError(UserID,clsError);</strong></p>","501859","","","","","2013-04-04 07:39:04","how to convert json object into class object","<android>","3","1","1","",""
"4311044","1","","","2010-11-30 06:15:03","4","11511","<p>i'm currently using the matrix method to implement drag and pinch zoom for an image (image A)</p><p>Now i want a part of image A to be clickable so i put another imageview (image B) over image A and set the layout_margins for it in the xml file.</p><p>My question is...is there a way to dynamically change my layout_margins as i'm scaling my image for drag and pinch zoom?</p><p>I guess the simpler question is...how do i dynamically set the layout_margins for an imageview?</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;ImageView android:id=""@+id/imageView""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:src=""@drawable/map""     android:scaleType=""matrix"" /&gt;    &lt;ImageView       android:id=""@+id/dundas_station""       android:layout_width=""75px""       android:layout_height=""75px""       android:layout_marginTop=""337px""   android:layout_marginLeft=""373px""       android:clickable=""true""       android:src=""@drawable/google_maps_icon""       android:scaleType=""matrix""       /&gt;&lt;/RelativeLayout&gt;</code></pre><p>thanks!</p>","513757","","","","","2012-03-07 13:14:49","android - dynamically changing the position of an imageview","<android><layout><dynamic>","2","0","2","",""
"4311069","1","4413816","","2010-11-30 06:18:28","28","7645","<p>I have a BroadcastReceiver which is called every so often, and I have noticed many people use </p><pre><code>android: process ="":remote"" </code></pre><p>in their receiver. Mine is used to check a few things and if the conditions match then activate an alarm. My question is should I use the line I had posted above in my manifest? And if so what are the benefits of doing so? </p>","407133","","407133","","2013-05-17 20:59:34","2013-05-17 20:59:34","Should I use android: process ="":remote"" in my receiver?","<android><broadcastreceiver><android-broadcast>","1","2","11","",""
"4311097","1","4311131","","2010-11-30 06:23:53","4","4983","<p>I want to refresh the activity as i want thatwithout firing any event some work gets performed and activity calls  by itself. So, i want to know is there any option in android to refresh the activity by itself.</p>","493193","","241475","","2010-11-30 06:32:09","2012-08-23 17:17:41","How can I refresh the activity?","<android>","3","4","1","",""
"4311122","1","4311324","","2010-11-30 06:29:15","0","66","<p>I have a problem with a simple map viewer app. For some reason my app works fine when I upload it to an Android device via an iMac, but when I upload the exact same app from my Windows computer it loads the MapActivity, but no map tiles. So I do see the raster, and can move it around. Just no tiles.</p><p>I have the feeling it's something stupid I overlooked, but those things are often the most annoying to find. </p><p>I also checked the Google Maps API key, but came to the conclusion that debugging keys are the same on different computers, so that didn't matter.</p><p>Any ideas?</p>","479103","","","","","2010-11-30 07:07:17","Maps not loading when app compiled on Windows","<android><google-maps>","1","2","","",""
"4311149","1","4311310","","2010-11-30 06:34:30","0","1044","<p>hi im using 3 text views ..i have made them as clickable and i have written action part for those ..but theyr not focussing ...even i have set android:focusable to true  ..please help </p>","510553","","","","","2010-11-30 08:34:13","not able to make TextView as focusable","<android>","1","2","","",""
"4311206","1","4311266","","2010-11-30 06:45:42","0","734","<p>In my project I have two activities or classes. In first activity I have a EditText and I want to get the text of it from second class.</p><p>In the first class I wrote this code but it seems has problem.</p><pre><code>public String getTextMessage(){    return textMessage.getText().toString();}</code></pre><p>because in second class when I want to get it, program crashes.</p><pre><code>message = encode.getTextMessage();</code></pre><p>What is your suggestion? </p>","513413","","","","","2010-11-30 07:43:05","Android: problem in getText method of EditText","<android><gettext><edittext>","2","3","","",""
"4311232","1","4337529","","2010-11-30 06:49:56","1","320","<p>i have a simple opengl app that renders arbitrary 3d objects. on the emulator things work great. on my nexus on, not so good.</p><p>the model is rendered, but it's clipped to almost nothing in the far z. i use the model's bounding sphere diameter as my far Z value. the code seems pretty boilerplate, it's included below for reference. </p><p>the problem must be with the call to gluPerspective(), but i can't understand what about that would differ between devices. the only difference is that the aspect ratio is <em>slightly</em> different. i tried hard coding the value of farZ to something real big and that fixed the problem. any ideas?</p><p>thanks.</p><pre><code>public void onDrawFrame(GL10 gl) {    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    gl.glLoadIdentity();    GLU.gluLookAt(gl, 0f, 0f, 2f*mesh.diameter, 0f, 0f, 0f, 0f, 1f, 0f);    gl.glPushMatrix();    gl.glRotatef(mesh.rx, 1, 0, 0);    gl.glRotatef(mesh.ry, 0, 1, 0);    mesh.draw(gl);    gl.glPopMatrix();}public void onSurfaceChanged(GL10 gl, int width, int height) {    float zNear = 0.1f;    float zFar = zNear + mesh.diameter;    float aspect = (float) width / (float) height;    float left = mesh.mid.x - mesh.diameter;    float right = mesh.mid.x + mesh.diameter;    float bottom = mesh.mid.y - mesh.diameter;    float top = mesh.mid.y + mesh.diameter;    /*    if (aspect &lt; 1.0) { // window taller than wide        bottom /= aspect;        top /= aspect;    } else {        bottom *= aspect;        top *= aspect;    }    */    gl.glViewport(0, 0, width, height);    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    GLU.gluPerspective(gl, 90.0f, aspect, zNear, zFar);    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    gl.glOrthof(left, right, bottom, top, zNear, zFar);    gl.glMatrixMode(GL10.GL_MODELVIEW);    gl.glLoadIdentity();}</code></pre>","337455","","44729","","2010-11-30 16:24:51","2010-12-02 16:50:10","android opengl app behaves differently on device, z-far is different?","<android><opengl-es>","1","3","","",""
"4311288","1","","","2010-11-30 07:00:30","0","333","<pre><code>   My problem is when a dialog is opened, if I change the tab,  that dialog is displayed in the activity in the next tab.How to remove that .</code></pre><p>Pls help.This occurs because according to my requirement I can interact with the dialog and the view behind at the same time.</p>","522834","","","","","2012-12-29 05:42:11","Android Dialog problem with TabView","<android><uitableview><dialog>","3","0","","",""
"4311442","1","","","2010-11-30 07:26:48","1","504","<p>I am using Drupal Services along with the JSON Services module as a data source.</p><p>I am using the DrupalCloud library, <a href=""https://github.com/skyred/DrupalCloud/wiki"" rel=""nofollow"">https://github.com/skyred/DrupalCloud/wiki</a>, and am wondering how to best process the results that I receive from a userLogin() call.</p><p>If the call itself fails we get:</p><pre><code>{  ""#error"": true,  ""#message"": ""Some message""}</code></pre><p>If the call succeeds but the login credentials are wrong:</p><pre><code>{  ""#error"": false,  ""#data"": {    ""#error"": true,    ""#message"": ""Some message""  }}</code></pre><p>If the call success and the login credentials are correct, it returns:</p><pre><code>{  ""#error"": false,  ""#data"": {    ""sessid"": ""foo"",    ""user"": {      ""uid"": ""69"",      ""name"": ""Russell Jones"",      ""pass"": ""bar"",      ""mail"": ""russell@test.net"",      ""roles"": {        ""2"": ""authenticated user"",        ""5"": ""Student""      },    }  }}</code></pre><p>How do I go about using this data meaningfully?  Or rather, how do I test to see if the call worked, and if the login was successful or not.</p>","437654","","","","","2010-11-30 08:35:31","How do I deserialize Drupal JSON Services strings in Android?","<java><android><drupal>","2","0","","",""
"4311513","1","","","2010-11-30 07:39:58","2","1576","<p>is it possible to create a <code>Dialog</code> that will be dismissed automatically after some time if it doesn't have any user interaction?</p>","522834","","65977","","2010-11-30 08:08:46","2014-03-11 09:34:53","Producing a Dialog that will be dismissed automatically","<android><dialog>","5","0","1","",""
"4311579","1","4312543","","2010-11-30 07:50:10","2","1430","<p>I'm having a small dilemma</p><p>I'm working with android (not that it is relevant) and I noticed one thing on some phones and not others:</p><p>the scissor prevents the glClear(GL_COLOR_BUFFER_BIT) from working correctly.</p><p>therefore I'm wandering if it is better to do:</p><pre><code>gl.glDisable(GL10.GL_SCISSOR_TEST);gl.glClear(GL10.GL_COLOR_BUFFER_BIT);gl.glEnable(GL10.GL_SCISSOR_TEST);</code></pre><p>or </p><pre><code>gl.glScissors(0,0,800,480);gl.glClear(GL10.GL_COLOR_BUFFER_BIT);</code></pre><p>Basically is it better to change to scissors test zone before the clear or is it better to disable enable?</p>","440336","","44729","","2010-11-30 16:24:12","2010-11-30 16:24:12","GLScissors : what is faster/better?","<android><opengl-es>","1","0","","",""
"4311690","1","4311850","","2010-11-30 08:07:45","4","12545","<p>I am using following code, but my progress bar is not displaying in the center of frame layout. I want to avoid padding to my progressbar.Can any one please explain? It is perfectly working if i am using ""Linear Layout""</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""   android:orientation=""vertical""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:gravity = ""center_vertical|center_horizontal""&gt;&lt;ProgressBar android:id=""@+id/progress_bar""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    /&gt; &lt;ImageView android:id = ""@+id/gallery_Img""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""/&gt; &lt;/FrameLayout&gt;</code></pre>","486139","","932225","","2012-03-12 07:55:02","2014-03-20 05:23:41","How to set ProgressBar at the center screen in frame layout?","<android><android-layout>","4","2","3","",""
"4311693","1","4311768","","2010-11-30 08:08:13","4","1168","<p>Below is the documentation of the method, I dont understand what does the Object data do?</p><p>What is it for?</p><pre><code>public void addHeaderView (View v, Object data, boolean isSelectable)</code></pre><p>Add a fixed view to appear at the top of the list. If addHeaderView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want.NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that will also account for header and footer views.</p><p>Parameters:</p><pre><code>   v:           The view to add.   data:         Data to associate with this view.   isSelectable: whether the item is selectable.</code></pre>","505162","","","","","2010-11-30 08:19:53","What does the second parameter in AddHeaderView in the class ListView do?","<android><android-listview>","1","0","","",""
"4311780","1","4311886","","2010-11-30 08:21:17","0","1898","<p>i'm trying use webview to load a image from sdcard</p><p>i use this path :</p><p>file///sdcard/1.png</p><p>but i didn't see the picture.</p><p>is anything wrong?</p>","422405","","","","","2010-11-30 08:42:20","android webview use <img> load a image from sdcard","<android><webview>","1","1","","",""
"4311818","1","4311912","","2010-11-30 08:28:19","0","423","<p>I want to create a drawable object with a width equal to the screen's width and display 3 images inside the drawable. I know the last part can be done using a LayerDrawable object, but I don't know how to set the drawable sizes. What would be the best way to do this?</p><p>Thank you and best regards</p>","460611","","","","","2010-11-30 08:45:20","Create Drawable with specific height","<android>","1","0","1","",""
"4311823","1","4311844","","2010-11-30 08:29:10","0","667","<p>Hey, I've developed an application with french and english translation.A guy sent me the strings.xml in polish language and in UTF-8 format (cause there are many characters i can't read).I can open it with notepad with no problem, but Eclipse replace all the special characters by another one (a sort of square)an idea ?</p>","431652","","30618","","2010-11-30 08:34:00","2010-11-30 08:34:00","strings.xml special characters in multilingual","<android><multilingual><polish>","1","0","","",""
"4311854","1","4443717","","2010-11-30 08:34:01","16","11538","<p>I have a gallery with several full screen images. I want to limit the fling gesture to only advance one image at a time (like the HTC Gallery app). What's the right/easiest way to achieve this?</p>","184844","","","","","2012-05-31 14:35:54","How can I limit fling in Android gallery to just one item per fling?","<android><gallery>","6","1","12","",""
"4311869","1","4311990","","2010-11-30 08:38:19","1","256","<p>i want to dowmload android source  as repo init -u git://android.git.kernel.org/platform/manifest.git -b android-2.2_r1,i know the method of downloads ,but i donot know  where to find ""android-2.2_r1"" ,if i want to find 2.1, how to modify the  parameter after -b,could you give a link that tell me which versions may be download. thanks </p>","233618","","","","","2010-11-30 09:02:39","where to find source code link","<android><android-source>","3","0","","",""
"4312062","1","4312264","","2010-11-30 09:11:12","1","5445","<p>How can I create this drawable programatically? </p><pre><code>&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item&gt;  &lt;bitmap android:src=""@drawable/android_red""    android:gravity=""center"" /&gt;&lt;/item&gt;&lt;item android:top=""10dp"" android:left=""10dp""&gt;  &lt;bitmap android:src=""@drawable/android_green""    android:gravity=""center"" /&gt;&lt;/item&gt;&lt;item android:top=""20dp"" android:left=""20dp""&gt;  &lt;bitmap android:src=""@drawable/android_blue""    android:gravity=""center"" /&gt;&lt;/item&gt;</code></pre><p></p><p>Thanks a lot</p>","460611","","","","","2013-04-04 21:03:51","Create a LayerDrawable object programatically","<android>","2","0","1","",""
"4312133","1","","","2010-11-30 09:21:17","7","1801","<p>How can I get a LinearLayout (or any other ViewGroup) to assume the size of it's child views rather than assuming the size of the background image?</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:background=""@drawable/large_image300x300pix""&gt; &lt;TextView android:id=""@+id/TextView01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""Hello world!""/&gt;&lt;/LinearLayout&gt;</code></pre><p>The linear layout becomes the same size as the background image.How can I get my linear layout to assume the same size as the textview?</p>","233947","","233947","","2010-11-30 09:34:32","2013-10-16 13:52:18","How to wrap content views rather than background drawable?","<android><background>","4","0","1","",""
"4312220","1","4312282","","2010-11-30 09:33:02","1","984","<p>2010-06-14 02:21:49-0400or 2010-06-14 02:21:49+0400</p><p>The above is the string coming from my webservice...is there a way to convert this string to the date according to the local machine time zone</p><p>I used Simpledateformatter .. but not able to display correctly.. please help</p>","450487","","","","","2010-11-30 09:47:04","Display date according to the time zone of device","<java><android><datetime>","2","0","","",""
"4312262","1","4312331","","2010-11-30 09:37:49","1","371","<p>I am playing around with Android MapView and have come across a requirement, where i have to put a marker at the place where the user clicks.in my scenario, the user can pan a map , zoom in and out, and click wherever she likes.in this case, the marker should be put wherever the user is clicking on the map.If a previous marker was there on map, then at click event it should be cleared and be put at the new place.This should repeat every time the case repeats.</p><p>In future, I'll be having some more drawables like range representative and a pointer to select range which can be dragged.</p><p>I am able to put the marker on the first place, but my code doesn't work when the user clicks anywhere else.</p><p>Here's the code for the class that I am using: <a href=""http://pastebin.com/6idn7VwK"" rel=""nofollow"">http://pastebin.com/6idn7VwK</a>The full class extending MapActivity and the one extending the ItemizedOverlay can be found in the link above.</p><p>I understand that I might be doing some wrong things, so please correct me.</p><p>Thanks!</p>","243709","","243709","","2010-11-30 10:00:41","2010-11-30 10:00:41","What would be an effective way to put a marker drawable on the mapview everytime the user clicks the map","<android><android-sdk-2.1><android-maps>","1","0","","",""
"4312288","1","4312749","","2010-11-30 09:42:17","1","904","<p>I want to show progress bar to going from one activity to another activity until another activity is loaded can anybody give example</p><p>Thanks</p>","426344","","","","","2011-08-18 09:25:22","how to show progress bar moving from one activity to another activity in android","<android>","2","3","1","",""
"4312319","1","4365637","","2010-11-30 09:47:30","57","42828","<p>I would like to alter the layout based on whether the virtual keyboard is shown or not. I've searched the API and various blogs but can't seem to find anything useful.</p><p>Is it possible?</p><p>Thanks!</p>","2172","","","","","2014-02-10 14:54:57","Howto capture the 'virtual keyboard show/hide' event in Android?","<android><events>","10","1","15","",""
"4312504","1","4313352","","2010-11-30 10:11:27","1","4875","<p>In my project I have an bitmap image. I need to convert this picture to byteArray in order to manipulate some bytes and after that save it as image.</p><p>with this code <code>image = BitmapFactory.decodeResource(context.getResources(), R.drawable.tasnim);</code> I have acces to width and height but how can I have access to bytes of this image?</p><p>Thanks</p>","513413","","","","","2010-12-01 05:00:07","Android: conerting Image into byteArray","<android><image><bitmap><bytearray>","2","0","1","",""
"4312585","1","7200749","","2010-11-30 10:21:38","11","3363","<p>I have a VideoView that is inside a scrollView. When I scroll the scrollView, the VideoView does not scroll with it. It is like its position is fixed. How can I scroll the VideoView correctly with the scrolling of all other elements in the scrollView?</p>","346583","","","","","2013-05-31 19:20:58","Android::VideoView inside a ScrollView","<android><video><scroll><scrollview><videoview>","3","3","6","",""
"4312633","1","5927455","","2010-11-30 10:26:19","3","1678","<p>Is it possible to have two thumbs on a single seekbar in android to control the boundary values for a range? Thanks in advance.</p>","525004","","846075","","2013-01-07 07:29:55","2014-03-31 04:42:42","Double thumb on a single seekbar in Android 2.1","<android><seekbar>","2","0","1","",""
"4312641","1","","","2010-11-30 10:27:08","1","44","<p>Hi form the following site <a href=""http://grepcode.com/snapshot/repository.grepcode.com/java/ext/com.google.android/android-apps/2.1_r2/"" rel=""nofollow"">http://grepcode.com/snapshot/repository.grepcode.com/java/ext/com.google.android/android-apps/2.1_r2/</a><br>i can download the source code of all android app as jar ,i need the videorecording app from the above jar ,is it possible ie by importing jar in to my app and call like default intent calling eg Intent i=new ... Startactivity().</p>","487219","","","","","2010-11-30 10:27:08","android externel application","<android>","0","0","","",""
"4312680","1","4313049","","2010-11-30 10:30:42","3","4758","<p>2010-06-14 02:21:49+0400 or 2010-06-14 02:21:49-0400</p><p>is there a way to convert this string to the date according to the local machine time zone with format 2010-06-14 02:21 AM</p>","450487","","243782","","2010-11-30 10:45:15","2010-11-30 11:48:13","Getting device's local timezone","<java><android><timezone>","3","2","","",""
"4312695","1","4312727","","2010-11-30 10:31:50","0","396","<p>I'm developing an android app, and have developed a game, but I now have stupid problem. You control a UFO and when it's health will be reduced to zero the game should be over. How should I contruct gameOver?</p><p>Previous I've used an intent to open a new activity but this requires the class to extend Activity, and since I want the mainthread to look up when the UFO has his health reduced to zero I can't just call GameActivity.gameOver since it want to use a static method to be called, and since a static method can't contain a new intent I can't figure it out.</p>","525016","","","","","2010-11-30 10:35:02","Android - new intent and activity problems","<android><activity><android-intent>","1","1","","",""
"4312712","1","","","2010-11-30 10:33:48","3","1105","<p>I have a number of different Android Virtual Devices. Sometimes when I launch them the network connection for the virtual device doesn't work. The network bar box on the top status bar will show up with an 'x' in it. Recently this has been happening more often than not. Why is it that the virtual device network sometimes not work?</p><p>Also, when I use the settings app and go to ""wi-fi"" the checkmark is off and if I click on it I get the ""error"" message, but no more details than that.</p>","211292","","211292","","2010-12-01 05:48:13","2011-02-04 20:23:20","Why is the (Mac OS X) android emulator network disconnected?","<android><android-emulator><android-sdk-2.2>","1","4","","",""
"4313007","1","4313064","","2010-11-30 11:03:26","10","9039","<p>Currently I'm drawing a PNG image in my Android application like so: </p><pre><code>ImageView image = new ImageView(context);image.setImageDrawable(context.getResources().getDrawable(R.drawable.testimage))</code></pre><p>If I have a list of image names in a database, is there a way to set the drawable above using the image name? I already have the code to go through the database, I'm just looking to draw the image based on the value taken from here.</p><p>For example, a record for the DB:</p><pre><code>ID:    Name:    ImageName:-      Test     testimage</code></pre><p>So when I'm reading this record, I have a string with the value of ""testimage"" and I'd then want to set the image drawable to <code>R.drawable.testimage</code>.</p><p>One way I was thinking of doing it would be something like this:</p><pre><code>int image = R.drawable.blank; // blank image// testimage.png is the image name from the databaseif(imageName.toString().equals(""testimage.png""))    image = R.drawable.testimage;else if(imageName.toString().equals(""another.png""))    image = R.drawable.another;else if(imageName.toString().equals(""etc.png""))    image = R.drawable.etc;</code></pre><p>However this isn't very efficient!</p><p>Thanks</p>","143979","","143979","","2010-11-30 11:08:50","2010-11-30 11:19:08","Setting Android images from string value","<java><android><imageview><android-imageview>","3","0","6","",""
"4313077","1","","","2010-11-30 11:11:28","14","7267","<p>What are the differences between these methods (classes)?</p><p>I want to run a app that runs every 5 seconds, clear the memory when it is finished and when the cpu is in standby mode, that you can run the app. So that the app is not bound to a wakelock.</p><p>Regards,</p><p>Shafqat</p>","525061","","2535973","","2014-02-18 09:35:23","2014-02-18 09:35:23","Android Asynctask vs Runnable vs timertask vs Service","<android><service><android-asynctask><runnable><timertask>","1","1","5","",""
"4313189","1","4314177","","2010-11-30 11:25:20","6","1036","<p>I'd like to know if anyone could help me with this.</p><p>I've got a textView and I want the background just to be applied to the text, according to its size, not to the whole textView.</p><p>There is no problem when the text is only one row lenghth, but there is when it takes more than one line...</p><p>Maybe this pic helps to understand this all...</p><p>top: what I havebottom: what I want</p><p><img src=""http://i.stack.imgur.com/b7K2x.png"" alt=""alt text""></p><p>Thank you :-)</p>","453981","","453981","","2012-02-09 15:00:32","2012-02-09 16:40:03","Adjust background to text on TextView in android","<android><background><textview>","1","0","4","",""
"4313271","1","","","2010-11-30 11:36:04","3","4037","<p>Im working on a little interface in android and when I run it the ""xxx application has stopped unexpectedly"" appears. Im looking for posible errors but I don't find anything.</p><p>Anyway I would like to change the R class package name, when I refactor->rename it eclipse generates another one in the old package,even if I delete that package eclipse generates it again, I can't get rid of it!</p>","525082","","118587","","2010-11-30 11:51:27","2011-12-06 11:24:20","Change R class package android/eclipse","<android><eclipse><android-emulator>","5","0","1","",""
"4313274","1","","","2010-11-30 11:36:29","5","2537","<p>I'm making an appwidget, and there's a bitmap on the widget of which I want to change it's transparency.</p><p>In the service I have:</p><pre><code>RemoteViews remoteView = new RemoteViews(getApplicationContext().getPackageName(), R.layout.myWidget);remoteView.setInt(R.id.widgetPNG, ""setAlpha"", 50);</code></pre><p>But it doesn't work. The emulator shows ""Problem loading widget"" on the home screen.I'm pretty sure everything else is fine cos when i changed the line to change it's imageResource it runs perfectly: <code>remoteView.setInt(R.id.widgetPNG, ""setImageResource"", R.drawable.anotherPNG).</code></p><p>Can anyone help me? I've been stuck with this for a week...</p>","525085","","525085","","2010-11-30 12:48:26","2011-03-15 17:05:50","setAlpha for RemoteViews problem","<android><android-widget>","2","0","","",""
"4313418","1","","","2010-11-30 11:54:04","0","392","<p>Hi friends      async process dialog not showing  in application in android  can anybody tell what is the problem?</p><p>My code</p><pre><code>public void onClick(View v) {  new FetchTask(getBaseContext()).execute(null);          } public class FetchTask extends AsyncTask&lt;Object, ArrayList,ArrayList&gt;  {      private ProgressDialog dlg;      private Context ctx;      public FetchTask(Context context) {          ctx = context;      }      @Override      protected void onPreExecute() {          dlg = new ProgressDialog(ctx);          dlg.setMessage(""Loading...."");          dlg.show();         super.onPreExecute();      }      @Override      protected void onPostExecute(ArrayList parserValue) {          dlg.dismiss();            for(int i=0;i&lt;parservalue.size();i++)             {                DomParserDataSet dataset=(DomParserDataSet)parservalue.get(i);                   if(dataset.getToken_string().length()&gt;1)                      {                  Intent homeIntent=new Intent(ctx,HelloTabWidget.class);                  homeIntent.putExtra(""strUserName"", username);                  homeIntent.putExtra(""strPassword"",password );                  homeIntent.putExtra(""questGroupId"",dataset.getQuest_group_id());                  homeIntent.putExtra(""userid"",dataset.getUser_id());                  homeIntent.putExtra(""systemuserid"", dataset.getSystem_user_id());                  homeIntent.putExtra(""providerid"",dataset.getIndex_provider_id());                       startActivity(homeIntent);                   //startActivity(new Intent(this,HelloTabWidget.class));                   }                   else                   {                     DomParserDataSet dataset1=(DomParserDataSet)parservalue.get(i);                        AlertDialog.Builder alertbox = new AlertDialog.Builder(ctx);                      alertbox.setMessage(dataset1.getError_value());                         alertbox.setNeutralButton(""Ok"", new DialogInterface.OnClickListener() {                           public void onClick(DialogInterface dialog, int arg1) {                               // the button was clicked                            dialog.cancel();                           }                       });                       // show it                       alertbox.show();                     }             }              // display data          }  @Override  protected ArrayList doInBackground(Object... arg0) {   try      {          username=edtUserName.getText().toString();          password=edtPassword.getText().toString();          WebService service=new WebService();          String webservicevalue=service.callServer(SOAP_ACTION,"""", username,password,URL);            webservicevalue=decodeXMLData(webservicevalue);            DomParser xmlParser=new DomParser();           parservalue=xmlParser.parseXmlFile(webservicevalue);           String parservalue1=Integer.toString(parservalue.size());           Log.d(""parser value size is"",parservalue1);            }             catch (Exception e) {       // TODO: handle exception              e.printStackTrace();      }             return parservalue;       }  } </code></pre><p>can anybody tell what i have to change</p>","426344","","","","","2010-11-30 15:53:54","async process dialog not showing in application in android","<android>","2","1","","",""
"4313421","1","","","2010-11-30 11:54:35","0","233","<p>I was kind of stuck trying to pass the resources to a subclass used on my Activity. I solved it in two ways, but not sure if one or both will lead to possible memory leaks. So here is what I have so far:</p><p>-myactivity (the activity class)</p><p>-global (global class to the package, I'm using to to save global accesible variables)</p><p>-subclass (the subclass where I want to use a drawable resource)</p><p><strong>a)</strong> </p><pre><code>public class global{    public static Resources appRes;    ....}public class myactivity extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        global.resApp = this.getResources();        ...    }    private void somewhere(){        subclass tmp = new subclass();        tmp.subclasmethod();    }}public class subclass{    public subclass(){...}    public void subclassmethod(){        Bitmap bmp = BitmapFactory.decodeResource(Global.appRes, R.drawable.myres);        ...    }}</code></pre><p><strong>b)</strong></p><pre><code>public class myactivity extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        ...    }    private void somewhere(){        subclass tmp = new subclass(this.getContext());        tmp.subclasmethod();    }}public class subclass{    Context context;    public subclass(Context context){        this.context = context        ...    }    public void subclassmethod(){        Bitmap bmp = BitmapFactory.decodeResource(context.getResources(), R.drawable.myres);        ...    }}</code></pre><p>Thanks in advance for you feedback.</p>","525106","","958370","","2012-02-04 11:00:30","2012-02-04 11:00:30","best way to handle resources","<android><android-resources>","1","0","","",""
"4313458","1","","","2010-11-30 11:59:24","0","537","<p>i have developed an android application using google maps. when i deploy the application to a samsung galaxy s handset (runnning on Android 2.1) and also on other handsets running on Android 2.1 everything works fine.when i change my project to support Android 2.2 i can still deploy the application to the galaxy tablet  (running on Android 2.2). all functionality works there like on the galaxy s (Android 2.1) except the maps integration. when i open the maps on the android 2.2 device i only get grey tiles.  </p><p>thanks in advance for your help.</p><p>br,martin</p>","384011","","","","","2010-11-30 12:11:26","android google maps app running on galaxy s, but not on galaxy tab - getting grey tiles","<android><google-maps>","2","0","","",""
"4313460","1","4313728","","2010-11-30 11:59:25","0","498","<p>I m in little problemI add the buttons on listview but i can't add the listener on that buttons.i used the custom listview in which we give xml view to custom adapter and set that adapter on listview and this listview placed in another xml file.</p><p>if anyone add the buttons on listview and handle that buttons with listeners then please help me because my project is stop for this reason </p>","590489","","","","","2010-11-30 12:27:15","How control buttons on listview in android","<android>","1","1","","",""
"4313488","1","4313844","","2010-11-30 12:02:24","0","148","<p>just wondering if anyone else has a better suggestion that what I'm coming up with.</p><p>The issue is to do with a TabLayout, 5 Tabs all using a single Activity.  Each Tab layout contains quite a few fields so the main parent on each tab is a ScrollView.</p><p>What I currently have is a 'Save' &amp; 'Cancel' button sitting outside the scrollviews so theyre always visible and there for the user regardless which tab they're on.  The problem is that since I'm using Tabs and always have these buttons visible when they are editing and the IME is displayed, they'res barely any of the form visible.  </p><p>So I think the best thing for me to do is to probably show the buttons at the end of each scrollview.  What I don't like about this is as I have 5 tabs, it will mean I have to declare 5 sets of the buttons, and of course define them and bind them in the Activity.. which seems rather messy and inefficient.</p><p>So if anyone has any better ideas I sure would love to hear them :-)</p><p>Thanks</p><p>Rgds,</p><p>Dave<img src=""http://i.stack.imgur.com/o6YSu.png"" alt=""alt text""></p>","333276","","333276","","2010-11-30 12:21:38","2010-11-30 12:41:25","Any better approach for layout design?","<android><layout>","3","3","","",""
"4313500","1","","","2010-11-30 12:03:40","0","2150","<p>I have an issue with streaming video file via HTTP. VideoView is used.</p><p>And I have noticed that buffer percentage decrease when seeking back. Also I have noticed that video start downloading once again if it is replaying.</p><p>Is it possible to provide some kind of cache for video buffer. And how to do this?</p>","303212","","","","","2010-11-30 12:12:48","Managing video stream buffering in Android","<android><video-streaming><buffering><videoview>","1","0","","",""
"4313514","1","","","2010-11-30 12:04:59","0","374","<p>Can Android applications can use flash content in them?</p>","525115","","","","","2010-11-30 14:06:03","Android Flash support","<android><flash>","3","0","","",""
"4313587","1","4313620","","2010-11-30 12:11:50","0","630","<p>As per the requirement i need to change the image src dynamically, hence i using JavaScript to accomplish this.</p><p>I am accessing the image with id and adding new src depending on the user click, below is the code where i am getting the problem. Through out the process i am getting the updated SRC Data of image, but its looks strange that i could see updated image in desktop browser but not in Mobile safari and Andriod.</p><p>Please help</p><pre><code>//This is id for fetching the user datavar text_food=document.getElementById(""plateText_food"");//User Datavar currentFoodName=text_food.innerHTML; //as per the requirement removing space and adding ""-""var regExp = /\s+/g;var foodName=currentFoodName.replace(regExp,'-');//Detail URLvar detailURL_food01 = 'img/beer_images_png/' + foodName + '.png';//id FOR ACCESSING IMAGE var updateFoodImage=document.getElementById(""detailURL_food"");//adding updated srcupdateFoodImage.src = detailURL_food01;</code></pre>","504023","","1104926","","2011-12-19 13:58:14","2011-12-19 13:58:14","Javascript SRC is not working in IPhone Safari and Android","<javascript><android><dhtml><mobile-safari>","1","0","","",""
"4313636","1","","","2010-11-30 12:17:29","0","231","<p>I cannot find the old Android ndk 1.5 r1 installation file anywhere on the web (right now its r4b)? I think google dropped it becuase it shouldnt be needed anymore. Does anyone know where I can find it?</p><p>/Br Johannes</p>","185433","","","","","2010-11-30 12:30:55","How can I find android ndk 1.5 r1 installation file?","<android><installation><android-ndk>","1","0","","",""
"4313842","1","4313878","","2010-11-30 12:41:01","7","2633","<p>I have created a PreferenceActivity based on xml for PreferenceScreen. In the xml you can assign default values to the different preferences. But these are not stored in my SharedPreferences before the screen is opened and closed. </p><p>The problem is that I want to immediately use the Preferences stored in this screen (like server address), and the user will only need to open it if he wants to change the default values. </p><p>Is there a way to store all the preferences from the preferencescreen xml without forcing the user to open and close the preference activity? </p><p>I am aware that you can supply a default value when retrieving the Preference from SharedPreferences, but it is stupid to have to maintain default values both in xml and code.  </p>","510732","","","","","2010-11-30 12:44:24","How to make SharedPreferences from a PreferenceActivity be set to default in Android?","<android><preferences><sharedpreferences><preferenceactivity>","1","0","1","",""
"4313885","1","4313916","","2010-11-30 12:44:56","0","2060","<p>I am trying to build a query for fetching the events from the native calendar, i have stored description with 1 word from the these 3 words: ""google"", ""yahoo"", ""stackoverflow""</p><p>For example: description=""google"",</p><p>As of now, i have made query as below:</p><pre><code>Cursor eventCursor = getContentResolver().query(builder.build(),        new String[] {""event_id"", ""title"", ""begin"", ""end"", ""allDay"",""description"" }, ""Calendars._id="" + calId,        null, ""startDay ASC, startMinute ASC""); </code></pre><p>now, <strong>i would like to make query with Description part, how do i</strong>?? of my current implementation is wrong, please show me a correct way as if you know !!!</p><h2>Update:</h2><p>I have done so far:</p><pre><code>public String Fetch_Events_Detail(long From_milliseconds, String kind_website) {  String event_detail = null;  Uri.Builder builder = calendar_events_URI.buildUpon();        //long now1 = new Date().getTime();        ContentUris.appendId(builder, From_milliseconds);        ContentUris.appendId(builder, From_milliseconds + DateUtils.DAY_IN_MILLIS);       /* Cursor eventCursor = getContentResolver().query(builder.build(),                new String[] {""event_id"", ""title"", ""begin"", ""end"", ""allDay"",""description"" }, ""Calendars._id=? and description = ?"",                new String[] { DatabaseUtils.sqlEscapeString(calId),  DatabaseUtils.sqlEscapeString(kind_website)}, ""startDay ASC, startMinute ASC"");         */        Cursor eventCursor = getContentResolver().query(builder.build(),                new String[] {""event_id"", ""title"", ""begin"", ""end"", ""allDay"",""description"" },""Calendars._id="" + calId,                null, ""startDay ASC, startMinute ASC"");         if(eventCursor != null)        {         while (eventCursor.moveToNext())          {            String uid2 = eventCursor.getString(0);            String event_title = eventCursor.getString(1);            String event_start = eventCursor.getString(2);            String event_description = eventCursor.getString(5);            try            {                // SimpleDateFormat sdf = new SimpleDateFormat(""MMM dd,yyyy HH:mm"");             SimpleDateFormat sdf = new SimpleDateFormat(""HH:mm"");                Date resultdate = new Date(Long.parseLong(event_start));                event_detail=sdf.format(resultdate)+""  ""+event_title;                event_detail.trim();                if(event_description.trim().equalsIgnoreCase(kind_website))                {                  return event_detail;                }            }            catch(NumberFormatException e)            {             Log.i(""Exception raised"", """");            }          }        }        return null; }</code></pre><p>Thanx</p>","379693","","21234","","2011-01-07 00:15:22","2011-01-07 00:15:22","Query with Calendar","<android><calendar>","1","0","1","",""
"4313942","1","","","2010-11-30 12:50:14","3","789","<p>To find all the apps that open a URL I would do like this:</p><pre><code>    Uri uri = Uri.parse(URL);    Intent intent = new Intent(Intent.ACTION_VIEW, uri);    Intent intentChooser = Intent.createChooser(intent,""Choose navigator"");    activity.startActivity(intentChooser);</code></pre><p>The problem is that I don't want to user the Chooser control, because of some developing specifications.</p><p>The question is how can I get the list of apps that open URL (that's what I get with the code above) to pass them to an ArrayAdapter / Spinner. </p>","31791","","","","","2010-12-11 13:38:04","Android, how to get the list of the apps that open a URL without using createChooser","<android>","2","1","2","",""
"4313954","1","4314113","","2010-11-30 12:51:49","1","548","<p>I want to make an Activity which should be created only once and then it should be updated based on certain values. First I tried to pass data through Intent but since I have made that activity as singleTask it do not get the new Intent object and uses the previous one. </p><p>What can be the way of passing the data to an Activity that is singleTask and needs to be updated on certain values?</p>","261566","","","","","2010-11-30 13:11:24","How to make single instance of Activity with different data passed through Intents in Android?","<android><activity>","2","1","","",""
"4313987","1","4314161","","2010-11-30 12:55:50","3","2701","<p>This is probably a silly question but i haven't been able to find the answer yet.</p><p>I want to use a TEXT column with my own unique names as the primary key in a table.the little section of code to define this looks something like this in my project:</p><pre><code>...blahblah...""CREATE TABLE "" + CAT_BUD_TAB + "" ("" + CAT_ITEM_ID + ""_ID TEXT PRIMARY KEY,    ""...blahblah..</code></pre><p>Will this work as i intend? Or perhaps i need to use ""AS ID""? I only ever see single tables with _ID as an autoincrementing integer in. Also this was intended to be a foreign key in another table but since i designed my database i've read more information and i'm not sure that'll really matter using android &amp; SQLITE?</p><p><strong>Thanks to the posters below but i'm a bit slow and not sure if i'm applying the info right, could you check?</strong></p><p>So if i have a create statement like this:</p><pre><code>""CREATE TABLE "" + CAT_BUD_TAB + "" ("" + CAT_ITEM_ID + "" TEXT PRIMARY KEY, "" +     IN_OUT + "" TEXT, "" + BUDGET_AMOUNT + "" REAL, "" + ACTUAL_AMOUNT_SPENT + "" REAL, ""    + AMOUNT_STRAYED + "" REAL, "" + OVERBUDGET_TF + "" INTEGER, "" + AUTOSPEND_TF +     "" INTEGER);""</code></pre><p>Then have:    db.execSQL(""SELECT ID, ID AS CAT_ITEM_ID"")</p><p>Can i then use them interchangeably? am i even anywhere near close? haha sorry i am trying!</p>","523874","","523874","","2010-11-30 13:42:45","2013-10-04 11:35:32","Do i have to use _ID as a SQlite primary key? and does it have to be an INT? (Android Dev)","<android><database><sqlite>","3","1","1","",""
"4314014","1","","","2010-11-30 12:58:26","1","183","<p>I am using custom ListView and when i scroll my list the image field of each listitem get replaced by some other image of some other listitem.</p><p>Can you please tell me some property of listview to prevent this.</p><p>Actually when we scroll the list the items those are not visible will perhapsneeds to  be populated again by list adapter each time during scroll.</p><p>Thanks in Advance </p>","525175","","","","","2010-11-30 14:31:31","List get distorted on scrolling","<android>","2","1","0","",""
"4314085","1","","","2010-11-30 13:07:22","1","2229","<p>I am getting the following error while building the project using ""ant debug"".Here is small the snap shot:</p><blockquote>  <p>-dex:       [echo] Converting compiled files and external libraries into C:\ELOQUENCE\b  in\classes.dex...      [apply] Could not create the Java virtual machine.      [apply] Error occurred during initialization of VM      [apply] Could not reserve enough space for object heap  BUILD FAILED  H:\USE\android-sdk-windows\tools\ant\ant_rules_r3.xml:361: The following error o  ccurred while executing this line:  H:\USE\android-sdk-windows\tools\ant\ant_rules_r3.xml:174: apply returned: 1</p></blockquote><p>please tell me what can be done?</p><p>Thanks!</p>","515791","","109702","","2012-10-06 11:58:28","2012-10-06 11:58:28","ANDROID-compile error (no JVM initialized)","<android>","2","1","","",""
"4314087","1","4314149","","2010-11-30 13:07:28","1","992","<p>hai my images are gallery all image display in same view but i expect the selected image only zoom for my gallery that type how to create any one help how to create give me your idea.....now i am post my screenshot.....help me....</p><p><img src=""http://i.stack.imgur.com/8NULx.png"" alt=""alt text""> </p>","486554","","","","","2010-11-30 13:15:33","how to zoom image","<java><android><zoom>","2","0","2","2012-05-20 23:43:07",""
"4314196","1","","","2010-11-30 13:20:38","1","2945","<pre><code> Pattern p = Pattern.compile(""^\\+(?:[0-9] ?){6,14}[0-9]$"");          //Match the given string with the pattern          Matcher m = p.matcher(numberstr);          //check whether match is found           boolean numberFound = m.matches();</code></pre>","489752","","243782","","2010-11-30 13:34:36","2010-11-30 13:34:36","how to place validation for phone number in android,""starts with +""?","<android>","1","1","2","2012-01-12 12:53:05",""
"4314246","1","","","2010-11-30 13:26:01","2","289","<p>When I upgraded one of the paid apps I wrote for Android Market, the release map API key failed to work. Two unhappy customers downloaded an app which did not display the maps but only a white grid.</p><p>This app has three map pages. Substituting the debug-based key, instead of the release key, in any one of the three pages causes it to display properly (also I switched debuggable to true in this case). Everything runs absolutely fine on my development phone using the key based on debug keystore.</p><p>I tried generating a new key, actually four others, but none work.</p><p>I'm pretty sure that I am doing things properly as I have got release keys before.</p><p>I'm afraid to upgrade any of my other posted apps for fear of breaking them too.</p><p>One key which fails to work is: 0VhiLw2B2QaOEjTVRmycP6RGHfAtTNQQE6Pioaw</p><p>Also non-functional are:0lrAHi7hTTo7rfdYU8v1AEu4FelcMLbkhlWoYZg0VhiLw2B2QaOREesqZwlM1lyDkzFmqMQIbL3QcQ0VhiLw2B2QaNbf3oXAum82nV26Oc12gCdjsQScA 20VhiLw2B2QaNOl7XH6GhKn85Tk4k7kB9V6fG61g</p><p>I used the following to generate some of these keys:</p><p>alias8, Nov 29, 2010, PrivateKeyEntry, Certificate fingerprint (MD5): 24:CE:2E:95:64:8B:27:09:6B:06:A6:D8:91:8F:C2:0Calias5, Nov 29, 2010, PrivateKeyEntry, Certificate fingerprint (MD5): 91:64:40:C6:28:9A:10:1F:D5:2E:09:F0:B5:92:11:DBalias3, Nov 2, 2010, PrivateKeyEntry, Certificate fingerprint (MD5): 2E:9A:AF:0C:E3:2A:1C:16:B6:AE:F9:CA:B3:C0:96:6Balias2, Oct 8, 2010, PrivateKeyEntry, Certificate fingerprint (MD5): 17:CA:09:A6:F0:53:E9:A1:AA:99:EB:5F:87:40:51:22</p><p>I think this is a bug in the Android Map service. I have wasted a lot of time trying to fix this and was forced to unpublish my best-selling app temporarily.</p><p>Any ideas anyone?</p>","525205","","3947","","2010-12-08 05:20:40","2011-02-06 20:19:09","My release map API key does not function, yet debug key works fine","<android><map>","0","0","","",""
"4314331","1","","","2010-11-30 13:37:10","0","1118","<p>This is my only class where i get connected to my web service :</p><pre><code>    public class Main extends Activity {    /** Called when the activity is first created. */ private static final String SOAP_ACTION=""http://tempuri.org/getme/TSM/LogOn""; private static final String METHOD_NAME=""LogOn""; private static final String NAMESPACE=""http://tempuri.org/getme/TSM/""; private static final String URL=""http://theking/eget/WebService/WSAuth.asmx""; @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView tv = (TextView) findViewById(R.id.TextView01);        SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);        Request.addProperty(""strUsername"", ""Test"");        Request.addProperty(""strPassword"", ""Test123"");        Request.addProperty(""strMessage"", ""hello"");        SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);        soapEnvelope.dotNet = true;        soapEnvelope.setOutputSoapObject(Request);        AndroidHttpTransport aht = new AndroidHttpTransport(URL);        try        {         aht.call(SOAP_ACTION, soapEnvelope);         SoapObject response = (SoapObject)soapEnvelope.getResponse();            String LogonResult =  response.getProperty(0).toString();            String MessageResult =  response.getProperty(1).toString();         tv.setText(""Status : "" + LogonResult + "" Message: "" + MessageResult);        }        catch(Exception e)        {         e.printStackTrace();        }    } }</code></pre><p>I think it breaks before the TRY tag.. all i get on the virtual screen is : false.Any solutions.. i don't know where is the problem ?</p><p>The following is a sample SOAP request and response.</p><pre><code>&lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;  &lt;soap:Body&gt;    &lt;LogOn xmlns=""http://tempuri.org/getme/TSM""&gt;      &lt;strUsername&gt;string&lt;/strUsername&gt;      &lt;strPassword&gt;string&lt;/strPassword&gt;      &lt;strMessage&gt;string&lt;/strMessage&gt;    &lt;/LogOn&gt;  &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;    &lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;  &lt;soap:Body&gt;    &lt;LogOnResponse xmlns=""http://tempuri.org/getme/TSM""&gt;      &lt;LogOnResult&gt;int&lt;/LogOnResult&gt;      &lt;strMessage&gt;string&lt;/strMessage&gt;    &lt;/LogOnResponse&gt;  &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre>","518667","","","","","2011-05-20 11:31:40","Trying to get any response when connecting from Android to my web service (SOAP 1.1)","<android><ksoap2><android-ksoap2>","2","1","","",""
"4314371","1","4507707","","2010-11-30 13:42:24","4","1279","<p>I have database heavy operations happening, which adds around 10,000 records to my Database. Since this could take a very long time, it would be better to use transactions.</p><pre><code>db.startTransaction();....do write operations.....db.setTransactionSuccessful();db.endTransaction();</code></pre><p>Now, I have some read operations inside the transactions, and since the inserts are not committed until endTransaction, those records are not fetched. I have heard about something called Transaction Isolation Levels, which enables us to read dirty (uncommitted) records as well. Any idea how to do this?</p>","177890","","","","","2010-12-22 09:18:51","Reading uncommitted transactions in Android","<java><sql><android><database><sqlite>","3","2","2","",""
"4314455","1","4314511","","2010-11-30 13:51:33","0","358","<p>In my android application I want to create a custom type of IM that should be editable via standard contacts editing application. There are several built-it IMs that user can select from: Aim, Windows Live, Yahoo, etc. I want to add ""My Very Best IM"" to the list, so that user can pick it quickly without the need to enter the ""custom"" text and value by hand. Any ideas on how to do this?</p>","244888","","","","","2010-11-30 13:57:24","Android create custom IM type","<android>","1","0","","",""
"4314507","1","4882476","","2010-11-30 13:56:51","3","1325","<p>I found this list of HTML-Tags that are (supposedly) supported for HTML.fromHtml to create a Spanned-Text:</p><p><a href=""http://commonsware.com/blog/Android/2010/05/26/html-tags-supported-by-textview.html"" rel=""nofollow"">http://commonsware.com/blog/Android/2010/05/26/html-tags-supported-by-textview.html</a></p><p>Now is there ANY way to set a custom Typeface with the Font-Tag?</p>","457378","","244296","","2011-02-24 12:41:04","2012-10-26 17:55:21","Using Html.fromHtml to set custom Typeface","<android><string-formatting>","2","1","1","",""
"4314771","1","4314945","","2010-11-30 14:29:26","3","429","<p>Is there any phone that doesn't have typical sms content provider (""content://sms/inbox"")?</p><p>Or there is any phone that has different fields scheme?</p>","296427","","","","","2010-11-30 15:03:51","Is there any phone that doesn't have sms inbox content provider?","<android><sms><android-contentprovider><inbox>","2","0","","",""
"4314777","1","4315162","","2010-11-30 14:29:56","27","13654","<p>When I expand a new group, can I collapse the last one expanded?</p>","2443607","","418183","","2011-06-30 11:54:21","2013-07-11 06:39:30","Programmatically collapse a group in ExpandableListView","<android><expandablelistview>","5","0","17","",""
"4314831","1","","","2010-11-30 14:34:52","0","751","<p>i am using services and broadcast receiver, to launch an list view ,i am using only two activity classes firstas first class starts it starts service with it..in the services m hiting a webservice and parsing data ,n passing data into broadcast receiver,now the data m geting in onreceive, and storing that data into another data...now i wan this data to access in my activity class which i wl use for listView...please tell how can i do it..without making that var. static.....</p><p>i also tried this thing with in another way please if it is possible in that way too...there first screen is geting launch there i kept one button as i click on the button service will start n will do whole job as i wrote above.....but here as i click the button another acvity is being launched which is that listview but that isnt extending listActivity that is extending activity....so i want to update that list view dynamically how can i do this...please any Help is Appriciable...</p><p>my code is here where m getting stuck</p><pre><code>public class MessageList extends Activity { public static final String TAG = MessageList.class.getSimpleName(); Context mContext; public static ArrayList&lt;String&gt; mData; public ListView mListView; private List&lt;Message&gt; messages; @Override protected void onCreate(Bundle savedInstanceState) {  // TODO Auto-generated method stub  super.onCreate(savedInstanceState);  setContentView(R.layout.maina);  System.out.println(""check bro""+mData);  System.out.println(""In OnCreate of Messagelist class"");  System.out.println(""1st"");  System.out.println(""3rd"");  mListView = (ListView) findViewById(R.id.mylist);  PlaceAdapter adapter = new PlaceAdapter(this, mData);  mListView.setAdapter(adapter); } private OnItemClickListener mItemClickListener = new OnItemClickListener() {  @Override  public void onItemClick(android.widget.AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {   Intent viewMessage = new Intent(Intent.ACTION_VIEW,Uri.parse(messages.get(arg2).getLink().toExternalForm()));   startActivity(viewMessage);  } }; /* @Override  protected void onListItemClick(ListView l, View v, int position, long id)  {  super.onListItemClick(l, v, position, id);  Intent viewMessage = new Intent(Intent.ACTION_VIEW, Uri.parse(messages  .get(position).getLink().toExternalForm()));  this.startActivity(viewMessage);  }*/ class MessageListBroadCast extends BroadcastReceiver {  @Override  public void onReceive(Context context, Intent intent) {   System.out.println(""hello"");   System.out.println(""final Done"");   Bundle bundle = intent.getExtras();   mData = bundle.getStringArrayList(""keya"");   Log.d(TAG, """" + mData);   intent.putExtra(""name"", mData);  } };}</code></pre><p>that massege list is the class which is a list viewthanks </p>","453448","","440502","","2010-11-30 14:39:09","2010-12-01 05:27:47","How Can I Update the activity(ListView) - android","<android>","1","0","","",""
"4315304","1","","","2010-11-30 15:22:44","2","1237","<p>The following gives different results in J2SE and Android for the de_DE locale:</p><pre><code>Locale locale = new Locale(""de"",""DE"");log(String.format(locale,""%.1f"", 0.45));</code></pre><p>In JRE 1.6.0_22, I get ""0,5"" as expected.</p><p>With the Android Platform 2.2 I get ""0,4""</p><p>Thanks, Roland</p>","521611","","","","","2010-12-01 00:14:39","String.format() Bug?","<android>","2","0","1","",""
"4315309","1","","","2010-11-30 15:22:55","1","374","<p>I need to resize a view so that this view remains square, like in the example.</p><p><img src=""http://i.stack.imgur.com/ctHn0.jpg"" alt=""alt text"">Different screens can have a different diagonal size. I need that the view named Panel2 remains a square and I also need that panel2 fits the full remainig screen height.  How can I do?</p><p>I prefear an XML solution, but now I need only a solution. Thanks.</p>","50455","","50455","","2011-05-20 12:40:33","2011-05-20 15:51:31","Resizing a view on different resolution","<android><screen-resolution>","0","0","2","",""
"4315332","1","4315784","","2010-11-30 15:24:56","16","10164","<p>Imagine a full Android device screen, I want it split in to two sections:</p><ol><li>The upper half has text in it, which may be larger than the space available (or not) and so the text will scroll (i.e. TextView inside a ScrollView)</li><li>The lower half contains a MapView control.</li></ol><p>Looking specifically at some scenarios:</p><ol><li>If the text is small, I want the map to take up more space, i.e. more than 50%. So perhaps 20% text, 80% map.</li><li>If the text is larger, it only takes up a MAXIMUM of 50% of the screen space, and then scrolls. So 50% map, 50% text.</li></ol><p>At the moment I've assigned weights to the two parts, and that isn't too bad, but if the text is small, the map doesn't expand to take the space, and the layout has a wasted gap that the map could usefully use.</p><p>I've tried loads of combinations but can't see how to make this happen. It seems to be a common experience for me that I know what I want, but can't see how to get the available views to deliver it. I'm hoping there's a nice easy way to do this.</p><p>Please feel free to make me look like a fool and point out the obvious attribute I've missed :-)</p><p>======================================================================</p><p>As far as I can see there's no way to do this just in declarative XML and it needs doing in the code. I set the text section height to wrap_content, weight to 0 (no resizing), and have the map set to weight=1 (i.e. take up the remaining space). I then check if the text section (in a ScrollView) is taking up too much space and if so, shrink it back. This code would need changing to support a different layout orientation.</p><pre><code>private void fixLayoutProportions(){    float maxPercentageOfScreenForText = 50/100;    LinearLayout container = (LinearLayout)findViewById(R.id.container);    ScrollView eventText = (ScrollView)findViewById(R.id.text_scroller);    int heightAvailable = container.getHeight();    int scrollerHeight = eventText.getHeight();    if ( scrollerHeight&gt;(heightAvailable*maxPercentageOfScreenForText) )      // Text section using too much space    {        eventText.getLayoutParams().height = (int)(heightAvailable*maxPercentageOfScreenForText) ;        eventText.invalidate();    }}</code></pre>","477415","","477415","","2011-02-09 18:57:49","2013-01-05 15:47:14","How to create two views in Android that use 50% height each, unless one is smaller?","<android>","7","1","3","",""
"4315611","1","4316252","","2010-11-30 15:50:20","23","15333","<p>I'm setting an alarm like this:</p><pre><code>alarmManager.set(AlarmManager.RTC_WAKEUP, alarmTime, pendingEvent);</code></pre><p>I'm interested in removing all the alarms that where previously set, clearing them.</p><p>Is there a way for me to do that or to get all the alarms that are currently set so that I can delete them manually ? </p><p>Thanks,</p>","146100","","","","","2012-02-02 11:12:54","Android: Get all PendingIntents set with AlarmManager","<android><alarmmanager>","2","1","15","",""
"4315612","1","","","2010-11-30 15:50:22","0","222","<p>I have ContentProvider with database in one application and I inserted some data in to database.</p><p>Now i want to access the database data from another application through ContentProviders.</p><p>please help me.</p>","523046","","82118","","2011-01-13 00:23:47","2011-01-13 00:23:47","Accesing ContentProviders data from another application in android","<android>","1","0","","",""
"4315654","1","4316803","","2010-11-30 15:54:15","2","679","<p>I have a <code>ListView</code> that is inside a <code>TabWidget</code>. When I select an item on the <code>ListView</code> and go to the child <code>ListView</code>, the <code>TabWidget</code> disappears. This is fine, except that it invokes the <code>onPause</code> method, and thus causes <code>onRestart</code> to be called when I return to the parent <code>ListView</code>.</p><p>I have <code>onRestart</code> setup to retrieve updated data from the server, but I do not want this to occur everytime the user returns to the parent <code>ListView</code>. I only want <code>onRestart</code> to be called when the app comes alive from running in the background. I have tried implementing a Boolean variable to determine if I should execute the code that is inside <code>onRestart</code>, but there doesn't seem to be a way to get around the effects of this.</p><p>Ideas?</p>","300129","","","","","2010-11-30 17:50:43","Working with onPause, onRestart, in Tab Widget - Android","<android><multitasking><restart><tabwidget><onstart>","1","0","0","",""
"4315899","1","4316502","","2010-11-30 16:18:27","1","380","<p>Newbie here, bear with me..</p><p>I have a class that extends TabActivity. One of my tabs currently contains one long string composed of some records i got from my sqlite table. Now i'm following a tutorial and the next step is to move away from the string and create something a bit more appropriate for the records, a listView. However it says i'll need to change my class to extend ListActivity but i've already extended TabActivity (not part of the tutorial)and i don't really have the knowledge yet to know where to go from here.</p><p><strong>I figure if my tabs content was set with intents to separate classes I wouldn't have a problem but it's important to me that both the tabs and their content are constructed in the same class because i will want to be doing a lot between them later.</strong> But maybe there is no way i can avoid creating a separate class? If so could i still point both of my tabs towards the same class? for the same reason as above. But then how would i get them still displaying different content?</p><p>I sure there's an obvious solution but i don't have enough programming experience to have a clue what it is, I've been googling a while now but i'm not really sure what to look for so if somebody could point me in the right direction i'd really appreciate it.</p><p>Hope I'm talking sense, <strong>Here's a link to see the class i'm working on:</strong></p><p><a href=""http://codeviewer.org/view/code:148c"" rel=""nofollow"">Codeviewer.org , my Budget.java</a></p>","523874","","523874","","2010-11-30 16:54:19","2010-11-30 17:18:16","How would I get a ListView from ListActivty INSIDE a class that extends on TabActivity?","<android><listview><tabs><listactivity><tabactivity>","3","2","","",""
"4315954","1","","","2010-11-30 16:23:39","0","346","<p>I am doing some injections to sql, about a hundred on first launch.  it doesn't take that long but i want a progress bar while the app is injecting data. </p><p>This is my code but progress bar doesn't appear, only black screen.  </p><pre><code>SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);        boolean firstStart = settings.getBoolean(""firstStart"", true);                if(firstStart) {                           ProgressDialog dialog = ProgressDialog.show(myInject.this, """", ""Please wait."", true);            addInjection(""The quick brown fox""); // about a hundred of these injectionsSharedPreferences.Editor editor = settings.edit();         editor.putBoolean(""firstStart"", false);         editor.commit();         dialog.dismiss(); //if i remove this i can see the progress dialog but wont close.}</code></pre>","525435","","21234","","2010-11-30 16:53:35","2010-11-30 17:22:21","Android: Help create progress bar while injecting sql","<android><progress-bar>","1","1","","",""
"4315976","1","4316194","","2010-11-30 16:25:51","0","796","<p>I'm having  abit of an issue and i'm not too sure how to go about solving it.</p><p>Essentially i have an activity which has a base xml layout of ScrollView and i want this activity to list some results from a Cursor. So i thought i'd use SimpleCursorAdapter... however when i got it all set up it appears that the ListView that the SimpleCursorAdapter goes into doesn't play nice being within another scrollable layout element.</p><p>I've sorta got it working programmically but i'd much rather use a ListAdapter as it will make each list entry look like a button and keep it inline with the design of the rest of the application and can handle the ids of each item and where to send the user upon clicking.</p><p>So my question is this: is there anyway to either make ListView show all the items such that it never needs to scroll, or can i change the ListView to something like a LinearLayout?</p><p>I hope that makes sense!Any help / insight / ideas are welcome!Cheers!</p>","483458","","","","","2010-11-30 17:34:53","SimpleCursorAdapter within a ScrollView","<android><listview><scrollview>","3","1","","",""
"4316005","1","4316089","","2010-11-30 16:28:35","2","2819","<p>I get an error trying to implement an OnTouchListener: </p><blockquote>  <p>The method onTouch(View, MotionEvent)  of type new View.OnTouchListener(){}  must override a superclass method</p></blockquote><p>I have no idea why it's not working as it seems I'm overrriding the method correctly:</p><pre><code>public class MyActivity extends Activity{    ...creation code etc...    OnTouchListener mTouchListener = new OnTouchListener()    {        @Override        public boolean onTouch(View v, MotionEvent event)        {                 ...touch code...            }        }}</code></pre><p>Any ideas on how I can debug this?</p>","235708","","","","","2010-11-30 16:37:59","Error with OnTouchListener","<android><ontouchlistener>","2","0","","",""
"4316019","1","4316206","","2010-11-30 16:29:36","0","1321","<p>I would like to design an application which could work with devices of any screen resolution.</p><p>My idea to do so was to create one Custom View for each type of View I use, and use the layout_width and layout_height specified in the XML as a percentage of the parent size (for example, layout_width=""100dp"" is equivalent to fill_parent, and layout_width=""50dp"" means the View's width will be half the parent's one).</p><p>Here is the custom TextView class I made:</p><pre><code>public class RSTextView extends TextView {    public RSTextView(Context context, AttributeSet attrs) {        super(context, attrs);    }    @Override    protected void onMeasure(int w, int h) {        int parentWidth = ((View)this.getParent()).getWidth();        int parentHeight = ((View)this.getParent()).getHeight();        Log.i(null, ""Width: "" + w + ""; Height: "" + parentHeight);        this.setMeasuredDimension(parentWidth * MeasureSpec.getSize(w) / 100,                parentHeight * MeasureSpec.getSize(h) / 100);    }}</code></pre><p>But it does not work. The parentWidth and parentHeight size is always 0.</p><p>So, first, is it a good idea to do it that way, or do you have better ideas to create an application with a relative size?</p><p>And if it is the right way to go, how can I retrieve the View's parents' size from the onMeasure method?</p><p>Thank you!</p>","488054","","","","","2010-11-30 16:47:20","How can I create a custom View with a Relative Size?","<android><view><relative>","1","0","","",""
"4316120","1","4316186","","2010-11-30 16:39:20","1","1911","<p>I have two apps that both log in to the same system but they have separate functions and may not both be installed at the same time. I can sign the two apps with the same signature no problem, even make them run in the same process.</p><p>How can I store the login cookie (among other things) in such a way that it is shared by both apps and still be secured from unknown apps? </p>","463304","","463304","","2010-11-30 20:40:20","2010-12-10 09:19:28","Preserving login session across multiple Android apps","<android><storage><isolatedstorage>","3","0","1","",""
"4316184","1","4316377","","2010-11-30 16:44:46","5","21878","<p>There are some components I need to use from these three 'supposedly' open source apps for android.  </p><p>I looked at the <a href=""http://android.git.kernel.org/"" rel=""nofollow"">source code for android</a>, but I can't seem to find the gmail app; I can only find the email app.  </p><p>I looked at the <a href=""https://github.com/facebook/facebook-android-sdk/"" rel=""nofollow"">source code for the official facebook sdk for android</a>, but there is no source code for the actual facebook app; there only is the source for the sdk, not the app.</p><p>And as for the twitter app, I can't even find the source code repository despite a million articles on the web saying that the twitter for android is open source.</p><p>Does anyone know where?</p>","481009","","105971","","2011-12-22 23:29:45","2013-07-03 14:44:46","Where can I find the source code for the gmail, facebook, and twitter apps for android? Are they even open source?","<android><facebook><twitter><gmail>","2","3","5","",""
"4316210","1","4316287","","2010-11-30 16:47:45","3","790","<p>I have an Android app that includes a C library using NDK to execute some some code. Within the C library I would like to update the applications shared preferences. My question... is it possible to read/edit shared preferences in native code?</p>","420008","","","","","2010-11-30 16:54:23","Is it possible to read/edit shared preferences in native code?","<android>","1","0","","",""
"4316226","1","","","2010-11-30 16:49:02","0","1187","<p>I am currently working on an application for Android and I'm using Eclipse and of course Android SDK, but I have bumped in to a problem that is almost the only thing I need to fix before I can relaese a beta-version to Android Market.</p><p>So, my problem is that I have an xml with 4 different buttons, and if the user press on a certain button, one sound will be played, and if the user press any of the other buttons is pressed another sound will play but the sound only play sometimes, I want it to play every time the user press a button.Here's my code(concerning the mediaplayer):</p><pre><code>    public MediaPlayer right=null;      public MediaPlayer wrong=null;     if(right!=null) {           right.reset();        right.release();      }      if(wrong!=null) {           wrong.reset();              wrong.release();      }      right = MediaPlayer.create(getBaseContext(), R.raw.rightsound);    wrong = MediaPlayer.create(getBaseContext(), R.raw.wrongsound);    if(****()){        right.start();    }     else {     wrong.start(); } </code></pre><p>That's my code and I would be very grateful if somebody could help me solve my problem.</p>","525468","","418183","","2010-11-30 16:58:47","2011-02-05 18:47:58","Playing sound on EVERY buttonclick(Android=","<android><audio><media-player>","1","2","","",""
"4316600","1","4323644","","2010-11-30 17:30:02","6","5159","<p>i have this customized list. each row contains an image and two lines of text one below the other. i want to open a new activity when any list item is clicked. but i am not able to do so, even after implementing the setOnItemClickListener(). please correct me if i am wrong. the below is the code for the list. PS: This is an normal activity and not list activity.</p><pre><code>l1.setAdapter(new EfficientAdapter(this,eventTitleArray,eventDateArray,eventImageLinkArray));   //l1 = getListView();   l1.setClickable(true);   l1.setOnItemClickListener(new OnItemClickListener() {    @Override    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,      int position, long arg3) {     Intent intent = new Intent(MainActivity.this, DisplayActivity.class);     Bundle b = new Bundle();     b.putString(""event"", eventTitleArray[position]);     intent.putExtras(bundle);     startActivity(intent);     Toast.makeText(getApplicationContext(), ""Opening detailed view for:""+eventTitleArray[position], Toast.LENGTH_SHORT).show();    }   });</code></pre>","377337","","","","","2013-06-27 16:14:31","android list view clickable problem","<android><listview><listviewitem><android-listview>","2","0","","",""
"4316658","1","4452350","","2010-11-30 17:36:14","3","4028","<p>I need a library to <em>generate</em> a 2D bar code on iPhone and Android (and preferably WM7 and possibly j2me too) - the idea is to transfer information to another device with a corresponding scanner (decoder). What are the good options?</p><p><a href=""http://code.google.com/p/zxing/"" rel=""nofollow"">ZXing</a> is an option, in particular for the reading/decoding aspect, but I want to <em>generate</em> them on these devices.</p>","39334","","21234","","2010-12-15 14:52:57","2012-08-28 15:09:35","Generate 2D bar code (e.g. QR Code, Data Matrix, PDF417) on iPhone and Android","<iphone><android><qr-code>","8","0","2","",""
"4316741","1","4316774","","2010-11-30 17:45:50","0","710","<p>I compiled my application, and it used to work fine. When I build normally it creates an APK file in the bin folder. Now, nothing.</p><pre><code>[2010-11-30 12:06:58 - MyProject] Removing generated java classes.[2010-11-30 12:06:58 - MyProject] Refreshing resource folders.[2010-11-30 12:06:58 - MyProject] Starting full Pre Compiler.[2010-11-30 12:06:58 - MyProject] Removing generated java classes.[2010-11-30 12:06:58 - MyProject] Preparing generated java files for update/creation.[2010-11-30 12:06:58 - MyProject] C:\dev\android-sdk-windows\platforms\android-4\tools\aapt.exe package -m -v -J C:\svn\MyProject\gen -M C:\svn\MyProject\AndroidManifest.xml -S C:\svn\MyProject\res -I C:\dev\android-sdk-windows\platforms\android-4\android.jar [2010-11-30 12:06:58 - MyProject] Locale/Vendor pairs:[2010-11-30 12:06:58 - MyProject]    /[2010-11-30 12:06:58 - MyProject]    /[2010-11-30 12:06:58 - MyProject]    /[2010-11-30 12:06:58 - MyProject]    /[2010-11-30 12:06:58 - MyProject] [2010-11-30 12:06:58 - MyProject] Files:... truncated ...[2010-11-30 12:06:58 - MyProject]       Src: C:\svn\MyProject\res\values\strings.xml[2010-11-30 12:06:58 - MyProject]   xml\settings.xml[2010-11-30 12:06:58 - MyProject]       Src: C:\svn\MyProject\res\xml\settings.xml[2010-11-30 12:06:58 - MyProject]   AndroidManifest.xml[2010-11-30 12:06:58 - MyProject]       Src: C:\svn\MyProject\AndroidManifest.xml[2010-11-30 12:06:58 - MyProject] Including resources from package: C:\dev\android-sdk-windows\platforms\android-4\android.jar[2010-11-30 12:06:58 - MyProject] applyFileOverlay for drawable[2010-11-30 12:06:58 - MyProject] applyFileOverlay for layout[2010-11-30 12:06:58 - MyProject] applyFileOverlay for anim[2010-11-30 12:06:58 - MyProject] applyFileOverlay for xml[2010-11-30 12:06:58 - MyProject] applyFileOverlay for raw[2010-11-30 12:06:58 - MyProject] applyFileOverlay for color[2010-11-30 12:06:58 - MyProject] applyFileOverlay for menu... truncated ...[2010-11-30 12:06:58 - MyProject]   Writing symbols for class R.[2010-11-30 12:06:58 - MyProject] Nothing to pre compile![2010-11-30 12:07:00 - MyProject] Refreshing resource folders.[2010-11-30 12:07:00 - MyProject] Starting incremental Pre Compiler: Checking resource changes.[2010-11-30 12:07:00 - MyProject] Nothing to pre compile!</code></pre><p>Everything seems fine until the last line. Verbose is turned on.</p><p>Any idea what's wrong??</p><p>Thanks.</p>","442512","","","","","2012-04-05 11:31:50","Build problem: APK not produced, ""Nothing to pre compile!""","<android>","2","0","1","",""
"4316744","1","4316812","","2010-11-30 17:45:56","4","3664","<p>I'm building Android application which needs to identify device by some unique number/string.</p><p>I've heard about <a href=""http://www.anddev.org/code-snippets-for-android-f33/how-to-uniquely-identify-an-android-device-android-id-t6394.html"" rel=""nofollow"">ANDROID_ID</a> but there are also reports that it can be the same on some phone models or even updates.Another thing is that it is recreated after factory reset or system reinstall. I can live with that although I would prefer if it stayed the same.</p><p>Is there another way to identify the phone without asking for more permissions? IMEI requires them(android.permission.READ_PHONE_STATE) but it can scare away users.</p><p>How Shazam does that? I know it identifies the phone permanently (it remembers that I was a user before it introduced 5 tags a month restriction for new users) even though I completely reinstalled the system. </p>","219449","","","","","2010-11-30 17:51:19","Unique identifier for Android phone","<android>","2","0","","",""
"4316763","1","","","2010-11-30 17:47:34","1","14778","<p>well this is the code snippet i use to access the getUser.php to retrive user details from a MySQL database in my application:</p><pre><code>String result = """";    //the year data to send    ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();    nameValuePairs.add(new BasicNameValuePair(""uid"",""demo""));         //http post         try{                 HttpClient httpclient = new DefaultHttpClient();           HttpPost httppost = new HttpPost(""http://192.xxx.xx.xxx/getUser.php"");            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));                HttpResponse response = httpclient.execute(httppost);                HttpEntity entity = response.getEntity();                InputStream is = entity.getContent();        }catch(Exception e){                Log.e(""log_tag"", ""Error in http connection ""+e.toString());        }        //convert response to string        try{                InputStream is = null;                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);                        Log.i(""log_tag"",""id: ""+json_data.getInt(""id"")+                              "", name: ""+json_data.getString(""fname"")+                                "", sex: ""+json_data.getInt(""sex"")+                                "", birthyear: ""+json_data.getInt(""dob"")                        );                }  }        catch(JSONException e){                Log.e(""log_tag"", ""Error parsing data ""+e.toString());        }}</code></pre><p>This snippet is taken from <a href=""http://helloandroid.com"" rel=""nofollow"">http://helloandroid.com</a></p><p>Everything is configured fine: the MySQL Db, IIS with FASTCGi, PHP tools and drivers. even the script below when called from browser with url: <a href=""http://192.xxx.xx.x.xxx/getUser.php?uid=demo"" rel=""nofollow"">http://192.xxx.xx.x.xxx/getUser.php?uid=demo</a> works fine, But returns error in android with <strong>java.lang.NullPointerException</strong> and <strong>org.json.JSONEXCEPTION: End of input at character 0</strong></p><pre><code>&lt;?phpmysql_connect(""myhost"",""username"",""pwd"");mysql_select_db(""mydb"");$q=mysql_query(""SELECT * FROM userinfo WHERE uid ='"".$_REQUEST['uid'].""'"");while($e=mysql_fetch_assoc($q))        $output[]=$e;print(json_encode($output));mysql_close();?&gt;</code></pre><p>Can anybody help in this section?</p><p>Regards,Mistry Hardik</p>","500033","","59058","","2010-11-30 17:55:18","2014-04-17 16:35:31","Connect MySQL database from Android","<mysql><android>","1","3","5","",""
"4316808","1","","","2010-11-30 17:51:11","-2","3137","<p>I am new to Android, my requirement is to use only one button for playing and pause using media player class?</p>","513745","","168175","","2011-09-19 18:52:00","2014-04-08 09:53:44","using only one button to play and pause a Mediaplayer in Android","<android>","4","2","","",""
"4316874","1","4317406","","2010-11-30 17:57:48","2","915","<p>How can I simulate movement of the emulator in a program that is tracking speed using the GPS?I understand that the general way to go about it is to go into the DDMS perspective, and then under emulator control upload a gpx file and press play to simulate that track.  However, my code is not detecting the movement... and I am not sure if it is because of something wrong with my code or something wrong with the simulated emulator gpx.  My code is simply</p><pre><code>public void onLocationChanged(Location myLocal) {    float mySpeed=-1;            if(myLocal.hasSpeed()){                    mySpeed = myLocal.getSpeed();               }    ...}</code></pre><p>I have uploaded my gpx file and have pressed play, but no call to onLocationChanged occurs.  If someone would be able to suggest a method to determine where the problem may lie it would be much appreciated.</p><p>Update 1 : I've found that the onLocationChanged method does get called when I use a real phone and not the emulator.  </p>","513939","","513939","","2010-12-01 13:41:32","2010-12-01 13:41:32","Mock GPS routes in android emulator","<android><android-emulator>","1","0","","",""
"4316887","1","4317281","","2010-11-30 17:59:19","1","4138","<p>I did some reading on the API for File IO and read the following blog post: <a href=""http://techknock.blogspot.com/2008/05/file-hadling-in-android.html"" rel=""nofollow"">http://techknock.blogspot.com/2008/05/file-hadling-in-android.html</a>. His code works fine when everything is in the same activity. But what I am trying to do is create an IOInterface class that I can use to open multiple databases to populate multiple lists.</p><p><strong>ListA.java</strong></p><pre><code>public class ListA{    public List&lt;ClassA&gt; list;    private final String DBA = ""dbA"";    private IOInterface database;    public List()    {        list = new ArrayList&lt;ClassA&gt;();        database = new IOInterface();    }    ...    public void initListA() throws IOException    {        database.openForWriting(DBA);        String myStr = new String(""content"");        database.dos.writeBytes(myStr);        database.dos.flush();        database.dos.close();    }}</code></pre><p><strong>IOInterface.java</strong></p><pre><code>public class IOInterface{    public DataOutputStream dos;    private FileOutputStream fos;    public void openForWriting(String database)    {        try {            fos = openFileOutput(database, Content.MODE_PRIVATE);            dos = new DataOutputStream(fos);        } catch (FileNotFoundException e) {            e.printStackTrace();        }    }}</code></pre><p>Eclipse underlines <code>fos = openFileOutput(database, Content.MODE_PRIVATE);</code>. With the comment that <code>openFileOutput()</code> does not exist. The resolution to this is to extend the IOInteface class as an Activity. I suppose then <code>openFileOutput()</code> is a method of an activity class.</p><p>So my question is how do accomplish what I am trying to do? Standard Java file io such as:</p><pre><code>File fp = new File(""database"");FileOutputStream fos = new FileOutputStream(fp);</code></pre><p>does not work. It catches a FileNotFoundException. This has to be doable though. Any ideas?</p><p>Thanks,</p>","450780","","","","","2010-11-30 18:48:24","Android File IO Interface Class","<java><android><file-io>","1","0","","",""
"4316928","1","","","2010-11-30 18:05:16","1","285","<p>HiI am testing an app (android 2.1 level7) on a HTC Hero phone (via Perfecto Mobile).  I get the Foce Close msg and look at the log which says:-</p><pre><code>11-30 18:41:25.765: ERROR/dalvikvm(2158): Could not find method android.telephony.SmsManager.getDefault, referenced from method com.AccidentAlert.ListViewLoader.sendSMS</code></pre><p>The code which calls this is:_</p><pre><code>SmsManager sms = SmsManager.getDefault();        sms.sendTextMessage(phoneno,null, message, sentPI, deliveredPI);</code></pre><p>Can anyone suggest why the phone should have a problem like this?ThanksRon</p>","479505","","418183","","2010-11-30 18:15:08","2010-12-01 10:58:45","android phone cant find telephony.smsmanager","<android>","1","1","","",""
"4316931","1","4316946","","2010-11-30 18:05:36","1","2146","<p>I'm not sure, if ""running string"" the right name.</p><p>I try to explain, what I mean.</p><p>I have a TextView in my Layout and want to have text there, which runs from rigth to left, again, and again, and again.</p><p>I thougt, I just should enable marquee for that, but the text stays instead of running :(</p><p>Here is my TextView-Code:</p><pre><code>&lt;TextView android:id=""@+id/text_ticker""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:background=""@color/grey0""  android:textColor=""@color/black""  android:layout_marginLeft=""5dp""  android:layout_marginRight=""5dp""  android:layout_marginTop=""5dp""  android:padding=""10dp""  android:ellipsize=""marquee""       android:marqueeRepeatLimit=""marquee_forever"" android:scrollHorizontally=""true""&gt;&lt;/TextView&gt;</code></pre><p>Thank you,</p><p>Mur</p>","408780","","","","","2010-11-30 18:06:53","Running string in Android","<android><textview>","1","3","0","",""
"4317018","1","4317411","","2010-11-30 18:14:50","1","532","<p>Is it possible to specify that a @string value belongs to a different package via the Manifest?</p><p>i.e. android:text=""@string/my_logo_text""</p><p>Implicitly specifies the value as belonging to the current package. Is there a way to fully qualify that this string belongs to another package?</p>","440093","","","","","2010-11-30 19:00:43","Android: Specify String in different Package in Manifest","<android>","1","0","","",""
"4317048","1","4317160","","2010-11-30 18:18:10","2","1006","<p>I'm seeing this message</p><blockquote>  <p>This rating option has been disabled  by the Android Market team</p></blockquote><p>next to the ""All"" rating option for my app.  This is showing up for my apps that need Internet access to serve up adMob ads.  I am not allowed to select the All option.  My app is suitable for little kids, and the ads don't show up on the main game screen.  Does anyone know of a way to get around this?</p>","265877","","","","","2012-04-14 01:43:13","This rating option has been disabled by the Android Market team","<android><google-play>","3","2","","",""
"4317125","1","4376874","","2010-11-30 18:27:43","1","849","<p>I'm trying to resolve a small problem:</p><pre><code>mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 120000, 0, mLocationListener);</code></pre><p>So I assumed that mLocationListener should wait for 2 mainutes before calling it's onLocationChanged method. However, the method is called right after I send geo fix updates to emulator, every time I do it. Did I misunderstand the android developers guide, and do I have to to use timers or anything similar for organizing update rate I need?</p>","525328","","","","","2010-12-07 13:13:45","Configuring frequency of notifications for requesting location updates","<android>","2","4","","",""
"4317182","1","4641923","","2010-11-30 18:33:55","2","722","<p><strong>SOLVED:</strong> Removed edittext and showed keyboard using </p><pre><code>imgr.toggleSoftInput(0, 0);</code></pre><p>Original question:</p><p>Hello, I am developing a remote controller app with touchpad/keyboard modes.My problem is with SW keyboard. When user presses a key on SW keyboard I need to send this value to PC. I managed to do that in portrait mode with hidden EditText but when I change the orientation to landscape, the SW keyboard opens with the white text field which covers all the space above the keyboard and it shows the text user has written. Is there any way i could open and listen to landscape keyboard without that text field?</p><p>My code for opening the SW keyboard:</p><pre><code>InputMethodManager imgr = (InputMethodManager) getSystemService(this.INPUT_METHOD_SERVICE);imgr.showSoftInput(edKeyListener, InputMethodManager.SHOW_FORCED);</code></pre><p>And the EditText xml:</p><pre><code>&lt;EditText        android:id=""@+id/keyListener""        android:layout_width=""0dp""        android:layout_height=""0dp""        android:inputType=""textFilter"" /&gt;</code></pre>","522545","","522545","","2010-11-30 19:01:29","2011-01-09 21:24:22","Landscape SW keyboard without text field above it?","<android><keyboard>","1","0","1","",""
"4317195","1","","","2010-11-30 18:35:26","2","296","<p>Trying to open socket connection in separate thread by calling this:</p><pre><code>Socket sc = sc = new Socket(address, Integer. parseInt(port));</code></pre><p>But there is a problem, if there is no active internet connection this thread is blocking, on my htc hero 2.1 for 30 seconds, and my android emulator 2.2 for 2 minutes.</p><p>I tryed to use this method before opening connection:</p><pre><code>public static boolean isOnline(){             ConnectivityManager cm = (ConnectivityManager) app.getInstance().getSystemService(Context. CONNECTIVITY_SERVICE);             if(null != cm.getActiveNetworkInfo())                   return cm.getActiveNetworkInfo().isConnectedOrConnecting();             return false ;}public void run(){    if(!isOnline())        throw new IOException(""internet not connected"");    Socket sc = new Socket(address, Integer. parseInt(port));}</code></pre><p>And everything is good, But if active connection will lost after isOnline was called, and before new Socket call, its still blocks for random time.</p><p>My question is there any possibility to solve that problem? or just block this thread for fixed time for about 2-3 seconds?</p>","309955","","","","","2010-11-30 20:46:52","Creation of Socket instance blocks thread for random time if no connection available","<android><sockets>","1","0","","",""
"4317234","1","","","2010-11-30 18:40:10","1","611","<p>am having a little trouble here. i don't know why i am getting a SecurityException, when trying to install my AppWidget on the home screen?. i don't know what will help to solve this but here is the simplified logcat output and my Android Manifest for starters:</p><pre><code>11-30 18:02:16.454: ERROR/AndroidRuntime(287): Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=android.appwidget.action.APPWIDGET_CONFIGURE cmp=com.MuchachaApps.WeatherViewer/.WeatherForecastConfigure (has extras) } from ProcessRecord{44e58dc8 287:android.process.acore/10001} (pid=287, uid=10001) requires null11-30 18:02:16.454: ERROR/AndroidRuntime(287):atandroid.os.Parcel.readException(Parcel.java:1218)113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.os.Parcel.readException(Parcel.java:1206)113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1214)113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.app.Instrumentation.execStartActivity(Instrumentation.java:1373)113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.app.Activity.startActivityForResult(Activity.java:2749)113018:02:16.454:ERROR/AndroidRuntime(287):atcom.android.launcher.Launcher.startActivityForResult(Launcher.java:969)113018:02:16.454:ERROR/AndroidRuntime(287):atcom.android.launcher.Launcher.addAppWidget(Launcher.java:1148)113018:02:16.454:ERROR/AndroidRuntime(287):atcom.android.launcher.Launcher.onActivityResult(Launcher.java:379)113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.app.Activity.dispatchActivityResult(Activity.java:3828)113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.app.ActivityThread.deliverResults(ActivityThread.java:3325)11-30 18:02:16.454: ERROR/AndroidRuntime(287):... 11 more</code></pre><p>My Android 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.MuchaaApps.WeatherViewer""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;service android:name= ""weatherForecast""&gt;&lt;/service&gt;&lt;activity android:name="".WeatherForecastConfigure"" android:label=""@string/app_name""&gt;&lt;/activity&gt;&lt;receiver android:name=""WeatherWidgetProvider"" android:label=""Weather Forecast""&gt;     &lt;intent-filter&gt;        &lt;action android:name= ""android.appwidget.action.APPWIDGET_UPDATE""&gt;&lt;/action&gt;     &lt;/intent-filter&gt;      &lt;intent-filter&gt;       &lt;action android:name=""com.MuchaaApps.WeatherViewer.WEATHER_UPDATE""&gt;&lt;/action&gt;       &lt;/intent-filter&gt;            &lt;meta-data android:name=""android.appwidget.provider""             android:resource=""@xml/weather_appwidget_info""&gt;&lt;/meta-data&gt;        &lt;/receiver&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""4"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""/&gt;&lt;/manifest&gt; </code></pre><p>if you need any other information, please let me know. Thank you</p>","479908","","","","","2011-03-06 19:37:20","Getting SecurityException when trying to install appWidget in HomeScreen","<android>","1","2","","",""
"4317331","1","","","2010-11-30 18:52:28","1","3095","<p>As the title says, how can I do this?I've looked but can't find the answer.It's really annoying me now.This is for my file browser, I've tried using Collections.sort() on the array that gets added to the ListView but that didn't do anything!</p><p>Help :'( :'( :'(</p>","427234","","","","","2010-11-30 19:01:27","Android Programming: Alphabetically Order ListView","<android><listview><sql-order-by><alphabetical>","1","1","","",""
"4317582","1","","","2010-11-30 19:18:56","3","1041","<p>I am trying to figure out an easy way for a user to select a word, preferably by long pressing on the word in a TextView. Basically, I have a TextView filled with text and I would like the user to have the ability to long press the word and then display a contextmenu so I can execute a database search? Is this possible? I can also switch to an EditText as long as I can make it look like a TextView. Make sense?</p><p>Thanks. </p>","485438","","","","","2010-11-30 19:57:50","Android selecting a word in either a TextView or EditView","<android><textview><edittext>","1","0","","",""
"4317612","1","6769362","","2010-11-30 19:22:57","4","369","<p>Suppose I want to run some program which requests too many permissions. For example, record from the microphone or read IMEI of my phone. However, there are no practical explanation why recording from the mic or IMEI number is needed for this particular application, except for data mining.</p><p>I want to try this app, but restrict its permissions. For example, if it reads IMEI, it should get random IMEI(but the same every time). If it tries to read the mic, it should get silence.</p><p>Some other interesting permissions:</p><ol><li>Phonebook read/write access -returns zero contacts, pretend thatwrite is OK, but actually donothing. </li><li>Send SMS - pretend that SMSis sent, but do nothing. </li><li>Get list ofvisible Wi-Fi networks - return zeronetworks.</li></ol><p>Obviously the tool should require a rooted phone. Are there any such tools?</p>","405131","","","","","2012-09-21 06:35:23","Are there any tools to sandbox a malware application even more than the granted permissions on Android?","<android><permissions><sandbox><privacy><malware>","3","2","4","",""
"4317659","1","","","2010-11-30 19:28:16","0","732","<p>is there a way to play a tone over bluetooth?</p><p>I'm not trying to stream audio or anything fancy, I just want the headset to make a beep sound like when pressing an on screen button or getting a call.</p>","454211","","","","","2010-11-30 20:16:35","android - notification tone over bluetooth","<android><bluetooth><notifications>","1","0","","",""
"4317665","1","","","2010-11-30 19:28:57","11","10690","<p>Query to <code>MediaStore.Video.Media.EXTERNAL_CONTENT_URI</code> returns only video in <code>/sdcard/DCIM/100MEDIA</code></p><p>But I want to get thumbnails for video in my <code>/sdcard/Android/data/mypackage/files</code> folder. Is it possible ?</p><p>Here is part of my code:</p><pre><code>        ContentResolver cr = getContentResolver();    String[] proj = {                    BaseColumns._ID    };    Cursor c = cr.query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null, null, null);    if (c.moveToFirst()) {        do        {            int id = c.getInt(0);            Bitmap b = MediaStore.Video.Thumbnails.getThumbnail(cr, id, MediaStore.Video.Thumbnails.MINI_KIND, null);            Log.d(""*****My Thumbnail*****"", ""onCreate bitmap "" + b);            ImageView iv = (ImageView) findViewById(R.id.img_thumbnail);            iv.setImageBitmap(b);        }        while( c.moveToNext() );    }             c.close();</code></pre>","281887","","1410342","","2013-01-16 05:58:49","2013-01-16 05:58:49","How to get thumbnail for video in my /sdcard/Android/data/mypackage/files folder?","<android><video><thumbnails>","1","0","10","",""
"4317676","1","4319059","","2010-11-30 19:30:01","1","6882","<p>i have the following exception when i running the following application</p><p>Activity:</p><pre><code>package com.google.android.SmartStudentmCompanion;import java.io.BufferedReader;import java.io.IOException;import java.util.ArrayList;import java.util.List;import org.apache.http.HttpResponse;import org.apache.http.NameValuePair;import org.apache.http.client.HttpClient;import org.apache.http.client.entity.UrlEncodedFormEntity;import org.apache.http.client.methods.HttpPost;import org.apache.http.message.BasicNameValuePair;import org.apache.http.util.EntityUtils;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.Toast;public class Login extends  Activity{    public static String ip_address=""192.168.1.101"";    EditText username;     EditText password;    Button login;    Button exit;    Toast toast;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.loginscreen);        System.out.println(""onCreate()..."");        username = (EditText) findViewById(R.id.username);        password = (EditText) findViewById(R.id.password);        this.login = (Button)findViewById(R.id.loginButton);        this.login.setOnClickListener(new View.OnClickListener() {            String usrnm;            String pwd;            @Override            public void onClick(View v) {                usrnm = username.getText().toString();                pwd = password.getText().toString();                System.out.println(""onClick()..."");                int length = 0;                try {                    System.out.println(""hello"");                    String page = executeHttpPost(usrnm,pwd);                    System.out.println(page);                    length = page.length();                } catch (Exception e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }                if (length == 0){                    Toast.makeText(getApplicationContext(),                             ""Invalid username and/or password"",                             Toast.LENGTH_SHORT).show();                }                else {                    /*Toast.makeText(getApplicationContext(),                             ""Valid username and password"",                             Toast.LENGTH_SHORT).show();*/                    Intent myIntent = new Intent(v.getContext(), VideoViewer.class);                    startActivityForResult(myIntent, 0);                }            }        });        this.exit = (Button)findViewById(R.id.exitButton);        this.exit.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                finish();            }        });    }    public String executeHttpPost(String username, String password) throws Exception {        BufferedReader in = null;        try {            ApplicationEx app = (ApplicationEx)this.getApplication();            HttpClient client = app.getHttpClient();            HttpPost request = new HttpPost(""http://""+ip_address+""/smartstudentmcompanion/check.php"");            List&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;();            postParameters.add(new BasicNameValuePair(""un"", username));            postParameters.add(new BasicNameValuePair(""pwd"", password));            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(postParameters);            request.setEntity(formEntity);            HttpResponse response = client.execute(request);            /*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();*/            String page = EntityUtils.toString(response.getEntity());            System.out.println(""page: "" + page);            return page;            } finally {            if (in != null) {                try {                    in.close();                } catch (IOException e) {                    e.printStackTrace();                }            }        }    }}</code></pre><p>Application:</p><pre><code>package com.google.android.SmartStudentmCompanion;import org.apache.http.HttpVersion;import org.apache.http.client.HttpClient;import org.apache.http.conn.ClientConnectionManager;import org.apache.http.conn.scheme.PlainSocketFactory;import org.apache.http.conn.scheme.Scheme;import org.apache.http.conn.scheme.SchemeRegistry;import org.apache.http.conn.ssl.SSLSocketFactory;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;import org.apache.http.params.BasicHttpParams;import org.apache.http.params.HttpParams;import org.apache.http.params.HttpProtocolParams;import org.apache.http.protocol.HTTP;import android.app.Application;import android.util.Log;public class ApplicationEx extends Application {    private static final String TAG = ""ApplicationEx"";    private HttpClient httpClient;    @Override    public void onCreate(){        super.onCreate();        httpClient = createHttpClient();    }    @Override    public void onLowMemory() {        super.onLowMemory();        shutdownHttpClient();    }    @Override    public void onTerminate() {        super.onTerminate();        shutdownHttpClient();    }    private HttpClient createHttpClient(){        Log.d(TAG,""createHttpClient()..."");        HttpParams params = new BasicHttpParams();        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);        HttpProtocolParams.setContentCharset(params, HTTP.DEFAULT_CONTENT_CHARSET);        HttpProtocolParams.setUseExpectContinue(params, true);        SchemeRegistry schReg = new SchemeRegistry();        schReg.register(new Scheme(""http"",                PlainSocketFactory.getSocketFactory(), 80));        schReg.register(new Scheme(""https"",                SSLSocketFactory.getSocketFactory(), 443));        ClientConnectionManager conMgr = new ThreadSafeClientConnManager(params,schReg);        return new DefaultHttpClient(conMgr, params);    }    public HttpClient getHttpClient() {        return httpClient;    }    private void shutdownHttpClient() {        if(httpClient!=null &amp;&amp; httpClient.getConnectionManager()!=null) {            httpClient.getConnectionManager().shutdown();        }    }}</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=""com.google.android.SmartStudentmCompanion""      android:versionCode=""1""      android:versionName=""1.0""&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;activity android:name="".VideoViewer""&gt;&lt;/activity&gt;    &lt;/application&gt;     &lt;uses-permission        android:name=""android.permission.INTERNET"" /&gt;     &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre>","480401","","234039","","2010-11-30 19:36:01","2012-07-08 07:18:59","android classcastexception at android.app.Application","<android><classcastexception>","1","4","","",""
"4317778","1","4318907","","2010-11-30 19:40:27","50","18012","<p>I have a <code>ListView</code>. The data behind it is fetched from the Internet, in sets of 10-30 items whenever the user scrolls all the way to the bottom. In order to indicate that it is loading more items, I used <a href=""http://d.android.com/reference/android/widget/ListView.html""><code>addFooterView()</code></a> to add a simple view that displays a ""Loading..."" message and a spinner. Now, when I'm out of data (no more data to fetch), I want to hide that message. I tried to do:</p><pre><code>loadingView.setVisibility(View.GONE);</code></pre><p>Unfortunately, while that does hide the view, it leaves space for it. I.e. I end up with a big blank space where the ""Loading"" message used to be. How can I go about properly hiding this view?</p><p>I can't use <code>removeFooterView()</code> because I may need to show it again, in which case I can't call <code>addFooterView()</code> again because an adapter has already been set on the <code>ListView</code>, and you can't call <code>addHeaderView()</code> / <code>addFooterView()</code> after setting an adapter.</p>","180784","","","","","2013-07-10 21:28:15","Hide footer view in ListView?","<android><listview>","7","0","17","",""
"4317808","1","","","2010-11-30 19:43:42","2","4617","<p>I am developing an application that uses tabs with each tab being linked to a webpage that the user will be able to see and interact with using webview. what i am having trouble with is implementing a add and delete command that the user will be able to use to delete a tab if desired or add a tab with a url of their choice that works just like the others</p><p>Below is my code</p><p>Here is the main java file that all other files use</p><pre><code>public class UniversityofColorado extends TabActivity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TabHost host=getTabHost();    host.addTab(host.newTabSpec(""one"")            .setIndicator(""Google"")            .setContent(new Intent(this, Hello.class)));    host.addTab(host.newTabSpec(""two"")                    .setIndicator(""Colorado Main Site"")                    .setContent(new Intent(this, ColoradoMainSiteBrowser.class)));    host.addTab(host.newTabSpec(""three"")                    .setIndicator(""CULearn"")                    .setContent(new Intent(this, CULearnBrowser.class)));    host.addTab(host.newTabSpec(""four"")            .setIndicator(""CULink"")            .setContent(new Intent(this, CULinkBrowser.class)));    host.addTab(host.newTabSpec(""five"")            .setIndicator(""MyCUInfo"")            .setContent(new Intent(this, MyCUInfoBrowser.class)));    host.addTab(host.newTabSpec(""six"")            .setIndicator(""Campus Map"")            .setContent(new Intent(this, CampusBrowser.class)));    host.addTab(host.newTabSpec(""Seven"")            .setIndicator(""Notes"")            .setContent(new Intent(this, Notepadv3.class)));}       // Inflates menu when ""menu Key"" is pressed    @Override    public boolean onCreateOptionsMenu(Menu menu) {        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.menu, menu);        return true;    }}</code></pre><p>Then i have each webpage defined in a seperate java file that the main file callsbelow is one of them</p><pre><code>public class ColoradoMainSiteBrowser extends Activity {WebView webview;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);webview = (WebView) findViewById(R.id.webview);webview.setWebViewClient(new HelloWebViewClient());webview.getSettings().setJavaScriptEnabled(true);webview.loadUrl(""http://colorado.edu/"");}private class HelloWebViewClient extends WebViewClient {@Overridepublic boolean shouldOverrideUrlLoading(WebView view, String url){view.loadUrl(url);return true;}}public boolean onKeyDown(int keyCode, KeyEvent event) {if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {webview.goBack();return true;}return super.onKeyDown(keyCode, event);}}</code></pre><p>I have the menu defined in the main file i just need to construct the methods so the buttons do what they are suppose to do. any help would be great</p>","524592","","524592","","2010-11-30 20:30:13","2012-02-10 10:21:36","How to allow user to Add and Delete Tabs in an android application","<android><delete><tabs><add><android-webview>","2","0","1","",""
"4318084","1","","","2010-11-30 20:12:36","3","916","<p>I am having issues importing <code>com.google.*</code> libraries.</p><p>I am very new to eclipse and do not know how to import these libraries to fix my code errors. Can someone point me in the right direction to importing these libraries?</p>","525672","","545127","","2013-07-01 12:14:28","2013-07-01 12:14:28","importing java com.google.* libraries","<java><android>","3","1","","2013-07-03 11:56:20",""
"4318252","1","4318275","","2010-11-30 20:30:16","3","447","<p>What I want to do is just check when the user is signing up that whether the password entered is at least 6 characters and has no space in it. Thats pretty much it. What would be a regex that I could use in Java Pattern Matcher classes for this purpose?</p><p>Thanks for your help guys.</p>","447886","","","","","2010-11-30 20:34:23","What would be a simple regular expression for password check during signup?","<java><android><regex>","4","0","","",""
"4318278","1","","","2010-11-30 20:32:41","2","852","<p>I've done quite a bit of searching on this but haven't found anything.</p><p>I have an idea for an app to control a device, that would need to connect through the headphone cable. </p><p>Is it possible to send signals through the headphone socket?</p>","446963","","","","","2010-11-30 22:24:46","Send signals through headphone cable","<android><headphones>","2","1","","",""
"4318371","1","","","2010-11-30 20:41:32","0","364","<p>i have some problem when i want to Debug my android code. When i go to Debug as/ it says (none applicable). I have set a breakpoint though there's no blue arrow on it. Anyone who knows why this is happening?</p><p>Thanks</p>","499488","","","","","2010-11-30 20:45:38","problem debugging a android application","<android><debugging>","1","0","","",""
"4318408","1","4318482","","2010-11-30 20:44:40","1","623","<p>I'm trying to learn custom dialogs.   I made one with a button in it and it comes up fine and I can hit breakpoints in the constructor and onCreate method, but when I click the button it crashes without ever getting to the button handler.  </p><p>The dialog layout XML (my_dialog_layout.xml) 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=""wrap_content""  android:layout_height=""wrap_content""&gt;    &lt;Button     android:id=""@+id/AButton""     android:layout_width=""100px""     android:layout_height=""wrap_content""     android:layout_alignParentRight=""true""     android:layout_marginLeft=""10px""     android:onClick=""AButtonHandler""     android:text=""Click Me""  /&gt;   &lt;TextView android:id=""@+id/text""    android:layout_width=""wrap_content""    android:layout_height=""fill_parent""    android:layout_toLeftOf=""@id/AButton""    android:text=""Click this button: ""     /&gt;   /&gt;</code></pre><p>... and the Dialog's java file is:  </p><pre><code>import android.os.Bundle;import android.widget.Toast;import android.view.View;import android.content.Context; import android.app.Dialog;public class MyDialog extends Dialog {    public MyDialog(Context context) {        super(context);        setContentView(R.layout.my_dialog_layout);   }    public void AButtonHandler(View target) {        int i = 0;   // just a placeholder to set a breakpoint at        i++;         //   ""                 ""//       Toast.makeText(this, ""in AButtonHandler"", Toast.LENGTH_LONG).show();        MyDialog.this.dismiss();    }    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);  //      Toast.makeText(this, ""Dialog onCreate"", Toast.LENGTH_LONG).show();    }   }</code></pre><p>When I click AButton it crashes in the debugger before getting to my breakpoint in AButtonHandler with ""<em>Thread [&lt;1> main] (Suspended (exception IllegalStateException))<br>    View$1.onClick(View) line: 2059     Button(View).performClick() line: 2408</em> ...""</p><p>Also notice the commented-out Toast's.    I wanted to put Toasts in but thye compiler gives me:  <em>The method makeText(Context, CharSequence, int) in the type Toast is not applicable for the arguments (MyDialog,  String, int)</em>     What am I doing wrong?</p><p>Thanks in advance!</p>","424690","","","","","2010-11-30 22:06:02","Android newbie learning dialogs = CRASH","<android>","2","2","","",""
"4318540","1","4318587","","2010-11-30 20:56:08","3","1525","<p>My xml (lvlayout.xml) layout for a listview is currently like this:</p><pre><code>&lt;TextView    android:id=""@+id/busnum""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""15dip""    android:gravity=""center_horizontal"" /&gt;   &lt;TextView    android:id=""@+id/servdate""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""10dip""    android:textColor=""#23cf34"" /&gt;</code></pre><p></p><p>I populate the listview via a simplecursor adapter like this:</p><pre><code>dueAdapter = new SimpleCursorAdapter(main.this, R.layout.lvlayout,            dueBusesCursor, columnsdue, to);    dueListView = (ListView) findViewById(R.id.ListView01);    dueListView.setAdapter(dueAdapter);</code></pre><p>How can I make the listviews horizontal so that the user scrolls sideways ? thanks in advance.</p>","377613","","","","","2012-07-10 07:49:59","Android Listview Horizontal","<java><android><listview>","2","0","","",""
"4318572","1","4411060","","2010-11-30 20:59:23","20","9360","<p>I have a digital clock widget. How can I use a custom font from assets/fonts as the default font in the textview showing the clock?</p><p>This is my code:</p><pre><code>    package android.tristan.widget.digiclock;import java.util.Calendar;import android.app.PendingIntent;import android.app.Service;import android.appwidget.AppWidgetManager;import android.appwidget.AppWidgetProvider;import android.content.BroadcastReceiver;import android.content.ComponentName;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.os.IBinder;import android.os.Vibrator;import android.text.format.DateFormat;import android.widget.RemoteViews;public class DigiClock extends AppWidgetProvider {    @Override    public void onDisabled(Context context) {        super.onDisabled(context);        context.stopService(new Intent(context, UpdateService.class));    }    public void onReceive(Context context, Intent intent)    {        super.onReceive(context, intent);        if(intent.getAction().equals(""android.tristan.widget.digiclock.CLICK""))        {          Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);          vibrator.vibrate(50);                       final Intent alarmClockIntent = new Intent(Intent.ACTION_MAIN, null);            alarmClockIntent.addCategory(Intent.CATEGORY_LAUNCHER);            final ComponentName cn = new ComponentName(""com.android.deskclock"", ""com.android.deskclock.AlarmClock"");            alarmClockIntent.setComponent(cn);            alarmClockIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            context.startActivity(alarmClockIntent);        }        if(intent.getAction().equals(""android.tristan.widget.digiclock.CLICK_2""))        {          Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);          vibrator.vibrate(50);           final Intent calendarIntent = new Intent(Intent.ACTION_MAIN, null);           calendarIntent.addCategory(Intent.CATEGORY_LAUNCHER);            final ComponentName cn = new ComponentName(""com.android.calendar"", ""com.android.calendar.LaunchActivity"");            calendarIntent.setComponent(cn);            calendarIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            context.startActivity(calendarIntent);               }    }    @Override    public void onEnabled(Context context) {        super.onEnabled(context);        context.startService(new Intent(UpdateService.ACTION_UPDATE));    }    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {        super.onUpdate(context, appWidgetManager, appWidgetIds);        context.startService(new Intent(UpdateService.ACTION_UPDATE));        final int Top = appWidgetIds.length;        final int Bottom = appWidgetIds.length;        for (int i=0; i&lt;Top; i++)        {            int[] appWidgetId = appWidgetIds;            RemoteViews top=new RemoteViews(context.getPackageName(), R.layout.main);            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(), R.layout.main);            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);        }}    public static final class UpdateService extends Service {       static final String ACTION_UPDATE = ""android.tristan.widget.digiclock.action.UPDATE"";        private final static IntentFilter sIntentFilter;        private final static String FORMAT_12_HOURS = ""h:mm"";        private final static String FORMAT_24_HOURS = ""kk:mm"";        private String mTimeFormat;        private String mDateFormat;        private String mDayFormat;        private Calendar mCalendar;        static {            sIntentFilter = new IntentFilter();            sIntentFilter.addAction(Intent.ACTION_TIME_TICK);            sIntentFilter.addAction(Intent.ACTION_TIMEZONE_CHANGED);            sIntentFilter.addAction(Intent.ACTION_TIME_CHANGED);        }        @Override        public void onCreate() {            super.onCreate();            reinit();            registerReceiver(mTimeChangedReceiver, sIntentFilter);         }        @Override        public void onDestroy() {            super.onDestroy();            unregisterReceiver(mTimeChangedReceiver);        }        @Override        public void onStart(Intent intent, int startId) {            super.onStart(intent, startId);            if (ACTION_UPDATE.equals(intent.getAction())) {                update();            }        }        @Override        public IBinder onBind(Intent intent) {            return null;        }        private void update() {            mCalendar.setTimeInMillis(System.currentTimeMillis());            final CharSequence time = DateFormat.format(mTimeFormat, mCalendar);            final CharSequence date = DateFormat.format(mDateFormat, mCalendar);            final CharSequence day = DateFormat.format(mDayFormat, mCalendar);            RemoteViews views = new RemoteViews(getPackageName(), R.layout.main);            views.setTextViewText(R.id.Time, time);            views.setTextViewText(R.id.Day, day);            views.setTextViewText(R.id.Date, date);            ComponentName widget = new ComponentName(this, DigiClock.class);            AppWidgetManager manager = AppWidgetManager.getInstance(this);            manager.updateAppWidget(widget, views);        }        private void reinit() {            mDayFormat = getString(R.string.day_format);            mDateFormat = getString(R.string.date_format);            mTimeFormat = is24HourMode(this) ? FORMAT_24_HOURS : FORMAT_12_HOURS;            mCalendar = Calendar.getInstance();        }        private static boolean is24HourMode(final Context context) {            return android.text.format.DateFormat.is24HourFormat(context);        }        private final BroadcastReceiver mTimeChangedReceiver = new BroadcastReceiver() {            @Override            public void onReceive(Context context, Intent intent) {                final String action = intent.getAction();                if (action.equals(Intent.ACTION_TIME_CHANGED) ||                    action.equals(Intent.ACTION_TIMEZONE_CHANGED))                {                    reinit();                }                update();            }        };    }}</code></pre>","525720","","","","","2013-03-17 22:29:28","How to use a custom typeface in a widget?","<android><widget><typeface>","6","4","19","",""
"4318610","1","4318750","","2010-11-30 21:03:12","1","79","<p>i have an android application that handles a sql-lite database and i need to to beable save a unique PendingIntent, and a unique long for every rowId in the database. The PendingIntent and long have to be reachable from all the applications classes so i can easily 1)retrieve them 2)cancel it(the PendingIntent) and 3)change them from anywhere is the applications code.</p><p>i am sure someone can help! thankyou :)</p><p>PS. if it makes any difference i have 2 sql databases that both need this.</p>","525726","","","","","2010-11-30 21:16:49","saving PendingIntents","<sql><android><arraylist><android-pendingintent>","1","0","1","",""
"4318648","1","4319987","","2010-11-30 21:06:07","2","912","<p>So I am having a problem with the different pieces of that make up my ListView. I put them into an ArrayList and use a custom ArrayAdapter to hook up to the ListView, which I have done before so I don't believe there is a problem there. Initially the list seems to have the pieces in the correct order, but then I will scroll down the list and the contents will then load in incorrect order. I then scroll back up and everything is jumbled. Has anyone run into this before?</p><p>Thanks-Jake</p>","399306","","","","","2010-12-01 00:01:00","ListView's contents scrambled on scroll","<android><listview><android-arrayadapter>","1","2","1","",""
"4318729","1","4318776","","2010-11-30 21:15:44","3","5472","<p>The two apps have the same sharedUserId. When I use this code in app1</p><pre><code>context.openFileOutput(""/data/data/org.me.app2/files/shared-data.dat"", MODE_PRIVATE)</code></pre><p>I get an exception telling me that the file contains a path separator.</p><p>I am trying to write a file from app1 into app2's storage. (I do of course need to make sure that app2's files directory exists first)</p><p>Ideally, I would write to a user specific directory instead of an app specific directory, but I do not know if that can be done</p>","463304","","463304","","2010-11-30 21:36:15","2011-07-15 14:35:04","Write a private access file to another app's files directory","<android><file><shared>","4","0","3","",""
"4318983","1","4319551","","2010-11-30 21:42:41","1","314","<p>I'm writing a geo app and it all works nicely, but I'm considering how it'll work on devices that don't have GPS or 3G, and the wifi may be off or not provide location info.</p><p>Is my best bet to just request a location update (or use the last known) and assume there is a way to get the location (whether GPS or network) or does the framework include a way to see what's available, and avoid the geo-lookup delay?</p><p>I figure on a device with no GPS my app should provide a UI for the user to specify the location, AND remember it in the sharedprefs so they don't have to keep re-entering it (I'm thinking devices like Google TV, and tablets).</p><p>I'd appreciate suggestions on how to handle the process of acquiring location in the context of various devices that have different levels of geo-awareness, and how to handle that.</p>","477415","","","","","2013-07-18 16:33:42","How to tell if an Android device will be able to provide a location?","<android>","2","0","","",""
"4319017","1","","","2010-11-30 21:47:02","1","835","<p>I am writing an application that searches a database in ""realtime"".i.e. as the user presses letters it updates a search results list.</p><p>Since the search can take a while, I need to do the search in background and allow new key presses to re-start a search. So that is a user presses 'a' (and the code starts searching for ""a""), then presses 'b' - the code will NOT wait for ""a"" search to end, then start searching for ""ab"", but rather STOP the ""a"" search, and start a new ""ab"" search.</p><ul><li>To do that I decided to do the search in an AsyncTask. Is this a wise decision ?</li></ul><p>Now - whenever a keypress is detected, I test to see if I have an AsyncTask running. If I do - I signal it (using a boolean within the AsyncTask) it should stop. Then set a timer to re-test the AsyncTask within 10 mSec, to see if it terminated, and start the new search.</p><ul><li>Is this a smart method ? Or is there another approach you would take ?</li></ul><p>TIA</p>","323208","","","","","2011-03-03 06:02:49","""realtime"" search using AsyncTask?","<android><android-asynctask>","1","2","","",""
"4319035","1","4320210","","2010-11-30 21:48:12","4","391","<p>I've seen that some Android devs promote this form of declarative layout:</p><pre><code>&lt;TextView style=""@style/my_textview_style"" /&gt;</code></pre><p>i.e. that pretty much all the attributes (including the ID) go into the style definition. It certainly makes for shorter layout files, but is it a step too far?</p><p>What would you recommend goes in the style definition, and what should stay in the layout, and why?</p><p>I've started doing Android dev this year, but have prior experience of development. Issues like this are so important, the ""way"" we use the tools, the habits, to be more efficient. I appreciate you sharing your views on what works for you, for clarity, for efficiency, for maintainability, for app reliability.</p>","477415","","","","","2010-12-01 00:39:30","Should I put all Android view attributes into the style?","<android>","2","1","2","",""
"4319076","1","4319116","","2010-11-30 21:54:45","2","1852","<p>When I'm writing a method or using a member variable, I often find I need to share them across an app. But where should they go?</p><p>I can subclass Activity, but that falls over as soon as I use a MapView and am forced to use MapActivity, so not all my activities inherit from my subclass. Is there I way around this?</p><p>Where inheritance isn't applicable, I am tending to put generic methods and member variables into a subclass of the Application object, but I'm finding it's creating a mess of code as every class needs to either grab access to the application object through via context, or I have to pass it down.</p><p>I suspect I would be better off creating MyApplication.getInstance() and keeping everything in a singleton, instead of passing the application object down through the app classes. but before I wanted to see what you guys had to say.</p>","477415","","","","","2010-11-30 23:38:15","Where should I put global methods and variables in an Android app?","<android>","3","0","2","",""
"4319212","1","4319257","","2010-11-30 22:11:09","36","17219","<p>I have code in my application that detects if Wi-Fi is actively connected. That code triggers a RuntimeException if airplane mode is enabled. I would like to display a separate error message when in this mode anyway. How can I reliably detect if an Android device is in airplane mode?</p>","501333","","646367","","2013-09-26 16:00:42","2013-09-26 16:00:42","How can one detect airplane mode on Android?","<java><android><airplane>","5","0","15","",""
"4319263","1","4319500","","2010-11-30 22:17:24","1","495","<p><strong>UPDATE: Solved, i'm an idiot, thank you everyone!</strong></p><blockquote>  <p>Okay little bit weird..  I just created a layout file for list items, I can see it there now, in my res/layout folder. It's called itemListBudget.xml. Inside i've declare two id's, catItem and budgetAmount as you can see here: <a href=""http://pastebin.com/ZV0wr9L0"" rel=""nofollow"">http://pastebin.com/ZV0wr9L0</a> (it'll only take a second to look at)</p>    <p>So now i'm just trying to bind data from my sqlite table to my list! Here's my method:</p></blockquote><pre><code>//private static int[] TO = { R.id.catItem, R.id.budgetAmount, };private void showBudgetOutcome(Cursor cursor) {    //Set up data binding     SimpleCursorAdapter adapter = new SimpleCursorAdapter(            this, R.layout.itemListBudget, cursor, FROM, TO,);    setListAdapter(adapter);}</code></pre><blockquote>  <p>Now i'm being told that <strong>R.id.catItem cannot be resolved</strong>. <strong>R.id.budgetAmount cannot be resolved</strong> and of course <strong>R.layout.itemListBudget cannot be resolved</strong>. Why on earth could this be?</p>    <p>I also have an error message saying my <strong>setListAdapter(adapter) is undefined</strong>, but i think that's caused by the problem above right?</p></blockquote>","523874","","523874","","2010-11-30 23:04:30","2010-11-30 23:04:30","Mystery! One of my .xml layout resources is just not being detected! What's going on?","<android><listview><layout><resources>","2","10","","",""
"4319340","1","","","2010-11-30 22:25:17","-1","809","<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=""wrap_content""        android:layout_height=""wrap_content""        &gt;    &lt;LinearLayout android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:paddingBottom=""20px""            &gt;        &lt;Button android:id=""@+id/expandButton""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text="" + ""                 android:focusable=""false""                android:focusableInTouchMode=""false""                android:clickable=""false""                /&gt;        &lt;TextView android:id=""@+id/jokeTextView""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:textSize=""16px""                android:singleLine=""true""                /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            &gt;        &lt;RadioGroup android:id=""@+id/ratingRadioGroup""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:orientation=""horizontal""&gt;            &lt;RadioButton android:id=""@+id/likeButton""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginLeft=""60px""                    android:text=""Like""                    /&gt;            &lt;RadioButton android:id=""@+id/dislikeButton""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginLeft=""60px""                    android:text=""Dislike""                    /&gt;        &lt;/RadioGroup&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I have class extends View(LinearLayout)</p><pre><code>import ...    public class JokeView extends LinearLayout{        private Button m_vwExpandButton;        private RadioButton m_vwLikeButton;        private RadioButton m_vwDislikeButton;        private RadioGroup m_vwLikeGroup;        private TextView m_vwJokeText;        private Joke m_joke;        public static final String EXPAND = "" + "";        public static final String COLLAPSE = "" - "";        public JokeView(Context context, Joke joke) {             super(context);             LayoutInflater inflater = (LayoutInflater)context.getSystemService(                      Context.LAYOUT_INFLATER_SERVICE);            inflater.inflate(R.layout.joke_view, this, true);        m_vwExpandButton=(Button)findViewById(R.id.expandButton);            m_vwLikeButton=(RadioButton)findViewById(R.id.likeButton);            m_vwDislikeButton=(RadioButton)findViewById(R.id.dislikeButton);            m_vwLikeGroup=(RadioGroup)findViewById(R.id.ratingRadioGroup);            m_vwJokeText=(TextView)findViewById(R.id.jokeTextView);            setJoke(joke);                collapseJokeView();                m_vwExpandButton.setOnClickListener(new OnClickListener(){                    @Override                    public void onClick(View v){                        Log.e(""tah"", ""onClick"");                    if(m_vwExpandButton.getText().equals(JokeView.EXPAND)){                             expandJokeView();                                   }                        else                                                if(m_vwExpandButton.getText().equals(JokeView.COLLAPSE)){                            collapseJokeView();                    }                            }                });            m_vwLikeGroup.setOnCheckedChangeListener(new OnCheckedChangeListener(){                    @Override                    public void onCheckedChanged(RadioGroup rg, int i) {                        if(i==1){                            m_joke.setRating(Joke.LIKE);                        }                        else if(i==2){                            m_joke.setRating(Joke.DISLIKE);                        }                    }                });        }        public void setJoke(Joke joke) {            if(joke!=null){                m_joke=joke;                m_vwJokeText.setText(joke.getJoke());                switch(joke.getRating()){                case Joke.LIKE:                    m_vwLikeButton.setChecked(true);                    break;                case Joke.DISLIKE:                    m_vwDislikeButton.setChecked(true);                    break;                case Joke.UNRATED:                    m_vwLikeGroup.clearCheck();                    break;                }            }        }        private void expandJokeView() {            m_vwJokeText.setEllipsize(null);            m_vwJokeText.setSingleLine(false);            m_vwLikeGroup.setVisibility(View.VISIBLE);                m_vwExpandButton.setText(JokeView.COLLAPSE);            this.requestLayout();        }        private void collapseJokeView() {            m_vwJokeText.setSingleLine(true);            m_vwJokeText.setEllipsize(TextUtils.TruncateAt.END);            m_vwLikeGroup.setVisibility(View.GONE);            m_vwExpandButton.setText(JokeView.EXPAND);            this.requestLayout();        }    }</code></pre><p>But onClick happens when I click on button</p>","278221","","278221","","2010-11-30 22:51:50","2011-03-18 17:03:25","Problem with a button","<android><button><onclick>","3","4","0","",""
"4319369","1","4898713","","2010-11-30 22:28:48","9","3922","<p>The Google Maps application features a search box (with autosuggestion) that allows you to search for an address, resulting in a marker being placed on the map of the Google Maps application.</p><p>Is it possible to re-use this functionality in a custom Android app, where a text box is also presented, resulting in a Geopoint being delivered to the custom app, so that the app itself can place the marker somewhere ? In other words, does the Google Maps application expose a service or an intent that can be used by a custom application ?</p><p>If so, how can this integration be done ?</p><p>If not, can someone provide a pointer on how a custom implementation can be realized ?</p>","492410","","","","","2011-02-04 13:52:35","Integrate a ""Search Maps"" function in an Android app","<android><google-maps>","1","0","4","",""
"4319456","1","","","2010-11-30 22:40:47","3","14538","<p>I have an EditText on my layout. Below are the attributes I currently have:</p><pre><code>&lt;EditText   android:id=""@+id/entryIdea""   android:layout_width=""fill_parent""   android:layout_height=""225sp""   android:gravity=""top""   android:background=""@android:drawable/editbox_background""   android:scrollbars=""vertical""/&gt;</code></pre><p>However, I can see the scrollbar but can't scroll it with mouse/touch.I thought that it may works if I put the corresponding listener since it works on TextView. Apparently, it isn't.</p><pre><code>EditText et = (EditText)findViewById(R.id.entryIdea);et.setMovementMethod(new ScrollingMovementMethod());</code></pre><p>Can you guys help me on this?</p><p>Thank you so much in advance.Sammy</p>","448732","","","","","2014-03-31 09:14:03","Enabling scrollbar in EditText Android","<android><scrollbar><edittext>","5","2","","",""
"4319596","1","","","2010-11-30 22:59:53","0","254","<p>I use getResources().getConfiguration().hardKeyboardHidden to detect if a device has a sliding keyboard drawer open (like on the G1).</p><p>Now I have a Droid Pro, and it returns 1 always, so my app thinks it has a slider open.</p><p>Is there a way I can tell the device has a keyboard, and that it's ALWAYS open ?</p><p>TIA</p>","323208","","456712","","2012-05-02 02:48:54","2012-11-22 23:57:08","How do I detect the FIXED keyboard on Droid Pro?","<android>","2","0","","",""
"4319630","1","4328816","","2010-11-30 23:04:50","6","2056","<p>What's the width and height of the live wallpaper preview thumbnail in pixels? It's definitely larger than 72x72, that I know. </p>","518116","","815724","","2013-01-20 06:36:08","2013-01-20 06:36:08","Live Wallpaper Preview Thumbnail Size","<android><live-wallpaper>","2","0","1","",""
"4319644","1","4829808","","2010-11-30 23:07:23","0","6330","<p>Hallo,</p><p>I have written a simple spinner wrapper, but was wondering if any of you experts out there could think of any ways to make it more robust.It only handles strings at the moment, so that could be the first enhancement...</p><p>Anyway, the code for the (shamefully badly named) MySpinner class is:</p><pre><code>package a.b.c;import android.content.Context;import android.util.AttributeSet;import android.widget.ArrayAdapter;import android.widget.Spinner;public class MySpinner extends Spinner {// constructors (each calls initialise)public MySpinner(Context context) {    super(context);    this.initialise();}public MySpinner(Context context, AttributeSet attrs) {    super(context, attrs);    this.initialise();}public MySpinner(Context context, AttributeSet attrs, int defStyle) {    super(context, attrs, defStyle);    this.initialise();}// declare object to hold data valuesprivate ArrayAdapter&lt;String&gt; arrayAdapter;// add the selected item to the end of the listpublic void addItem(String item) {    this.addItem(item, true);}public void addItem(String item, boolean select) {    arrayAdapter.add(item);    this.setEnabled(true);    if (select) this.selectItem(item);    arrayAdapter.sort(new Comparator&lt;String&gt;() {        public int compare(String object1, String object2) {            return object1.compareTo(object2);        };    });}// remove all items from the list and disable itpublic void clearItems() {    arrayAdapter.clear();    this.setEnabled(false);}// make the specified item selected (returns false if item not in the list)public boolean selectItem(String item) {    boolean found = false;    for (int i = 0; i &lt; this.getCount(); i++) {        if (arrayAdapter.getItem(i) == item) {            this.setSelection(i);            found = true;            break;        }    }    return found;}// return the current selected itempublic String getSelected() {    if (this.getCount() &gt; 0) {        return arrayAdapter.getItem(super.getSelectedItemPosition());    } else {        return """";    }}// allow the caller to use a different DropDownView, defaults to android.R.layout.simple_dropdown_item_1linepublic void setDropDownViewResource(int resource) {    arrayAdapter.setDropDownViewResource(resource);}// internal routine to set up the array adapter, bind it to the spinner and disable it as it is emptyprivate void initialise() {    arrayAdapter = new ArrayAdapter&lt;String&gt;(super.getContext(), android.R.layout.simple_spinner_item);    arrayAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);    this.setAdapter(arrayAdapter);    this.setEnabled(false);}}</code></pre><p>To use:<br>1. Use a.b.c.MySpinner instead of Spinner in your XML layout file<br>2. Set up a variable, mMySpinner = (MySpinner)findViewById(R.id.spinner);<br>3. You can then use all the functions which should be self-explanatory<br>4. If there are no items in the list, the spinner is disabled to prevent untoward events<br>    mMySpinner.clearItems()      to remove all the items<br>    mMySpinner.addItem(""Blue"")   to add Blue as an item in list (items are sorted by abc)    mMySpinner.selectItem(""Red"") to make the indicate item the current selection<br>    mMySpinner.getSelected()     to return the current selected item string  </p>","131209","","131209","","2011-01-28 15:20:33","2011-01-28 15:20:33","Simple Android Spinner code","<android><android-layout><spinner>","1","5","1","2013-02-01 00:17:24",""
"4319691","1","4319806","","2010-11-30 23:12:33","0","674","<p>A lot of time when I'm debugging my app, I click around and end up in an activity, but I'm not 100% sure which one. This happens in my latest project, which I inherited from someone else.</p><p>I want an easy method of figuring out which activity I'm currently in, not programmatically for the program to know, but for my brain. I see ActivityManager does say something like ""Displayed activity foo"" in logcat, but sometimes this message quickly goes away because of other logging.</p><p>Ideally, the current activity class would be displayed somewhere at all times, or there would be something similar to Firebug's Inspect button but for activities. I looked around the DDMS perspective and didn't find it there either.</p><p>Any ideas?</p>","47680","","","","","2012-01-06 15:15:53","Figure out what Activity is currently active in Android (non-programmatically)","<android><eclipse><activity>","4","0","","",""
"4319766","1","","","2010-11-30 23:22:59","0","233","<p>Greetings!</p><p>I'm building an app that requires internet use and a whole tab doesn't work without it.  I would like it so that when they select the tab it checks if there is internet and if there isn't then a panel slide (or appears) over the controls so that nothing can be done until an connection to the internet is established.  How could I achieve this?</p><p>Thanks-Mitchell</p>","445342","","","","","2010-11-30 23:35:30","A Panel To Block a View Android","<android><controls><internet><panel><block>","2","0","","",""
"4319817","1","4319888","","2010-11-30 23:33:08","0","1621","<p>I have a class that is already extending TabActivity so i can't extend ListActivity.</p><p>This hasn't be a problem until i needed to use this method:</p><pre><code>private static int[] TO = { R.id.catItem, R.id.budgetAmount, };private void showBudgetOutcome(Cursor cursor) {//Set up data binding SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.itemsforbudgetlist, cursor, FROM, TO);setListAdapter(adapter);}</code></pre><p>Obviously setListAdapter is undefined. Now i found this snippet of code searching SO</p><pre><code>mListView.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, COUNTRIES));</code></pre><p>But i don't really understand the parameters. I tried altering it to suit me:</p><pre><code>incomeView.setAdapter(new SimpleCursorAdapter&lt;String&gt;(this, R.layout.itemsforbudgetlist, adapter??));</code></pre><p>I see that mListView is just the users ListView so i replaced that, and the layout resource defining how each item in the list looks i guess. But the rest i'm not sure about. I figure maybe i want a Simple/CursorAdapter since i'm working with sqlite (see my method)? but i have no idea what COUNTRIES is meant to be and not sure what data type i need (presumably string but what do i know). So if someone could clear things up for me and tell me how to use it with my method above i'd be really greatful! </p>","523874","","523874","","2010-12-01 08:34:01","2010-12-01 08:34:01","How should I be using .setAdapter here? /How do i get around not extending ListActivity?","<android><adapter><listactivity><listadapter>","1","2","","",""
"4319835","1","4319928","","2010-11-30 23:37:06","5","3218","<p>I'm trying to do something simple, but I can't understand why it's not working.<br>What I'm trying to do is: when I touch an ImageView, it will show an animation on it. And then, only when that animation ends it will start the new activity.<br>Instead, what happens is that the new activity starts right away and the animation is not shown.</p><p>Here is the animation xml:</p><pre><code>&lt;rotate android:interpolator=""@android:anim/decelerate_interpolator""    android:fromDegrees=""-45""    android:toDegrees=""-10""    android:pivotX=""90%""    android:pivotY=""10%""    android:repeatCount=""3""    android:fillAfter=""false""    android:duration=""10000"" /&gt;</code></pre><p>And this is the code I use to call it:</p><pre><code>public void onCreate( Bundle savedInstanceState ){    final ImageView ib = (ImageView)this.findViewById( R.id.photo );    ib.setOnClickListener( new OnClickListener( ) {        @Override        public void onClick( View v )        {            Animation hang_fall = AnimationUtils.loadAnimation( Curriculum.this, R.anim.hang_fall );            v.startAnimation( hang_fall );            Intent i = new Intent( ThisActivity.this, NextActivity.class );            ThisActivity.this.startActivity( i );        }// end onClick    } );}// end onCreate</code></pre><p>As you see I tried putting a loooong time for the animation, but it doesn't work. The NextActivity starts right away, it doesn't wait for the animation in ThisActivity to finish.<br>Any idea on why this happens?</p>","525843","","","","","2010-11-30 23:53:10","Animation BEFORE activity change","<android>","2","0","2","",""
"4319838","1","","","2010-11-30 23:37:54","6","2022","<p>How do I know if a sound has finished playing? </p><p>I want to play 2 sounds but I want one sound to play and then wait until the 1st sound is done before the 2nd starts.  </p><p>Also, if I wanted to do something else when the sound is finished like show he next view in a view flipper, could I do that?</p><p>Right now I'm using SoundPool to play my sounds.</p>","520332","","","","","2014-04-10 15:56:26","How do I know if a sound is finished playing in android?","<android><soundpool>","4","0","1","",""
"4319873","1","4427621","","2010-11-30 23:43:41","13","7727","<p>Recently uninstalled and reinstalled eclipse with android sdk. Now I don't see the properties tab in the layout resource editor. </p><p>Suggestions?</p><p>Update: This is all I see in ""window > open perspective > other""<img src=""http://i.stack.imgur.com/AJrcn.png"" alt=""alt text""></p>","479180","","479180","","2010-12-01 03:20:08","2010-12-13 09:56:04","No properties tab in layout resource editor","<android><eclipse>","2","0","2","",""
"4319949","1","","","2010-11-30 23:55:56","1","1645","<p>For my app I need to play a pre recorded message to the caller. Say if someone calls my phone and I enable the app it should play back the audio such that the caller hears it. I tried setting the stream STREAM_DTMF,STREAM_VOICE_CALL ... (tried all of them) but nothing worked. STREAM_MUSIC made the audio play through the speaker but was not such that the caller could hear it ... </p><p>Tried searching around but have not found any answer yet ... would really appreciate if someone can respond !</p>","525885","","","","","2011-01-03 14:03:34","Need to play audio to the caller","<android>","1","0","3","",""
"4319958","1","","","2010-11-30 23:57:45","0","602","<p>the exception is </p><pre><code>11-30 22:53:18.017: ERROR/Zygote(32): setreuid() failed. errno: 211-30 22:53:27.508: ERROR/Zygote(32): setreuid() failed. errno: 1711-30 22:53:29.578: ERROR/BatteryService(65): usbOnlinePath not found11-30 22:53:29.578: ERROR/BatteryService(65): batteryVoltagePath not found11-30 22:53:29.578: ERROR/BatteryService(65): batteryTemperaturePath not found11-30 22:53:29.618: ERROR/SurfaceFlinger(65): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake11-30 22:53:36.538: ERROR/EventHub(65): could not get driver version for /dev/input/mouse0, Not a typewriter11-30 22:53:36.538: ERROR/EventHub(65): could not get driver version for /dev/input/mice, Not a typewriter11-30 22:53:36.708: ERROR/System(65): Failure starting core service11-30 22:53:36.708: ERROR/System(65): java.lang.SecurityException11-30 22:53:36.708: ERROR/System(65):     at android.os.BinderProxy.transact(Native Method)11-30 22:53:36.708: ERROR/System(65):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)11-30 22:53:36.708: ERROR/System(65):     at android.os.ServiceManager.addService(ServiceManager.java:72)11-30 22:53:36.708: ERROR/System(65):     at com.android.server.ServerThread.run(SystemServer.java:184)11-30 22:53:38.058: ERROR/SoundPool(65): error loading /system/media/audio/ui/Effect_Tick.ogg11-30 22:53:38.058: ERROR/SoundPool(65): error loading /system/media/audio/ui/KeypressStandard.ogg11-30 22:53:38.068: ERROR/SoundPool(65): error loading /system/media/audio/ui/KeypressSpacebar.ogg11-30 22:53:38.068: ERROR/SoundPool(65): error loading /system/media/audio/ui/KeypressDelete.ogg11-30 22:53:38.088: ERROR/SoundPool(65): error loading /system/media/audio/ui/KeypressReturn.ogg11-30 22:53:41.837: ERROR/ThrottleService(65): Could not open GPS configuration file /etc/gps.conf11-30 22:53:43.177: ERROR/logwrapper(143): executing /system/bin/tc failed: No such file or directory11-30 22:53:43.257: ERROR/logwrapper(145): executing /system/bin/tc failed: No such file or directory11-30 22:53:43.347: ERROR/logwrapper(147): executing /system/bin/tc failed: No such file or directory11-30 22:53:58.014: ERROR/HierarchicalStateMachine(65): TetherMaster - unhandledMessage: msg.what=311-30 22:55:39.283: ERROR/AndroidRuntime(272): FATAL EXCEPTION: main11-30 22:55:39.283: ERROR/AndroidRuntime(272): java.lang.RuntimeException: Unable to start activity ComponentInfo{ayanoo.forms/ayanoo.forms.FriendsActivity}: java.lang.NullPointerException11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at android.os.Handler.dispatchMessage(Handler.java:99)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at android.os.Looper.loop(Looper.java:123)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at java.lang.reflect.Method.invokeNative(Native Method)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at java.lang.reflect.Method.invoke(Method.java:521)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at dalvik.system.NativeStart.main(Native Method)11-30 22:55:39.283: ERROR/AndroidRuntime(272): Caused by: java.lang.NullPointerException11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at ayanoo.forms.FriendsActivity.createLetters(FriendsActivity.java:54)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at ayanoo.forms.FriendsActivity.initLayout(FriendsActivity.java:43)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at ayanoo.forms.FriendsActivity.onCreate(FriendsActivity.java:31)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)11-30 22:55:39.283: ERROR/AndroidRuntime(272):     ... 11 more</code></pre>","508377","","","","","2010-12-01 00:08:45","I have an exception in android application and i don't know the reason?","<android>","1","2","","",""
"4319973","1","","","2010-11-30 23:59:45","0","161","<p>I'm having a problem in my Android 1.6 app. I have a two java class files,each with their corresponding xml layout file.</p><p>When I perform the following:</p><pre><code>Intent ii = new Intent(this,           PatientEntry.class);startActivity(ii);</code></pre><p>I get an application error:</p><p>Sorry! The application XXXX has stopped unexpectedly. Please try again.</p><p>I have added the following to my AndroidManifest.xml file:</p><p>  </p><p>Why am I getting these errors and how do I fix it?</p><p>ThanksMike</p>","490698","","345717","","2010-12-01 00:02:09","2010-12-01 07:01:12","Android application error on starting new activity","<android>","2","1","","",""
"4320012","1","4321394","","2010-12-01 00:04:15","2","444","<p>I have a service that basically manages a MediaPlayer instance for playing podcasts.  Once an activity binds to the service it can do things like play, pause, stop, etc.  I used a service because I want the podcast to continue playing even after the activity is destroyed.</p><p>I'd like the service to be able to send messages back to the activity in case of an error or for normal status updates.  Is it possible for the service to get a reference to the activity that's trying to bind to it?  Doesn't look like the intent makes this available.</p>","460887","","","","","2010-12-01 05:12:23","Can a service get a reference to the activity during onBind?","<android>","1","2","","",""
"4320090","1","4320153","","2010-12-01 00:18:12","2","759","<p>Simple question: Does Typeface.createFromAsset() cache? Or should I just keep a reference around in memory to keep handy? The reason why I ask is because I use it quite a lot (all to maintain a single font across many activities / views), so I'm wondering if Typeface will do a simple bit of caching so I don't have to maintain the reference myself.</p>","295675","","","","","2010-12-01 00:28:54","Does Typeface.createFromAsset() cache?","<android><typeface>","1","0","","",""
"4320099","1","","","2010-12-01 00:20:02","9","4997","<p>I am writing an android Junit test for a class that relies on extras passed to it through an Intent. I was able to get the class working properly, but I would still like to know how to write a unit test for such a class, as the test still fails.</p><pre><code>public class AddClassEvent extends Activity{ private String eventType;  @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  Bundle extras = getIntent().getExtras();  final String cNo = extras.getString(""CourseNum"");  // create a model instance  final StudentDBModel model = new StudentDBModel(this);  setContentView(R.layout.add_class_event); ..... .....         }     }</code></pre><p>The test class looks like...</p><pre><code>public class AddClassEventTest extends ActivityInstrumentationTestCase2&lt;AddClassEvent&gt;{ private StudentDBModel model = null; private RenamingDelegatingContext context = null; public AddClassEventTest() {  super(""com.UI"", AddClassEvent.class); } /**  * This method is called before each test.  */ @Override public void setUp() {  context = new RenamingDelegatingContext(getActivity(), ""test_"");  model = new StudentDBModel(context); } /*  * This function will test addNewClassEvent() from StudentDBModel  */ public void testAddNewClassEvent(){  ContentValues courseValues = new ContentValues();  courseValues.put(""CourseId"", ""60-415"");  courseValues.put(""CourseName"", ""Advanced Database Design"");  courseValues.put(""Section"", ""1"");  courseValues.put(""Location"", ""Erie"");  courseValues.put(""Credit"", ""3"");  courseValues.put(""ProfEmail"", ""rfortier@uwindsor.ca"");  courseValues.put(""Website"", ""cs.uwindsor.ca"");  model.addNewCourses(courseValues);  int numEventsBefore = model.getNumClassEvents();  ContentValues values = new ContentValues();  values.put(""EventName"", ""Assignment 1"");  values.put(""CourseId"", ""60-415"");  values.put(""EventType"", ""Assignment"");  values.put(""EventWeight"", ""8"");  values.put(""DueDate"", ""10/20/2010"");  model.addNewClassEvent(values);  int numEventsAfter = model.getNumClassEvents();  assertEquals(numEventsBefore + 1, numEventsAfter); }}</code></pre><p>The problem is, the extra that I am passing to the class AddClassEvent is a PK for my DB that is created in another class and passed to AddClassEvent through an Intent. Whenever I run the test I get a NULL Pointer Exception on the on the line:</p><pre><code>final String cNo = extras.getString(""CourseNum"");</code></pre><p>How do I create the info from the extra in the Junit Test? Is there a way to get this test to work? I have searched extensively and can't find an answer. Is there some way to falsely create the extras in the Junit test so that it thinks it is being created by the other class? If so, could someone please show me how?</p><hr><p>OK so I have tried to take your advice and I have changed my setUp function to:</p><pre><code>@Overridepublic void setUp() {    context = new RenamingDelegatingContext(getActivity(), ""test_"");    model = new StudentDBModel(context);    Intent addEvent = new Intent();    addEvent.setClassName(""com.UI"", ""com.UI.AddClassEvent"");    addEvent.putExtra(""CourseNum"", ""60-415"");    setActivityIntent(addEvent);    getActivity();}</code></pre><p>but I am still getting a NULL Pointer exception. Is my syntax wrong? Any suggestions?</p>","525909","","525909","","2010-12-01 20:40:57","2010-12-01 22:26:55","How do I write an android JUnit test when my activity relies on extras passed through an Intent?","<android><junit><android-intent><extras>","2","1","3","",""
"4320117","1","4320216","","2010-12-01 00:23:21","2","580","<p>Looking through the Android SDK framework source code, I've come across this:</p><pre><code>private final class GpsLocationProviderThread extends Thread {        public GpsLocationProviderThread() {            super(""GpsLocationProvider"");        }        public void run() {            Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);            initialize();            Looper.prepare();            mHandler = new ProviderHandler();            // signal when we are initialized and ready to go            mInitializedLatch.countDown();            Looper.loop();        }    }</code></pre><p>(this is from Froyo's frameworks/base/location/java/com/android/internal/location/GpsLocationProvider.java)</p><p><code>GpsLocationProviderThread</code> is an inner class of <code>GpsLocationProvider</code>, and <code>mHandler</code> is a member instance variable of <code>GpsLocationProvider</code>. This variable is set from within this thread's <code>run()</code> method, but no synchronization is applied, and <code>mHandler</code> is not <code>volatile</code>.</p><p>Why does this work? And even if 99% of the time this does work, it's not always guaranteed to work, and it's certainly not good practice. Am I correct in this understanding, or is there something subtle to this code that I'm misunderstanding?</p>","300368","","","","","2010-12-01 00:40:34","mHandler isn't set from within a synchronized block in Android SDK","<java><android><synchronization>","1","2","","",""
"4320141","1","5023790","","2010-12-01 00:27:40","18","17410","<p>are there any good examples or tutorials on how best to structure an android applications anywhere?</p><p>am new to java and android and i've built winforms apps using passive and supervising controller variants of model view presenter and model view controller in asp.net but not really seen any examples or code on android that use these sorts of patterns.</p><p>how do people structure decent size android apps out there in the wild. are there any best practices or should i be sticking rigidly to official android documentation.</p>","2041","","","","","2011-02-17 00:19:19","android model view presenter/controller examples","<java><android><model-view-controller><patterns><mvp>","3","4","8","",""
"4320269","1","4320328","","2010-12-01 00:51:48","4","8772","<p>So I have the user enter password to signup from the android app.</p><p>Before I save the password to the database on the server I want to convert it to a MD5 one way hash and save it to the database.</p><pre><code>MessageDigest md = null;    try {        md = MessageDigest.getInstance(""MD5"");    } catch (NoSuchAlgorithmException e3) {        // TODO Auto-generated catch block        e3.printStackTrace();    }    try {        md.update(password.getBytes(""UTF-8""));    } catch (UnsupportedEncodingException e3) {        // TODO Auto-generated catch block        e3.printStackTrace();    }    byte raw[] = md.digest();</code></pre><p>How do I convert this byte array to a Base64 string. I saw in some forum that android util package left out the Base64 encoding and decoding on the other hand I see the encodetoString function in the android developers site.</p><p>Any help is appreciated.</p>","447886","","","","","2010-12-01 06:00:03","convert byte array to Base64 String in android","<java><android><base64>","3","0","1","",""
"4320303","1","","","2010-12-01 00:58:24","0","2391","<p>I am developing an application that uses tabs with each tab being linked to a webpage that the user will be able to see and interact with using webview. what i am having trouble with is implementing a add command that the user will be able to use to  add a tab with a url of their choice that works just like the others</p><p>Below is my code</p><p>Here is the main java file that all other files use</p><pre><code>public class UniversityofColorado extends TabActivity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TabHost host=getTabHost();    host.addTab(host.newTabSpec(""one"")            .setIndicator(""Google"")            .setContent(new Intent(this, Hello.class)));    host.addTab(host.newTabSpec(""two"")                    .setIndicator(""Colorado Main Site"")                    .setContent(new Intent(this, ColoradoMainSiteBrowser.class)));    host.addTab(host.newTabSpec(""three"")                    .setIndicator(""CULearn"")                    .setContent(new Intent(this, CULearnBrowser.class)));    host.addTab(host.newTabSpec(""four"")            .setIndicator(""CULink"")            .setContent(new Intent(this, CULinkBrowser.class)));    host.addTab(host.newTabSpec(""five"")            .setIndicator(""MyCUInfo"")            .setContent(new Intent(this, MyCUInfoBrowser.class)));    host.addTab(host.newTabSpec(""six"")            .setIndicator(""Campus Map"")            .setContent(new Intent(this, CampusBrowser.class)));    host.addTab(host.newTabSpec(""Seven"")            .setIndicator(""Notes"")            .setContent(new Intent(this, Notepadv3.class)));}       // Inflates menu when ""menu Key"" is pressed    @Override    public boolean onCreateOptionsMenu(Menu menu) {        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.menu, menu);        return true;    }}</code></pre><p>Then i have each webpage defined in a seperate java file that the main file callsbelow is one of them</p><pre><code>public class ColoradoMainSiteBrowser extends Activity {WebView webview;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);webview = (WebView) findViewById(R.id.webview);webview.setWebViewClient(new HelloWebViewClient());webview.getSettings().setJavaScriptEnabled(true);webview.loadUrl(""http://colorado.edu/"");}private class HelloWebViewClient extends WebViewClient {@Overridepublic boolean shouldOverrideUrlLoading(WebView view, String url){view.loadUrl(url);return true;}}public boolean onKeyDown(int keyCode, KeyEvent event) {if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {webview.goBack();return true;}return super.onKeyDown(keyCode, event);}}</code></pre><p>I have the menu defined in the main file i just need to construct the methods so the buttons do what they are suppose to do. any help would be great</p>","524592","","","","","2010-12-13 10:39:16","How to add tabs dynamically that can be linked to a users choice of webpage","<android><webview><dynamic><add>","1","0","0","",""
"4320325","1","","","2010-12-01 01:02:23","1","866","<p>hey..i plan to add a function to my app which will auto switch on the loudspeaker when the user received phone call..</p><p>here are part of my codes:</p><pre><code>  case TelephonyManager.CALL_STATE_OFFHOOK:              //CALL_STATE_OFFHOOK;               setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);                am.setMode(AudioManager.MODE_IN_CALL);                am.setSpeakerphoneOn(true);          boolean check = am.isSpeakerphoneOn();          Toast.makeText(Speaker.this, ""LoudSpeaker On: ""+ check,Toast.LENGTH_LONG).show();</code></pre><p>and i already added the permission for MODIFY_AUDIO_SETTINGS in the manifest..however..the speakerphone didnt manage to turn on..can anyone kindly give a helping hand on this problem..thanks in advance..by the way..this app was implement in android 2.1</p>","525939","","525939","","2010-12-01 03:45:17","2013-11-20 03:46:59","Programmatically activate loudspeaker when receiving phone call","<android>","1","2","","",""
"4320493","1","4326839","","2010-12-01 01:41:51","11","1395","<p>I'm currently working on a project that's based on Android. Without getting into many details, the software will run on a custom built device. The hardware will never change and will always be the same. That's a definite plus :)</p><p>With that said, this project is requiring us to store loads and loads of data on the device - Upwards of 3m rows in some tables. SQLite handles scanning this many rows just fine for us, the problem comes in when we start doing complex joins to bring back all the related data we need. We've thought about denormalizing the database but are afraid that will push the database outside the realm of usable. </p><p>We are looking into using an Object Oriented database, something like db4o or NeoDatis. Our hope is that by storing objects we can get rid of our relations on a row level and store them on the object (just like OOP). The problem is we have not been able to find any performance related benchmarks (at least not recent ones) of these ODBs running and being used on Android.</p><p>Does anyone have any experience with OODBs on Android and/or with storing and accessing this large amount of data? If so any advice you could provide would be greatly appreciated.</p><p>-- Edit</p><p>Here's an example of the problem we're facing. It's not related to our app (my NDA says I can't post anything specific) but this example represents the problem well.</p><p>Imagine we're building an application to monitor every vehicle that's driving on the New Jersey Turnpike at any given time. For any given car we need to track the car Make and Model, how many people are in the car and what's the demographic of the people in the car. So basically you end up with data that looks something like -</p><h2>car</h2><p>id |color |make_id |in_toll_lane |model_id</p><h2>make</h2><p>id |name</p><h2>model</h2><p>id |name |make_id</p><h2>car_person</h2><p>id |age |sex |is_driver |car_id</p><h2>toll_lanes</h2><p>id |cars_in_line |ideal_cars_in_line |ideal_occupants</p><p>This data is going to be changing frequently. It's also going to get rather huge, as there are no doubts A LOT of people driving down the NJ Pike at any given time. </p><p>With this data we need to be able to a snap shot, on demand, of anyone who's driving on the pike. We also need to be able to take a snap shot of all the males who are driving, or all the females on the turnpike. We also need to be able to search by Age, Sex, Make, Model, etc.</p><p>Now imagine we need to figure out what toll lane each car should go into based on the number of people in the car, the ideal number of occupants, the number of cars already in line, and the ideal number of cars that should be in line. </p><p>This is a very simple example, though pretty representative of our problem. </p><p>-- End Edit</p><p>Thanks in advance!</p>","451485","","451485","","2010-12-01 12:52:31","2010-12-02 00:33:30","Need to store LOTS of data on Android device, thinking of going OODB","<android><sqlite><oodbms><oodb>","4","4","6","",""
"4320499","1","","","2010-12-01 01:43:11","1","1534","<p>I've been playing with Android animation framework and I found the following 3D rotation sample code: </p><p><a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/animation/Transition3d.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/animation/Transition3d.html</a></p><p><a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/animation/Rotate3dAnimation.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/animation/Rotate3dAnimation.html</a></p><p>It does pretty much what I want but I want the ImageView to rotate while it's being translated from point A to point B and the it should rotate along it's own center(which is moving) instead of the center of the container of screen. </p><p>Does anyone know how to do that? </p><p>-Rachel </p>","436323","","","","","2010-12-01 02:03:19","3D rotation while object being translated","<android>","1","0","","",""
"4320561","1","4321334","","2010-12-01 01:57:06","5","8121","<p>I have a TextView which I fill with HTML and linkify it then. Some of the links in HTML are in special format and meant to be links to other activities in my project, not normal URL links. Is it possible to intercept clicks on such links in TextView and do custom action in case the link is in special format? </p><p>Thanks.</p>","94892","","","","","2010-12-01 04:59:09","Android: Start activity via link in TextView","<android><android-widget><linkify>","1","1","2","2013-12-18 05:38:34",""
"4320626","1","4320786","","2010-12-01 02:12:33","0","935","<p>I am trying to figure out how to take an audio file from the Assets folder (included as an AndroidAsset) and add it to the list of Ringtones you see when you make this call:</p><pre><code>this.StartActivity(new Intent(Android.Media.RingtoneManager.ActionRingtonePicker));</code></pre><p>I am adding the ringtone via this call:</p><pre><code>InputStream inputstream = Assets.Open(""filename.mp3"");</code></pre><p>Does anyone know how this is accomplished?  I have been searching all over and haven’t figured it out.  Thank you</p>","216951","","","","","2010-12-01 02:52:53","Android/MonoDroid custom Ringtones question","<android><android-emulator><monodroid>","1","0","1","",""
"4320631","1","","","2010-12-01 02:13:36","3","921","<p>I'm trying to get started creating some apps for Android but I keep running into this Eclipse error:</p><blockquote>  <p>NAND: could not read  file...android-sdk_r07-windows\android-sdk-windows/platforms\android-7\images/system.img,  Permission denied.</p></blockquote><p>Do you think I should delete the package and re-install? I'm wondering whether it could be a corrupted file, although it says ""permission denied"" which makes me think not so. I just installed the plugin for Eclipse and created my emulator but I can't run because of this error.</p><p>I have googled searched this and could not find a relevant answer. Any help would be <em>greatly</em> appreciated. :)</p>","525982","","404469","","2013-01-22 01:59:28","2013-12-24 06:18:27","Eclipse ""Permission denied"" error when trying to launch app","<java><android><eclipse>","7","5","","",""
"4320699","1","4592670","","2010-12-01 02:30:22","1","820","<p>I am trying to display a multi-depth expandable list.  That is, we have a table with the header ID | School | Grade | Name</p><p>and I want to show an expandable list that hasSchool   -  Grade       - Name</p><p>Where the schools are the 1st depth, Grade's are the second depth, and the name is the leaf node.  I understand how to get the grade display, but I am unable to figure out how to do the additional leaf below it.</p><p>Any help would be much appreciated!</p><p>Thanks!Jon</p>","524307","","524307","","2010-12-01 02:47:48","2011-01-04 10:39:51","Implementing a Multidepth ExpandableList Android","<android><expandablelistview><multi-level>","1","0","1","",""
"4320744","1","4757408","","2010-12-01 02:42:13","1","152","<p>I'm working on Android, and I'm new to graphics.</p><p>I have some particles that I don't want to be affected by lighting.  Right now, I am disabling lighting right before I draw the particles (gl.glDisable(GL10.GL_LIGHTING)), and then enabling them again once they're drawn, and continue drawing the rest of the scene. </p><p>Would it be more efficient to leave lighting on, and just set all the particles to be fully emissive?  (by calling glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, white) right before drawing the particles)</p>","506796","","","","","2011-01-21 09:55:25","OpenGL ES: Is it more efficient to turn lights off and on, or just assign emissivity to my particles?","<iphone><android><opengl-es>","1","1","","",""
"4320857","1","4320879","","2010-12-01 03:11:01","4","12732","<p>I have a requirement to create a horizontal bar graph that shows comparison between two values. So I need to create only two horizontal bars, first one is for total amount and second one is for consumed amount.  </p><p>could some one please help me with suggestions to create a bar chart in android. I look forward to hearing from you at the earliest.</p><p>Thanks in advance</p>","524937","","","","","2012-11-07 05:11:59","how to create a bar graph in android?","<android>","2","1","1","",""
"4321056","1","4450475","","2010-12-01 03:57:59","3","2641","<p>I want to know how I can detect child views if I move a view from one ViewGroup to another ViewGroup, particularly when doing a touch event. Is there a method I can call that will let me know which views i'm ""hovering"" over?</p><p>What I'm doing right now is when I detect an ACTION_MOVE event on my view i'm raising it to the top level parent so that it can move and be drawn within the entire window ( and not just inside it's original parent bounds ), then I want to move the view across to a different ViewGroup and on ACTION_UP attach the view to that ViewGroup.</p>","375490","","","","","2012-03-29 03:27:19","How can you detect which view you are passing over when performing a touch event?","<android><events><views><touch>","4","0","4","",""
"4321057","1","","","2010-12-01 03:58:00","0","1206","<p>I've checked the doc here:<a href=""http://developer.android.com/guide/topics/manifest/uses-feature-element.html"" rel=""nofollow"">http://developer.android.com/guide/topics/manifest/uses-feature-element.html</a></p><p>and found 2 most relevant features:</p><p>1)  android.hardware.sensor.accelerometer</p><p>2)  android.hardware.sensor.compass</p><p>Which one do I need to specify in my manifest? Or both?</p><p>Yes, I'm sure I'm using the accelerometer. But the Accelerometer and Magnetic Field values are also used to calculate ""Direction"" (which also means I'm using android.hardware.sensor.compass ??)</p><p>Here's my code:</p><pre><code>@Override public void onSensorChanged(SensorEvent event) {  int type = event.sensor.getType();  switch (type) {  case Sensor.TYPE_MAGNETIC_FIELD:   mags = event.values.clone();   break;               //I'm using Accelerometer here  case Sensor.TYPE_ACCELEROMETER:   accels = event.values.clone();                        break;}                    SensorManager.getRotationMatrix(rotationMat, I, accels, mags);   SensorManager.getOrientation(rotationMat, calculatedOrients);               //I also get direction here,  So do I need to specify android.hardware.sensor.compass in &lt;uses-feature&gt; ?   azimuth = (float) Math.toDegrees(calculatedOrients[0]);   pitch = (float) Math.toDegrees(calculatedOrients[1]);   roll = -(float) Math.toDegrees(calculatedOrients[2]);}</code></pre><p>Thank you in advance!</p>","461783","","","","","2010-12-01 05:44:36","I'm using onSensorChanged(). What should I specify in <uses-feature>?","<android><filtering><accelerometer><android-manifest><google-play>","1","0","","",""
"4321134","1","","","2010-12-01 04:14:06","5","26780","<p>Please suggest me some tutorial which gives the example for DatePicker and how to use its methods like  OnDateChangedListener, onDateChanged etc. Actually I am going through some sites, but i did not get the clear idea of it.</p><p>Thank you</p>","523058","","","","","2013-05-26 14:48:08","DatePicker Example in android","<android><datepicker>","3","0","1","",""
"4321224","1","4331758","","2010-12-01 04:35:12","2","931","<p>I am writing a little picture frame app for android that is using opengl for part of the UI.  This portion needs to get images from flickr and load them into a texture.  The code I have below is functional most of the time, but it has a Thread.sleep() kludge in between getting the input stream from the connection and the bitmap factory decoding the stream:</p><pre><code>            URL url = new URL(""http://farm5.static.flickr.com/4132/5168797476_7a85deb2be_b.jpg"");            URLConnection con = url.openConnection();            InputStream is = con.getInputStream();            Thread.sleep(250); //What am I actually waiting for?            sourceBitmap = BitmapFactory.decodeStream(is);</code></pre><p>How do I get around using the sleep() method in favor of something that makes logical sense?</p><p>I am testing on a samsung galaxy tab not in the emulator</p>","122229","","","","","2010-12-02 04:45:01","How to load image from url","<java><android>","3","0","1","",""
"4321231","1","","","2010-12-01 04:37:08","0","110","<p>I my application i need a list of items , where each item contains </p><ol><li>TextView</li><li>ProgressBar</li><li>Download button</li><li>Cancel button</li></ol><p>when ever i click on download button  progressBar starts and running its fine. . I have binded each row view to my data Object . In download task i.e; asynctask am using this view to update. But when am scrolling the list , progress is visible at differnt row then actual row.I dont know the reason ?</p><p>So, i decided to avoid  listview and go by creating  Viewgroup , then adding all views linearly  these views. (But i donno how to handle OnclickListens for download , button and cancel Button ) Is it good way or any other possible way to do ? performance role ? Can any one help me out these please ?</p><p>Thanking you ,</p><p>Srinivas</p>","414777","","","","","2010-12-01 05:49:11","Android : Is it better to choose ViewwGroup then ListView for below case in android?","<android><listview>","2","0","","",""
"4321260","1","","","2010-12-01 04:42:51","2","8716","<p>I have placed two markers on a Google map. One is in the USA and other one is somewhere in Asia. Google only gives zoom levels 1, 2, 3, 4, 5, 6, etc.</p><p>I don't want to hard-code the zoom level. How can I display all markers depending upon distance? I.e. if two items are very close to each other or in the same city, a close zoom level should be used, and if they're far apart, then maximum zoom level should be used.</p>","249991","","65863","","2012-01-12 04:50:00","2012-01-12 04:50:00","How to set zoom level of a Google map according to marker locations","<android><google-maps><android-mapview>","2","2","1","",""
"4321343","1","4321463","","2010-12-01 05:00:42","15","15841","<p>I was trying to write a custom ArrayAdapter referencing <a href=""http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/"">here</a>My code is </p><pre><code>package com.example.AndTest;import java.util.ArrayList;import android.content.Context;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.TextView;public class CategoryAdapter extends ArrayAdapter&lt;Category&gt; {    private ArrayList&lt;Category&gt; items;    public CategoryAdapter(Context context, int textViewResourceId,            ArrayList&lt;Category&gt; items) {        super(context, textViewResourceId, items);        this.items = items;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        View v = convertView;        if (v == null) {            LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);            v = vi.inflate(R.layout.list, null);        }        Category c = items.get(position);        if (c != null) {            TextView itemId = (TextView) v.findViewById(R.id.itemid);            TextView itemLabel = (TextView) v.findViewById(R.id.itemlabel);            if (itemId != null) {                itemId.setText(""Name: "" + c.getId());            }            if (itemLabel != null) {                itemLabel.setText(""Status: "" + c.getTitle());            }        }        return v;    }}</code></pre><p>But I'm getting error message on the line<code>LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);</code></p><p><code>The method getSystemService(String) is undefined for the type CategoryAdapter</code></p><p>Am i missing something..</p><pre><code>public class Category implements Parcelable {....}</code></pre>","174261","","","","","2010-12-01 05:26:40","Android getSystemService inside custom ArrayAdapter","<android>","1","0","3","",""
"4321452","1","","","2010-12-01 05:24:54","0","875","<p>I have a LinearLayout which contains an ImageButton, and underneath that, a TextView as a label. I would like to have the TextView to be centered, and to have it wrapped to the width of the ImageButton it is underneath. </p><p>EDIT: I should probably put the code I'm currently using. Here's the LinearLayout with Button and TextView</p><pre><code>        &lt;LinearLayout        android:id=""@+id/contestLayout""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:orientation=""vertical""&gt;        &lt;ImageButton            android:id=""@+id/contestButton""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:background=""@drawable/contestsbtnimg""            android:layout_weight=""1""&gt;        &lt;/ImageButton&gt;        &lt;TextView            android:id=""@+id/contestLabel""            style=""@style/MainMenuStyle""            android:text=""@string/contests""&gt;        &lt;/TextView&gt;    &lt;/LinearLayout&gt;</code></pre><p>And here's the relevant style declaration for the TextView:</p><pre><code>&lt;style name=""MainMenuStyle"" parent=""android:style/TextAppearance""&gt;  &lt;item name=""android:textColor""&gt;#000000&lt;/item&gt;  &lt;item name=""android:layout_centerHorizontal""&gt;true&lt;/item&gt;  &lt;item name=""android:textSize""&gt;12sp&lt;/item&gt;  &lt;item name=""android:singleLine""&gt;false&lt;/item&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;/style&gt;</code></pre><p>What I want is for the ImageButton to be on top of the LinearLayout, with the TextView acting as a label underneath, and wrapping its text to a second line if it would be wider than the button. </p>","439356","","439356","","2010-12-01 07:07:37","2010-12-01 07:07:37","Android Wrap TextView to width of ImageButton","<android><android-layout>","1","0","","",""
"4321477","1","4321605","","2010-12-01 05:28:15","0","359","<p>when i compile android2.1 source,it give me a attention:android some files use or override a deprecated api,Please use - Xlink: deprecation recompiled. can you tell me why giveus this information,it  It will have a negative effect ?</p>","233618","","","","","2010-12-01 05:53:38","android some files use or override a deprecated api","<android><android-source>","1","0","","",""
"4321613","1","4321668","","2010-12-01 05:54:31","0","5775","<p>I don't know why am i not able to get this?....maybe i am missing something or am plain dumb</p><p>I want trying to call webservice from a Android App</p><p>Now to do this came across that kSOAP 2 for Android is the library that would be needed</p><p>However, i see many guys in many posts pointing that one would have to <strong>include the jar for ksoap2 for android platform in eclipse</strong></p><p>But which jar to include ?</p><p>At ""http://code.google.com/p/ksoap2-android/"" i see a link to git source where entire source is there.....so is it that i take files needed and make a jar out of it.</p><p>Also i see many guys saying to include the jar file ending with ""-dependencies""....however, downloading such a file seems to be an issue....i just don't get the file with correct size.</p><p>So, which is the jar file to include in eclipse for calling webservices w.r.t. kSOAp 2 ?</p><p>ThanksYogurt</p>","475243","","","","","2012-11-14 00:59:43","kSOAP 2 Android","<android>","4","0","1","",""
"4321622","1","","","2010-12-01 05:56:04","5","1023","<p>I just made an offline card game webapp for iPhone and Android  When doing this, I went entirely off of the abundant iPhone offline webapp information on the web.  However, it seems to work perfectly on Android with one exception.  When I open it after killing the web connection, it states an error about not being able to connect.  After canceling, it works just fine.</p><p>My question is this: has anyone found any decent resources specifically regarding Android offline web apps?  Or is this simply a hack?  The iOS devices seems to support this in a more intuitive way.</p><p>UPDATE:  I had forgotten about this issue that I posted about.  This seems to have been resolved for a while.  I think it may have been fixed in Android 2.1.  I just seemed to have not noticed that there was no error message.  However, it still does not run HTML 5 webapps as cleanly as iOS in that the nav bar is still present when running from a desktop bookmark.</p>","522624","","522624","","2011-06-24 18:38:20","2011-06-24 18:38:20","Android Offline Webapp Resources","<iphone><android><html5><mobile><web-applications>","1","2","","",""
"4321671","1","4321683","","2010-12-01 06:03:59","2","170","<p>I am new in developing android applications. I want to create an android application(using eclipse) which needs a login page where the user needs to put his/her username and password and when the username and password is correct the application will open the main page. I already made a layout for the login page. My question is, is it proper to put the function codes of login and main page in the same package?</p>","516160","","","","","2010-12-01 07:26:56","Proper way of coding","<java><android><eclipse><android-emulator>","3","0","","",""
"4321675","1","","","2010-12-01 06:05:02","0","598","<p>As I understand, there are two built in themes for Android, Light and Dark. I want my application to display different resources based on which theme the user is using (NOT by having the user explicitly specify a theme in my app!). Is this possible? If so, is it possible to do via xml resources, or is a programmatic approach required?</p><p>Note: Yes, I've read <a href=""http://d.android.com/guide/topics/ui/themes.html"" rel=""nofollow"">http://d.android.com/guide/topics/ui/themes.html</a> at least thrice. It seems like all it tells me how to do is set one specific theme or styles to my element, rather than displaying light/dark elements correctly.</p>","156102","","156102","","2010-12-01 06:11:26","2010-12-01 06:11:26","How do I automatically show different resources for light vs dark themes in Android?","<android><resources><themes>","1","2","","",""
"4321682","1","","","2010-12-01 06:06:33","0","3098","<p>I made a stream mediaplayer for Android but when I try to run it, I get errors. Can anyone help me?</p><pre><code> package vn.zing.mp3.utils;import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.net.MalformedURLException;import java.net.URL;import java.net.URLConnection;import java.util.ArrayList;import java.util.LinkedList;import java.util.Queue;import android.media.MediaPlayer;import android.media.MediaPlayer.OnCompletionListener;import android.os.Handler;import android.util.Log;public class StreamingMp3Player { private File ftmp; private int countfile; private int crrPositionOfMp3 = 0; private MediaPlayer mp3player = new MediaPlayer(); private URL urlPath; private URLConnection urlConnect; private InputStream instream; private Queue queueByteArrays; private FileOutputStream fos; private final Handler handler = new Handler(); private FileInputStream insMP3; private final static String MEDIA_STORE = ""/sdcard/mp3vn/""; public StreamingMp3Player() {  queueByteArrays = new LinkedList&lt;byte[]&gt;(); } public void setURLPath(String url) {  try {   urlPath = new URL(url);   // Tao 1 file tam dung de write bytes doc ra tu queue   ftmp = new File(MEDIA_STORE + ""Tmp"" + "".dat"");   fos = new FileOutputStream(ftmp);  } catch (MalformedURLException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (FileNotFoundException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }  } public static byte[] intToByteArray(int value, int lengthArray) {        byte[] b = new byte[lengthArray];        for (int i = 0; i &lt; lengthArray; i++) {            int offset = (b.length - 1 - i) * 8;            b[i] = (byte) ((value &gt;&gt;&gt; offset) &amp; 0xFF);        }        return b;    } public void start() {  try {   queueByteArrays.clear();   urlConnect = urlPath.openConnection();   InputStream instream = urlConnect.getInputStream();   byte[] buf = new byte[8 * 1024];   int i = -1;   int count = 0;   while ((i = instream.read(buf)) != -1) {    ByteArrayOutputStream bos = new ByteArrayOutputStream();    count++;    bos.write(i);    byte[] tmp = bos.toByteArray();    queueByteArrays.add(tmp);    bos.close();    // Moi lan doc xong 3*8*1024 Bytes thi start mp3Player    if (count % 3 == 0)     play();   }   instream.close();   // Kiem tra truong hop doc it hon 3*8*1024,    // neu con du bao nhieu thi chuyen qua cho mp3Player choi het   finish();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } } public void finish() {  if (queueByteArrays.size() &gt; 0)   runMp3(queueByteArrays.size()); } public void play() {  Thread t = new Thread(new Runnable() {   @Override   public void run() {    // TODO Auto-generated method stub    if (queueByteArrays.size() &gt; 0)     runMp3(3);   }  });  t.start();  handler.post(t); } // Can dong bo hoa de tranh truong hop thread nay chua xong thread kia da doi play tiep theo public synchronized void runMp3(int noOfObjec) {  try {   for (int i = 0; i &lt; 3; i++) {    Log.d(""Ak"", ""QueueSize:"" + queueByteArrays.size());    if (queueByteArrays.size() == 0) {     break;    }    fos.write((byte[])queueByteArrays.remove());   }   // Sau khi doc ra tu Queue 3*8*1024 bytes thi chuyen qua cho mp3Player choi   insMP3 = new FileInputStream(ftmp);   mp3player.setDataSource(""/sdcard/mp3vn/Tmp.dat"");   // Doi voi truong hop khong phai la 3*8*1024 hoac append vao thi phai seekTo den   // vi tri truoc khi ket thuc cua thread truoc va choi tiep   if (crrPositionOfMp3 &gt; 0) {    mp3player.seekTo(crrPositionOfMp3);   }   mp3player.prepare();   mp3player.start();   // Sau moi lan hoan thanh xong 3KB thi tu dong luu lai currentTime de    // thread sau biet ma seek toi   mp3player.setOnCompletionListener(new OnCompletionListener() {    @Override    public void onCompletion(MediaPlayer mp) {     // TODO Auto-generated method stub     mp.pause();     crrPositionOfMp3 = mp.getCurrentPosition();    }   });  } catch (FileNotFoundException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } }}</code></pre>","398650","","959304","","2012-09-19 04:42:47","2012-09-19 04:42:47","Android: source code Streaming Media","<java><android><stream><media><player>","0","1","","",""
"4321697","1","","","2010-12-01 06:10:10","0","739","<p>I was looking to write some case study on Android's kernel. This would be a part of my curriculum in the Advanced Operating systems class.The primary focus that i wanted was the actual implementation of how priority queues are implemented in any RTOS just to relate it to the theory we have studied in the class.But i came to know that finding information is really a big task rather than just having a great idea. :(So for now i want to limit myself to either1. Kernel (either process or memory) which will be very specificor2. Difference in Android and Linux OSWhat i have observed is that though we have some information on both of them but the data given can be even seen in my text book. What i wanted was a practical difference.</p><p>I hope I would be getting some pointers in the direction.</p><p>-Sandeep</p>","270153","","","","","2010-12-01 06:17:31","Android OS kernel related queries","<android><linux><memory><kernel><rtos>","2","0","1","",""
"4321727","1","","","2010-12-01 06:16:07","1","701","<p>I am dealing with some sample code I am using to create an app that pulls in Surveys from a server. The layout rendering is done in the java rather than in XML and I am having a problem having labels and text editing boxes (for questions and answers, respectively) squishing into eachother on the same line rather than sitting one on top of the other on seperate lines as is the default with rendering in XML. </p><p>I want to have the Labels above the text edit boxes so both can stretch across the screen and be seen better.</p><p>the code for the overall layout it here:</p><pre><code>    private boolean DisplayForm(){    try    {        ScrollView sv = new ScrollView(this);        //need TableLayout Here!        final LinearLayout ll = new LinearLayout(this);        sv.addView(ll);        ll.setOrientation(android.widget.LinearLayout.VERTICAL);        ll.setBackgroundResource(R.color.background);        int i;        for (i=0;i&lt;theForm.fields.size();i++) {            if (theForm.fields.elementAt(i).getType().equals(""text"")) {                theForm.fields.elementAt(i).obj = new EditSurvey(this,(theForm.fields.elementAt(i).isRequired() ? ""*"" : """") + theForm.fields.elementAt(i).getLabel(),"""");                ll.addView((View) theForm.fields.elementAt(i).obj);            }            if (theForm.fields.elementAt(i).getType().equals(""numeric"")) {                theForm.fields.elementAt(i).obj = new EditSurvey(this,(theForm.fields.elementAt(i).isRequired() ? ""*"" : """") + theForm.fields.elementAt(i).getLabel(),"""");                ((EditSurvey)theForm.fields.elementAt(i).obj).makeNumeric();                ll.addView((View) theForm.fields.elementAt(i).obj);            }            if (theForm.fields.elementAt(i).getType().equals(""choice"")) {                theForm.fields.elementAt(i).obj = new SurveySpinners(this,(theForm.fields.elementAt(i).isRequired() ? ""*"" : """") + theForm.fields.elementAt(i).getLabel(),theForm.fields.elementAt(i).getOptions());                ll.addView((View) theForm.fields.elementAt(i).obj);            }        }</code></pre><p>the code for pulling in the labels and text editing boxes is here: </p><pre><code>public class EditSurvey extends LinearLayout {TextView label;EditText txtBox;public EditSurvey(Context context,String labelText,String initialText) {    super(context);    label = new TextView(context);    label.setText(labelText);    label.setTextColor(0xFF000000);    //label.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));    txtBox = new EditText(context);    txtBox.setText(initialText);    //txtBox.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));    this.addView(label);    this.addView(txtBox);}</code></pre><p>I've left out the other code snippet that pulls in the labels with spinners, which is pretty much the same.</p><p>This is not my code, just to be clear (it's Frank Abelson's), but I am trying to wrangle it to my purposes.</p><p>any help would be fantastic.</p>","340648","","","","","2010-12-01 06:16:07","How to customize a dynamic, programmatic layout - Android","<android><xml><android-layout><dynamic>","0","2","","",""
"4321856","1","","","2010-12-01 06:39:45","2","993","<p>We are having a problem with HTML buttons in the Android browser stealing touch events from the surrounding area.  It seems like the browser, or the native UI, gives HTML buttons a larger click area than the size of the button displayed on the screen and the button steals touch events that should be captured by nearby areas.  The problem occurs on the Android emulator as well as the various hardware platforms.  Here's an example web page:</p><p>Below, div1 is the top darker rectangle (with the text) and div2 is the bottom lighterrectangle (with the button).</p><ul><li>We click in div1 (red dot indicator)</li><li>The touch event is delivered to div1</li><li>The mouse events are delivered to the button and div2</li><li>We would have expected all events to be delivered to div1</li></ul><p><img src=""http://i.stack.imgur.com/IiLx3.png"" alt=""alt text""></p><p>Here is another example using the same page.</p><ul><li>We clicked in div2 at the red dot</li><li>The touch event was delivered to div2</li><li>The mouse events were delivered to div1</li><li>We expected all events to be delivered to div2</li></ul><p><img src=""http://i.stack.imgur.com/iGQgZ.png"" alt=""alt text""></p><p>We have examined the source code for Android and the Android Browser(including webkit) looking for an explanation for this behavior, but haven't found it.  We've also been searching the web for anyone else reporting this problem and have not found any mention of it!  </p><p>We are looking for some type of hint that might help us here... Perhaps a meta tag for the fuzzy-focus?  Or a CSS style that would reduce this click-stealing behavior?</p><p>Any ideas would be much appreciated, this characteristic makes our web app very frustrating to use. </p><p>Here is the code for the page:</p><pre><code>&lt;html xmlns=""http://www.w3.org/1999/xhtml""&gt;&lt;head&gt;&lt;meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" &gt;&lt;meta name=""viewport"" content=""width=device-width"" &gt;&lt;title&gt;Android click target test&lt;/title&gt;&lt;script type=""text/javascript"" charset=""utf-8""&gt;  var div1;  var div2;  var button1;  // OnLoad, install event listeners for touch events, synthesized mouse events, and click events  function doLoad(e) {      div1 = document.getElementById('div1');      div2 = document.getElementById('div2');      button1 = document.getElementById('button1');      messages = document.getElementById('messages');      div1.addEventListener(""touchstart"", touch_emsg, false);      div1.addEventListener(""touchend"", touch_emsg, false);      div1.addEventListener(""mousedown"", emsg, false);      div1.addEventListener(""mouseup"", emsg, false);      div1.addEventListener(""mouseover"", emsg, false);      div1.addEventListener(""mouseout"", emsg, false);      div1.addEventListener(""click"", emsg, false);      div2.addEventListener(""touchstart"", touch_emsg, false);      div2.addEventListener(""touchend"", touch_emsg, false);      div2.addEventListener(""mousedown"", emsg, false);      div2.addEventListener(""mouseup"", emsg, false);      div2.addEventListener(""mouseover"", emsg, false);      div2.addEventListener(""mouseout"", emsg, false);      div2.addEventListener(""click"", emsg, false);      button1.addEventListener(""touchstart"", touch_emsg, false);      button1.addEventListener(""touchend"", touch_emsg, false);      button1.addEventListener(""mousedown"", emsg, false);      button1.addEventListener(""mouseup"", emsg, false);      button1.addEventListener(""mouseover"", emsg, false);      button1.addEventListener(""mouseout"", emsg, false);      button1.addEventListener(""click"", emsg, false);  }  // Messages ring-buffer  var messages;  var lines = 0;  function emsg(e) {    text = """";    text += e.type + ""("" + ((e.clientX==undefined)?""?"":e.clientX) + "","" + ((e.clientY==undefined)?""?"":e.clientY) + "")"";    if (e.target.id != undefined) {text += "" "" + e.target.id;}    if (e.currentTarget != undefined &amp;&amp; e.currentTarget.id != undefined) {text += ""::"" + e.currentTarget.id;}    msg(text);  }  function touch_emsg(e) {    if (e.targetTouches != undefined) {        var touch = e.targetTouches[0];    }    text = """";    text += e.type;    if (touch != undefined) {text += ""("" + ((touch.clientX==undefined)?""?"":touch.clientX) + "","" + ((touch.clientY==undefined)?""?"":touch.clientY) + "")"";}    if (e.target.id != undefined) {text += "" "" + e.target.id;}    if (e.currentTarget != undefined &amp;&amp; e.currentTarget.id != undefined) {text += ""::"" + e.currentTarget.id;}    msg(text);  }  function msg(text) {    lines++;    if (lines &gt; 15) {clearmsg();}    messages.innerHTML += ""&lt;br/&gt;"" +  "" "" + text;  }  function clearmsg() {    lines = 0;    messages.innerHTML = """";  }&lt;/script&gt;&lt;/head&gt;&lt;body onload=""doLoad()""&gt;&lt;div id=""div1"" style=""position: absolute; left: 0px; top: 0px; width: 200px; height: 30px; background-color:#c0c0c0; z-index:1;""&gt;    div1 text&lt;/div&gt;&lt;div id=""div2"" style=""position: absolute; left: 0px; top: 30px; width: 200px; height: 40px; background-color:#f0f0f0; z-index:2;""&gt;    &lt;button id=""button1""&gt; button 1 &lt;/button&gt;&lt;/div&gt;&lt;button id=""clearbutton"" style=""float:right;"" onclick=""clearmsg();""&gt;Clear&lt;/button&gt;&lt;div id=""messages"" style=""position:relative; top:65px; background-color:#aaaaff""&gt;&lt;/div&gt;&lt;/body&gt;</code></pre>","343489","","23897","","2010-12-01 06:51:49","2012-10-28 00:40:35","Touchable area of HTML buttons is too large in Android browser","<html><android><javascript-events><button><touch>","2","5","","",""
"4321871","1","4322104","","2010-12-01 06:43:38","0","1227","<p>I need to add the new contacts on android 2.2 version. </p><p>How to add the all fields like Firstname, Lastname, URL, Nickname, IM, Addresses and mobile number?</p>","488433","","50776","","2011-12-16 18:23:26","2011-12-16 18:23:26","How to add the new contacts on android 2.2?","<android><android-contacts><android-2.2-froyo>","1","0","","",""
"4321896","1","4882425","","2010-12-01 06:49:27","13","6331","<p>I am using Html.fromHtml(STRING).toString() to convert a string that may or may not have html and/or html entities in it, to a plain text string.</p><p>This is pretty slow, I think my last calculation was that it took about 22ms on avg.  With a large batch of these it can add over a minute.  So I am looking for a faster, performance built option.</p><p>Is there anyway to speed this up or are there other decoding options available?</p><p><strong>Edit:</strong>  Since there doesn't appear to be a built in method that is faster or built for performance specifically, I will reward the bounty to anyone that can point me in the direction of a library that:</p><ul><li>Works well with Android</li><li>Licensed for free use</li><li>Faster than <code>Html.fromHtml(String).toString();</code></li></ul><p>As a note, I already tried Jsoup with this method:  <code>Jsoup.parse(String).text()</code> and it was slower.</p>","445348","","445348","","2011-01-31 17:26:34","2013-07-09 16:27:33","Is there a faster way to decode html characters to a string than Html.fromHtml()?","<android><html><string><decode><html-entities>","5","1","5","",""
"4321951","1","","","2010-12-01 06:58:21","1","3352","<p>I need post data to server.I use this code:</p><pre><code>HttpClient client = new DefaultHttpClient();try {    HttpPost httppost = new HttpPost(serverUrl);    StringEntity se = new StringEntity(data);    httppost.setEntity(se);    httppost.setHeader(""Accept"", ""application/json"");    httppost.setHeader(""Content-type"", ""application/json"");    // Execute HTTP Post Request    HttpResponse response = client.execute(httppost);    int statusCode = response.getStatusLine().getStatusCode();    Log.i(TVProgram.TAG, ""ErrorHandler post status code: "" + statusCode);} catch (Exception e) {    e.printStackTrace();} finally {    if (client != null) {        client.getConnectionManager().shutdown();    }}</code></pre><p>But problem is that Android freeze on execute() method, application is blocked out and after some time Android tell me that application doesn't respond.</p><p>I tried to debug into SDK classes and it freeze in AbstractSessionInputBuffer class on the line 103 which is </p><pre><code>l = this.instream.read(this.buffer, off, len);</code></pre><p>I also tried it run the request in separated thread, but the same problem.</p><p>I tested it on Android 2.1 (emulator) and Android 2.2 real mobile device.<br>I also tried to set HTTP proxy and use Fiddler to check HTTP communication data are received by server and server also send correct answer and HTTP code 200. All seems to be ok.</p><p>What is wrong please? </p><p>UPDATE: When I use AndroidHttpClient which is part of Android 2.2 SDK it works great. But it is not in earlier version of Android. So I include it's source code in my app for now. But AndroidHttpClient use DefaultHTTPClient internally, so problem will be in configuration of DefaultHttpClient.</p>","504179","","504179","","2010-12-04 08:30:41","2013-12-11 09:46:08","Do POST request with Android DefaultHTTPClient cause freeze on execute()","<android>","3","1","","",""
"4322090","1","4329932","","2010-12-01 07:23:55","1","1539","<p>I am writing data to xml files in my android app. I looked up how to properly do file IO and found that I need to use openFileOutput. As far as I can tell there is nothing wrong with my code but it keeps throwing an exception at the line I have a try-catch wrapped around in the following code:</p><pre><code>public void writeSearchXML(ArrayList&lt;String&gt; searches, String file)        throws Exception {    // try {    // File newxmlfile = new File(file);    // newxmlfile.createNewFile();    // } catch (Exception e) {    // }    try {        // THE FOLLOWING LINE THROWS AN EXCEPTION EVERY TIME        FileOutputStream out = openFileOutput(file,                Context.MODE_WORLD_WRITEABLE);    } catch (Exception e) {        throw new Exception(""Failing on fileoutput stream searches."");    }    FileOutputStream fOut = openFileOutput(file,            Context.MODE_WORLD_READABLE);    // we create a XmlSerializer in order to write xml data    XmlSerializer serializer = Xml.newSerializer();    // we set the FileOutputStream as output for the serializer, using UTF-8    // encoding    serializer.setOutput(fOut, ""UTF-8"");    // Write &lt;?xml declaration with encoding (if encoding not null) and    // standalone flag (if standalone not null)    serializer.startDocument(null, Boolean.valueOf(true));    // set indentation option    serializer.setFeature(            ""http://xmlpull.org/v1/doc/features.html#indent-output"", true);    // start a tag called ""root""    serializer.startTag(null, ""searches"");    for (String search : searches) {        serializer.startTag(null, ""search"");        serializer.text(search);        serializer.endTag(null, ""search"");    }    // // i indent code just to have a view similar to xml-tree    // serializer.startTag(null, ""username"");    // serializer.text(username);    // serializer.endTag(null, ""username"");    // serializer.startTag(null, ""password"");    // serializer.text(password);    // serializer.endTag(null, ""password"");    // //serializer.attribute(null, ""attribute"", ""value"");    serializer.endTag(null, ""searches"");    serializer.endDocument();    // write xml data into the FileOutputStream    serializer.flush();    // finally we close the file stream    fOut.close();}</code></pre><p>The only problem in all this code is just that one line. I've searched all over the internet and I haven't been able to fine a solution. What can I do to fix this?</p><p>UPDATE: The exception being thrown is a <code>fileNotFound</code> exception. This leads me to believe that the <code>openFileOutput</code> function doesn't actually create the file like it says it does in the description. What can I do in Android to create the file without using <code>openFileOutput</code>?</p>","515377","","281545","","2013-05-03 23:51:25","2013-05-03 23:51:25","openFileOutput throws exception","<java><android><file-io><android-emulator>","1","4","","",""
"4322103","1","4478698","","2010-12-01 07:25:46","0","193","<p>I'm working on an Eclipse plugin for Android. In order to make the plugin controls only visible if the selected folder is a project I added</p><pre><code>org.eclipse.core.resources.IProject</code></pre><p>as object class in the plugin manifest. However, this makes the controls visible for any Eclipse project. Is there a possibility to make the plugin only visible for Android projects? I did not find an interface like IAndroidProject.</p><p>Regards,Florian</p>","523653","","21234","","2010-12-02 11:04:29","2011-11-23 16:46:25","Android Project Type","<android><eclipse><eclipse-plugin>","1","0","1","",""
"4322182","1","4322202","","2010-12-01 07:40:34","11","14946","<p>Is there a base-64 decoder and encoder for a String in Android?</p>","450487","","1618135","","2014-03-22 15:09:49","2014-03-22 15:09:49","Base64 encoder and decoder","<java><android><base64><encoder><decoder>","4","0","5","",""
"4322294","1","4322616","","2010-12-01 08:00:23","1","1414","<p>I'm trying to write a file to my SDcard in my HTC Hero phone. I create the File in my SDCard using:</p><p>File = new File(path.getAbsolutePath(), ""Filename.txt"");</p><p>where path is the path to my externalStorageDirectory (i.e. \sdcard)</p><p>When I log the path of this file, it does say \sdcard\filename.txt</p><p>However, when I create a fileoutputstream to write to the file, suddenly the filepath is changed to \data\data and I cannot access it.</p><p>Can someone please help clarify how I can create a File in the SDCard and then write to it?</p><p>Thanks!</p><p>Edit:</p><pre><code>path = Environment.getExternalStorageDirectory();Log.d(""SDCARDPLSWORK"", path.toString());    try    {        myFile = new File(path.getAbsolutePath(), ""SensorValues.txt"");        boolean i = myFile.createNewFile();        Log.d(""SDCARDPLSWORK"", myFile.toString() + "" "" + i);        fos = new FileOutputStream(myFile);        Log.d(""FILEANDROID"", getFileStreamPath(""SensorValues.txt"").toString());    }    catch(FileNotFoundException e)    {        e.printStackTrace();    }</code></pre><p>This is what I'm doing. The part until SDCARDPLSWORK is correct, but when it comes to the FILEANDROID log it goes to the private data storage. </p>","526223","","526223","","2010-12-01 08:21:38","2010-12-01 09:20:12","Writing on SDCard Problem - Android","<java><android>","3","0","","",""
"4322320","1","","","2010-12-01 08:07:38","0","371","<p>I try to parse an XML file with the DOM method (<code>EventElement.getAttribute(""string"")</code>)but I couldn't detect the Warp (e.g ""\n"") but when I open it in the browser and open its source (ctrl+u) I see the warps.</p><p>when i use </p><p>string.split(""\n"") string.split(System.getProperty(""line.separator"")) ;string.split(""&#10;"");</p><p>all of them dosen't work</p><p>Thank you for any help</p>","462023","","462023","","2010-12-01 08:52:57","2010-12-01 10:26:12","I can't detect \n character in XMl parsing [android]","<android><xml-parsing>","2","1","","",""
"4322332","1","13221411","","2010-12-01 08:09:29","0","571","<p>We tried WCF and it is fairly complex, and it returns nulls in the JSON, which GSon chokes on.</p><p>Is there another quick and dirty way to mock a REST service, for Android/GSon usage ?</p>","77115","","77115","","2010-12-03 11:16:06","2012-11-04 18:14:44","A quick way to mock a REST service, for Android/GSon usage?","<android><rest><gson>","1","3","","",""
"4322339","1","4405048","","2010-12-01 08:10:06","3","2754","<p>well, I've managed to fit all my questions in the title. I need to break a long text in to columns/frames and layout them in to view. I've been digging for solutions for a couple of days now, but I can't find any examples or clear documentation on how to complete any of my tasks. I've seen a some mentions of StaticLayout, but I don't know how to use it properly. As for text height I've tried TextPaint's getTextBounds method, but it doesn't have width limit and it looks like it measures only single line (well, maybe I was doing something wrong).</p><p>Maybe someone has an example of StaticLayout or it's subclass usage?</p><p>Everything looks so simple ""on paper"": create ""frame"", check how much characters fits in it, fill frame and position it, repeat until end of text and yet I can't find anything on how to do this :)</p>","90571","","","","","2011-09-08 06:07:27","How to get height of text with fixed width and get text length which fits in a frame?","<android><android-layout><paint>","1","1","5","",""
"4322367","1","4322386","","2010-12-01 08:13:54","8","7467","<p>Ok folks.. long story short, I was developing on a computer that I no longer have access to. I was able to retrieve the source code, but not the .keystore file used to sign and publish my application to the market (with several updates). Am I, and my poor users, out of luck if I ever want to update?</p><p>I know the password used to sign the key (at least it is one of three it could be), so can I create another? There must be a way around this.. what about a hard drive fail?</p>","502630","","114066","","2011-11-21 07:34:43","2014-01-17 11:03:35","I lost my .keystore file?","<android><keystore><android-sdk-2.1>","4","1","1","",""
"4322433","1","4322933","","2010-12-01 08:25:41","0","492","<p>i am disigning a calendar application.now i have populated the grid elements.but that grid layout also shows the dates of pervious month.how to disable a particular cell in grid layout? and also if possible let me know how to enable the grid lines?some thing like this image:<img src=""http://i.stack.imgur.com/D6jSK.png"" alt=""alt text""></p>","430652","","","","","2010-12-01 09:35:34","how to disable a element in gridlayout?","<android><gridview><calendar><gridlines>","1","2","","",""
"4322440","1","5820803","","2010-12-01 08:26:35","1","1371","<p>I want to develop Android applications which will support multiple screen resolutions. I have gone through support multiple screen resolution article.</p><p>I tried creating folder layout-hdpi and had one layout file in that. The layout file with similar name was in layout folder too. I changed certain values in layout file which was in layout-hdpi but that also changed the values in layout file which was in layout folder. </p><p>To be more specific the hierarchy is something like this</p><p>res|-->layout|--------> main.xml|-->layout-hdpi|--------> main.xml</p><p>Any change in the main.xml under layout-hdpi also changes the value in main.xml under layout.</p><p>Can someone let me know why is this happening?</p>","261566","","","","","2011-04-28 15:09:12","Problem in Developing for multiple screen resolution in Android?","<android><screen><resolution>","2","1","","",""
"4322457","1","4322487","","2010-12-01 08:28:29","0","681","<p>my gallery display my images but which image select i don't know how to differentiate selected image and other images.. i want to set border line in my image...now i am attach my screen shots help me....</p><p>my screenshot:<img src=""http://i.stack.imgur.com/QQ7mm.png"" alt=""alt text""></p><p>i expect this type of screen in my emulator:<img src=""http://i.stack.imgur.com/sqtde.png"" alt=""alt text""></p><pre><code>package videothumb.videothumb;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.database.Cursor;import android.graphics.Bitmap;import android.os.Bundle;import android.provider.MediaStore;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.Gallery;import android.widget.ImageView;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;import android.net.Uri;import android.view.Window;import android.view.WindowManager;import android.graphics.Color;public class videothumb extends Activity{private final static Uri MEDIA_EXTERNAL_CONTENT_URI =    MediaStore.Video.Media.EXTERNAL_CONTENT_URI;private final static String _ID = MediaStore.Video.Media._ID;private final static String MEDIA_DATA = MediaStore.Video.Media.DATA;//flag for which one is used for images selectionprivate Gallery _gallery; private Cursor _cursor;private int _columnIndex;private int[] _videosId;private Uri _contentUri;private int video_column_index;//private static final int MENU_ID_ZOOM = 0;protected Context _context;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    _context = getApplicationContext();    setContentView(R.layout.main);    //set GridView for gallery    _gallery = (Gallery) findViewById(R.id.videoGrdVw);    //set default as external/sdcard uri    _contentUri = MEDIA_EXTERNAL_CONTENT_URI;    //initialize the videos uri     //showToast(_contentUri.getPath());    initVideosId();    //set gallery adapter     setGalleryAdapter();   }private void setGalleryAdapter() {    _gallery.setAdapter(new VideoGalleryAdapter(_context));    _gallery.setOnItemClickListener(videogridlistener);    }private void initVideosId() {    try    {        //Here we set up a string array of the thumbnail ID column we want to get back        String [] proj={_ID};        // Now we create the cursor pointing to the external thumbnail store        _cursor = managedQuery(_contentUri,                proj, // Which columns to return                null,       // WHERE clause; which rows to return (all rows)                null,       // WHERE clause selection arguments (none)                null); // Order-by clause (ascending by name)        int count= _cursor.getCount();        System.out.println(""total""+_cursor.getCount());        // We now get the column index of the thumbnail id        _columnIndex = _cursor.getColumnIndex(_ID);        //initialize         _videosId = new int[count];        //move position to first element        _cursor.moveToFirst();                    for(int i=0;i&lt;count;i++)        {                        int id = _cursor.getInt(_columnIndex);            //            _videosId[i]= id;            //            _cursor.moveToNext();            //        }    }catch(Exception ex)    {        showToast(ex.getMessage().toString());                }    }   protected void showToast(String msg)   {     Toast.makeText(_context, msg, Toast.LENGTH_LONG).show();   }   private OnItemClickListener videogridlistener = new OnItemClickListener() {     public void onItemClick(AdapterView parent, View v, int position,    long id) {        // Now we want to actually get the data location of the file        String [] proj={MEDIA_DATA};        // We request our cursor again        _cursor = managedQuery(_contentUri,                proj, // Which columns to return                null,       // WHERE clause; which rows to return (all rows)                null,       // WHERE clause selection arguments (none)                null);          //System.gc();         // video_column_index =                               _cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA);          _columnIndex = _cursor.getColumnIndex(MEDIA_DATA);            // Lets move to the selected item in the cursor            _cursor.moveToPosition(position);          String filename = _cursor.getString(_columnIndex);          Intent intent = new Intent(videothumb.this, ViewVideo.class);          intent.putExtra(""videofilename"", filename);          startActivity(intent);          showToast(filename);         // Toast.makeText(videothumb.this, """" + position, Toast.LENGTH_SHORT).show();         }       };    private class VideoGalleryAdapter extends BaseAdapter    {    public VideoGalleryAdapter(Context c)     {        _context = c;    }    public int getCount()     {        return _videosId.length;    }    public Object getItem(int position)     {        return position;    }    public long getItemId(int position)     {        return position;    }    public View getView(int position, View convertView, ViewGroup parent)     {        ImageView imgVw= new ImageView(_context);        try        {            if(convertView!=null)            {                imgVw= (ImageView) convertView;            }            imgVw.setImageBitmap(getImage(_videosId[position]));            imgVw.setAdjustViewBounds(true);            //imgVw.draw(canvas);            //imgVw.setBackgroundColor(Color.BLACK);            imgVw.setLayoutParams(new Gallery.LayoutParams(150, 100));            imgVw.setPadding(5,5,5,5);        }        catch(Exception ex)        {            System.out.println(""StartActivity:getView()-135: ex "" + ex.getClass() +"",           ""+ ex.getMessage());        }        return imgVw;    }    // Create the thumbnail on the fly    private Bitmap getImage(int id) {    Bitmap thumb = MediaStore.Video.Thumbnails.getThumbnail(getContentResolver(),id,     MediaStore.Video.Thumbnails.MICRO_KIND, null);      System.out.println(""ff""+MediaStore.Video.Thumbnails.getThumbnail     (getContentResolver(),     id, MediaStore.Video.Thumbnails.MICRO_KIND, null));        return thumb;    }     }          }</code></pre><p><img src=""http://i.stack.imgur.com/I3qUJ.png"" alt=""alt text""></p><p>i am set background color....</p>","486554","","486554","","2010-12-01 09:27:02","2010-12-01 09:27:02","border not display in my images","<java><android><border>","1","3","","",""
"4322508","1","","","2010-12-01 08:37:34","0","664","<p>I'm having some problems with the tabs in Android.</p><p>First of all i create my tabs like this:</p><pre><code>    tabHost = getTabHost();    search = tabHost.newTabSpec(""search"").setIndicator(""Search"").setContent(new Intent(this,Search.class));    mealplan = tabHost.newTabSpec(""mealplan"").setIndicator(""Mealplan"").setContent(new Intent(this,Search.class));    shoppinglist = tabHost.newTabSpec(""shoppinglist"").setIndicator(""Shoppinglist"").setContent(new Intent(this,Search.class));    settings = tabHost.newTabSpec(""settings"").setIndicator(""Settings"").setContent(new Intent(this,NewUser.class));    tabHost.addTab(search);    tabHost.addTab(mealplan);    tabHost.addTab(shoppinglist);    tabHost.addTab(settings);</code></pre><p>Now I want to have the ability to change the content of a tab inside a tab. For example if im currently in the search tab (the default start-tab) i want to programically change the content of search with instant effect. Earlier i was just starting new activities with the activitygroup but that ended up giving me stackoverflow all the time. I assume that was because i couldn't use finish() because that would close the whole program.</p><p>So as i said, my new approach to changing/starting a activity from inside a tab is to call the Activity holding the tabs, and make that class change the content of a tab. But how?</p><p>I've tried using the setContent, but the effect isn't instant and it kinda overlaps the default content from the tab. Can you help me? Let me know if u want any other code.</p><p>Thanks in advance.</p>","328146","","","","","2010-12-01 09:28:03","Changing a tabs content inside a tab","<java><android><tabs><activity>","1","0","","",""
"4322514","1","","","2010-12-01 08:38:29","10","6308","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3093365/android-get-version-of-system"">android get version of system</a>  </p></blockquote><p>How to Identify current android device OS from code?So from my application i need to know the current device version (2 is 5 or 2.01 6 Donut - 2.01 or 2.2  7 Eclair)??</p><p>Because if it's 2.2 i want to use c2dm, but if it's lower than 2.2 than i will not perform this action.But i want my application can be use from Android 1.6.</p><p>Thanks</p>","430926","","","","","2012-06-22 13:10:03","How to check Android version in code","<android><android-version>","0","0","0","2012-06-22 15:20:04",""
"4322576","1","4324406","","2010-12-01 08:48:12","0","275","<p>Has anyone worked on the SensorDump Android app before? I'm trying to get Accelerometer values from my phone and I've been able to dump it in to a CSV file on my computer. However, I'd like to add a timestamp to my values as well and SensorDump doesn't provide for that.</p><p>I can't find any documentation online ,and I was wondering if anyone had tried to modify it, or if there's any other app out there that does the same (i.e. lets me write Sensor Values onto a file, with timestamp). </p><p>Thanks!</p>","526223","","","","","2010-12-01 12:36:30","Accessing the SensorDump API - Android","<android>","1","0","","",""
"4322638","1","","","2010-12-01 08:58:35","1","1192","<p>I would like the ability to remove the ability for a user to interact with the SeekBar, from within the activity.</p><h2>The scenario:</h2><p>User slide's the Seekbar once.... then onStopTrackingTouch: further user interaction with the seekbar is denied....then Button OnClick... User interaction with Seekbar restored..</p><hr><p>I cant find an attribute for the seekbar that will allow this...?</p><p>One possible solution i have considered, is overlaying an image view containing a clear image. But this does not stop the underlying SeekBar from taking user touch input..?</p>","515080","","515080","","2010-12-01 10:16:31","2010-12-01 11:41:55","Remove User Input From Seekbar","<android>","1","0","","",""
"4322681","1","4322713","","2010-12-01 09:02:55","0","779","<p>how an application could make sure that it looks good on any mobile Android phone (there are several manufacturers, and each phone has slightly different specifications). </p>","526298","","20862","","2010-12-01 09:04:53","2010-12-01 09:12:26","Different display resolutions on android phones","<android>","3","0","","",""
"4322777","1","4322812","","2010-12-01 09:15:47","3","164","<p>I got a question about singing applications in Android.</p><p>I worked on an update for an app dat was already made and put in the Market before.I signed it and tried to upload it as an update but it said that the keystore was different.</p><p>I emailed the original developer and he signed it for me.I asked if I had to send it to him each time I wanted to upload an update.</p><p>This is what I got back from him:</p><blockquote>  <p>It's not the first time I've done this  , so I know for sure it works .  The  apk you give me must be unsigned ,  then I sign it , then you're  developers than up to the market .  After that you will not need my  keystore again .  Maybe some things  changed since the last time I did this  , but in order to know what is  happening I need to know all the  details .  </p>    <p>This is an unsigned apk ? the other  one was uploaded on market ? Did you  encountered any error .... what was  the message .  Attached you can find  the signed apk .</p></blockquote><p>Is this true? If I upload the signed APK he gave me, can I use a different keystore for the next update?</p>","517460","","473070","","2010-12-01 09:22:33","2010-12-01 09:22:33","Question about Signing Application for Android","<java><android><code-signing><google-play>","2","0","","",""
"4322819","1","4324095","","2010-12-01 09:21:24","8","3067","<p>I'm trying to figure out what is the best general design for applications that access several web services and have multiple activities where information is displayed.</p><p>The way I implemented my latest Android application is the following. I have an <code>IntentService</code> that receives requests from activities to get information from web services. My <code>Service</code> notifies the activities through a <code>ResultReceiver</code> about the status of the request (started/error/finished). After calling the web service, getting the result(xml/json) and parsing it, I put that information in a <code>ContentProvider</code> (backed up by a sqlite database) and use a <code>ContentResolver</code> to notify any activities about the changes. The activities get notified about the changes (some use <code>ContentObserver</code> and others use <code>SimpleCursorAdapter</code>s and are notified automatically).</p><p>Now, the problems with my approach:</p><ul><li>every time I enter an activity, I request info from web service through the method described above and I delete all the rows in that particular table, fill it with the new info and notify the activity. So, if the user presses back and then enters again, I do the whole dance again. I think I should add some fields in the database for when was the last updated etc. but I don't know how exactly to proceed with that. Suggestions? I think one alternative would be to use alarms and trigger updates at specific intervals. But in my case, the specification asks to check the web service every time I enter the activity.</li><li>when I call the web service, I show a indeterminate progress bar in the activity, over the other views (which contain the info fetched previously and that sits in the database until the web service call finishes) but the user can start interacting with the views and this is not good (the info may disappear from the database). Any way to disable the interaction? A ProgressDialog comes to mind.</li><li>if I move quickly through different activities, the IntentService is blocked with previous web service calls and it takes longer to get to my latest web service call. I could create multiple <code>IntentService</code> for every web service but I don't think this is its purpose.</li></ul><p>I have the feeling that the approach I have taken is not really the best one for this particular application. It is <em>partially</em> inspired from the Google I/O application (I couldn't understand everything, like the updated sqlite fields etc.). One alternative would have been to use AsyncTasks in all the activities. But where can I store the info in order to be accessed from other activities? In lists in <code>Application</code>? And how about id management?</p><p>I'm really interested on your opinions/ideas/suggestions and how can I make my next applications work better and more efficiently.</p>","292263","","135152","","2011-05-25 03:06:15","2011-05-25 03:06:15","General application design (IntentService/ContentProvider/AsyncTask)","<android><design><sqlite>","1","0","4","",""
"4322902","1","4722389","","2010-12-01 09:32:08","4","483","<p>This is my first post here, I was stuck with linearlayout, I have linearlayout(horizontal)  with 3 buttons in it of which I set the third button layout_weight=1 so it takes up the whole space in linearlayout this is pretty much working properly.</p><p>But when I put this layout in HorizontalScrollview the weight property doesnt works for me,what I want is to display two button horizontally on whole screen width and when scrolled third button should appear taking up the whole width of screen hiding both the buttons but its not happening.</p><p>Regard'sSaurabh Agnihotri</p>","517247","","","","","2011-06-15 07:59:15","Android linearLayout problem","<android><android-linearlayout>","2","4","2","",""
"4322938","1","","","2010-12-01 09:36:37","4","489","<p>Task: fit large characters into a small button.</p><p>Problem: I noticed what when you create a button using non-alpha characters such as -, +, =.. etc, there is a lot of ""padding"" below and above the text, especially when you increase the font size. When you use alpha characters, it appears fine.ie.this is what happens<br><strong><em>_</em>__<em>_</em>__<em>_</em>_</strong><br>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><em>_</em>__</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>|&nbsp;&nbsp;&nbsp;&nbsp;|<strong><em>_</em>__<em></strong>|&nbsp;&nbsp;&nbsp;&nbsp;|<br>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>|<strong></em>__<em>_</em>__<em>_</em>__</strong>|<br></p><p>when i want this..<br><strong><em>_</em>__<em>_</em>__<em>_</em>_</strong><br>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><em>_</em>__</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>|&nbsp;&nbsp;&nbsp;&nbsp;|<strong><em>_</em>__<em></strong>|&nbsp;&nbsp;&nbsp;&nbsp;|<br>|<strong></em>__<em>_</em>__<em>_</em>__</strong>|<br>where the rectangle in the middle is a big giant dash.</p><p>I have tried setting the padding to zero, but that doesn't work.Any ideas?</p>","526344","","1140748","","2012-05-01 17:31:29","2012-05-01 17:31:29","Android: How to fit large fonts into a small button?","<android><button><fonts>","1","2","","",""
"4323034","1","","","2010-12-01 09:47:55","1","596","<p>I'm very very new on Unity for Android development. I'm developing game in android with a game engine that has custom layouts to show data from user. Don't think why has done it in this way. It's only an example.</p><p>Now, I want to migrate my game to Unity.</p><p>My game is a collaborative game that need to show users connected to the game. The game uses a REST service to communicate with others players. Also, the game is splits in challenge, I need a list to show them.</p><p>Can I do all of this with Unity? May I merge my actual Android project with a Unity project?</p><p>Thanks. </p>","68571","","11182","","2012-01-21 04:50:04","2012-01-21 04:50:04","Unity for Android: Creating my own Actitivities and XML-Based layouts","<android><android-layout><unity3d>","0","0","1","",""
"4323093","1","","","2010-12-01 09:54:46","2","232","<p><img src=""http://i.stack.imgur.com/lasho.jpg"" alt=""alt text""></p><p>I am using web view in my activity. I am using an url to load the page. The page contains text field which takes user-name and password as input from user.When I click on nay of the field a corresponding small field is shown overlapping the other.</p><p>Here I am attaching image how it looks when i click password field..</p><p>can anybody tell me how to solve this?</p><p>Thanks.</p>","289597","","179850","","2011-02-21 19:11:23","2013-04-10 16:31:50","android webview showing two edit fields","<android>","1","2","","",""
"4323141","1","","","2010-12-01 10:03:02","1","79","<p>I have created this Android layout:</p><p><img src=""http://i.stack.imgur.com/pZdEz.png"" alt=""Custom Android Layout""></p><p>This has a custom title bar and a TextView containing some sample text. The TextView is inside a ScrollView.</p><p>The 'start/stop' button is supposed to start and stop the text automatically scrolling.</p><p>I am using a Scroller object but I can't find a method to pause the scrolling. Does such a method exist or should I be using an alternative approach (and if so, what)?</p>","395661","","4023","","2012-08-17 13:23:44","2012-08-17 13:23:44","How do I pause autoscrolling of an Android application?","<java><android>","1","0","1","",""
"4323164","1","4323327","","2010-12-01 10:06:10","0","1073","<p>As Activities are opened by the user, they're stacked up on the view stack.and as the user finishes an Activity by any means, it is popped out of the view stack.</p><p>Now, I have a situation where the user has opened the app's home screen, and has successively opened multiple activities, on top of the home screen. In each activity, there's a control which lets the user see the home screen again.</p><p>As i can think, there can be two approaches to get this:</p><ol><li>On the press of that control, pop the home screen from the bottom of the view stack and push it on the top of it.</li><li>As the control is pressed, start popping each of the current screen until the home screen becomes the current screen.</li></ol><p>I know there's some way in Android to do at least one of this, or something like this.I just can't remember what was it.</p><p>Please help me choose the better approach, and let me know the way (the code, specifically) to do it.</p><p>Thanks a lot :)</p><p>(Please edit the title/text if it isn't appropriate)</p>","243709","","","","","2010-12-01 10:25:49","Finishing (or Accessing) a specific Activity in Android","<android><android-sdk-2.2>","1","0","","",""
"4323189","1","","","2010-12-01 10:09:17","1","1313","<p>I am having an OpenGL SurfaceView. This now needs to be updated by some external event coming over a networksocket, this networksocket is running in an external thread, since it needs to listen for all time on the port for incoming traffic, when some traffic arrives a new OpenGL object should be created and shown on the screen.As far as I understand all that OpenGL stuff, you can't change the objects from an outer thread, but with queueevent() you have a chance.My code looks the following, but unfortunatelly it isn ot working:</p><pre><code>public class GameMain extends Activity {  protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    glView=new GameView(this);    setContentView(glView);    } }public class MyGLSurfaceView extends GLSurfaceView{    public MyGLSurfaceView(Context context) {    super(context);            renderer = new OpenGLRenderer();            this.setRenderer(renderer);     }     public void do(ServerSocket ss){        try{    while(true){            try {                ss.setSoTimeout(500);            Socket s = ss.accept();                            renderer.set();                       }catch(SocketTimeoutException e){}                     }             }catch(Exception e){                    handleException();     }     public void handleEvent(){    Thread t = new Thread(new Runnable() {        @Override        public void run() {            try{                ServerSocket ss = new ServerSocket(7070);                while(true){                    get(ss);                }            }catch(Exception e){                e.printStackTrace();            }        }    });    queueEvent(t);    t.start();} }public class OpenGLRenderer implements  Rend{ Cube c = null;    public OpenGLRenderer(){         //inits     }public void onSurfaceCreated(GL10 gl, EGLConfig config) {           //.....     }    public void onDrawFrame(GL10 gl) {      if(c!=null)         doSth();             //....    }   public void set(){       c = new Cube();   }  }</code></pre><p>So the set() Method is called when networking traffic is arriving, but unfortunatelly the local variable c is not updated for the onDrawFrame() method. Why is that the case, how can I achieve this?</p><p>Can anyone please help me!?</p><p>Thanks a lotRegards</p>","495918","","44729","","2010-12-01 15:35:15","2012-04-05 12:37:39","Android: OpenGL in several threads","<android><multithreading><opengl-es>","2","0","","",""
"4323273","1","","","2010-12-01 10:18:47","1","2101","<p>I'm wondering why the android webview has this strange behaviour... What I wonna do:</p><p>I have one activity whose content (especially the webview content) is ""reloaded"" by a button (next, previous), but not by invoking a new activity with extra params... The inner class below (SampleData) contains some data, one data-field (name) that is being rendered in the TextView ""funcName"", and the other data part (desc) on the WebView ""funcDesc"" (because it contains html-data).</p><p>Here is a modified example from my source (but it clearly describes what I wanna do):</p><pre><code>public class SampleActivity extends Activity{int position = 0;private ArrayList&lt;SampleData&gt; array;private TextView funcName;private WebView funcDesc;private ImageView backBtn;private ImageView forwardBtn;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.sampleactivity);        loadSampleData();    initFields();    startMyActivity(position);}private void loadSampleData(){    array = new ArrayList&lt;SampleData&gt;();    array.add(new SampleData(""One"", ""&lt;b&gt;Hello One&lt;/b&gt;, you are just &lt;i&gt;great&lt;/i&gt;""));    array.add(new SampleData(""Two"", ""&lt;b&gt;Hello Two&lt;/b&gt;, you are even &lt;i&gt;better&lt;/i&gt;""));    array.add(new SampleData(""Three"", ""&lt;b&gt;Hello Three&lt;/b&gt;, you are just &lt;u&gt;awesome&lt;/u&gt;""));}private void initFields(){    funcName = (TextView) findViewById(R.id.sampledata_func_name);    funcDesc = (WebView) findViewById(R.id.sampledata_func_desc);    funcDesc.setBackgroundColor(0);    WebSettings settings = funcDesc.getSettings();    settings.setCacheMode(WebSettings.LOAD_NO_CACHE); // do I have to provide this feature for no caching?    backBtn = (ImageView) findViewById(R.id.serviceprocess_navigation_back);    backBtn.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            callOnBackPressed();        }    });    forwardBtn = (ImageView) findViewById(R.id.serviceprocess_navigation_forward);    forwardBtn.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            callOnForwardPressed();        }    });}private void startMyActivity(int position) {    funcName.setText(array.get(position).getName());    /* Only this works! */    {        deleteDatabase(""webview.db"");        deleteDatabase(""webviewCache.db"");    }    funcDesc.loadData(array.get(position).getDesc(), ""text/html"", ""utf-8"");    funcDesc.reload();      }private void callOnBackPressed(){    startMyActivity(--position); // no check for IndexOutOfBounds...}private void callOnForwardPressed(){    startMyActivity(++position); // no check for IndexOutOfBounds...}private class SampleData{    public SampleData(String name, String desc){        this.name = name;        this.desc = desc;    }}</code></pre><p>}</p><p>I already found a solution(<a href=""http://stackoverflow.com/questions/2465432/android-webview-completely-clear-the-cache"">android-webview-completely-clear-the-cache</a>) on Stackoverflow. But this (delete database) couldn't be the correct way to handle this???</p>","248755","","","","","2010-12-01 10:18:47","Android webview strange cache behaviour","<android><caching><webview>","0","0","","",""
"4323301","1","","","2010-12-01 10:22:39","0","918","<p>I'm having trouble when trying to show the search bar at the top of my app. I just want this bar to be visible for the hole application (in all the activities) even when the app starts, with no need for the user to press a button, I'm trying to use android's searchable function. Here's what I've got so far: </p><p><strong>manifest.xml</strong></p><pre><code>&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="".BigImageView""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.SEARCH"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data android:name=""android.app.searchable""               android:resource=""@xml/searchable""/&gt;    &lt;/activity&gt;    &lt;!-- declare the default searchable Activity for the whole app --&gt;    &lt;meta-data android:name=""android.app.default_searchable""           android:value="".BigImageView"" /&gt;&lt;/application&gt;</code></pre><p><strong>res/xml/searchable.xml</strong></p><pre><code>&lt;searchable xmlns:android=""http://schemas.android.com/apk/res/android""android:label=""@string/app_name""android:hint=""@string/search_hint"" &gt;</code></pre><p></p><p>Can I accomplish this or does the user need to press a buttons to invoke the search bar?</p>","499488","","1288","","2011-10-12 18:12:07","2011-10-12 18:12:07","Showing a search bar in Android","<android><uisearchbar>","1","0","1","",""
"4323354","1","4323393","","2010-12-01 10:28:15","1","1070","<p>I want to play game pacman. There is a problem exists in the moving of the pacman ghosts. How can i move the ghost. I use Random Method but it moves in the same direction up or down or left or right. I want actual theory behind pacman movement</p>","339116","","143979","","2010-12-01 10:34:18","2012-10-27 11:29:20","Pacman Ghost moving in android","<android><artificial-intelligence><pacman>","4","1","1","",""
"4323413","1","","","2010-12-01 10:34:42","3","1722","<p>I want the user to enter a password everytime he tries to enter the application. That is, the user must enter the password everytime the app comes to foreground from background, be it by pressing the <strong>launcher icon</strong> or <strong>long-pressing the home key</strong></p><p>I sort-of achieved the first part because the launcher intent is fired and i get a callback in onRestart of that activity. </p><p>But by long-pressing home key and launching the does not provide callback to onRestart.</p><p>Also what if the user launches the app by pressing the <strong>notification</strong> from, the notification bar. How do I distinguish whether the app was originally in background or fore-ground before the user clicked the notification</p>","266272","","","","","2010-12-02 05:20:36","How to password protect an application in Android","<android><password-protection>","3","2","3","",""
"4323553","1","4324576","","2010-12-01 10:53:13","0","4911","<p>Is there any way (intent) to know if my application is installed ?I followed the below link, but my application don't get the intent when my app is installed</p><p><a href=""http://stackoverflow.com/questions/3510544/android-how-to-intercept-the-install-application-intent"">Android - How to intercept the 'Install application' intent</a></p>","505011","","","","","2012-08-07 11:09:52","Way to know if my application is installed","<android>","2","6","1","",""
"4323720","1","4324147","","2010-12-01 11:11:39","1","1165","<p>I am new to Android Platform. Please resolve my query ""how to save &amp; retrieve data in the same activity with SharedPreferences in Android""</p>","526443","","473070","","2010-12-01 11:14:08","2010-12-01 12:04:08","how to save & retrieve data in the same activity with SharedPreferences in Android","<java><android><sharedpreferences>","2","1","","",""
"4324086","1","4324319","","2010-12-01 11:56:55","0","1710","<p>I want to make a SMS gateway app, that polls my website and checks if there are messages to send in the queue, and if there is, the app will send it to the destination number.</p><p>There should also be a callback function, where I will post information about the message, what android did exactly with it.</p><p>I thought first to create a service and do the poll check over wifi to the website, but refering to website ""http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-are-not/"" it is not possible to create a service that will run forever.</p><p>What should I take in mind by make this app possible. There a lot of tricks, like wakelocks, startforeground etc, but still the service will not run forever.</p><p>Thanks.</p><p>Shafqat</p>","525061","","","","","2010-12-01 12:26:49","SMS gateway how to program android app","<android><service><sms-gateway><standby><android-wake-lock>","2","1","1","",""
"4324099","1","4324199","","2010-12-01 11:59:04","0","1022","<p>my textview display in  emulator top..how to change into the bottom...</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"" android:background=""@drawable/tv""&gt; &lt;TextView  android:text=""EmbDes Technologies"" android:id=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:textColor=""#ff000000""  android:textStyle=""bold""  android:gravity=""bottom""/&gt;&lt;Gallery xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/videoGrdVw"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""/&gt;      &lt;/RelativeLayout&gt;</code></pre><p><img src=""http://i.stack.imgur.com/dytoq.png"" alt=""alt text""></p>","486554","","486554","","2010-12-01 12:25:36","2011-03-11 12:50:16","how to set textview in bottom","<java><android><textview>","3","0","","",""
"4324110","1","4324191","","2010-12-01 11:59:54","0","656","<p>i want to learn modify and  compile source, what i need to learn,can you give some linkor sample and so on, i know  i also need to learn  frameworks knowledge,how and where to learn</p>","233618","","","","","2010-12-01 12:09:03","how to learn frameworks of android","<android><frameworks>","1","1","","2012-08-18 05:43:54",""
"4324120","1","4325093","","2010-12-01 12:00:58","17","9189","<p>I need to view who signed the application I have installed onto my device. Is this generally possible to do on the device or on PC?</p>","526494","","","","","2013-08-02 12:59:14","How to view the identity of person who signed the apk on Android device?","<android><certificate><signature><apk>","2","2","11","",""
"4324248","1","4324636","","2010-12-01 12:15:46","1","1429","<p>I know how to force numbers, texts etc.. but is there a flag or IME options for  me to force the EditText to accept only certain language like English in case my DB fields can accept only English characters ? of course i can check and notify the users on bad input but that's not exactly user friendly...</p><p>Implementing my own filter on the EditText might also be possible but I'm not sure it will force the keyboard layout itself to be in the language i need.</p><p>Any idea ?</p>","312288","","785326","","2012-07-05 21:40:28","2012-07-05 21:40:28","how to force english keyboard in android EditText","<android><keyboard><culture>","1","0","","",""
"4324341","1","","","2010-12-01 12:28:52","3","2211","<p>What the title says really. I need to stream the audio from the microphone on the telephone and play it in a desktop application (also Java code) on a computer.</p><p>Using UDP or TCP does not matter for me, whatever works best. Phone and computer will be on same NAT anyway so transmission will work fine.</p><p>I have a fair idea of how to send the stream data from the device using this code:</p><pre><code>MediaRecorder recorder = new MediaRecorder();recorder.setAudioSource(MediaRecorder.AudioSource.MIC);recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);String host = ""10.0.2.2"";int port = 5740;Socket socket = null;try {    socket = new Socket(InetAddress.getByName(host), port);    ParcelFileDescriptor pfd = ParcelFileDescriptor.fromSocket(socket);    recorder.setOutputFile(pfd.getFileDescriptor());    recorder.prepare();    recorder.start();    Log.d(TAG, ""Sending audio for 20 seconds.."");    Thread.sleep(20000);    } catch (Exception e) {         // TODO Auto-generated catch block        e.printStackTrace();            }</code></pre><p>The problem is, how do I play this stream in my java application on the PC?Or is there a better way to stream the sound?</p><p>I have mined the internet for information on this but without any good results but surely somebody must have accomplished this before?</p><p>Thanks in advance for any kind of help!</p>","473596","","","","","2011-07-05 05:07:59","Streaming audio from Android to desktop application","<android><audio><streaming><java>","3","0","3","",""
"4324362","1","","","2010-12-01 12:31:22","26","43506","<p>I'm currently fiddling around with Android programming, but I have a small problem detecting different touch events, namely a normal touch press (press on the screen and release right away), a long press (touch the screen and hold the finger on it) and movement (dragging on the screen).</p><p>What I wanted to do is have an image (of a circle) on my screen which I can drag around. Then when I press it once (short/normal press) a Toast comes up with some basic information about it. When I long press it, an AlertDialog with a list comes up to select a different image (circle, rectangle or triangle).</p><p>I made a custom View with my own OnTouchListener to detect the events and draw the image in onDraw. The OnTouchListener.onTouch goes something like this:</p><pre><code>// has a touch press started?private boolean touchStarted = false;// co-ordinates of imageprivate int x, y;public boolean onTouch(View v, MotionEvent event) {    int action = event.getAction();    if (action == MotionEvent.ACTION_DOWN) {        touchStarted = true;    }    else if (action == MotionEvent.ACTION_MOVE) {        // movement: cancel the touch press        touchStarted = false;        x = event.getX();        y = event.getY();        invalidate(); // request draw    }    else if (action == MotionEvent.ACTION_UP) {        if (touchStarted) {            // touch press complete, show toast            Toast.makeText(v.getContext(), ""Coords: "" + x + "", "" + y, 1000).show();        }    }    return true;}</code></pre><p>The problem is that the press doesn't quite work as expected, because when I casually touch the screen it also detects a tiny bit of movement and cancels the touch press and moves around the image instead.</p><p>I ""hacked"" around this a bit my introducing a new variable ""mTouchDelay"" which I set to 0 on ACTION_DOWN, increase in MOVE and if it's >= 3 in MOVE I execute my ""move"" code. But I have a feeling this isn't really the way to go.</p><p>I also haven't found out how to detect a long press. The culprit really is the MOVE which seems to always trigger.</p><p>For an example of what I roughly want, see the Android application ""DailyStrip"": it shows an image of a comic strip. You can drag it if it's too large for the screen. You can tap it once for some controls to pop-up and long press it for an options menu.</p><p>PS. I'm trying to get it to work on Android 1.5, since my phone only runs on 1.5.</p>","504451","","942852","","2012-11-14 10:15:05","2014-04-10 10:02:42","Detect touch press vs long press vs movement?","<android><touch><move><long-press>","8","1","3","",""
"4324447","1","7355851","","2010-12-01 12:41:56","2","565","<p>I'm trying to get the total number transmitted bytes from the device (using <a href=""http://developer.android.com/reference/android/net/TrafficStats.html#getMobileTxBytes%28%29"" rel=""nofollow"">getMobileTxBytes()</a>.</p><p>The number i'm getting from the method call in the emulator is -1 (which means that this method not supported on the device).Is there any way to make the emulator return a reasonable number here? the best would be a number that will increase as i'm browsing the web in the emulator.</p>","16418","","","","","2012-10-01 09:57:41","Is it possible to enable TrafficStats on android emulator?","<android><android-emulator><traffic-measurement>","1","0","1","",""
"4324467","1","4324768","","2010-12-01 12:44:14","1","1136","<p>I've been trying to set-up a ProgressDialog (which somewhat works), but it seems to freeze (the animation of the little wheel thing) after about 2-3 spins. The data does eventually load, and the ProgresssDialog gets dismissed - so, all works fine, other than the fact that it freezes after 2-3 spins.</p><p>Here's a snip of the code:</p><pre><code>// setting up loadersummaryLoader = ProgressDialog.show(SummaryView.this, """", ""Loading summary..."", false, true);// settings up and starting the helper thread that's going to load the summery dataThread t = new Thread() {  @Override  public void run() {    _populateSummary();  }};t.start();</code></pre><p>I'm running this on an Entourage Edge running Android 1.6.</p><p>I did read about some issues with 1.6 and the animation freezing, but I thought I'd give this a shot and see if anyone here has some ideas.</p>","380579","","","","","2010-12-01 13:24:01","ProgressDialog loading animation stuck/frozen after 2-3 spins","<android><animation><freeze><progressdialog>","1","0","","",""
"4324480","1","6399682","","2010-12-01 12:45:50","1","1112","<p>Hhow do I determine weather or not the accelerometer would report a roll of zero when the bottom <strong>long</strong> side of the screen is facing the ground?</p><p>I need to do this without instructing the user to hold the phone in a certain position.  I am hoping to be able to do something like...</p><pre><code>Context.getResources().getConfiguration().getNaturalOrientation == Orientation.LANDSCAPE</code></pre><p>*<strong>IMPORTANT: The above line of code is not possible; it's just an example of what I would like to do</strong></p>","481009","","","","","2011-06-19 00:06:09","How do I determine if an android device is naturally landscape or portrait?","<android><accelerometer>","2","0","","",""
"4324659","1","4324712","","2010-12-01 13:08:32","5","3935","<p>I have audio recording, when a phone call come I need to stop the recording, how can I do this?</p>","487219","","1006836","","2012-11-29 09:32:57","2013-04-03 08:28:28","Android Handle phone call","<android><telephonymanager>","2","0","3","",""
"4324772","1","","","2010-12-01 13:24:28","1","453","<p>I'm facing a basic problem but i didn't find any tutorial in order to help me... </p><p>I'm writing an application with sort of backup contact options. I want that my applications works for android phones since 1.5 to 2.2 </p><p>So i write a two implementation of ContactApi, one for 1.5, 1.6 and an other for new api version. </p><p>Here is the list of problem I'm facing with. </p><p>With new api, nothing. All works fine, backing up contacts works well. </p><p>But with older api I'm not able to backing up some datas : </p><ul><li>Email Datas (able to read, but not able to save) </li><li>IM datas (able to read, but not able to save) </li><li>Notes (able to read the first note, if many notes, I lost datas, same things for backup) </li></ul><p>Here is the code I'm using : </p><p>=======EMAIL======= <code></p><pre><code>private ArrayList&lt;Email&gt; getEmailAddresses(String id) {             ArrayList&lt;Email&gt; emails = new ArrayList&lt;Email&gt;();             Cursor emailCur = this.contentResolver.query(Contacts.ContactMethods.CONTENT_EMAIL_URI, null, Contacts.ContactMethods.PERSON_ID + "" = ?"", new String[] { id }, null);             Email email = null;             while (emailCur.moveToNext()) {                     // This would allow you get several email addresses                     email = new Email();                     email.setData(emailCur.getString(emailCur.getColumnIndex(Contacts.ContactMe thods.DATA)));                     email.setType(emailCur.getInt(emailCur.getColumnIndex(Contacts.ContactMetho ds.TYPE)));                     email.setLabel(emailCur.getString(emailCur.getColumnIndex(Contacts.PeopleCo lumns.NAME)));                     emails.add(email);             }             emailCur.close();             return emails;     } private void saveEmailAddresses(ContentUris contactUri, List&lt;Email&gt; emailList, String id) {             if (emailList != null &amp;&amp; emailList.size() &gt; 0) {                     ContentValues values = null;                     ContentValues[] valueArray = new ContentValues[emailList.size()];                     int i = 0;                     for (Email email : emailList) {                             values = new ContentValues();                             values.put(Contacts.ContactMethods.PERSON_ID, id); //                             values.put(Contacts.ContactMethods.KIND, Contacts.KIND_EMAIL); //                             values.put(Contacts.ContactMethods.DATA, email.getData()); //                             values.put(Contacts.ContactMethods.TYPE, email.getType()); //                             values.put(Contacts.PeopleColumns.NAME, email.getLabel()); //                             valueArray[i] = values;                             i++;                     }                     contentResolver.bulkInsert(Contacts.ContactMethods.CONTENT_EMAIL_URI, valueArray);             }     } </code></pre><p></code></p><p>======== IM adress============= </p><p><code></p><pre>private ArrayList&lt;IM&gt; getIM(Cursor cur, String id) {                 ArrayList&lt;IM&gt; imList = new ArrayList&lt;IM&gt;();                 String where = Contacts.ContactMethods.PERSON_ID + "" = ? AND "" +     Contacts.ContactMethods.KIND + "" = ?"";                 String[] whereParameters = new String[] { id, String.valueOf(Contacts.KIND_IM) };                 Cursor imCur = this.contentResolver.query(Contacts.ContactMethods.CONTENT_URI, null, where, whereParameters, null);                 IM im = null;                 while (imCur.moveToNext()) {                         try {                                 String imName = imCur.getString(imCur.getColumnIndex(Contacts.ContactMethodsColumns.DATA));                                         im = new IM();                                         im.setName(imName); im.setType(imCur.getInt(imCur.getColumnIndex(Contacts.ContactMethodsColumns .TYPE))); im.setProtocol(cur.getString(imCur.getColumnIndex(Contacts.ContactMethods.A UX_DATA)));                                         imList.add(im);                         } catch (Exception e) {                                 Log.e(where, ""Error im : "", e);                         }                 }                 imCur.close();                 return imList;         }         private void saveIM(List&lt;IM&gt; imList, String id) {                 if (imList != null &amp;&amp; imList.size() &gt; 0) {                         ContentValues values = null;                         ContentValues[] valueArray = new ContentValues[imList.size()];                         int i = 0;                         for (IM im : imList) {                                 values = new ContentValues();                                 values.put(Contacts.ContactMethods.PERSON_ID, id); //                                 values.put(Contacts.ContactMethods.KIND, Contacts.KIND_IM); //                                 values.put(Contacts.ContactMethodsColumns.DATA, im.getName()); //                                 values.put(Contacts.ContactMethods.AUX_DATA, ContactMethods.encodeCustomImProtocol(im.getProtocol())); //                                 values.put(Contacts.ContactMethodsColumns.TYPE, im.getType()); //                                 valueArray[i] = values;                                 i++;                         }                         contentResolver.bulkInsert(Contacts.ContactMethods.CONTENT_URI, valueArray);                 }         } </code></pre><p>==========Notes ======= </p><p>I have no idea how to get all notes ? </p><p>Can someone help me with this ? </p>","526598","","244296","","2010-12-01 13:25:42","2012-11-28 13:18:44","Contact API problem with save datas Options","<android><contact>","1","0","","",""
"4324818","1","4324868","","2010-12-01 13:30:01","2","1062","<p>What i am trying to do is catch a Button click that is inside a ListView managed by a CustomCursorAdapter. when clicked i need to make the button invisible and update a value in the database. here is the code i am using for the ListActivity and the CursorAdapter.</p><pre><code>public class MainTabView extends ListActivity{/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    fillListData();}private void fillListData(){ DataBaseNamesHelper myDbNamesHelper = new DataBaseNamesHelper(this); myDbNamesHelper.openDataBase(); Cursor cursor = myDbNamesHelper.getCursorQueryWithAllTheTaxiStations(); startManagingCursor(cursor);   // the desired columns to be bound    String[] columns = new String[] { DataBaseNamesHelper.COLUMN_NAME, DataBaseNamesHelper.COLUMN_PEOPLE};    // the XML defined views which the data will be bound to    int[] to = new int[] { R.id.name_entry, R.id.number_entry };    // create the adapter using the cursor pointing to the desired data as well as the layout information    CustomCursorAdapter mAdapter = new CustomCursorAdapter(this, R.layout.list_entry, cursor, columns, to);    // set this adapter as your ListActivity's adapter    this.setListAdapter(mAdapter);       this.getListView().setOnItemClickListener(mAdapter);    myDbNamesHelper.close();}</code></pre><p>and the Adapter:</p><pre><code>public class CustomCursorAdapter extends SimpleCursorAdapter implements SectionIndexer,Filterable,     android.widget.AdapterView.OnItemClickListener{private Context context;private int layout;private AlphabetIndexer alphaIndexer;public CustomCursorAdapter (Context context, int layout, Cursor c, String[] from, int[] to) {    super(context, layout, c, from, to);    this.context = context;    this.layout = layout;    alphaIndexer=new AlphabetIndexer(c, c.getColumnIndex(DataBaseNamesHelper.COLUMN_NAME), "" ABCDEFGHIJKLMNOPQRSTUVWXYZ"");}@Overridepublic View newView(Context context, Cursor cursor, ViewGroup parent) {    Cursor c = getCursor();    final LayoutInflater inflater = LayoutInflater.from(context);    View v = inflater.inflate(layout, parent, false);    int nameCol = c.getColumnIndex(DataBaseNamesHelper.COLUMN_NAME);    String name = c.getString(nameCol);    /**     * Next set the name of the entry.     */    TextView name_text = (TextView) v.findViewById(R.id.name_entry);    if (name_text != null) {        name_text.setText(name);    }    int favCol = c.getColumnIndex(DataBaseNamesHelper.COLUMN_FAVOURITED);    int fav = c.getInt(favCol);    Button button = (Button) v.findViewById(R.id.Button01);    if(fav==1){     button.setVisibility(View.INVISIBLE);    }    return v;}@Overridepublic void bindView(View v, Context context, Cursor c) {    int nameCol = c.getColumnIndex(DataBaseNamesHelper.COLUMN_NAME);    String name = c.getString(nameCol);    /**     * Next set the name of the entry.     */    TextView name_text = (TextView) v.findViewById(R.id.name_entry);    if (name_text != null) {        name_text.setText(name);    }    int favCol = c.getColumnIndex(DataBaseNamesHelper.COLUMN_FAVOURITED);    int fav = c.getInt(favCol);    Button button = (Button) v.findViewById(R.id.Button01);    Log.e(""fav"",String.valueOf(fav));    if(fav==1){     button.setVisibility(View.INVISIBLE);    }} @Override public int getPositionForSection(int section) {  return alphaIndexer.getPositionForSection(section); } @Override public int getSectionForPosition(int position) {    return alphaIndexer.getSectionForPosition(position); } @Override public Object[] getSections() {    return alphaIndexer.getSections(); } @Override public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {  Log.e(""item Click"", arg1.toString()+ "" position&gt; "" +arg2); }</code></pre><p>i have already set the button to be clickable(true) and focusable(false). </p><p>with this code i can achieve what i want but by clicking the listView row (logs only item clicks on the LinearLayout that is holding the button. how do i make the button receive click exactly the same as LinearLayout does?</p><p>here is the row layout:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:orientation=""horizontal"" android:focusable=""false""&gt; &lt;TextView  android:id=""@+id/name_entry""  android:layout_height=""wrap_content""  android:textSize=""28dip"" android:layout_width=""wrap_content"" android:layout_weight=""1"" android:layout_gravity=""center_vertical""/&gt;       &lt;Button android:id=""@+id/Button01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Fav"" android:layout_gravity=""center_vertical"" android:layout_marginRight=""10dp"" android:focusable=""false"" android:clickable=""true""&gt;&lt;/Button&gt;&lt;TextView  android:id=""@+id/number_entry""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textSize=""28dip"" /&gt;&lt;/LinearLayout&gt;</code></pre>","448192","","","","","2010-12-01 14:36:36","Problem registering clicks on Button on CustomCursorAdapter in a ListView","<android><listview><button><onclick>","2","0","","",""
"4324889","1","","","2010-12-01 13:38:54","2","1561","<p>I have a listview where i need to show contact pictures and its details.Format :   </p><p>The vertical separator is not showing up at al! Here is my layout file for listitem: [Using relative layout here as I have some more views to be added in the list relatively]</p><p></p><pre><code>&lt;ImageButton android:id=""@+id/pic""                                  android:layout_alignParentTop=""true""                                  android:layout_alignParentLeft=""true""/&gt;      &lt;ImageView android:id=""@+id/vertical_separator""           android:orientation=""vertical""           android:layout_width=""wrap_content""           android:layout_height=""fill_parent""           android:background=""@android:drawable/divider_vertical_bright""           android:layout_toRightOf=""@id/badge""           android:layout_alignWithParentIfMissing=""true""/&gt;                                &lt;TextView android:id=""@+id/details""          android:layout_toRightOf=""@id/verticalseparator""          android:layout_alignTop=""@id/badge""          android:layout_alignWithParentIfMissing=""true""/&gt;</code></pre><p></p><p>Even though the height is ""fill_parent"" , the divider is shown as a small dot after the contact picture. I tried changing the width to 2dp ..but still the same.</p><p>--I use a ListAdapter to this type to fill in the list: </p><p>Am I missing anything here? The horizontal divider is shown correctly, but not the vertical divider</p>","526548","","750987","","2011-05-28 13:02:59","2011-05-28 13:57:58","Vertical divider in android listview not working","<android><android-layout><android-listview>","1","0","","",""
"4324937","1","","","2010-12-01 13:44:21","0","1335","<p>I have a table with a composite primary key and I am having trouble inserting. The code used to create the table is:</p><pre><code>CREATE TABLE ClassEvent (    EventName varchar(10) NOT NULL,     CourseId varchar(10) NOT NULL,     EventType varchar(20),     EventWeight number(3),     DueDate DATE NOT NULL,     FOREIGN KEY (CourseId) REFERENCES Courses(CourseId),     PRIMARY KEY (CourseId, EventName));</code></pre><p>The problem I am having is when I want to insert records that have values that may not be unique for the columns CourseId or EventName, but are a unique combination of the 2.for example, if I try to run the following 2 inserts:</p><pre><code>INSERT INTO ClassEvent VALUES('Assignment 1','60-415','Assignment',10,'12/10/2010');INSERT INTO ClassEvent VALUES('Project 1','60-415','Project',15,'5/12/2010');</code></pre><p>I get the following error:</p><pre><code>Error: columns CourseId, EventName are not unique.</code></pre><p>and the second insert does not make it into the DB. Why does this error out? I thought that a composite primary key requires that the <strong>combination</strong> of both values are unique. In my above inserts, the values for the EventName column are different even though the values for CourseId are the same. Shouldn't this be seen as 2 unique combinations and thus 2 different primary keys?</p><p>My table needs to be able to hold several different events for each CourseId, but each Event must be unique for each Course. I need to be able to insert values into the table like:</p><p>EventName        CourseIdAssignment 1     60-415Project 1        60-415Assignment2      60-415Project 2        60-415Assignment 1     60-367Project 1        60-367</p><p>and so on. Can anyone tell me how I can get this to work? Why are these composite PK's not being seen as unique entries? Any help would be much appreciated. </p><hr><p>Here is the java function I am using for the insert:</p><pre><code>public void addNewClassEvent(ContentValues values) {    SQLiteDatabase db = openConnection();    db.insert(""ClassEvent"", null, values);    db.close();}</code></pre><p>Could this be causing the problem?</p>","525909","","21234","","2012-03-16 09:56:29","2012-03-16 09:56:29","Problem with inserting into android sqlite3 table that has composite primary key","<android><sqlite3><insert><composite-primary-key>","2","0","","",""
"4324986","1","11075537","","2010-12-01 13:48:25","1","2575","<p>My Android app can only function with WiFi connected to the Internet. Thus, I use the following code to check if the device is connected:</p><pre><code>ConnectivityManager conMgr = (ConnectivityManager)getSystemService(Activity.CONNECTIVITY_SERVICE);boolean wifi = conMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnected();</code></pre><p>However, very often when the application is launched and WiFi connected to the Internet, I get the notification that is only shown when <code>wifi = false</code>. Have I missed something, or the check is not that accurate?</p>","519908","","","","","2012-06-17 23:16:12","Problem: Android's isConnected() used to get current state of WiFi often returns false even when the device is connected","<android><connection><wifi>","2","3","","",""
"4325006","1","","","2010-12-01 13:50:49","0","725","<p>I was experimenting with Android development, and created a small application, which puts the phone on silent when theres an incoming call. </p><p>It worked fine on my phone, so I also installed it on my friends phone. Though he uninstalled it later, his phone still goes into the silent mode whenever he gets a phone call (after one ring in normal mode). </p><p>I searched everywhere, but neither could I find any process nor service of mine running. It is not present under the task manager (he also tried listing by package).The application is not present in the ""Manage Applications"" menu either.</p><p>Any idea how I can completely delete the application from his phone and why is it behaving this way ?</p><p>PS: All these problems are being caused by a Broadcast Receiver.</p><p>Thanks,Abhinav</p>","526635","","","","","2010-12-01 13:50:49","Android - application still runs after uninstall","<android><uninstall><broadcastreceiver>","0","5","","",""
"4325067","1","","","2010-12-01 13:58:01","0","259","<p>I have a app that works correctly in my phone(1.6), and in the emulator (2.0 and 2.1) but for some people it throw this excepcition.¿how can i get more information about what make this exception happen(ie line number, android version)¿How can i reproduce this problem in the emulator?</p><p>Thanks</p><p>java.lang.NumberFormatException: gabat java.lang.Long.parse(Long.java:364)at java.lang.Long.parseLong(Long.java:354)at java.lang.Long.parseLong(Long.java:320)at android.database.MatrixCursor.getLong(MatrixCursor.java:255)at android.database.CursorWrapper.getLong(CursorWrapper.java:132)at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1313)at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1194)at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1068)at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1051)at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:285)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)</p><hr>","526648","","","","","2010-12-01 13:58:01","exception in android app","<android><exception>","0","2","","",""
"4325073","1","10154139","","2010-12-01 13:58:43","15","10047","<p>My Android application may save logcat logs to a file. This log file is then sent to developers for analysis.</p><p>Is there a nice <strong><em>desktop</em></strong> android log viewer application, which would visualize these logs?</p><p>I wasn't able to find a ready to use tool in Android SDK. Maybe I missed something there?</p>","69802","","","","","2013-10-14 05:32:18","Android desktop log viewer","<android><logging><log-viewer>","7","1","4","",""
"4325201","1","4325257","","2010-12-01 14:11:14","2","5644","<p>I am developing a simple application with an ImageView, when the ImageView is clicked the application should open the device Image gallery. to achieve this i am using the following code</p><pre><code>    Intent imageIntent=new Intent(Intent.ACTION_PICK);    imageIntent.setType(""image/*"");    startActivityForResult(imageIntent,5);</code></pre><p>And the ActivityResult</p><pre><code>super.onActivityResult(requestCode, resultCode, data);if(requestCode == 5)    {        Cursor cursor;        Uri uri=data.getData();             if(uri!=null)        {            cursor=getContentResolver().query(uri, new String[]{ android.provider.MediaStore.Images.ImageColumns.DATA },                    null, null, null);            cursor.moveToFirst();            String imageID=cursor.getString(0);            personImage.setImageURI(uri);            Log.i(""ImageId"", """"+imageID);            cursor.close();        }    }</code></pre><p>The selected image is displayed in the ImageView. Now the problem is when i am doing it second time i am getting the following exception.</p><pre><code>12-01 19:31:52.344: ERROR/AndroidRuntime(2011): FATAL EXCEPTION: main12-01 19:31:52.344: ERROR/AndroidRuntime(2011): java.lang.OutOfMemoryError:  bitmap      size exceeds VM budget12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:468)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:332)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.graphics.drawable.Drawable.createFromStream(Drawable.java:657)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.widget.ImageView.resolveUri(ImageView.java:572)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.widget.ImageView.setImageURI(ImageView.java:293)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at com.css.testsample.ReadImage.onActivityResult(ReadImage.java:36)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.app.Activity.dispatchActivityResult(Activity.java:3931)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3730)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3776)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.app.ActivityThread.access$2800(ActivityThread.java:135)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2166)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.os.Handler.dispatchMessage(Handler.java:99)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.os.Looper.loop(Looper.java:144)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at android.app.ActivityThread.main(ActivityThread.java:4937)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at java.lang.reflect.Method.invokeNative(Native Method)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at java.lang.reflect.Method.invoke(Method.java:521)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-01 19:31:52.344: ERROR/AndroidRuntime(2011):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I dont know how to handle this problem, if anybody knows it please help me.</p><p>Thanks and Regards,Rajapandian.K</p>","131062","","","","","2012-05-09 07:08:13","Getting Out of memory error when reading images from SDcard","<android>","1","0","","",""
"4325215","1","","","2010-12-01 14:13:09","0","377","<p>I am adding an API in the form of a shared library to Android. The API gives developers access to a service that for a bunch of different reasons needs to be a part of the Android Framework and hence has been placed there (it resides in a folder separate from ""Android"" in base/services/java/com).This all works nice and smooth, but the problem is that the service has to access the API too. Specifically, the service has to instantiate, update and delegate objects of classes from the API. This created a circular dependency between the API and the service, which the Android build system didn't seem to like very much. I did away with the API->Service dependency, but the other way around I can't do anything about.</p><p>Trying to build, I get build errors originating in the service, saying that the package from the shared library doesn't exist, and it follows that the rest of the errors are symbols that can't be found. I've tried to tinker with the .mk files, but to no avail. It seems if I try to instruct the build system that the framework depends on my lib, it will try to build that lib first - which will make it croak because building the lib at that point will fail due to the framework not having been built first.. or so I've come to understand the problem.</p><p>Surely there must be some way of telling the build system to LOOK at the lib without actually building it? Like a forward declaration of sorts? All other build systems since the age of the dinosaurs have been able to handle this type of catch-22 situations, but I just can't seem to be able to figure out how to make this one behave. Anyone else know how to do this? I can't be the first one to struggle with this, so I'm confident someone out there knows what to do.</p>","386440","","","","","2010-12-01 14:13:09","How do I resolve a circular dependency between the Android Framework and a shared lib?","<android><api><frameworks>","0","2","","",""
"4325349","1","4325448","","2010-12-01 14:27:47","2","826","<p>whats this file ?!!! i don't delete it !! java.io.FileNotFoundException: res/drawable-mdpi/scrollbar_handle_vertical.9.png</p><pre><code>12-06 14:26:33.606: ERROR/AndroidRuntime(276): FATAL EXCEPTION: main    12-06 14:26:33.606: ERROR/AndroidRuntime(276): android.view.InflateException: Binary XML file line #101: Error inflating class &lt;unknown&gt;    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at ayanoo.forms.UserView.&lt;init&gt;(UserView.java:50)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at ayanoo.forms.SearchResultForm.addUser(SearchResultForm.java:124)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at ayanoo.forms.SearchResultForm.doSearch(SearchResultForm.java:105)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at ayanoo.forms.SearchResultForm$1.onClick(SearchResultForm.java:55)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.View.performClick(View.java:2408)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.View$PerformClick.run(View.java:8816)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.os.Handler.handleCallback(Handler.java:587)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.os.Handler.dispatchMessage(Handler.java:92)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.os.Looper.loop(Looper.java:123)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.main(ActivityThread.java:4627)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invokeNative(Native Method)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invoke(Method.java:521)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at dalvik.system.NativeStart.main(Native Method)    12-06 14:26:33.606: ERROR/AndroidRuntime(276): Caused by: java.lang.reflect.InvocationTargetException    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.widget.Button.&lt;init&gt;(Button.java:65)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at java.lang.reflect.Constructor.constructNative(Native Method)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     ... 22 more    12-06 14:26:33.606: ERROR/AndroidRuntime(276): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/scrollbar_handle_vertical.9.png from drawable resource ID #0x7f060057    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.content.res.Resources.loadDrawable(Resources.java:1714)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.view.View.&lt;init&gt;(View.java:1885)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.widget.TextView.&lt;init&gt;(TextView.java:327)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.widget.Button.&lt;init&gt;(Button.java:69)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     ... 26 more    12-06 14:26:33.606: ERROR/AndroidRuntime(276): Caused by: java.io.FileNotFoundException: res/drawable-mdpi/scrollbar_handle_vertical.9.png    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.content.res.AssetManager.openNonAssetNative(Native Method)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.content.res.AssetManager.openNonAsset(AssetManager.java:405)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     at android.content.res.Resources.loadDrawable(Resources.java:1706)    12-06 14:26:33.606: ERROR/AndroidRuntime(276):     ... 30 more    12-06 14:26:56.035: ERROR/MetadataRetrieverClient(33): failed to extract an album art</code></pre>","508377","","","","","2010-12-01 14:40:13","I've an exception when run android application (java.io.FileNotFoundException)?","<android>","2","1","1","",""
"4325529","1","4325578","","2010-12-01 14:47:34","2","1739","<p>I've been able to find a few posts on StackOverflow about how to control USB devices using an Android phone -- which I understand is impossible (The Android being a USB device and all.)</p><p>However, I would be perfectly happy to set up my application to communicate with the other computer (a Linux host) as a USB device.  (Like a really expensive mouse...)</p><p>Does anybody have information about how to set up an Android app/phone to use the USB connection and exchange data with a host computer.  Obviously, it already works at some level -- it's how Eclipse and Android SDK/debugger do what they do, but I'm still looking for some way to do this in an application.</p><p>(My current phone, BTW, is a Droid Incredible.)</p><p>Thanks,R.</p>","453989","","","","","2010-12-10 22:44:09","Using My Android as a USB Device","<android><usb>","1","5","1","",""
"4325554","1","","","2010-12-01 14:49:16","0","364","<p>I'm currently trying to build a little application on android that is using a webspace but the problem ist that if I want to download a ksoap2 package (e.g. ksoap2 with all dependencies 2.5.2 from <a href=""http://code.google.com/p/ksoap2-android/source/browse/#svn/m2-repo/com/google/code/ksoap2-android/ksoap2-android-assembly/2.5.2"" rel=""nofollow"">here</a>) the filesize is 21.6KB after downloading. But the table says 141KB.</p><p>This is resulting into printing out errors when I try to import it as an external library (not compatible to Dalvik) which is un derstandable because the archive is corrupt/broke.</p><p>Can someone give me a link where can download a proper .jar-archive?</p><p>(2nd question: how do I use the javadocs? do I have to set them into the path if I click on the external libraries dialog->ksoap2...->javadoc ?)</p><p>thanks in advance</p>","526709","","526709","","2010-12-01 15:40:30","2010-12-02 15:02:39","Broken Package links for ksoap2 .jars?","<java><android><ksoap2><android-ksoap2>","1","1","","",""
"4325587","1","4325762","","2010-12-01 14:53:33","3","9336","<p>is there the way to customize a DatePicker? That is my Layout-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=""wrap_content""&gt;    &lt;LinearLayout        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:gravity=""center_horizontal""         android:orientation=""vertical""&gt;        &lt;DatePicker             android:id=""@+id/ad_date_picker""            android:layout_height=""wrap_content""            android:layout_width=""wrap_content""            android:layout_margin=""5dp""/&gt;        &lt;TimePicker                     android:id=""@+id/ad_time_picker""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""             android:layout_margin=""5dp""/&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>In that case the date format of the DatePicker is MM-DD-YYYY and I'd like to have it in DD-MM-YYYY, and if it's also possible I'd like to have month's shortname instead of number.</p><p>I've tried to find, how to do it, but without success.</p><p>Thank you,</p><p>Mur</p>","408780","","","","","2013-06-07 13:04:34","Customize DatePicker. Android","<android><layout><datepicker>","1","1","","",""
"4325611","1","4325936","","2010-12-01 14:56:11","0","761","<p>Android icon guidelines says to use icon of size 36*36pixels for ldpi and 48*48 for mdpi 72*72pixels for hdpi (http://developer.android.com/guide/practices/ui_guidelines/icon_design.html). What is value that i should give as pixels per inch while creating the icon?(Photoshop shows 72 pixels/inch as default value while creating a new icon)</p>","110024","","","","","2010-12-01 15:29:14","default resoultion for android launcher icon","<android>","1","0","","",""
"4325615","1","4326164","","2010-12-01 14:56:30","0","450","<p>Well, to give you a bit of history on this project - I'm parsing a string that's about 100k in a child thread, and returning the Spanned object from Html.fromHtml(). </p><p>The issue is when it returns to the main thread - when trying to setText using the Spanned that was just created in another thread, it takes quite a long time processing it from a Spanned object into a displayable format (setText).</p><p>I would normally process this in the child thread, but unfortunately, since this is related to the UI, I can't - has to be on the main thread. So, my question is whether there is a way to process the Spanned into something easily interpreted by the setText, so that it doesn't spend a lot of time on the main thread processing it after the child thread has finished.</p><pre><code>testQuestionsExplanations.setText(spannedExplanationsObj);</code></pre><p>My biggest issue is that it locks the main thread down doing this.</p>","380579","","","","","2010-12-01 15:51:15","Processing large Spanned objects with TextView (setText)","<android><multithreading><textview><spanned>","1","0","","",""
"4325628","1","4326912","","2010-12-01 14:57:54","5","10863","<p>I'm learning about Android dialogs and I'm confused about what determines their height.   If I use this XML for my dialog 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=""wrap_content""  android:layout_height=""wrap_content""&gt;  &lt;Button     android:id=""@+id/AButton""     android:layout_height=""wrap_content""     android:layout_width=""wrap_content""     android:layout_alignParentRight=""true""     android:layout_marginLeft=""10px""     android:text=""Click Me to Dismiss""  /&gt;   &lt;TextView android:id=""@+id/text""    android:layout_width=""wrap_content""    android:layout_height=""fill_parent""    android:layout_toLeftOf=""@id/AButton""    android:text=""Click this button: ""     /&gt;   &lt;ImageView    android:id=""@+id/an_image""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginLeft=""42px""    android:src=""@drawable/screw50""&gt;  &lt;/ImageView&gt;        /&gt;</code></pre><p>I get this dialog . . . </p><p><img src=""http://i.stack.imgur.com/RKxfv.jpg"" alt=""alt text""></p><p>But Developer.Android.com says that... </p><p>""*WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content (plus padding)*""</p><p>... so why is the dialog so much higher than it needs to be?</p><p>If I replace the layout height with </p><pre><code>  android:layout_height=""200px""</code></pre><p>it makes a properly short dialog but I don't want to use explicit pixel heights (it's not good practice).    How do I make the dialog be just big enough for its content?</p>","424690","","","","","2011-07-26 15:45:47","Android custom dialog height","<android><dialog>","3","0","","",""
"4325639","1","","","2010-12-01 14:58:44","67","81006","<p>I am trying to call some javascript functions sitting in an html page running inside an android webview.  Pretty simple what the code tries to do below - from the android app, call a javascript function with a test message, which inturn calls a java function back in the android app that displays test message via toast.</p><p>The javascript function looks like:</p><pre><code>function testEcho(message){     window.JSInterface.doEchoTest(message);}</code></pre><p>From the WebView, I have tried calling the javascript the following ways with no luck:</p><pre><code>myWebView.loadUrl(""javascript:testEcho(Hello World!)"");mWebView.loadUrl(""javascript:(function () { "" + ""testEcho(Hello World!);"" + ""})()"");</code></pre><p>I did enable javascript on the WebView</p><pre><code>myWebView.getSettings().setJavaScriptEnabled(true);// register class containing methods to be exposed to JavaScriptmyWebView.addJavascriptInterface(myJSInterface, ""JSInterface""); </code></pre><p>And heres the Java Class</p><pre><code>public class JSInterface{private WebView mAppView;public JSInterface  (WebView appView) {        this.mAppView = appView;    }    public void doEchoTest(String echo){        Toast toast = Toast.makeText(mAppView.getContext(), echo, Toast.LENGTH_SHORT);        toast.show();    }}</code></pre><p>I've spent a lot of time googling around to see what I may be doing wrong.  All examples I have found use this approach.  Does anyone see something wrong here?</p><p>Edit:  There are several other external javascript files being referenced &amp; used in the html, could they be the issue?</p>","163757","","163757","","2010-12-01 15:46:25","2013-07-28 16:47:54","Android Calling JavaScript functions in WebView","<javascript><android><webview>","5","3","46","",""
"4325669","1","4325836","","2010-12-01 15:02:17","23","26000","<p>I'm currently developing android application which includes text messaging. Is it possible to send and receive text messages just by using android emulator? If yes, how can I do it?</p>","516160","","","","","2014-03-21 09:23:49","Sending and receiving text using android emulator","<android><eclipse><sms><android-emulator>","6","1","14","2014-03-24 18:12:23",""
"4325689","1","4325767","","2010-12-01 15:04:01","0","158","<p>in my android app, i want to detect the user's device if the device has keyboard(like motorola milestone) and then show corresponding user interface. Do you guys know how to do that? thanks ! </p><p>regardsjusticepenny</p>","502958","","","","","2010-12-01 15:13:14","Android recognize cell phone with keyboard or not?","<java><android><android-layout>","2","0","","",""
"4325696","1","4337194","","2010-12-01 15:04:57","2","4936","<p>Recently I'm trying to use android's expandable list view, so I googled around and stumbled upon this</p><p><a href=""http://about-android.blogspot.com/2010/04/steps-to-implement-expandablelistview.html"" rel=""nofollow"">http://about-android.blogspot.com/2010/04/steps-to-implement-expandablelistview.html</a></p><p>I followed the steps almost exactly, but I created a file just to contain implementation of my own adapter. Basically on my onCreate method of the main activity I call:</p><pre><code>mEntries = findViewById(R.id.entries);    ExpandableListAdapter adapter = new MyExpandableListAdapter(this);mEntries.setAdapter(adapter);</code></pre><p>Here's the code (Taken from above URL and modified):</p><pre><code>import android.content.Context;import android.view.Gravity;import android.view.View;import android.view.ViewGroup;import android.widget.AbsListView;import android.widget.BaseExpandableListAdapter;import android.widget.TextView;public class MyExpandableListAdapter extends BaseExpandableListAdapter {    private String[] groups = {""Vehicle"", ""Baj""};    private String[][] children = {        {""Mol"", ""Mor""},        {""In"", ""Ruh""}    };    private Context cxt;    public MyExpandableListAdapter(Context cxt) {        this.cxt = cxt;    }    @Override    public Object getChild(int groupPos, int childPos) {        return children[groupPos][childPos];    }    @Override    public long getChildId(int groupPos, int childPos) {        return childPos;    }    @Override    public View getChildView(int groupPos, int childPos,            boolean isLastChild, View convertView, ViewGroup parent) {        TextView tv = getGenericView();        tv.setText(getChild(groupPos, childPos).toString());        return tv;    }    @Override    public int getChildrenCount(int groupPos) {        return children[groupPos].length;    }    @Override    public Object getGroup(int groupPos) {        return groups[groupPos];    }    @Override    public int getGroupCount() {        return groups.length;    }    @Override    public long getGroupId(int groupPos) {        return groupPos;    }    public TextView getGenericView() {        // Layout parameters for the ExpandableListView        AbsListView.LayoutParams lp = new AbsListView.LayoutParams(            ViewGroup.LayoutParams.FILL_PARENT, 64);        TextView tv = new TextView(this.cxt);tv.setLayoutParams(lp);        // Center the text vertically        tv.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);        // Set the text starting position        tv.setPadding(36, 0, 0, 0);        return tv;    }    @Override    public View getGroupView(int groupPos, boolean isExpanded, View convertView,            ViewGroup parent) {        TextView tv = getGenericView();        tv.setText(getGroup(groupPos).toString());        return null;    }    @Override    public boolean hasStableIds() {        return true;    }    @Override    public boolean isChildSelectable(int groupPos, int childPos) {        return true;    }}</code></pre><p>The logcat spit these:</p><pre><code>12-01 22:24:54.883: ERROR/AndroidRuntime(14424): java.lang.NullPointerException12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.AbsListView.obtainView(AbsListView.java:1276)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.ListView.makeAndAddView(ListView.java:1668)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.ListView.fillDown(ListView.java:637)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.ListView.fillFromTop(ListView.java:694)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.ListView.layoutChildren(ListView.java:1521)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.view.View.layout(View.java:6830)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.RelativeLayout.onLayout(RelativeLayout.java:900)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.view.View.layout(View.java:6830)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.view.View.layout(View.java:6830)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.view.View.layout(View.java:6830)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.view.View.layout(View.java:6830)snip...</code></pre><p>Anyone care to shed a light on this? =/</p><p>EDIT: I've already implemented the methods required in the Base class.</p><p>EDIT2:Code added</p>","135448","","135448","","2010-12-01 15:24:56","2010-12-02 16:20:40","Android ExpandableListView","<android>","2","0","","",""
"4325735","1","4325830","","2010-12-01 15:09:42","1","663","<p>I have 2 activities :</p><ul>- activity A is gathering data from internet (it takes some time)</ul><ul>- activity B is building UI elements based on the data previously received (it takes some time too)</ul><p>When activity A start downloading, the app enter a loading phase. When it's complete, activity B starts, so I have a transition between the views of A &amp; B. Then B requires also a loading phase.</p><p>I have loading - transition - loading - result which doesn't look nice at all.</p><p>I would like to have loading - transition - result where the loadings of both activities are grouped.</p><p>So my question is : is there a way to start the activity but to delay the transition ?</p>","526744","","","","","2010-12-01 15:47:24","Starting an Activity and delaying its transition","<android><views><activity><transition>","2","1","","",""
"4325924","1","","","2010-12-01 15:27:59","1","749","<p>i am trying to get information about a GSM cell such as signal strength, signal to noise ratio, and error rate. </p><p>getGsmSignalStrength() works fine, but getEvdoSnr() and getGsmBitErrorRate() always returns -1. Same results during a call.</p><p>Here is the code:</p><pre><code>private class MyPhoneStateListener extends PhoneStateListener {        @Override        public void onSignalStrengthsChanged(SignalStrength strength) {            super.onSignalStrengthsChanged(strength);            new AlertDialog.Builder(CellMonitorActivity.this)                .setTitle(""SNR"")                .setMessage(String.valueOf(strength.getEvdoSnr()))                .create()                .show();        }    }</code></pre>","526768","","","","","2010-12-01 15:27:59","SignalStrength methods","<android><signal-strength>","0","1","1","",""
"4326013","1","","","2010-12-01 15:36:36","0","1245","<p>HelloMy aim is to get the local address using the emulator sdk 2.2.I wrote this code but when I run it tell me to close the application. this is the code</p><pre><code>package exercice1.identificateur.ex;import java.net.InetAddress;import java.net.NetworkInterface;import java.net.SocketException;import java.util.Enumeration;import android.app.ListActivity;import android.os.Bundle;import android.util.Log;import android.widget.ArrayAdapter;import android.widget.TextView;import exercice1.identificateur.R;public class wifi1 extends ListActivity { private static final String LOG_TAG = null; public String getLocalIpAddress() {     try {         for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {             NetworkInterface intf = en.nextElement();             for (Enumeration enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {                 InetAddress inetAddress = enumIpAddr.nextElement();                 if (!inetAddress.isLoopbackAddress()) {                     return inetAddress.getHostAddress().toString();                 }             }         }     } catch (SocketException ex) {         Log.e(LOG_TAG, ex.toString());     }     return null; } public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  TextView tv = new TextView(this);       tv.setText(getLocalIpAddress());       setContentView(tv);   }}</code></pre><p>this is the manifest.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=""exercice1.identificateur""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".ex.wifi1""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;uses-configuration&gt;&lt;/uses-configuration&gt;&lt;uses-feature&gt;&lt;/uses-feature&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_WIFI_STATE""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.CHANGE_WIFI_STATE""&gt;&lt;/uses-permission&gt;&lt;uses-sdk&gt;&lt;/uses-sdk&gt;&lt;/manifest&gt; </code></pre><p>I hope that you can help me Thank you in advance</p><p>(I don't have a device, I use just the emulator installing in my PC. It is possible?) </p><p>[edit]The error:</p><pre><code>12-01 17:13:23.154: ERROR/ AndroidRuntime(511): FATAL EXCEPTION: main12-01 17:13:23.154: ERROR/ AndroidRuntime(511): java.lang.RuntimeException: Unable to start activity ComponentInfo{exercice1.identificateur/ exercice1.identificateur.ex.wifi1}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'</code></pre>","526776","","149841","","2011-12-05 09:31:32","2011-12-05 09:31:32","How to get the ip address with an emulator android","<android><android-emulator><ip-address><android-wifi><ipv4>","1","1","","",""
"4326037","1","5931094","","2010-12-01 15:38:18","16","9294","<p>I am trying to implement a resource data structure that includes an array of arrays, specifically strings.  The issue I run into is how to get the sub-array objects and their specific values.  Here is what my resource file looks like....</p><pre><code>&lt;resources&gt;   &lt;array name=""array0""&gt;     &lt;item&gt;       &lt;string-array name=""array01""&gt;         &lt;item name=""id""&gt;1&lt;/item&gt;         &lt;item name=""title""&gt;item one&lt;/item&gt;       &lt;/string-array&gt;     &lt;/item&gt;     &lt;item&gt;       &lt;string-array name=""array02""&gt;         &lt;item name=""id""&gt;2&lt;/item&gt;         &lt;item name=""title""&gt;item two&lt;/item&gt;       &lt;/string-array&gt;     &lt;/item&gt;     &lt;item&gt;       &lt;string-array name=""array03""&gt;         &lt;item name=""id""&gt;3&lt;/item&gt;         &lt;item name=""title""&gt;item three&lt;/item&gt;       &lt;/string-array&gt;     &lt;/item&gt;   &lt;/array&gt;&lt;/resources&gt;</code></pre><p>Then, in my Java code I retrieve the array and try to access the sub elements like so...</p><pre><code>TypedArray typedArray = getResources().obtainTypedArray(R.array.array0);TypedValue typedValue = null;typedArray.getValue(0, typedValue);</code></pre><p>At this point the typedArray object should represent the string-array ""array01"", however, I don't see how to retrieve the ""id"" and ""title"" string elements.  Any help would be appreciated, thanks in advance.</p>","60231","","","","","2011-05-08 23:28:11","Android Resource - Array of Arrays","<java><android><xml>","2","2","10","",""
"4326169","1","","","2010-12-01 15:51:32","2","567","<p>I developed a view based application for Android but I get navigation keys on the touch screen, up/down/select/ok. I do not need these keys and I want to remove them so that they don't show on the screen so that the application displays full screen. Anything to do with LWUIT? Help please.Thanks</p>","526792","","","","","2010-12-01 21:10:50","How can I remove on-screen keys in Eclipse built Android application","<android><eclipse><java-me><key><touchscreen>","1","1","","",""
"4326319","1","4327055","","2010-12-01 16:06:33","5","6095","<p>So far in my learning I have only come across spreading column sizes equally, giving one/two a higher priority to take as much space as they need, or setting the size of a column manually.</p><p>I was wondering if there was anyway of setting a column size in Android to be a fraction of the total table size. I want to split it into sixths. 1/6 for the first column, 3/6 for the second column and 2/6 for the third.</p><p>Is there any way to do this?</p>","348261","","461338","","2014-03-06 20:15:22","2014-03-06 20:15:22","Is there any way to make table columns equal to a fraction of the total width?","<android><android-layout><table><layout>","1","0","7","",""
"4326582","1","","","2010-12-01 16:33:31","0","701","<p>how can i how can I make it centered verrically and horizontally at the same time ??</p><pre><code>        android:gravity=""center_horizontal""</code></pre><p>??</p>","508377","","321697","","2010-12-01 17:26:53","2010-12-01 17:26:53","how to set item centered horizontally and vertically in android?","<android><gravity>","1","1","","",""
"4326794","1","","","2010-12-01 16:52:24","2","702","<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've created an sqlite3 database and a number of tables using SQLiteManager 3.5.1. However, i've no idea as to how i should be able to connect, access and use the database. Moreover, i also want to be able to modify the tables and the data in the tables. Is it possible to put the database (with the .sqlite extension) within the assets directory and work back and forth from the android to SQLiteManager?</p>","522784","","244296","","2010-12-01 16:59:04","2011-12-01 15:57:15","Working on sqlite 3 and Android","<android><eclipse><sqlite3>","1","0","1","2011-12-17 23:02:44",""
"4326931","1","4326967","","2010-12-01 17:06:24","0","785","<p>There's a service which runs always and listens to some events, will push them into a log someday. I would like to display those events in the main actvity when it's running, but how to send the event details to the activity? You don't receive the intent itself, when you send it to the activity with <code>Context.startActivity()</code>, so that you can't retrive the data with <code>Intent.getXxxExtra()</code>.<br>(The activity would ""subscribe"" and ""unsibscribe"" to the events in onStart() and onStop() with an intent sent to the service, so that the events wouldn't open the activity if it's not in foreground)<br>Or is there any other way to send data (20-30 characters long String) from a service to an intent?</p>","500505","","","","","2010-12-01 17:13:38","How to send an intent to an activity and read extras from it?","<android><android-intent>","2","0","","",""
"4327089","1","","","2010-12-01 17:24:03","0","717","<p>I have an application which displays a series of custom views in a LinearLayout.  The LinearLayout is in a ScrollView.  The custom views draw a picture, when their onDraw method is called.  Generally this works fine.  But occasionally the application crashes on a drawPicture() call.  When it crashes, no exception seems to be thrown, but I do get this message in logcat: ""Wrote stack trace to 'data/anr/traces.txt'"".</p><p>The contents of traces.txt is below:</p><pre><code>DALVIK THREADS:""main"" prio=5 tid=3 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x2aac2250 self=0x84d00  | sysTid=412 nice=0 sched=0/0 cgrp=unknown handle=2130112448  at android.graphics.Canvas.native_drawPicture(Native Method)  at android.graphics.Canvas.drawPicture(Canvas.java:1404)  at com.MyView.onDraw(PDFPageView.java:100)  at android.view.View.draw(View.java:6534)  at android.view.ViewGroup.drawChild(ViewGroup.java:1531)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)  at android.view.View.draw(View.java:6537)  at android.view.ViewGroup.drawChild(ViewGroup.java:1531)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)  at android.view.View.draw(View.java:6537)  at android.widget.FrameLayout.draw(FrameLayout.java:352)  at android.view.ViewGroup.drawChild(ViewGroup.java:1531)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)  at android.view.View.draw(View.java:6537)  at android.widget.FrameLayout.draw(FrameLayout.java:352)  at android.view.ViewGroup.drawChild(ViewGroup.java:1531)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)  at android.view.View.draw(View.java:6537)  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:6537)  at android.widget.FrameLayout.draw(FrameLayout.java:352)  at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1849)  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:4325)  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)""AsyncTask #1"" prio=5 tid=17 WAIT  | group=""main"" sCount=1 dsCount=0 s=N obj=0x2e4262b0 self=0x351ab8  | sysTid=420 nice=10 sched=0/0 cgrp=unknown handle=3480528  at java.lang.Object.wait(Native Method)  - waiting on &lt;0x195468&gt; (a java.lang.VMThread)  at java.lang.Thread.parkFor(Thread.java:1535)  at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)  at sun.misc.Unsafe.park(Unsafe.java:317)  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:131)  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996)  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1001)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)  at java.lang.Thread.run(Thread.java:1096)""Binder Thread #3"" prio=5 tid=15 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x2e3e9cc0 self=0x191798  | sysTid=419 nice=0 sched=0/0 cgrp=unknown handle=1738736  at dalvik.system.NativeStart.run(Native Method)""Binder Thread #2"" prio=5 tid=13 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x2e3e9c00 self=0x1a7510  | sysTid=418 nice=0 sched=0/0 cgrp=unknown handle=1792360  at dalvik.system.NativeStart.run(Native Method)""Binder Thread #1"" prio=5 tid=11 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x2e3e9b40 self=0x1aae60  | sysTid=417 nice=0 sched=0/0 cgrp=unknown handle=1738512  at dalvik.system.NativeStart.run(Native Method)""JDWP"" daemon prio=5 tid=9 VMWAIT  | group=""system"" sCount=1 dsCount=0 s=N obj=0x2e3e82a0 self=0x1b82a0  | sysTid=416 nice=0 sched=0/0 cgrp=unknown handle=1792208  at dalvik.system.NativeStart.run(Native Method)""Signal Catcher"" daemon prio=5 tid=7 RUNNABLE  | group=""system"" sCount=0 dsCount=0 s=N obj=0x2e3e81e8 self=0x1b9420  | sysTid=415 nice=0 sched=0/0 cgrp=unknown handle=1791968  at dalvik.system.NativeStart.run(Native Method)""HeapWorker"" daemon prio=5 tid=5 VMWAIT  | group=""system"" sCount=1 dsCount=0 s=N obj=0x2d68c4c8 self=0x1b9968  | sysTid=413 nice=0 sched=0/0 cgrp=unknown handle=1792792  at dalvik.system.NativeStart.run(Native Method)</code></pre><p>This is the logcat output:</p><pre><code>W/WindowManager(   53): Key dispatching timed out sending to com.mypackage/com.mypackage.MyActivity  W/WindowManager(   53): Dispatch state: {{KeyEvent{action=1 code=82 repeat=0 meta=0 scancode=229 mFlags=8} to Window{4387d7f8 Keyguard paused=false} @ 1291224780532 lw=Window{4387d7f8 Keyguard paused=false} lb=android.view.ViewRoot$W@4387d408 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4392eb90 com.mypackages/com.mypackage.MyActivity paused=false}}}  W/WindowManager(   53): Current state:  {{null to Window{4392eb90 com.mypackages/com.mypackage.MyActivity paused=false} @ 1291225159009 lw=Window{4392eb90 com.mypackage/com.mypackage.MyActivity paused=false} lb=android.os.BinderProxy@4392e9b8 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4392eb90 com.mypackage/com.mypackage.MyActivity paused=false}}}  I/ActivityManager(   53): ANR in process: com.mypackage(last in com.mypackage)  I/ActivityManager(   53): Annotation: keyDispatchingTimedOut  I/ActivityManager(   53): CPU usage:  I/ActivityManager(   53): Load: 0.71 / 0.81 / 0.44  I/ActivityManager(   53): CPU usage from 19028ms to 19ms ago:  I/ActivityManager(   53):   com.mypackage: 34% = 34% user + 0% kernel / faults: 24 minor  I/ActivityManager(   53):   system_server: 2% = 1% user + 0% kernel / faults: 8minor  I/ActivityManager(   53):   com.android.phone: 0% = 0% user + 0% kernel  I/ActivityManager(   53):   adbd: 0% = 0% user + 0% kernel / faults: 72 minor  I/ActivityManager(   53): TOTAL: 38% = 36% user + 2% kernel  I/ActivityManager(   53): Removing old ANR trace file from /data/anr/traces.txt  I/Process (   53): Sending signal. PID: 514 SIG: 3  I/dalvikvm(  514): threadid=7: reacting to signal 3  I/dalvikvm(  514): Wrote stack trace to '/data/anr/traces.txt'  I/Process (   53): Sending signal. PID: 53 SIG: 3   I/dalvikvm(   53): threadid=7: reacting to signal 3   I/dalvikvm(   53): Wrote stack trace to '/data/anr/traces.txt'  I/Process (   53): Sending signal. PID: 96 SIG: 3  I/dalvikvm(   96): threadid=7: reacting to signal 3  I/dalvikvm(   96): Wrote stack trace to '/data/anr/traces.txt'  I/Process (   53): Sending signal. PID: 223 SIG: 3  I/dalvikvm(  223): threadid=7: reacting to signal 3  I/dalvikvm(  223): Wrote stack trace to '/data/anr/traces.txt'  I/Process (   53): Sending signal. PID: 140 SIG: 3  I/dalvikvm(  140): threadid=7: reacting to signal 3  I/dalvikvm(  140): Wrote stack trace to '/data/anr/traces.txt'  I/Process (   53): Sending signal. PID: 120 SIG: 3  I/dalvikvm(  120): threadid=7: reacting to signal 3  I/dalvikvm(  120): Wrote stack trace to '/data/anr/traces.txt'  I/Process (   53): Sending signal. PID: 172 SIG: 3   I/dalvikvm(  172): threadid=7: reacting to signal 3  I/dalvikvm(  172): Wrote stack trace to '/data/anr/traces.txt'  I/Process (   53): Sending signal. PID: 175 SIG: 3  I/dalvikvm(  175): threadid=7: reacting to signal 3  I/dalvikvm(  175): Wrote stack trace to '/data/anr/traces.txt'  I/Process (   53): Sending signal. PID: 94 SIG: 3  I/dalvikvm(   94): threadid=7: reacting to signal 3  I/dalvikvm(   94): Wrote stack trace to '/data/anr/traces.txt'  W/WindowManager(   53): No window to dispatch pointer action 1  W/WindowManager(   53): No window to dispatch pointer action 1  W/WindowManager(   53): No window to dispatch pointer action 0  W/WindowManager(   53): No window to dispatch pointer action 1  D/dalvikvm(   53): GC freed 12498 objects / 629776 bytes in 174ms</code></pre>","426493","","426493","","2010-12-01 17:49:35","2010-12-01 18:41:22","Android: crash on drawPicture() call?","<android>","1","2","","",""
"4327171","1","4327558","","2010-12-01 17:33:00","0","763","<p>In order to publish my Android app I had to change the package name from the com.example.project I had used during development. Although, after I changed the package name I cannot access the sqlite database any longer. I tried accessing it through the .adb, and it works with the old package-name but not the new one. </p><p>How can i access the db in order to put it under the new package? I have a copy of the old un-altered project file. </p><p>Many thanks! AK</p>","455479","","181337","","2012-05-05 19:15:04","2012-05-05 19:15:04","How can I access my Sqlite database after changing package name in Android?","<android><sqlite><package><rename>","1","2","1","",""
"4327183","1","4328787","","2010-12-01 17:34:20","1","2117","<p>I have confusion regarding multi screens support in android. I have gone through article for multi screen support at android developer forum. My question is if app has 15-20 images that need to be shown full screen on device screen. Now if I want to support all screens what should i put in three drawable folders ldpi, mdpi &amp; hdpi. Here what i have done</p><p>In ldpi - images of 240x320 resolutionmdpi - images of 320x480 reolutionhdpi - images of 720x800 resolution.(I am using same densities for all three resolution)I think this is not right approach.</p><p>What exactly I should do? Put images of different resolution in drawable-ldpi, drawable-mdpi &amp; drawable-hdpi as above or should i use images of different densities 120 dpi, 160 dpi &amp; 240 dpi. If i use images of different densities what should be their resolution(should 120 dpi resolution be 240x320, 160 dpi resolution 320x480 &amp; 240 dpi resolution be 480x800). Or if i am using different dpi images their resolution should be same(320x480) for all densities .</p><p>Regards,Anuj </p>","495906","","495906","","2011-10-04 09:42:12","2011-10-04 09:42:12","Images in case of multi screen support in android","<android><android-screen-support>","2","1","","",""
"4327339","1","4327368","","2010-12-01 17:49:55","9","15350","<p>All the Android docs mention the ""drawable"" directory.  However, when I create an Android project in Eclipse, it doesn't create a ""/res/drawable"" directory, but it does create ""/res/drawable-ldpi"" and ""/res/drawable-mdpi"".  I imagine those have something to do with pixel resolution, but what's exactly going on here?  When I've stepped through the tutorials, I've manually created a ""drawable"" directory and put my resources in there, but did I need to?  Do references to ""/res/drawable/"" work if only ""drawable-{l|m}dpi"" are present?</p>","10508","","","","","2014-01-19 11:22:09","drawable vs. drawable-ldpi/drawable-mdpi","<android>","4","0","3","",""
"4327372","1","4329122","","2010-12-01 17:52:55","2","554","<p>I've a JSON array like this:[{""usename"":""user"", ""user_pic"":""picture"", ""photo"":""http://hfhfhfhhfh.jpg"", ""timestamp"":""10-09-10""} {""username"":""user2"", ..........}]<br>I've 10 JSONObject in this array, and I want use it for populate a stream with:<br>Avatar - Nickname<br>Photo <br>Timestamp<br>Is a stream of my application, I want have the latest post of other user.<br>How can I populate the stream?I think i could use a baseadapter is correct?</p><p>Thank you so much!</p>","496371","","496371","","2010-12-01 18:06:43","2010-12-01 21:04:22","Populate BaseAdapter from web","<android><stream><adapter>","1","0","","",""
"4327383","1","4329382","","2010-12-01 17:53:49","2","292","<p>My application has a database that has to be exposed to global search. I have the sqlite database as a raw file. I am trying to copy the database file to the databases directory in my project but it throws a FileNotFoundException. I am guessing that this is a permissions issue.</p><p>My application is similar to the Searchable dictionary but the problem is that since I have around 2000 records, it is taking around 15-30 seconds to populate the database. I also have to way to tell the user that the data is loading. So I just decided to use the sqlite database which I can copy to the databases directory of my project in the onCreate method of my databasehelper class.[extends SqliteOpenHelper].</p><p>Now I use the same method to copy my actual application database and it works fine. This may be because they are running in the same process.</p><p>How can I copy my database to the databases dir or where to I need to copy it to?</p><p>Thank you.</p>","229266","","","","","2010-12-01 21:33:52","Unable to create Database for content providers","<android>","1","0","","",""
"4327477","1","4328403","","2010-12-01 18:02:16","0","508","<p>I am using the android emulator ddms to simulate movement using a gpx file.  There are about 1000 entries in the gpx file.  However, I'm finding that my onLocationChanged method is only being triggered a few times during the course of the entire file.  My code is as follows...</p><pre><code>LocationManager locationManager = (LocationManager)    this.getSystemService(Context.LOCATION_SERVICE);         locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 1, myListener);myListener = new LocationListener(){public void onLocationChanged(Location location){    double mylat = location.getLatitude();    double mylon = location.getLongitude();      ...    }...}</code></pre><p>My understanding of the requestLocationUpdates being set to 1000 is that it should request a location update every 1 second provided the location is more than 1m away from the previous.  Is this correct?  If so, why would I only be retrieving a few of the lat/lon pairs from the gpx file?  Wouldn't I be retrieving nearly a thousand?  (The GPS data is from someone running so there is constant motion.)</p>","513939","","513939","","2010-12-01 19:02:26","2010-12-01 19:46:29","GPS emulator tracks","<android><android-emulator>","1","0","","",""
"4327517","1","","","2010-12-01 18:06:53","1","3226","<p>How can i decompress a String that was zipped by PHP gzcompress() function?</p><p>Any full examples?</p><p>thx</p><p>I tried it now like this:</p><pre><code>public static String unzipString(String zippedText) throws Exception{    ByteArrayInputStream bais = new ByteArrayInputStream(zippedText.getBytes(""UTF-8""));    GZIPInputStream gzis = new GZIPInputStream(bais);    InputStreamReader reader = new InputStreamReader(gzis);    BufferedReader in = new BufferedReader(reader);    String unzipped = """";    while ((unzipped = in.readLine()) != null)         unzipped+=unzipped;    return unzipped;}</code></pre><p>but it's not working if i i'm trying to unzip a PHP gzcompress (-ed) string. </p>","478605","","1439305","","2013-02-01 19:43:18","2013-02-01 19:43:18","Android: decompress string that was compressed with PHP gzcompress()","<java><android><gzip><gzipinputstream>","3","0","2","",""
"4327550","1","4329287","","2010-12-01 18:09:55","0","978","<p>How do I use the Android's CountDownTimer?</p><p>I basically want to have the following scenario:</p><pre><code>boolean 3_s_passed = false;// setup counter to change 3_s_passed=true when it finishescounter.start();while(true){if(3_s_passed || user_is_Done) break;// do some stuff which may set user_is_Done to true}</code></pre><p>So either 3 seconds passed or the user finishes and I'm out of the loop.Will the while-loop code run before the counter finishes? Is my understanding of the CountDownTimer correct?</p><p>Thanks for your help</p>","524332","","","","","2013-12-03 10:38:12","How do I use Android's CountDownTimer?","<android><counter>","2","0","","",""
"4327557","1","","","2010-12-01 18:10:51","1","556","<p>I'm trying to do an autocomplete for android's default search dialog but it doesn't seem to work. Is this impossible to do?</p>","526924","","2117960","","2014-01-25 21:13:06","2014-01-25 21:13:06","Can I make auto complete to android's default Searchbar?","<android>","1","0","","",""
"4327611","1","4327649","","2010-12-01 18:15:54","7","4885","<p>Friends,<br>      I need to know much about Single Sign On support for Facebook. I have two applications on my device and I have to post the feed. I login the very first time from either one of the applications, but I need it to continue using the same login credential and session for the other application without showing the login page. Is this possible in android? If so please guide me how to implement it.</p><p>Thanks in advance.</p>","393953","","535664","","2011-05-17 19:08:27","2011-05-17 19:08:27","Single Sign On for Android Facebook","<android><facebook><single-sign-on>","2","0","5","",""
"4327698","1","","","2010-12-01 18:26:05","0","91","<p>I would like to add twoo buttons on an appwidget, then i would like to set the onclicklistener methods of this. </p><p>Is there a way to do it? how?</p>","472537","","","","","2011-10-10 15:12:11","Android appwidget, can i put buttons on it?","<android><appwidget>","1","0","","",""
"4327709","1","4369755","","2010-12-01 18:26:40","2","4812","<p>I'm having serious problems when showing a ProgressDialog while a service is getting ready... The service takes time to get ready as it's a bit heavy, so I want to show the ProgressDialog meanwhile it's started.</p><p>The thing is that it shows the ProgressDialog right before the next activity starts... I really don't find what it is...</p><pre><code>package org.pfc;import android.app.Activity;import android.app.ProgressDialog;import android.content.BroadcastReceiver;import android.content.ComponentName;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.content.ServiceConnection;import android.os.Bundle;import android.os.IBinder;import android.util.Log;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.widget.Button;public class ConnectActivity extends Activity {    // FIELDS------------------------------------------------------------------    protected LocalService mSmeppService;    private ProgressDialog progressDialog;    private Thread tt;    private ServiceConnection mConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName className, IBinder service) {            // Gets the object to interact with the service            mSmeppService = ((LocalService.LocalBinder) service).getService();        }        public void onServiceDisconnected(ComponentName className) {            // This is called when the connection with the service has been            // unexpectedly disconnected -- that is, its process crashed.            // Because it is running in our same process, we should never            // see this happen.            mSmeppService = null;        }    };    // For getting confirmation from the service    private BroadcastReceiver serviceReceiver = new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            Log.i(TAG, ""receiver onReceive..."");            if (progressDialog.isShowing())                progressDialog.dismiss();            // Change activity            Intent groupsActivityIntent = new Intent(ConnectActivity.this,                    GroupsActivity.class);            startActivity(groupsActivityIntent);        }    };    // METHODS ----------------------------------------------------------------    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        if (LocalService.isRunning) {            // TODO start ListActivity            Log.i(TAG, ""Starting GroupsScreen"");            Intent i = new Intent(ConnectActivity.this, GroupsActivity.class);            startActivity(i);        } else {            setContentView(R.layout.connect_screen);            // Add listener to the button            Button buttonConnect = (Button) findViewById(R.id.button_connect);            buttonConnect.setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                    processThread();                }            });        }    }    // PRIVATE METHODS --------------------------------------------------------    private void processThread() {        progressDialog = ProgressDialog.show(ConnectActivity.this, """",                ""Loading. Please wait..."", true, false);        tt = new Thread() {            public void run() {                // Register broadcastReceiver to know when the service finished                // its creation                ConnectActivity.this.registerReceiver(serviceReceiver,                        new IntentFilter(Intent.ACTION_VIEW));                // Starts the service                startService(new Intent(ConnectActivity.this,                        LocalService.class));                Log.i(TAG, ""Receiver registered..."");            }        };        tt.start();    }}</code></pre><p>The service executes by the end of the onStart method this:</p><pre><code>// Send broadcast so activities take itIntent i = new Intent(Intent.ACTION_VIEW);    sendOrderedBroadcast(i, null);</code></pre><p>So the onReceive method runs and we go to the next activity</p>","483362","","","","","2010-12-06 18:38:42","Showing ProgressDialog while a Service is being started","<android><service><progressdialog>","1","0","2","",""
"4327710","1","4327759","","2010-12-01 18:26:54","2","2200","<p>I will develop an android application,so i need one help form you,i want to find  <code>what are the applications are installed in our device and i want to uninstalled by given application name by user using Intent</code>.How is possible?</p><p>Thanks All </p>","500595","","","","","2014-03-17 12:04:47","How to find installed application's name in device?","<android>","1","0","","",""
"4327733","1","4327818","","2010-12-01 18:29:46","6","5873","<p>I have a Google map with these kind of items on it:</p><pre><code>drawable3 = this.getResources().getDrawable(R.drawable.trazeicon);</code></pre><p>but automatically, Android draws a shadow of the image <code>trazeicon</code> on the map, and I don't want to have that shadow.</p><p>How can I remove it?</p><h3>EDIT:</h3><p>I got the error: <code>Syntax error, insert ""}"" to complete ClassBody</code></p><p>Here is the full code:</p><pre><code>package com.GPSLoc;import java.util.ArrayList;import android.app.AlertDialog;import android.content.Context;import android.graphics.Canvas;import android.graphics.Rect;import android.graphics.drawable.Drawable;import com.google.android.maps.ItemizedOverlay;import com.google.android.maps.MapView;import com.google.android.maps.OverlayItem;public class MyItemizedOverlay extends ItemizedOverlay {    private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();    private Context mContext;    public MyItemizedOverlay(Drawable defaultMarker) {        super(boundCenterBottom(defaultMarker));    }    protected OverlayItem createItem(int i) {      return mOverlays.get(i);    }    public int size() {      return mOverlays.size();    }    public void addOverlay(OverlayItem overlay) {        mOverlays.add(overlay);        populate();    }    public MyItemizedOverlay(Drawable defaultMarker, Context context) {          //super(defaultMarker);          super(boundCenterBottom(defaultMarker));          mContext = context;    }    public void clear()    {        mOverlays.clear();    }    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;    }    public void draw(Canvas canvas, MapView mapView, boolean shadow)    {        if(!shadow)        {            super.draw(canvas, mapView, false);        }    }}</code></pre>","479886","","1288","","2011-09-27 12:42:50","2012-12-04 12:02:27","It is possible to remove the Shadow of the Icons (items) on a googlemap?","<android><google-maps><drawable>","1","0","2","",""
"4327783","1","","","2010-12-01 18:35:08","1","864","<p>I am making a date picker activity that looks like a scrolling 30 day month/calendar (think Outlook calendar).  The date picker contains a ListView (for scrolling) of MonthView views each of which is a TableView of the individual days.  Each individual day in the MonthView is a button.  When the MonthView is instantiated I walk each of the days (buttons) and attach a click listener:</p><pre><code>final Button b = getButtonAt(i);b.setOnClickListener(new OnClickListener(){      @Override      public void onClick(View v) {            setSelectedDate(buttonDayClosure, b);      }});</code></pre><p>setSelectedDate does a variety of things, but it also turns the button's background to yellow to signify the date is selected.</p><p>On my emulator, everything works as you would expect.  Activity comes up, you press a day, the day turns yellow.  No problems.</p><p>However, on some of my peer's emulators and on physical devices when you touch a day nothing happens... until you scroll the ListView... and then all of a sudden the selected day turns yellow.  So, for example, you touch ""the 3rd"" and then nothing happens.  Wait a few seconds and then scroll the ListView (touching an area of the calendar that is NOT the 3rd) and as soon as ListView scrolls the 3rd magically turns yellow.</p><p>On my peer emulators that show this behavior, I can set a breakpoint on the fist line of onClick and I see that the BP is in fact not hit until the ListView is scrolled.</p><p>This behavior doesn't make any sense to me. I would expect the onClick behavior to be unrelated to the encapsulating View's scrolling efforts.</p><p>Any thoughts on why this might be the case and how I can rectify the situation so that onClicks always happen immediately when the button is touched?</p><p>Thanks.</p><p>Post Scriptus:  ArrayAdapter and ListView code requested:</p><pre><code>public class MonthArrayAdapter extends ArrayAdapter&lt;Date&gt; {    private MonthView[] _views;     private Vector&lt;Procedure&lt;Date&gt;&gt; _dateSelectionChangedListeners = new Vector&lt;Procedure&lt;Date&gt;&gt;();    public MonthArrayAdapter(Context context, int textViewResourceId, Date minSelectableDay, Date maxSelectableDay) {        super(context, textViewResourceId);        int zeroBasedMonth = minSelectableDay.getMonth();        int year = 1900 + minSelectableDay.getYear();        if(minSelectableDay.after(maxSelectableDay))        {            throw new IllegalArgumentException(""Min day cannot be after max day."");        }        Date prevDay = minSelectableDay;        int numMonths = 1;        for(Date i = minSelectableDay; !sameDay(i, maxSelectableDay); i = i.addDays(1) )        {            if(i.getMonth() != prevDay.getMonth())            {                numMonths++;            }            prevDay = i;        }        _views = new MonthView[numMonths];        for(int i = 0; i&lt;numMonths; i++)        {            Date monthDate = new Date(new GregorianCalendar(year, zeroBasedMonth, 1, 0, 0).getTimeInMillis());            Date startSunday = findStartSunday(monthDate);            this.add(monthDate);            _views[i] = new MonthView(this.getContext(), startSunday, minSelectableDay, maxSelectableDay);            zeroBasedMonth++;            if(zeroBasedMonth == 12)            {                year++;                zeroBasedMonth = 0;            }        }        for(final MonthView a : _views)        {            a.addSelectedDateChangedListener(new Procedure&lt;MonthView&gt;()            {                        @Override                    public void execute(MonthView input) {                        for(final MonthView b: _views)                        {                            if(a != b)                            {                                b.clearCurrentSelection();                            }                        }                        for(Procedure&lt;Date&gt; listener : _dateSelectionChangedListeners)                        {                            listener.execute(a.getSelectedDate());                        }                    }            });        }    }    void addSelectedDateChangedListener(Procedure&lt;Date&gt; listener)    {        _dateSelectionChangedListeners.add(listener);    }    private boolean sameDay(Date a, Date b)    {        return a.getYear() == b.getYear() &amp;&amp; a.getMonth() == b.getMonth() &amp;&amp;               a.getDate() == b.getDate();    }    @Override    public View getView (int position, View convertView, ViewGroup parent)    {        return _views[position];    }    private Date findStartSunday(Date d)    {        return d.subtractDays(d.getDay());    }    public void setSelectedDate(Date date)    {        for(MonthView mv : _views)        {            mv.setSelectedDate(date);        }    }}</code></pre><p>and</p><pre><code>public class DatePicker extends ActivityBase {    public static final String CHOSEN_DATE_RESULT_KEY = ""resultKey"";    public static final String MIN_SELECTABLE_DAY = DatePicker.class.getName() + ""MIN"";    public static final String MAX_SELECTABLE_DAY = DatePicker.class.getName() + ""MAX"";    private static final String SELECTED_DATE = UUID.randomUUID().toString();    private long _selectedDate = -1;    private MonthArrayAdapter _monthArrayAdapter;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Date now = new Date();        Bundle inputs = this.getIntent().getExtras();        long min = inputs.getLong(MIN_SELECTABLE_DAY, 0);        Date minSelectableDate;        if(min == 0)        {            minSelectableDate = new Date(now);        }        else        {            minSelectableDate = new Date(min);        }        Log.i(DatePicker.class.getName(), ""min date = "" + minSelectableDate.toString());        long max = inputs.getLong(MAX_SELECTABLE_DAY, 0);        Date maxSelectableDate;        if(max == 0)        {            maxSelectableDate = new Date(now.addDays(35).getTime());        }        else        {            maxSelectableDate = new Date(max);        }        setContentView(R.layout.date_picker);        Button doneButton = (Button) findViewById(R.id.DatePickerDoneButton);        if(doneButton == null)        {            Log.e(this.getClass().getName(), ""Could not find doneButton from view id."");            finish();            return;        }        doneButton.setOnClickListener(new OnClickListener()        {            @Override            public void onClick(View v) {                Intent result = new Intent();                result.putExtra(CHOSEN_DATE_RESULT_KEY, _selectedDate);                setResult(RESULT_OK, result);                finish();            }        });        Button cancelButton = (Button) findViewById(R.id.DatePickerCancelButton);        if(cancelButton == null)        {            Log.e(this.getClass().getName(), ""Could not find cancelButton from view id."");            finish();            return;        }        cancelButton.setOnClickListener(new OnClickListener()        {            @Override            public void onClick(View v) {                setResult(RESULT_CANCELED, null);                finish();            }        });        ListView lv = (ListView)findViewById(R.id.DatePickerMonthListView);        lv.setDividerHeight(0);        _monthArrayAdapter =             new MonthArrayAdapter(this, android.R.layout.simple_list_item_1, minSelectableDate, maxSelectableDate);        _monthArrayAdapter.addSelectedDateChangedListener(new Procedure&lt;Date&gt;()                {                    @Override                    public void execute(Date input) {                        _selectedDate = input.getTime();                    }                });       lv.setAdapter(_monthArrayAdapter);    }    @Override     public void onRestoreInstanceState(Bundle savedInstanceState)    {        if(savedInstanceState.containsKey(SELECTED_DATE))        {            _selectedDate = savedInstanceState.getLong(SELECTED_DATE);            _monthArrayAdapter.setSelectedDate(new Date(_selectedDate));        }    }    @Override    public void onSaveInstanceState(Bundle savedInstanceState)    {        savedInstanceState.putLong(SELECTED_DATE, _selectedDate);    } }</code></pre>","410176","","410176","","2010-12-01 18:56:53","2013-09-01 22:12:02","Android: Button within ListView not receiving onClick events","<android>","4","3","","",""
"4327901","1","4329186","","2010-12-01 18:49:18","0","3122","<p>I have an app that has to show my phone contact list. The user has to select one phone number and I have to use this phone number programmatically on my app.How can I do it?</p><p>Code examples will be great.</p>","479886","","234175","","2011-10-10 19:28:20","2011-10-10 19:28:20","How can I show my contact phone numbers and get one of the phone numbers for use on my app?","<android><contacts>","2","2","","",""
"4327981","1","4329922","","2010-12-01 18:58:13","8","3765","<p>I'm thinking about using Google Accounts as a user verification for a service I'm developing.  This will be a client and server.  I'm hoping to be able to use the already signed-in Google Account on the Android phone and use that as a verification on my server.</p><p>Where can I find information about this?</p><p>Is it possible to use the already signed-in account on the phone or do I have to re-sign-in in my application?</p>","324943","","","","","2010-12-01 23:47:28","Howto use Google Accounts as login","<android><google-api><google-account>","1","0","","",""
"4328127","1","","","2010-12-01 19:14:30","6","852","<p>I'm trying to use a third party library in my Android app that only allows me to load a file using a string that represents the path to the file. I've placed this file in my app's assets folder thinking that I could use the AssetManager to get its path as a string. However, it only returns a relative path to the file. So I'm wondering if there's some way to get the full path to the file so this library can successfully load the file.</p>","32396","","","","","2010-12-01 19:23:12","Is it possible to get the full path to an Android application asset file as a string?","<android><filepath><assets>","1","0","","",""
"4328151","1","4328382","","2010-12-01 19:17:37","1","5402","<p>I'm just beginning Android and have gotten myself stuck.  I've made a simple app/view.  The idea is draw a line-maze in the top, with motion buttons on the bottom.  My app only draws an x with a couple lines in the frame, but that works.  The problem is that my buttons are being drawn too far down, and are clipped in height.</p><p>I assume the problem is all in 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;        &lt;FrameLayout            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""1"" &gt;             &lt;none.maze.MazeView             android:id=""@+id/maze""                android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""                        /&gt;            &lt;RelativeLayout                android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" &gt;                &lt;TextView                 android:id=""@+id/text""                    android:text=""@string/maze_layout_text_text""                    android:visibility=""visible""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_centerInParent=""true""                    android:gravity=""center_horizontal""                    android:textColor=""#ff8888ff""                    android:textSize=""24sp""/&gt;            &lt;/RelativeLayout&gt;        &lt;/FrameLayout&gt;        &lt;LinearLayout            android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1"" &gt;                         &lt;Button                android:id=""@+id/left""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""Left""                 android:layout_weight=""1""                 /&gt;            &lt;Button                android:id=""@+id/forward""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""Forward""                 android:layout_weight=""1""                 /&gt;            &lt;Button                android:id=""@+id/right""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""Right""                 android:layout_weight=""1""                 /&gt;        &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","282157","","","","","2010-12-01 19:54:53","trouble with nested layouts","<android><layout>","3","0","1","",""
"4328166","1","4328672","","2010-12-01 19:19:30","13","19897","<p>I've setup a LinearLayout with the following drawable background:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;corners android:radius=""10dp"" /&gt;    &lt;solid android:color=""#CCFFFFFF""/&gt;&lt;/shape&gt;</code></pre><p>The problem I'm having is within the LinearLayout I have another LinearLayout element that sits at the bottom of it's parent. Since that doesn't have rounded corners its corners extend past the parents bottom left and right corners. </p><p>The drawable background on the Child LinearLayout looks like this:</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/pedometer_stats_background""     android:tileMode=""repeat""   /&gt;</code></pre><p>The issue looks like this: <a href=""http://kttns.org/hn2zm"">http://kttns.org/hn2zm</a> on the device the non-clipping is more apparent. </p><p>What is the best method to accomplish the clipping?</p>","257949","","","","","2011-11-30 09:01:18","Android XML rounded clipped corners","<android><xml><rounded-corners>","2","1","12","",""
"4328259","1","4338988","","2010-12-01 19:30:42","0","451","<p>This is thebasic idea, but the image is ugly and pixelated. WHY???</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);    ImageView iv = (ImageView) findViewById(R.id.iv);    Bitmap bmap = BitmapFactory.decodeResource(getResources(), R.drawable.btn_default_normal);    NinePatchDrawable npd = new NinePatchDrawable(bmap, bmap.getNinePatchChunk(), new Rect(0,0,512,512), ""name"");    npd.mutate();    npd.setBounds(new Rect(0,0,512,512));    npd.invalidateSelf();    Bitmap bp = Bitmap.createBitmap(512,512, Bitmap.Config.RGB_565);    Canvas canvas = new Canvas(bp);    npd.draw(canvas);    FileOutputStream ofo=null;    try {      ofo = openFileOutput(""image"", MODE_WORLD_READABLE);    } catch (IOException e) {      e.printStackTrace();    }    bp.compress(Bitmap.CompressFormat.PNG, 100, ofo);    Intent intent = new Intent(Intent.ACTION_VIEW);    intent.putExtra(Intent.EXTRA_STREAM, getFileStreamPath(""image"").toURI());    intent.setType(""image/png"");    //startActivity(intent);    iv.setImageDrawable(new BitmapDrawable(bp));  }}</code></pre>","420259","","420259","","2010-12-01 19:32:28","2010-12-02 19:30:35","How to render a tricky ass NinePatch?","<android>","1","7","","",""
"4328266","1","","","2010-12-01 19:31:29","0","1126","<p>I have been trying to include the search dialog in my activity screen by following the methods provided at <a href=""http://developer.android.com/guide/topics/search/search-dialog.html"" rel=""nofollow"">http://developer.android.com/guide/topics/search/search-dialog.html</a></p><p>The issue I have while including search dialog in my activity is that, I am not able to show the android search dialog along with other components in the activity screen.</p><p>As an example I tried to place a button underneath the search dialog, using the steps mentioned in the above link. But now, the search dialog wont even show up.</p><p>Can anyone kindly guide me through the proper steps so that I can get around this issue. </p><p>Any help in this regard will be well appreciated.</p><p>Looking </p><p>Regards,Rony</p>","264953","","","","","2010-12-01 19:31:29","Android Search Dialog in an Activity","<java><android><android-emulator><android-widget>","0","2","2","",""
"4328280","1","4328847","","2010-12-01 19:33:04","3","2227","<p>I need to change the SMS notification tone using code in android. Any help is appreciated...</p>","527053","","527053","","2010-12-01 20:23:31","2010-12-01 20:35:07","Android: Set SMS Notification Tone","<android><sms><notifications>","1","5","","",""
"4328345","1","4328771","","2010-12-01 19:40:32","9","1712","<p>I'm currently working on a large Android app using a massive amount of C++ code.It compiles and runs, so far so good.</p><p>Unfortunately, every time I modify something in the structure of my native source (add/delete/rename/move a file), which happens pretty often, <em>ndk-build</em> rebuilds the whole source, even the untouched files.</p><p>Does anyone know how I can set up the Android NDK to build incrementally somehow?</p><p>Thanks in advance</p>","527072","","","","","2010-12-01 20:29:08","Android NDK incremental build","<android><android-ndk><android-ndk-r4><incremental-build>","1","1","3","",""
"4328374","1","4334076","","2010-12-01 19:43:07","3","671","<p>i have an android app with a googlemap view</p><p>i have to put an animated icon representing a gps position on the map</p><p>i know how to do it with a normal png image, but i want to use something like a GIF image, an animated image</p><p>how i can to do it?</p><p>EDIT:</p><p>THIS IS THE XML ANIMATED: animation.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;animation-list xmlns:android=""http://schemas.android.com/apk/res/android"" android:oneshot=""false""&gt;&lt;item android:drawable=""@drawable/miniicon"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/miniicon2"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/star"" android:duration=""200"" /&gt;&lt;/animation-list&gt;</code></pre><p>this is where i asign the XML animated to the drawable</p><pre><code>//drawable2 = this.getResources().getDrawable(R.drawable.miniicon2); // Icono del programa, para mi posicion GPSdrawable2 = this.getResources().getDrawable(R.layout.animation); // Icono del programa, para mi posicion GPS</code></pre>","479886","","479886","","2010-12-02 10:13:29","2010-12-02 10:47:21","It is possible to put a animate image on a item of a googlemap? (like a gif)","<android><google-maps>","3","0","","",""
"4328376","1","4328482","","2010-12-01 19:43:08","0","1355","<p>Can anyone give me a clear description of what is AsyncCallBack? Does it exist in the latest android version? Because I am directed to AsyncTask when I search for AsyncCallBack.... Are these both same? Does anyone have an example?</p><p>Thanks in advance.</p>","324446","","","","","2010-12-01 20:02:04","What is AsyncCallBack in Android?","<android><asynchronous><android-asynctask>","2","1","1","",""
"4328534","1","5381294","","2010-12-01 20:02:33","8","5228","<p><strong>Edited to add more details:</strong>(originally asked nearly two months ago...still haven't found a solution)</p><p>I have an activity with a somewhat complicated view.  Not complicated in a technical sense...there's just a lot going on.  All activities in this particular app are set to FullScreen NoTitleBar, and they're all set to Landscape orientation.  I noticed early on in development when the app is hidden and then resumes, there was an infrequent tendency for the layout to slide down vertically as if to make room for the titlebar and statusbar.</p><p>Later on in development, the app now calls out to various external intents.  I notice now that there is more of a tendency to make this same shift when resuming from an externally handled fired intent (such as creating a ""chooser"" intent or picking an image).  I am able to reproduce it inconsistently using the exact same steps...sometimes it happens sometimes it doesn't.  It seems as if there's a race condition in between various phases of measuring and laying out.  I assume that one of these steps that the system is doing for me is checking for fullscreen and notitlebar, and making the necessary shift.  This is probably happening late in some cases.</p><p>I put a bunch of logging, and calls to invalidate(), requestLayout(), etc trying to maybe catch the race condition, but the problem seems external to my layouts.  The top() and bottom() values of my root layout are always 0 and the height of my screen, respectively, even when I'm logging this while the issue is occurring.</p><p>Is there some other method of the Window, WindowManager or any other system view-related object that I can force a full remeasure, redraw, re-check for current theme/style flags?</p>","53501","","53501","","2011-01-27 20:26:05","2012-11-01 15:15:27","Force a full screen Activity to remeasure/redraw on resume?","<java><android>","8","0","2","",""
"4328673","1","4343017","","2010-12-01 20:17:14","2","728","<p>I am able to set the ringtone perfectly, when I insert the row in Mediastore.Audio.Media</p><pre><code> newUri = this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values); </code></pre><p>But for an existing record i.e when am trying to insert the row again, logcat shows me database constraint error 19. So how do I work around this? Basically I need to set a .ogg file from my sound board app as a ringtone, which is already existing in the mediastore database... Any help is appreciated..</p>","527053","","","","","2010-12-03 06:24:14","Android: Set Ringtone for existing record in Mediastore.Audio.Media","<android><ringtone>","1","0","","",""
"4328838","1","4328983","","2010-12-01 20:34:05","12","27739","<p>I am trying to create a custom View that would replace a certain layout that I use at multiple places, but I am struggling to do so.</p><p>Basically, I want to replace this:</p><pre><code>&lt;RelativeLayout android:id=""@+id/dolphinLine"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:layout_centerInParent=""true"" android:background=""@drawable/background_box_light_blue"" android:padding=""10dip"" android:layout_margin=""10dip""&gt;  &lt;TextView   android:id=""@+id/dolphinTitle""   android:layout_width=""200dip""   android:layout_height=""100dip""   android:layout_alignParentLeft=""true""   android:layout_marginLeft=""10dip""   android:text=""@string/my_title""   android:textSize=""30dip""   android:textStyle=""bold""   android:textColor=""#2E4C71""   android:gravity=""center""/&gt;  &lt;Button   android:id=""@+id/dolphinMinusButton""   android:layout_width=""100dip""   android:layout_height=""100dip""   android:layout_toRightOf=""@+id/dolphinTitle""   android:layout_marginLeft=""30dip""   android:text=""@string/minus_button""   android:textSize=""70dip""   android:textStyle=""bold""   android:gravity=""center""   android:layout_marginTop=""1dip""   android:background=""@drawable/button_blue_square_selector""   android:textColor=""#FFFFFF""   android:onClick=""onClick""/&gt;  &lt;TextView   android:id=""@+id/dolphinValue""   android:layout_width=""100dip""   android:layout_height=""100dip""   android:layout_marginLeft=""15dip""   android:background=""@android:drawable/editbox_background""   android:layout_toRightOf=""@+id/dolphinMinusButton""   android:text=""0""   android:textColor=""#2E4C71""   android:textSize=""50dip""   android:gravity=""center""   android:textStyle=""bold""   android:inputType=""none""/&gt;  &lt;Button   android:id=""@+id/dolphinPlusButton""   android:layout_width=""100dip""   android:layout_height=""100dip""   android:layout_toRightOf=""@+id/dolphinValue""   android:layout_marginLeft=""15dip""   android:text=""@string/plus_button""   android:textSize=""70dip""   android:textStyle=""bold""   android:gravity=""center""   android:layout_marginTop=""1dip""   android:background=""@drawable/button_blue_square_selector""   android:textColor=""#FFFFFF""   android:onClick=""onClick""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>By this:</p><pre><code>&lt;view class=""com.example.MyQuantityBox""    android:id=""@+id/dolphinBox""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:myCustomAttribute=""@string/my_title""/&gt;</code></pre><p>So, I do not want a custom layout, I want a custom View (it should not be possible for this view to have child).</p><p>The only thing that could change from one instance of a MyQuantityBox to another is the title. I would very much like to be able to specify this in the XML (as I do on the last XML line)</p><p>How can I do this? Should I put the RelativeLayout in a XML file in /res/layout and inflate it in my MyBoxQuantity class? If yes how do I do so?</p><p>Thanks!</p>","488054","","","","","2013-12-17 18:59:36","Create a custom View by inflating a layout?","<android><xml><view>","4","1","4","",""
"4328906","1","","","2010-12-01 20:40:49","10","3681","<p>I am developing a rather large software on Android with a log native code, it's working now but having some performance issues. </p><p>I am hoping I can profile each module(function call) of the software for CPU cycles, memory usage, etc, on several real android phones. Is there a simple c library to do that? </p><p>I see people using oprofile, It seems to be a overkill for my case since that it is a system wild profiler, and it requires rebuild the kernel and system image. </p><p>As I have the full source code of my app, all I really need is a simple c library that I can embed in my code to do some profiling while the app runs several test cases. </p><p>BTW, what is the Linux way of doing this?</p>","527134","","","","","2013-02-19 11:07:37","Android software NDK native c code profiling on actual Android phones","<android><profiling><android-ndk>","1","3","4","",""
"4329036","1","4331909","","2010-12-01 20:54:47","1","1047","<p>When I try to download file using the following code and run the apk file, it always results in ""Parsing Error"". I am clueless. Any help is appreciated.</p><pre><code>try                  {                   URL url  = new URL(""http://10.0.0.1/test.apk"");                          URLConnection conexion = url.openConnection();                          conexion.connect();                         int lenghtOfFile = conexion.getContentLength();                         InputStream is=url.openStream();                         FileOutputStream fos=new FileOutputStream(""/flash/test.apk"");                        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;                                  Log.v(""APK Download"", ""total = ""+progress);                                  // Log.v                             }                              fos.write(data, 0, count);                          }                          is.close();                          fos.close();                          Log.v(""APK Download"", ""Download Done"");                    }catch (Exception e){}</code></pre>","492458","","234039","","2010-12-01 21:48:57","2010-12-02 05:14:46","android downloading apk file from internet results in parsing error","<android>","1","5","","",""
"4329080","1","4330033","","2010-12-01 20:59:29","0","726","<p>Is it possible to programmatically change the <code>android:name</code> attribute in code for Application and BroadcastReceiver? I would like to change the name of my App icon and Widget names programmatically, in order to reuse our existing localization infrastructure.</p>","440093","","","","","2011-04-14 20:59:27","Android: Programmatically change android:name attribute for Application and BroadcastReceiver","<android>","1","0","","",""
"4329164","1","","","2010-12-01 21:08:32","8","10010","<p>I want to build something like this but using an android phone: <a href=""http://www.youtube.com/watch?v=WOt9mb5QqRs"" rel=""nofollow"">http://www.youtube.com/watch?v=WOt9mb5QqRs</a></p><p>I've already built an app that sends sensor information via socket (still looking for a good websocket implementation for android). I intend to use that information to interact with a web app, so for example i would be able to move an image based on the phone movement.The problem is that I tried to calculate distance based on the accelerometer data but the results are really bad. I wonder if anyone could help me with the correct equation, but first of all, is it possible to do this?</p><p>Till now I'm using the following equations:</p><p><code>velocity = acceleration * time;</code></p><p><code>distance = velocity * time + (acceleration * time^2) / 2;</code></p><p>then I translate distance from meters per second to pixels based on monitor screen resolution.</p><p>that's calculated with javascript in the browser every time i receive sensor data, which is every ~80ms.</p>","527174","","814463","","2012-10-15 19:04:41","2012-10-15 19:04:41","How to calculate distance based on phone acceleration","<android><distance><formula><acceleration>","2","0","8","",""
"4329175","1","9195020","","2010-12-01 21:10:21","14","13235","<p>I can not get my TableLayout to fit inside the screen <code>when the text cell is large</code>, despite the text wraps <code>inside the cell</code>. I have been googling for an answer but it I can not find an advice that works for me.This is my TableLayout. A simple two-rows, two-columns table. Left column cells are <code>multiline</code>. If the text of one of these cell is large enought to break in two lines, the column is stretched to fill the entire screen and the right columns is pushed out of the screen. Why? How can I force the full table to stay inside the screen?Any hint is welcomed.Thanks in advanceSammy</p><p>My TableLayout is the following:</p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/myTableLayout""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TableRow&gt;    &lt;TextView        android:text=""Account 4 with a very large name to see if it breaks  on two or more lines""        android:singleLine=""false""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        &gt;    &lt;/TextView&gt;    &lt;TextView        android:text=""$400.00""        android:gravity=""right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        &gt;    &lt;/TextView&gt;&lt;/TableRow&gt;&lt;TableRow&gt;    &lt;TextView        android:text=""Account 5""        android:singleLine=""false""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        &gt;    &lt;/TextView&gt;    &lt;TextView        android:text=""$400.00""        android:gravity=""right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        &gt;    &lt;/TextView&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>The code to display the layout is basic:</p><pre><code>public class AccountBrowserTest     extends Activity{    public void onCreate(Bundle savedInstanceState)     {            super.onCreate(savedInstanceState);        this.setContentView(R.layout.accountbrowser_test);    }} </code></pre>","527144","","944657","","2012-10-11 03:20:23","2013-03-19 16:08:50","Android table layout formatting problems","<android><tablelayout>","8","0","4","",""
"4329251","1","","","2010-12-01 21:20:03","0","1868","<p>Developing an App on Android.Looking for a free REST API that returns in XML format nearby places (Just like Facebook places app on iphone does).Ultimately I would also want to display some of the places returned on the MapActivity - so better to have longitude-latitute in response. I also want to store the result address in free form, so that should also be part of the response..</p><p>I also want some other API - which give free-format address would convert it to longitude-latitude. Something like this:<a href=""http://developer.yahoo.com/geo/placefinder/"" rel=""nofollow"">http://developer.yahoo.com/geo/placefinder/</a></p>","467554","","","","","2010-12-04 00:35:20","Android - find nearby places","<android><geolocation>","3","0","","",""
"4329308","1","","","2010-12-01 21:26:18","4","18501","<p>I created a Java application which opens an xml file that looks something like this:</p><pre class=""lang-xml prettyprint-override""><code>&lt;AnimalTree&gt;  &lt;animal&gt;    &lt;mammal&gt;canine&lt;/mammal&gt;    &lt;color&gt;blue&lt;/color&gt;  &lt;/animal&gt;  &lt;!-- ... --&gt;&lt;/AnimalTree&gt;</code></pre><p>And I can open it using:</p><pre class=""lang-java prettyprint-override""><code>File fXmlFile = getResources.getXml(""res/xml/data.xml"");DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();Document doc = dBuilder.parse(fXmlFile);doc.getDocumentElement().normalize();NodeList animalNodes = doc.getElementsByTagName(""animal"");</code></pre><p>Then I can simply create a node, push the object into a ListArray, then do what I want with the objects as I loop through the ListArray.</p><pre class=""lang-java prettyprint-override""><code>for (int temp = 0; temp &lt; animalNodes.getLength(); temp++) {Node nNode = animalNodes.item(temp);     if (nNode.getNodeType() == Node.ELEMENT_NODE) {Element eElement = (Element) nNode;question thisAnimal = new animal();thisAnimal.mammal = getTagValue(""mammal"",eElement);// ...</code></pre><p>Plain and simple! Now only, in Android I cannot simply read the file ""<code>res/xml/data.xml</code>"" because ""<code>File();</code>"" requires a <code>String</code> not an <code>integer</code> (id). This is where I am lost.  Is there some way I can make ""<code>File();</code>"" open the file, or is this impossible without using <code>SAXparser</code> or <code>XPP</code>? (both of which I really cannot understand, no matter how hard I try.)<br>If I am forced to use those methods, can someone show me some simple code analogous to my example?</p>","520925","","995926","","2012-12-27 07:26:29","2014-02-27 13:56:25","Open XML file from res/xml in Android","<android><xml><file><local><saxparser>","2","0","3","",""
"4329440","1","4330269","","2010-12-01 21:40:58","3","3055","<p>The below code should describe an app where once the widget button is clicked, it sends off an intent that should be received by TestReceiver. However, in running my below code, the onReceive of TestReceiver is never called.</p><p>Could someone let me know what I'm doing wrong?</p><p>Widget code</p><pre><code>public class Widget extends AppWidgetProvider {public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    final int N = appWidgetIds.length;    // Perform this loop procedure for each App Widget that belongs to this provider    for (int i=0; i&lt;N; i++) {        int appWidgetId = appWidgetIds[i];        // Create an Intent to launch ExampleActivity        //Intent intent = new Intent(context.getApplicationContext(), TestReceiver.class);        Intent intent = new Intent();        intent.setAction(TestReceiver.TEST_INTENT);        intent.setClassName(TestReceiver.class.getPackage().getName(), TestReceiver.class.getName());        PendingIntent pendingIntent = PendingIntent.getBroadcast(context.getApplicationContext(), 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);        // Get the layout for the App Widget and attach an on-click listener to the button        RemoteViews views;       views = new RemoteViews(context.getPackageName(), R.layout.main);             views.setOnClickPendingIntent(R.id.btnTest, pendingIntent);        // Tell the AppWidgetManager to perform an update on the current App Widget        appWidgetManager.updateAppWidget(appWidgetId, views);    }}</code></pre><p>}</p><p>Receiver Code:</p><pre><code>   public class TestReceiver extends BroadcastReceiver {     public static final String TEST_INTENT= ""MyTestIntent"";     @Override     public void onReceive(Context context, Intent intent) {      // TODO Auto-generated method stub      Toast.makeText(context, ""Test"", Toast.LENGTH_SHORT);      if(intent.getAction()==TEST_INTENT)      {         System.out.println(""GOT THE INTENT"");       Toast.makeText(context, ""Test"", Toast.LENGTH_SHORT);      }     }    }</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=""com.test.intenttest""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;  &lt;receiver android:name="".TestReceiver"" android:label=""@string/app_name""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""MyTestIntent""&gt;    &lt;/action&gt;   &lt;/intent-filter&gt;  &lt;/receiver&gt;  &lt;receiver android:label=""@string/app_name"" android:name=""Widget""&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/widget""  /&gt;  &lt;/receiver&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt; </code></pre>","178014","","881229","","2014-04-01 19:53:35","2014-04-01 19:53:35","Android Widget Click and Broadcast Receiver Not Working","<android><android-intent><broadcastreceiver>","1","6","2","",""
"4329466","1","4330061","","2010-12-01 21:44:23","2","4333","<p>have tried to change the timezon in android-emulator but it doesn't work. I write the <a href=""http://developer.android.com/guide/developing/tools/emulator.html"" rel=""nofollow"">-timezone</a> option in eclipse menu: Window - Preferences - Android - Launch - Default Emulator options:<br><code>-timezone Europe/Stockholm</code><br>I found the timezone info <a href=""http://www.php.net/manual/en/timezones.europe.php"" rel=""nofollow"">here</a>.In stockholm we add one hour to the british time. If my computer clock is e.g. <strong>22.19</strong> I also want the time in the android emulator to be <strong>22.19</strong>. But it always show <strong>21.19</strong>. How shall I give the -timezone arg to the emulator from inside eclipse so it works. I use winXp and Eclipse 3.5. And I have always restarted the emulator after each change of timezone.</p>","199138","","199138","","2010-12-01 22:37:16","2012-04-30 21:16:00","timezone in android emulator","<android><eclipse><android-emulator>","4","2","1","",""
"4329481","1","4329539","","2010-12-01 21:45:56","3","387","<p>The following code works, but takes way too long (over a minute) to open a small file. The LogCat shows a lot of instances of ""GC_FOR_MALLOC freed #### objects / ###### bytes in ##ms"". Any suggestions?</p><pre><code> File dirPath = new File(Environment.getExternalStorageDirectory(), ""MyFolder""); String content = getFile(""test.txt""); public String getFile(String file){  String content = """";  try {   File dirPathFile = new File(dirPath, file);   FileInputStream fis = new FileInputStream(dirPathFile);   int c;   while((c = fis.read()) != -1) {    content += (char)c;   }   fis.close();  } catch (Exception e) {   getLog(""Error ("" + e.toString() + "") with: "" + file);  }  return content; }</code></pre><p>Update:</p><p>This is what it looks like now: </p><pre><code>File dirPath = new File(Environment.getExternalStorageDirectory(), ""MyFolder"");String content = getFile(""test.txt"");public String getFile(String file){    String content = """";    File dirPathFile = new File(dirPath, file);    try {        StringBuilder text = new StringBuilder();        BufferedReader br = new BufferedReader(new FileReader(dirPathFile));        String line;        while ((line = br.readLine()) != null) {            text.append(line);            text.append('\n');        }        content = new String(text);        } catch (Exception e) {            getLog(""Error ("" + e.toString() + "") with: "" + file);    }    return content;}</code></pre><p>Thank you all!!</p>","512669","","512669","","2010-12-02 16:32:36","2010-12-02 16:32:36","Opening a 12kb text file takes WAY too long....?","<android><sd-card><fileinputstream>","6","1","","",""
"4329626","1","4330620","","2010-12-01 22:03:49","8","2439","<p>I may be misunderstanding how <code>&lt;include&gt;</code> and <code>&lt;merge&gt;</code> work, but according to <a href=""http://stackoverflow.com/questions/2732682/simple-example-of-merge-and-include-usage-in-android-xml-layouts"">Simple example of  and  usage in Android XML-layouts.</a>, <code>&lt;include&gt;</code> means ""take that file and paste its contents here"".</p><p>Let's say you want to have 3 activities that all have the same header, but have different content.  You'll still need to have 3 XML layout files for each activity.  The only difference between each of the layout's will be that they define a different layout in the <code>&lt;include&gt;</code> tag.  If I wanted to add a footer I'd have to change each layout.</p><p>I'm looking for a way to achieve the inverse, so the children layouts would override specific blocks of the parent (<a href=""http://docs.djangoproject.com/en/dev/topics/templates/"">similar to Django templates</a>).  That way, if I wanted to add that footer, I would just change the parent and the children would continue to override just the content.</p>","135199","","","","","2013-10-30 17:29:13","Does Android support layout inheritance (similar to Django templates)?","<android><django>","2","1","4","",""
"4329663","1","4329694","","2010-12-01 22:08:56","5","5857","<p>I've done my profiling and it seems that most of my time is spent during drawBitmap, which is called (understandingly) on every frame. </p><p>I use SurfaceView/updating thread/canvas locking approach as demonstrated in LunarLander sample. But I've changed it (according to <a href=""http://stackoverflow.com/questions/4288539/how-to-draw-game-on-android-canvas-with-lots-of-primitives"">this question</a>) as to </p><ul><li>on the very first frame construct a bitmap buffer and paint onto it</li><li>paint each subsequent frame reusing that Bitmap (not everything on my screen changes)</li><li>at the end of each frame paint the buffer once into the target Canvas (to the screen)</li></ul><p>Traceview showed me that this  drawBitmap takes 5ms for each frame on my 800x480 device. Can I get any better than that or is it just something that is 'carved into the stone' and I just have to optimize other parts of the code to achieve good frames per second?</p>","72746","","","","","2013-04-10 23:39:03","How to optimize Canvas drawing - drawBitmap on Android?","<android><canvas>","3","1","2","",""
"4329686","1","","","2010-12-01 22:13:11","4","2499","<p>I want to make an Android app that will stream music from my site to all users that use my app. So, my question is, what is better - to get a shoutcast server and stream that to my app (I have to know which song is playing at the moment), or just streaming the music files stored on my server (is this possible?).</p><p>Please point me at the right track, and also recommend me some libraries for this purpose (or Android SDK have this).</p><p>Thank you.</p>","391770","","","","","2010-12-01 23:54:55","Android app with music streaming","<android><streaming><music>","1","1","1","",""
"4329691","1","4329905","","2010-12-01 22:14:15","1","1248","<p>I have developed a sound board application, in which I set ringtones on long press. No issues about it. The ringtone is changed. But when i go to Settings->Sound &amp; Display->Phone Ringtone my ringtone is not listed at all. And No ringtone is selected. How do I list my ringtone there? </p>","527053","","","","","2013-10-22 01:09:07","Android: Ringtone is not visible in settings>Sound and Display>phone ringtone","<android><ringtone>","2","0","","",""
"4329710","1","4346611","","2010-12-01 22:16:23","11","2805","<p>I am trying to have a a progress dialog open when polling my server.  The class is an ActivityGroup because it is nested within a tab bar. To keep the view within the frame, the ActivityGroup is needed.  Here is the declaration of my ActivityGroup class:</p><pre><code>   public class CheckInActivity extends ActivityGroup{        ...        public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.checkin);            new LocationControl().execute(this);</code></pre><p>Now my AsyncTask class is within the same CheckInActivityClass as such:</p><pre><code>private class LocationControl extends AsyncTask&lt;Context, Void, Void&gt;    {        private final ProgressDialog dialog = new ProgressDialog(CheckInActivity.this);        protected void onPreExecute()        {            this.dialog.setMessage(""Determining your location..."");            this.dialog.show();        }</code></pre><p>When I run the given app it throughs an error relating to WindowManager$BadTokenException.  Stating the it cannot start the window with an unknown token.  I tried making a sample app that is just a regular Activity(not ActivityGroup) and it worked just fine. </p><p>Does anyone know how to modify this to make it work, or a work around that will allow the progress bar to be nested within the tab bar?  Any help is greatly appreciated.</p>","527235","","","","","2012-12-21 11:38:40","Android: AsyncTask ProgressDialog will not open in ActivityGroup","<android><android-asynctask><progressdialog><activitygroup>","3","0","4","",""
"4329733","1","4329803","","2010-12-01 22:19:12","2","2972","<p>I need to have a user form that is larger than the screen.  The layout consists of a fixed ""title area"", the form (in a scrollview possibly) and a button on the bottom.  I have created three layouts and the middle layout is a ScrollView with a vertically-oriented LinearLayout.  Unfortunately, the form pushes the buttons off the screen?!</p><p>Is there a simple example to do this?</p><p>I suppose that I can use a ListView, but I would think my ScrollView is easier to manage.  Here is 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;!-- Title Area on top --&gt;    &lt;LinearLayout    android:id=""@+id/layout_form""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    &gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""    &gt;        &lt;ImageView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_marginTop=""0dip""            android:layout_marginBottom=""0dip""            android:paddingTop=""20dip""            android:paddingBottom=""20dip""            android:paddingLeft=""5dip""            android:paddingRight=""10dip""            android:src=""@drawable/logo""            android:layout_gravity=""center""            android:layout_weight=""1""            /&gt;        &lt;TextView              android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:layout_gravity=""center""            android:layout_weight=""2""            android:layout_marginTop=""0dip""            android:layout_marginBottom=""0dip""            android:layout_marginLeft=""4dip""            android:layout_marginRight=""4dip""            android:text=""@string/title_create""            /&gt;    &lt;/LinearLayout&gt;    &lt;!-- Form entry on top --&gt;        &lt;ScrollView             android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:fillViewport=""true""            android:clipChildren=""true""            &gt;            &lt;LinearLayout                 android: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""             android:layout_gravity=""center_horizontal""            android:layout_marginLeft=""8dip""            android:layout_marginRight=""8dip""            android:text=""@string/label_field_one""            /&gt;        &lt;EditText            android:id=""@+id/edit_field_one""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:singleLine=""true""            android:layout_marginLeft=""10dip""            android:layout_marginRight=""10dip""            android:hint=""@string/hint_field_one""            /&gt;        &lt;TextView              android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:layout_gravity=""center_horizontal""            android:layout_marginLeft=""8dip""            android:layout_marginRight=""8dip""            android:text=""@string/label_field_two""            /&gt;        &lt;EditText            android:id=""@+id/edit_field_two""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:singleLine=""true""            android:layout_marginLeft=""10dip""            android:layout_marginRight=""10dip""            android:hint=""@string/hint_field_two""            /&gt;            &lt;!-- Repeat label-text and edit-text until done ... --&gt;            &lt;/LinearLayout&gt;            &lt;/ScrollView&gt;    &lt;!-- ""spring"" between form and wizard buttons. --&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""0dp""        android:layout_weight=""1""    /&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_gravity=""left""        android:layout_weight=""2""        &gt;        &lt;Button            android:id=""@+id/btn_submit""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""right""            android:layout_weight=""1""            android:text=""@string/button_submit""        /&gt;    &lt;/LinearLayout&gt;        &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","157804","","","","","2010-12-01 23:19:55","How do you layout a form that scrolls in Android SDK?","<android><forms><layout><scrollview>","1","0","3","",""
"4329757","1","4330630","","2010-12-01 22:22:16","2","1381","<p>I have a WebView with a WebViewClient with the onRecievedError method set.</p><p>But if I set my phone to Airplane mode and the page fails to loadthe above method isn't called, is there any to detect and deal with WebView being unable to load pages?</p>","433825","","","","","2010-12-02 00:41:13","How to handle WebView not loading","<android><android-webview>","1","0","0","",""
"4329802","1","4329880","","2010-12-01 22:29:10","1","276","<p>I got a simple widget that's show a label with text.What I'm trying to do is give the chance to send this text via sms, mail, tweet it or set it as state message in gtalk.</p><p>How should i build my Intents objects?</p>","418543","","213269","","2010-12-21 16:39:36","2010-12-21 16:39:36","How to define Intent for call other applications?","<android><activity><android-intent>","1","0","1","",""
"4329808","1","","","2010-12-01 22:29:43","0","1052","<p>What syntax (xml and java) should I use to create a View, which would have a couple of buttons (""Next"" and ""Back"") at the top of the screen, and a List, located below the buttons?I have tried the following, but it did not work at all:</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:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;&lt;Button android:text=""@+id/Button01"" android:id=""@+id/Button01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;ListView android:id=""@+id/ListView01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>FirstScreen.java:</p><pre><code>public class FirstScreen extends ListActivity {    /** Called when the activity is first created. */    String [] entries = {""one"",""two"",""three""};    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ArrayAdapter&lt;String&gt; adapter =       new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,entries);        ListView lv = new ListView(this,null,R.id.ListView01);        setListAdapter(adapter);    }}</code></pre>","518012","","213269","","2010-12-21 16:42:07","2010-12-21 16:42:07","How create a View, that contains Buttons and a List within the same Activity?","<android><listview><activity>","2","1","","",""
"4329867","1","4329897","","2010-12-01 22:37:16","0","356","<p>I have a web service which queries the cloud for some data and then populates a ListView.</p><p>I would like to display some sort of spinning indicator to the user letting them know that the cloud is being queried.</p><p>I would prefer not to show the popup with the spinner on it, as I want my user to still be able to use the application.  I use this for my Log In screen, but here this is not applicable.</p><p>Is there a built-in way to do this?  I could certainly hack it myself by including my own spinning image resource and hiding/showing the resource while the cloud is being queried, but I was hoping that there was some built-in resource so I didn't have to use my own.</p>","406790","","","","","2010-12-01 22:42:19","Android built-in spinner","<android><spinner><hourglass>","1","0","1","",""
"4330000","1","","","2010-12-01 22:56:38","0","427","<p>So i'm pretty new at this whole development thing for android and I don't know a slick of java. I'm tryin to teach myself this so I thought this would be a great resource. I've read the devoloper.android resources and i still dont understand it so here is my question.I'm making a simple app that will change the background color when the button is pressed. How do i make the button do that?</p><p>Any outside resources/examples would be greatly appreciated</p><p>Here is my code so far:</p><p>IntroActivity.java</p><pre><code> package com.flashcalc;import android.app.Activity;import android.os.Bundle;import android.view.View.OnTouchListener;import android.widget.Button;public class IntroActivity 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>Main.xml</p><pre><code>   &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@color/all_white""&gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    android:textColor=""@color/all_black""     android:gravity=""center_horizontal""/&gt;&lt;Button android:text=""@string/ChangeColor"" android:id=""@+id/ChangeColor""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content"" android:gravity=""center_horizontal|center_horizontal|center"" android:layout_gravity=""center_horizontal|center_horizontal|center""&gt; &lt;/Button&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;Tjs Flashlight&lt;/string&gt;    &lt;string name=""app_name""&gt;FlashCalc&lt;/string&gt;    &lt;string name=""ChangeColor""&gt;I Love Buttons&lt;/string&gt;    &lt;color name=""all_white""&gt;#FFFFFF&lt;/color&gt;    &lt;color name=""all_black""&gt;#000000&lt;/color&gt;&lt;/resources&gt;</code></pre>","527283","","21234","","2010-12-01 23:10:00","2010-12-03 18:30:35","Button Control?","<android><button>","2","0","","",""
"4330071","1","4366250","","2010-12-01 23:08:13","4","593","<p>i ve been facing some problems trying to pass data through intents and pending intents to a BroadcastReceiver, concerning proximity alerts. More specifically, am trying to pass an object, that among others holds the user's constantly changing position. I ve tried various tactics being proposed here (and not only) but none worked, resulting to either null values or same-as-first-time created intents, when the intent is retrieved on the BroadcastReceiver's side. Tactics used:</p><ul><li>Flagging the intent that carries the object with:FLAG_ACTIVITY_NEW_TASK+FLAG_ACTIVITY_CLEAR_TOP+FLAG_ACTIVITY_SINGLE_TOPResult:Null values on the BroadacastReceiver's side</li><li>Flagging the pending intent created using the initial intent, with:FLAG_UPDATE_CURRENT or FLAG_CANCEL_CURRENTResult:Null values on the BroadacastReceiver's side</li><li>Acquiring a random ID for intent or the pending intent using System.currentTimeMillis();Result:Intents are not fired or received at all</li><li>Nothing described above. Result:Retrieving the same initial value every time.</li></ul><p>Code for the calling method (stripped from any experimentations/producing null values):</p><pre><code>private void setProximityAlert(MyCar myCar) {   String locService = Context.LOCATION_SERVICE;   LocationManager locationManager;   locationManager = (LocationManager)getSystemService(locService);  float radius = myCar.getMyCarRadius();   long expiration = myCar.getMyCarExpiration();   myService.setMyDriverLat(userLat);//setting user's position  myService.setMyDriverLng(userLng);//setting user's position  Intent  intent = new Intent(myCar.getMyCarName());  intent.putExtra(""myCar"",myCar);  PendingIntent proximityIntent = PendingIntent.getBroadcast(this, -1, intent, 0);  locationManager.addProximityAlert(myCar.getMyCarLat(), myCar.getMyCarLng(), radius, expiration, proximityIntent); }</code></pre><p>Code for the calling method that sets the intent filter and registers the BroadcastReceiver:</p><pre><code>public void addNewCarPoint (MyCar myCar){        IntentFilter filter = new IntentFilter(myCar.getMyCarName());        registerReceiver(new ProximityAlertReceiver(), filter);        setProximityAlert(myCar);    }</code></pre><p>Code for the BroadcastReceiver's side:</p><pre><code>public class ProximityAlertReceiver extends BroadcastReceiver { @Override public void onReceive (Context context, Intent intent) { MyCar myCar=(MyCar)intent.getParcelableExtra(""myCar"");  driverLoc=(String)Double.toString(myCar.getMyDriverLat());  Toast.makeText(context, userLoc, Toast.LENGTH_SHORT).show();  Intent i = new Intent(context, MyCarDiscoveryPrompt.class);  context.startActivity(i);//firing intent } public void intentDataLoader(){       }</code></pre><p>}</p><p>Any ideas would be more than welcome.Thank you in advance.</p>","485328","","485328","","2011-01-05 11:28:19","2011-01-05 11:45:35","PendingIntents keep caching same object","<android><broadcastreceiver><android-intent><android-pendingintent>","3","0","1","",""
"4330112","1","4331299","","2010-12-01 23:13:47","0","993","<p>here is my WCF server code (VB.NET)...</p><p><strong>Service1.svc</strong></p><pre><code>Public Class Service1Implements IService1Public Sub New()End SubPublic Function GetText() As String Implements IService1.GetText    Return String.Format(""YO MTV ROCKS!"")End FunctionPublic Function GetData(ByVal value As Integer) As String Implements IService1.GetData    Return String.Format(""You entered: {0}"", value)End FunctionPublic Function GetDataUsingDataContract(ByVal composite As CompositeType) As CompositeType Implements IService1.GetDataUsingDataContract    If composite Is Nothing Then        Throw New ArgumentNullException(""composite"")    End If    If composite.BoolValue Then        composite.StringValue &amp;= ""Suffix""    End If    Return compositeEnd FunctionEnd Class</code></pre><p><strong>IService1.vb</strong></p><pre><code>' NOTE: You can use the ""Rename"" command on the context menu to change the interface name ""IService1"" in both code and config file together.&lt;ServiceContract()&gt;Public Interface IService1&lt;OperationContract()&gt; _&lt;WebGet(UriTemplate:=""GetText"", BodyStyle:=WebMessageBodyStyle.WrappedRequest, responseformat:=WebMessageFormat.Json, RequestFormat:=WebMessageFormat.Json)&gt; _Function GetText() As String&lt;OperationContract()&gt; _&lt;WebGet(UriTemplate:=""GetData?v={value}"", responseformat:=WebMessageFormat.Json)&gt; _Function GetData(ByVal value As Integer) As String&lt;OperationContract()&gt;Function GetDataUsingDataContract(ByVal composite As CompositeType) As CompositeType' TODO: Add your service operations hereEnd Interface' Use a data contract as illustrated in the sample below to add composite types to service operations.&lt;DataContract()&gt;Public Class CompositeType&lt;DataMember()&gt;Public Property BoolValue() As Boolean&lt;DataMember()&gt;Public Property StringValue() As String</code></pre><p>End Class</p><p><strong>Web.config</strong></p><pre><code>&lt;?xml version=""1.0""?&gt;&lt;configuration&gt;  &lt;system.web&gt;    &lt;compilation debug=""true"" strict=""false"" explicit=""true"" targetFramework=""4.0"" /&gt;      &lt;customErrors mode=""Off""/&gt;  &lt;/system.web&gt;  &lt;system.serviceModel&gt;    &lt;behaviors&gt;        &lt;endpointBehaviors&gt;            &lt;behavior name=""httpBehavior""&gt;                &lt;webHttp /&gt;            &lt;/behavior&gt;        &lt;/endpointBehaviors&gt;        &lt;serviceBehaviors&gt;            &lt;behavior name=""""&gt;                &lt;serviceMetadata httpGetEnabled=""true"" /&gt;                &lt;serviceDebug includeExceptionDetailInFaults=""false"" /&gt;            &lt;/behavior&gt;        &lt;/serviceBehaviors&gt;    &lt;/behaviors&gt;    &lt;serviceHostingEnvironment multipleSiteBindingsEnabled=""true"" /&gt;    &lt;services&gt;        &lt;service name=""HttpWcfWeb.VehicleService""&gt;            &lt;endpoint address=""""                behaviorConfiguration=""httpBehavior""                binding=""webHttpBinding""                contract=""HttpWcfWeb.IVehicleService"" /&gt;        &lt;/service&gt;    &lt;/services&gt;  &lt;/system.serviceModel&gt;  &lt;system.webServer&gt;    &lt;modules runAllManagedModulesForAllRequests=""true""/&gt;  &lt;/system.webServer&gt;&lt;/configuration&gt;</code></pre><p>here is my android client code...</p><pre><code>public static final String _URL = ""http://192.168.212.37:8080/Service1.svc"";protected void logIn(){    try    {// Send GET request to &lt;service&gt;/GetText   HttpGet request = new HttpGet(_URL + ""/GetText"");   request.setHeader(""Accept"", ""application/json"");   request.setHeader(""Content-type"", ""application/json"");   DefaultHttpClient httpClient = new DefaultHttpClient();   HttpResponse response = httpClient.execute(request);   HttpEntity responseEntity = response.getEntity();   // Read response data into buffer   long intCount = responseEntity.getContentLength();     char[] buffer = new char[(int)responseEntity.getContentLength()];     InputStream stream = responseEntity.getContent();     InputStreamReader reader = new InputStreamReader(stream);     reader.read(buffer);     stream.close();     tvStatus.append(""response: "");     JSONArray plates = new JSONArray(new String(buffer));     for (int i = 0; i &lt; plates.length(); ++i) {      tvStatus.append(plates.getString(i));     }    } catch (Exception e) {        e.printStackTrace();    }}</code></pre><p>For some unkown reason, I can run the VS 2010 client test and it the WCF host works fine.  The code above just returns nothing (it's supposed to return a string)</p><p>any ideas on what I'm doing wrong?</p>","496189","","","","","2011-01-29 23:44:43","Android app won't return result from VB.NET WCF Service","<.net><android><vb.net><wcf><json>","1","3","","",""
"4330115","1","4330195","","2010-12-01 23:14:32","4","5145","<p>I'm not new to Java but new to the Android platform. I'm finding one of the platforms shortcomings to be meaningful feedback on runtime crashes. Fine in user code where breakpoints apply, but I have a crash on first run that is preventing my project from starting, and I can't see a way to track it down. Can anyone shed any light?</p><pre><code>DalvikVM[localhost:8626]        Thread [&lt;1&gt; main] (Suspended (exception RuntimeException))          ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2585          ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2679           ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125         ActivityThread$H.handleMessage(Message) line: 2033          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]      Thread [&lt;6&gt; Binder Thread #2] (Running)     Thread [&lt;5&gt; Binder Thread #1] (Running) </code></pre><p>Same on emulator and device.</p><p>I've seen reports of crashes like these being caused by inflation of invalid XML so I have removed all XML's and resources from my project, almost one by one, and the same error remains! Are there any tricks or instrumentation I can apply to try and get a more meaningful error message? Thanks.</p>","524529","","","","","2010-12-01 23:26:36","Debugging Android RuntimeException - Before my code even executes","<android>","1","1","1","",""
"4330155","1","4330866","","2010-12-01 23:19:19","0","2767","<p>I have a simple question to solve, but I am not sure how to do it.</p><p>I have a class that extends Service that runs a thread looking for a TCP connection. If one comes in, it read an input message.</p><p>If the input message is ""START"", I start an activity, in this fashion:</p><pre><code>Intent dialogIntent = new Intent(getBaseContext(), VoIPCall.class);dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);dialogIntent.putExtra(""inetAddress"", clientSocket.getInetAddress());getApplication().startActivity(dialogIntent);</code></pre><p>While this activity is running, the Service keeps running. At some point I may reserve a ""STOP"". I would like to call a method in the previously created Activity but I am not sure how to interact with it.</p><p>I do not want to use a static method. How can I please do that?</p><p>Thank you very much,</p><p>EDIT: I changed my code to this:</p><pre><code>Intent dialogIntent = new Intent(""com.voip.rudy.START_CALL"");dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);dialogIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);dialogIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);dialogIntent.putExtra(""inetAddress"", clientSocket.getInetAddress());getApplication().startActivity(dialogIntent);</code></pre><p>And in the manifest:</p><pre><code>&lt;activity android:name="".VoIPCall""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""com.voip.rudy.START_CALL"" /&gt;        &lt;action android:name=""com.voip.rudy.STOP_CALL"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;&lt;category android:name=""android.intent.category.DEFAULT"" /&gt; was required to avoid having it crash.</code></pre><p>EDIT:</p><p>The solution given has fixed my issue but I wanted to actually act on member variables on that class, that are previously initialized. Say I call the constructor, then I would like to go back into this activity and act on the member variables.</p><p>The member variables are not initialized when I call one action after another, it seems to create a new activity somehow. Would there be anyway to act on the same activity, and keep the objects intact please?</p><p>James</p>","522835","","522835","","2010-12-02 20:06:50","2010-12-07 19:29:03","Android: calling a method from a Service to an Activity","<android><service><activity>","3","1","1","",""
"4330264","1","4330292","","2010-12-01 23:37:17","4","1047","<p>Having some trouble passing values from one class to another. I basically have a Timetable class from which I want to send a value to another class called daytab.The value I want to pass through is called day. I've attempted to pass it through using intent.putExtra() but it's either not sending the value or not receiving it.It's supposed to store the received variable in the String daynew in daytab.java</p><p>Timetable.java:<pre><code>package day.tab;</p><p>import android.app.TabActivity;</p><p>import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;</p><p>public class Timetable extends TabActivity {</p><pre><code>private static final String EXTRA_DAY = ""EXTRA_DAY"";/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    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, daytab.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""Monday"").setIndicator(""Mon"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    intent.putExtra(EXTRA_DAY, ""monday"");    tabHost.addTab(spec);    // Do the same for the other tabs    intent = new Intent().setClass(this, daytab.class);    spec = tabHost.newTabSpec(""Tuesday"").setIndicator(""Tue"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    intent.putExtra(EXTRA_DAY, ""tuesday"");    tabHost.addTab(spec);    intent = new Intent().setClass(this, daytab.class);    spec = tabHost.newTabSpec(""Wednesday"").setIndicator(""Wed"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    intent.putExtra(EXTRA_DAY, ""wednesday"");    tabHost.addTab(spec);    intent = new Intent().setClass(this, daytab.class);    spec = tabHost.newTabSpec(""Thursday"").setIndicator(""Thur"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    intent.putExtra(EXTRA_DAY, ""thursday"");    tabHost.addTab(spec);    intent = new Intent().setClass(this, daytab.class);    spec = tabHost.newTabSpec(""Friday"").setIndicator(""Fri"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    intent.putExtra(EXTRA_DAY, ""friday"");    tabHost.addTab(spec);    intent = new Intent().setClass(this, daytab.class);    intent.putExtra(EXTRA_DAY, ""saturday"");    spec = tabHost.newTabSpec(""Saturday"").setIndicator(""Sat"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, daytab.class);    spec = tabHost.newTabSpec(""Sunday"").setIndicator(""Sun"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    intent.putExtra(EXTRA_DAY, ""sunday"");    tabHost.addTab(spec);    tabHost.setCurrentTab(0);}</code></pre><p>}</pre></code></p><p>daytab.java.EXTRA_DAY:<pre><code>package day.tab;</p><p>import android.app.ListActivity;import android.content.Intent;import android.database.Cursor;import android.os.Bundle;import android.view.ContextMenu;import android.view.ContextMenu.ContextMenuInfo;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.AdapterContextMenuInfo;import android.widget.AdapterView.OnItemClickListener;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;</p><p>public class daytab extends ListActivity {</p><pre><code>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 String daynew;private NotesDbAdapter mDbHelper;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.notes_list);    daynew = getIntent().getStringExtra(""EXTRA_DAY"");    mDbHelper = new NotesDbAdapter(this);    mDbHelper.open();    fillData();    registerForContextMenu(getListView());    String[] hour = getResources().getStringArray(R.array.hours);    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, hour));    ListView lv = getListView();    lv.setTextFilterEnabled(true);    lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View view,                int position, long id) {                mDbHelper.open();                fillData();                registerForContextMenu(getListView());        }    });}/** Called when the activity is first created. */private void fillData() {    // Get all of the rows from the database and create the item list    Cursor notesCursor = mDbHelper.fetchAllNotes(daynew);    startManagingCursor(notesCursor);    // Create an array to specify the fields we want to display in the list (only TITLE)    String[] from = new String[]{NotesDbAdapter.KEY_TITLE};    // and an array of the fields we want to bind those fields to (in this case just text1)    int[] to = new int[]{R.id.text1};    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter notes =         new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to);    setListAdapter(notes);}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    menu.add(0, INSERT_ID, 0, R.string.menu_insert);    return true;}@Overridepublic boolean onMenuItemSelected(int featureId, MenuItem item) {    switch(item.getItemId()) {    case INSERT_ID:        createNote();        return true;    }    return super.onMenuItemSelected(featureId, item);}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,        ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    menu.add(0, DELETE_ID, 0, R.string.menu_delete);}@Overridepublic boolean onContextItemSelected(MenuItem item) {    switch(item.getItemId()) {    case DELETE_ID:        AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();        mDbHelper.deleteNote(info.id);        fillData();        return true;    }    return super.onContextItemSelected(item);}private void createNote() {    Intent i = new Intent(this, NoteEdit.class);    startActivityForResult(i, ACTIVITY_CREATE);}@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Intent i = new Intent(this, NoteEdit.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>}</pre></code></p><p>AndroidManifest.xml:<pre>    </p><pre><code>    &lt;activity android:name="".Timetable"" 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="".NoteEdit""&gt;&lt;/activity&gt;    &lt;activity android:name="".daytab""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""aexp.Timetable.add""&gt;&lt;/action&gt;            &lt;category android:name=""android.intent.category.LAUNCHER""&gt;&lt;/category&gt;        &lt;/intent-filter&gt;</code></pre><p><br>        </pre></p><p>Thanks in advance for any help!!</p>","527303","","527303","","2010-12-02 00:13:39","2010-12-02 00:13:39","Can't get values passed through using Intent","<java><android>","1","0","","",""
"4330334","1","","","2010-12-01 23:51:35","1","900","<p>So there are ways to get the current battery levels via a listener. However, these give you the values of the phone's current battery state, but no indicator of how fast/slow is the rate at which the battery is draining.</p><p>What would be a way to estimate the time remaining until the battery is depleted? Can you do anything knowing what the voltage is? Or perhaps monitor the rate at which the battery drains over a period of time and then extrapolating it?</p><p>Many thanks.</p>","527329","","","","","2012-06-01 13:03:57","Estimating time until battery is depleted for Android phones programmatically","<android>","1","0","","",""
"4330357","1","","","2010-12-01 23:54:28","4","1236","<p>I'm using the Apache HTTP commons <code>DefaultHttpClient</code> and after construction, I'm setting its retry handler:</p><pre><code>httpClient.setHttpRequestRetryHandler(new HttpRequestRetryHandler() {                @Override                public boolean retryRequest(final IOException ioe,                        final int numRetry, final HttpContext context)                {                    Log.d(TAG, ""retry handler received exception of type: "" + ioe.getClass().getName() + "", num retries: "" + numRetry);                    if (numRetry > 4) { // 3 retries                        return false;                    }                    // Some exceptions we can retry without knowledge of which methods are being invoked                    if (ioe instanceof NoHttpResponseException                            || ioe instanceof UnknownHostException                            || ioe instanceof SocketException) {                    }                    return false;                }        });</code></pre><p>The server that I am sending my requests to frequently times out, and in the <code>catch</code> of my execute() call, I receive an IO error, ""The operation timed out"" however I never see any the ""retry handler received exception of type"" log statement in my console output. All of my requests are POST requests, but they are idempotent--they're safe to call multiple times without adverse side-effects.</p><p>Am I setting up the retry handler incorrectly? Is the retry handler only invoked in certain scenarios?</p>","300368","","115145","","2010-12-02 01:08:26","2013-06-28 07:07:26","Apache HttpClient HttpRequestRetryHandler never invoked","<java><android><httpclient>","2","0","1","",""
"4330392","1","4794289","","2010-12-01 23:59:16","10","7194","<p>I have a string that is already in the proper URLEncoded Form format and would like to send it through a POST request on Android to a PHP server. I know the method for sending URL encoded forms on Android uses the <a href=""http://developer.android.com/reference/org/apache/http/client/entity/UrlEncodedFormEntity.html""><code>UrlEncodedFormEntity</code></a> and I know <a href=""http://www.androidsnippets.org/snippets/36/index.html"">how to use it</a>. The problem with that is that the data comes into the function already URL encoded and joined by ampersands, so using <code>UrlEncodedFormEntity</code> would involve a lot of extra work to turn it into a <code>List</code> of <code>NameValuePairs</code> and I'd rather not.</p><p><strong>So, how do I make a proper POST request sending this string as the content body?</strong></p><p>I have already tried using <a href=""http://developer.android.com/reference/org/apache/http/entity/StringEntity.html""><code>StringEntity</code></a>, but the PHP server didn't get any of the data (empty <code>$_POST</code> object).</p><p>I am testing against <a href=""http://test.lifewanted.com/echo.json.php"">http://test.lifewanted.com/echo.json.php</a> which simply is</p><pre><code>&lt;?php echo json_encode( $_REQUEST );</code></pre><p>Here is an example of the already-encoded data:</p><blockquote>  <p>partnerUserID=email%40example.com&amp;partnerUserSecret=mypassword&amp;command=Authenticate</p></blockquote>","321937","","","","","2011-06-04 14:21:24","On Android, make a POST request with URL Encoded Form data without using UrlEncodedFormEntity","<android><urlencode><http-post>","1","0","5","",""
"4330439","1","4330528","","2010-12-02 00:06:13","0","805","<p>i have to parse a RSS feed and display the same in android. i am using a DOM parser. i am able to parse all the tag except for the tag that has html formatting tags. for example</p><pre><code>&lt;description&gt;&lt;p&gt;&lt;span style=""font-family: arial, geneva, sans-serif; font-size: 11px;""&gt;&lt;p style=""font-family: Arial, Helvetica, sans-serif; max-width: 600px; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margi&lt;strong&gt;WILL YOUR KIDS LOVE ROCK OF AGES AS MUCH AS YOU WILL?&lt;/strong&gt;&amp;nbsp;We think they will have a great time, but you should know that he age of 14.&lt;/span&gt;&lt;/p&gt;&lt;/description&gt;</code></pre><p>Could some one please guide me how do I get the unformatted text content from that tag . Also, changing the RSS feed is not an option...</p><p>thanks</p>","377337","","","","","2013-01-16 07:18:36","rss parsing using dom, html format tags","<android><dom><html-parsing><domparser>","2","0","","",""
"4330521","1","4331643","","2010-12-02 00:19:56","6","4907","<p>I'm trying to create a GLSurfaceView that displays a map of a game area. When the player moves, the game activity calls highlightSpot, which in turn should trigger a render request. The only time I want to re-draw the view is when the player moves.</p><p>However, with my current implementation, despite calling <code>setRenderMode(RENDERMODE_WHEN_DIRTY)</code> on my GLSurfaceView, its render mode still seems to be continuous. To check, I threw a single println statement in my onDrawFrame method, and when I run my application, the output quickly fills up my logcat without the player moving even once-- it's clearly not behaving as I intended. Is there something else I need to do in order to make the view render only when asked?</p><p>(The bulk of this code is derived from the tutorials at <a href=""http://insanitydesign.com/wp/projects/nehe-android-ports/"">http://insanitydesign.com/wp/projects/nehe-android-ports/</a>. I omitted my onDrawFrame, OnSurfaceChanged, and onSurfaceCreated methods for the sake of conciseness, as I am not changing the render mode or requesting a render anywhere in those methods. If someone thinks it might be relevant, I can post those too.)</p><pre><code>public class SurfaceViewClass extends GLSurfaceView implements Renderer {    public SurfaceViewClass(Context context) {        super(context);        ...        this.setRenderer(this);        this.setRenderMode(RENDERMODE_WHEN_DIRTY);    }    public void highlightSpot(int x, int y) {        /* change some variables here */        ...        this.requestRender();    }}</code></pre>","496830","","44729","","2010-12-02 01:42:58","2010-12-02 04:21:38","GLSurfaceView continuously renders despite changing render mode","<android><opengl-es><glsurfaceview>","1","0","1","",""
"4330565","1","4331266","","2010-12-02 00:28:41","6","13963","<p>i am using a custom CursorAdapter to get data from a SQLite database and show it in a listview. The database contains a 2 columns with about 8.000 rows. so i am looking for a way to query and show all the data as fast as possible. i have done this with asyncTask here is the code:</p><pre><code>private class PrepareAdapter extends AsyncTask&lt;Void,Void,CustomCursorAdapter &gt; { @Override protected void onPreExecute() {     dialog.setMessage(""Wait"");     dialog.setIndeterminate(true);     dialog.setCancelable(false);     dialog.show();     Log.e(""TAG"",""Posle nov mAdapter""); } @Override protected CustomCursorAdapter doInBackground(Void... unused) {   Cursor cursor =  myDbNamesHelper.getCursorQueryWithAllTheData();   mAdapter.changeCursor(cursor);   startManagingCursor(cursor);   Log.e(""TIME"",""posle start managing Cursor"" + String.valueOf(SystemClock.elapsedRealtime()-testTime)+ "" ms"");     testTime=SystemClock.elapsedRealtime();     mAdapter.initIndexer(cursor);     return mAdapter; } protected void onPostExecute(CustomCursorAdapter result) {     TabFirstView.this.getListView().setAdapter(result);     Log.e(""TIME"",""posle adapterSet"" + String.valueOf(SystemClock.elapsedRealtime()-testTime)+ "" ms"");    testTime=SystemClock.elapsedRealtime();     dialog.dismiss(); }</code></pre><p>}</p><p>this works good except the part when i need to set the result into an adapter. i have done some time tests and it takes aprox 700 ms to make it past the startManagingCursor. the problem is that it takes about 7 seconds to make it past the setAdapter(result) and this is running in UI thread so it makes my app unresponsive (the progress dialog freezes and sometimes does the app). how do i make this time less? can i make this also run in background or any way to increase responsiveness?</p><p>tnx.</p><pre><code>public class CustomCursorAdapter extends SimpleCursorAdapter implements OnClickListener,SectionIndexer,Filterable,                                    android.widget.AdapterView.OnItemClickListener{    private Context context;    private int layout;    private AlphabetIndexer alphaIndexer;    public CustomCursorAdapter (Context context, int layout, Cursor c, String[] from, int[] to) {        super(context, layout, c, from, to);        this.context = context;        this.layout = layout;    }    public void initIndexer(Cursor c){         alphaIndexer=new AlphabetIndexer(c, c.getColumnIndex(DataBaseNamesHelper.COLUMN_NAME), "" ABCDEFGHIJKLMNOPQRSTUVWXYZ"");    }    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent) {        Cursor c = getCursor();        final LayoutInflater inflater = LayoutInflater.from(context);        View v = inflater.inflate(layout, parent, false);        int nameCol = c.getColumnIndex(DataBaseNamesHelper.COLUMN_NAME);        String name = c.getString(nameCol);        /**         * Next set the name of the entry.         */        TextView name_text = (TextView) v.findViewById(R.id.name_entry);        if (name_text != null) {            name_text.setText(name);        }        int favCol = c.getColumnIndex(DataBaseNamesHelper.COLUMN_FAVOURITED);        int fav = c.getInt(favCol);        int idCol = c.getColumnIndex(DataBaseNamesHelper.COLUMN_ID);        Button button = (Button) v.findViewById(R.id.Button01);        button.setOnClickListener(this);        button.setTag(c.getInt(idCol));        if(fav==1){            button.setVisibility(View.INVISIBLE);        }        else button.setVisibility(View.VISIBLE);        return v;    }    @Override    public void bindView(View v, Context context, Cursor c) {        int nameCol = c.getColumnIndex(DataBaseNamesHelper.COLUMN_NAME);        String name = c.getString(nameCol);        /**         * Next set the name of the entry.         */        TextView name_text = (TextView) v.findViewById(R.id.name_entry);        if (name_text != null) {            name_text.setText(name);        }        int favCol = c.getColumnIndex(DataBaseNamesHelper.COLUMN_FAVOURITED);        int fav = c.getInt(favCol);        Button button = (Button) v.findViewById(R.id.Button01);        button.setOnClickListener(this);        int idCol = c.getColumnIndex(DataBaseNamesHelper.COLUMN_ID);        button.setTag(c.getInt(idCol));      //  Log.e(""fav"",String.valueOf(fav));        if(fav==1){            button.setVisibility(View.INVISIBLE);        } else button.setVisibility(View.VISIBLE);    }    @Override    public int getPositionForSection(int section) {        return alphaIndexer.getPositionForSection(section);    }    @Override    public int getSectionForPosition(int position) {          return alphaIndexer.getSectionForPosition(position);    }    @Override    public Object[] getSections() {          return alphaIndexer.getSections();    }    @Override    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {        Log.e(""item Click"", arg1.toString()+ "" position&gt; "" +arg2);    }    @Override    public void onClick(View v) {            if(v.getId()==R.id.Button01){                //Log.e(""Button Click"", v.toString()+ "" position&gt; "" +v.getTag().toString());                v.setVisibility(View.INVISIBLE);                DataBaseNamesHelper dbNames = new DataBaseNamesHelper(context);                dbNames.setFavouritesFlag(v.getTag().toString());            }        }}</code></pre>","448192","","448192","","2010-12-02 02:10:26","2013-08-28 02:21:08","Using Cursor with ListView adapter for a large amount of data","<android><database><listview><adapter>","4","5","4","",""
"4330675","1","8741875","","2010-12-02 00:49:40","21","13398","<p>I'm using overridePendingTransition for when my activity is created and that works fine I can see the fade in works great, but when I try and animate the finish on the activity it is still doing the default right to left slide.</p><p>I first tried defining the out animation when I start the activity as follows:</p><pre><code>Intent myIntent = new Intent(a, SkdyAlert.class);    myIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);    a.startActivity(myIntent);    if (android.os.Build.VERSION.SDK_INT &gt; android.os.Build.VERSION_CODES.DONUT) {        AnimationHelper.overridePendingTransition(a, R.anim.fadein, R.anim.fadeout);    }</code></pre><p>Then I tried doing it when I finish the activity as well</p><pre><code>okBtn.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            finish();            if (android.os.Build.VERSION.SDK_INT &gt; android.os.Build.VERSION_CODES.DONUT) {                AnimationHelper.overridePendingTransition(activity, 0, R.anim.fadeout);            }        }    });</code></pre><p>But neither of these approaches will prevent the ""right to left"" slide for the exit animation.  Any ideas on what I'm doing wrong?</p>","469682","","","","","2013-09-25 11:31:54","How can I add an animation to the activity finish()","<android><animation><activity>","5","0","2","",""
"4330806","1","4330858","","2010-12-02 01:15:40","3","1048","<p>I want to set up an intent filter to handle urls like:<a href=""http://mysite.com/?action=delete&amp;id=30492"" rel=""nofollow"">http://mysite.com/?action=delete&amp;id=30492</a></p><p>I've tried setting up my <code>intent-filter</code> as follows:</p><pre><code>&lt;intent-filter&gt;&lt;action android:name=""android.intent.action.VIEW"" /&gt;&lt;category android:name=""android.intent.category.DEFAULT"" /&gt;&lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;&lt;data android:scheme=""http"" android:host=""mysite.com"" android:pathPrefix=""/?action=""/&gt;&lt;/intent-filter&gt;</code></pre><p>However, this doesn't work, and my app is not recognized as being able to handle the URL. I know that it's because I'm doing something wrong with my <code>pathPrefix</code> because when I remove the <code>pathPrefix</code> it works.  I also know that it's related to having the question mark in there because if I remove the question mark from the URL and the <code>pathPrefix</code>, it works.</p><p>Do I need to escape the question mark in some way?  I tried escaping with a slash (<code>android:pathPrefix=""/\?action=""</code>) but that doesn't work either.</p><p>How can I get this intent filter to work?</p>","527393","","377270","","2012-03-22 03:01:48","2012-03-22 03:01:48","intent filter pathPrefix with question mark","<android>","1","0","","",""
"4330957","1","4330988","","2010-12-02 01:51:13","4","668","<p>I know that adding <code>android:theme=""@android:style/Theme.NoTitleBar""</code> to the manifest removes the title, but what do I do to remove the notifications bar?</p>","498680","","1292730","","2012-05-01 14:08:26","2012-05-01 14:08:26","How to remove the android notifications bar?","<android><android-notification-bar>","1","0","","",""
"4330962","1","","","2010-12-02 01:52:26","2","11629","<p>I am new to android so please if I sound stupid, do not reply.</p><p>Hello,I have tried searching all over the net for a good tutorial that would help me understand how android takes the touch events and reacts accordingly. But I have not been successful. If anyone knows a good tutorial that could help me, please post it here. It would be very helpful.</p>","524570","","1228","","2013-08-14 12:27:04","2013-08-14 12:27:04","Need touch tutorial","<android><touch><new-operator>","3","1","2","2013-08-14 12:35:59",""
"4331004","1","","","2010-12-02 02:03:12","1","4109","<p>I'm using a JS Charts library to draw graphs in a WebView of my Android Application. I want to provide the data from the SQLite database. At this moment I'm stuck on how to pass array of data from Java to JavaScript. The JavaScript part expects something like that:</p><pre><code>data = new Array([10, 10], [20, 10]);</code></pre><p>I know about the <em>addJavaScriptInterface</em> and I managed to pass single values from my Activity to a WebView. It's only the array that gives me trouble. I thought about something like that:</p><pre><code>final class ChartDataLoader{</code></pre><p>public double[][] getData(){   double[][] data = { {10,10}, {20, 10} };   return data;  } }</p><p>Note that for now I'm just hard-coding the data, but eventually this will be pulled out from a database. So then I expose this to my JS: </p><pre><code>webView.addJavascriptInterface(new ChartDataLoader(), ""dataLoader"");</code></pre><p>And finally try to read it in JavaScript:</p><pre><code>&lt;html&gt;&lt;head&gt;&lt;script type=""text/javascript"" src=""jscharts.js""&gt;&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;div id=""chartcontainer""&gt;You should see a chart here.&lt;/div&gt;&lt;script type=""text/javascript""&gt; myData = dataLoader.getData();  alert(""DataReceived: "" + myData.length); alert(""Element 0 : "" + myData[0]); var myChart = new JSChart('chartcontainer', 'line'); myChart.setDataArray(myData); myChart.draw();&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>JavaScript fails on those two alert statements stating:</p><blockquote>  <p>ERROR/Web Console(2455): Uncaught  TypeError: Cannot read property  'length' of undefined at  file:///android_asset/chart.html:15</p></blockquote><p>Any hints? I saw some code online where other people convert arrays to a String and then recreate it back in JavaScript but that seems like an overkill to me and I was hoping for a better solution. An alternative is to pass an XML file to the chart library, but again, I thought it would be slow to create a new XML every time a user wants to see a graph.</p>","527417","","","","","2013-02-25 11:00:24","Passing an array of values from Android Activity to JavaScript in a WebView","<java><javascript><android><android-webview>","2","1","3","",""
"4331021","1","4331122","","2010-12-02 02:08:14","2","2247","<p>this must be simple, but i'm missing it. </p><p>i have a complex model that has >32767 vertices. now, the indices can only be passed to opengl as type GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT. java has no concept of unsigned, so the unsigned short option maps to simply (signed) short, which is 16 bits, or +32767. when i specify the vertices, i need to pass opengl a short[], where the values in the array point to a vertex in the vertice array. however, if there are >32767 vertices, the value won't fit in the short[].</p><p>is there another way to specify the indices? code snippet is below, thanks.</p><pre><code>    short[] shorts = ... read the indices ...;    ...    ShortBuffer indicesBuffer = null;    ByteBuffer ibb = ByteBuffer.allocateDirect(indices.length * Short.SIZE / 8);    ibb.order(ByteOrder.nativeOrder());    indicesBuffer = ibb.asShortBuffer();    indicesBuffer.put(indices);    indicesBuffer.position(0);    ...    gl.glDrawElements(GL10.GL_TRIANGLES, numOfIndices, GL10.GL_UNSIGNED_SHORT, indicesBuffer);    ...</code></pre>","337455","","44729","","2010-12-02 05:42:34","2010-12-02 05:42:34","java opengl: glDrawElements() with >32767 vertices","<java><android><opengl-es><unsigned><short>","1","2","","",""
"4331023","1","4356134","","2010-12-02 02:08:47","2","74","<p>I have two spinners, spinner A and spinner B.  When the user changes A, B gets updated with a full new set of data.  I also implemented a callback for B to use setOnItemSelectedListener so that I can modify some objects in another class whenever B is changed by the user.</p><pre><code>B.setOnItemSelectedListener(new OnItemSelectedListener() {    public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {        mComponentColor.setSelection(position);        mCompColorAsBuilt[mComponent.getComponentSelection()] = position;        setColor();         }});</code></pre><p>The problem I've ran into is that I really don't want these objects to change unless the user was the one who changed the spinner.  Because I automatically populate B based on A's selection, B's callback is invoked when the users changes A.</p><p>Any thoughts how I could deal with this situation?</p>","432209","","","","","2010-12-04 22:17:30","Programatic call to a method vs. a user initiated call via the UI - how to handle both when the application must know the difference?","<java><android><callback>","1","5","","",""
"4331087","1","","","2010-12-02 02:19:27","2","198","<p>I am developing an android application in which a tweet option is to be implemented. I have downloaded the jTwitter.jar file and when i try to tweet from my application it says the login is invalid, eventhoigh i can login to twitter from a pc using the same login details.Please help.</p>","527428","","83446","","2011-03-11 03:22:32","2011-03-11 03:22:32","Need help with tweeting from android application","<android><twitter-api>","0","5","1","",""
"4331094","1","4331437","","2010-12-02 02:20:28","13","27640","<p>I am trying to add a progress bar or loading bar to my application which uses webview. I have to application set up to run all the links within the app but i am confused on how to implement a progress bar for whenever a link is clicked on</p><p>here is my code that i am using</p><pre><code>public class CULearnBrowser extends Activity {WebView webview;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);webview = (WebView) findViewById(R.id.webview);webview.setWebViewClient(new HelloWebViewClient());webview.getSettings().setJavaScriptEnabled(true);webview.loadUrl(""https://culearn.colorado.edu/webct/entryPageIns.dowebct"");}private class HelloWebViewClient extends WebViewClient {@Overridepublic boolean shouldOverrideUrlLoading(WebView view, String url){view.loadUrl(url);return true;}}public boolean onKeyDown(int keyCode, KeyEvent event) {if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {webview.goBack();return true;}return super.onKeyDown(keyCode, event);}}</code></pre><p>Here is the 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;WebView  xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/webview""android:layout_width=""fill_parent""android:layout_height=""fill_parent""/&gt;&lt;TextView  android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""@string/hello""/&gt;&lt;/LinearLayout&gt;</code></pre><p>any help would be greatly appreciated. I know it shouldnt be hard but i cant figure it out</p>","524592","","524592","","2010-12-02 04:12:00","2014-01-30 13:48:41","How to add a Progress Bar in Webview","<android><progress-bar><android-webview><progressdialog>","5","1","4","",""
"4331255","1","","","2010-12-02 02:55:22","1","999","<p>I need to populate my baseadapter.<br>I parse my JSONArray, but I have problem to put the image into my baseadapter.<br>The timestamp and name works good.<br>How can i do this?<br>I need to have a list of post:<br>AVATAR - Nickname<br>Image<br>timestamp<br></p><pre><code>public class Latest extends Activity {public Latest() {    // TODO Auto-generated constructor stub}keepClient keep = new keepClient();HttpClient client = keep.startClient();HttpResponse response = keep.getHttpResponse();HttpEntity entity;String url = ""http://blablabl.getvlalalal.get.com"";String username =""user"";String password = ""password"";String json = null;JSONArray myArray = null;JSONObject myObject = null;ArrayList&lt;Post&gt; postList = new ArrayList&lt;Post&gt;();ArrayList&lt;HashMap&lt;String, Object&gt;&gt; data = new ArrayList&lt;HashMap&lt;String,Object&gt;&gt;();@Overrideprotected void onCreate(Bundle savedInstanceState) {    // TODO Auto-generated method stub    super.onCreate(savedInstanceState);    setContentView(R.layout.latest);    try {        keep.doLogin(username, password, client);        json = URLreader(url, entity);        JSONArray ja = new JSONArray(json);        myArray = ja.getJSONArray(1);        postList = PostList(myArray.length(), myArray);        String[] from = {""profile_image"", ""name"", ""item"", ""timestamp""};        int[] to = {R.id.avatar,R.id.fullname,R.id.purchase ,R.id.timestamp};        SimpleAdapter adapter=new SimpleAdapter(                getApplicationContext(),                data,                R.layout.latestrow,                from,                to);        ((ListView)findViewById(R.id.latestwrapper)).setAdapter(adapter);    } catch (ClientProtocolException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (JSONException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }}ArrayList&lt;Post&gt; PostList (int index, JSONArray myArray) throws JSONException, MalformedURLException {    ArrayList&lt;Post&gt; posts_list = new ArrayList&lt;Post&gt;();    for (int i = 0; i &lt; index; i++) {        myObject = myArray.getJSONObject(i);        posts_list.add(createPost(myObject));        HashMap&lt;String, Object&gt; postMap = new HashMap&lt;String, Object&gt;();        postMap.put(""profile_image"", posts_list.get(i).getProfile_Image());        postMap.put(""name"", posts_list.get(i).getName());        postMap.put(""item"", new URL(posts_list.get(i).getItem()));        postMap.put(""timestamp"", posts_list.get(i).getTimeStamp());        data.add(postMap);    }    return posts_list; }Post createPost(JSONObject jo) throws JSONException{    String profile_image, name, item, timestamp;    profile_image = jo.getString(""image"");    name = jo.getString(""name"");    item = jo.getString(""thumbnail"");    timestamp = jo.getString(""timestamp"");    Post post = new Post(profile_image, name, item, timestamp);    return post;}</code></pre>","496371","","","","","2010-12-02 02:55:22","JSONObject get Image/Populate BaseAdapter","<android>","0","0","","",""
"4331422","1","","","2010-12-02 03:37:33","1","389","<p>I am creating a multiple choice layout for contact list. I successfully pick the contacts. However, instead of displaying the contact name in text view,it appear as String value. I just want the contact name to appear in TextView not the String values.</p><p>I got 2 classes. One class is to pick contact. While the other class is for browsing and selecting the contacts.</p><p>Selected Contact Activity</p><pre><code>package com.droidnova.android.samples; import android.app.Activity;  import android.content.Intent;  import android.database.Cursor;  import android.os.Bundle;  import android.provider.Contacts.People;  import android.provider.ContactsContract.Contacts;  import android.view.View;  import android.widget.Button;   public class SelectContact extends Activity { private static final int PICK_CONTACT = 0; private Button btnPick;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.button);        btnPick = (Button)findViewById(R.id.button);        btnPick.setOnClickListener(new MyOnClickListener());    }    @Override     protected void onActivityResult(int requestCode, int resultCode, Intent data) {        if (requestCode == PICK_CONTACT) {            if (resultCode == RESULT_OK) {                Cursor contact = getContentResolver().query(data.getData(), null, null, null, null);                contact.moveToFirst();                String name = contact.getString(contact.getColumnIndexOrThrow(People.NAME));        }    }       }    private class MyOnClickListener implements View.OnClickListener {     @Override   public void onClick(View v) {         startActivityForResult(new Intent(Intent.ACTION_PICK),PICK_CONTACT);  }  }}</code></pre><p>Contacts Activity</p><pre><code>package com.droidnova.android.samples; import java.util.ArrayList; import java.util.List; import java.util.zip.Inflater; import android.app.ListActivity; import android.content.Context; import android.content.Intent; import android.content.DialogInterface.OnClickListener; import android.database.Cursor; import android.os.Bundle; import android.provider.Contacts.People; import android.util.Log; import android.util.SparseBooleanArray; import android.view.View; import android.widget.Adapter; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleCursorAdapter; import android.widget.TextView; public class Contacts extends ListActivity {ListView list;TextView Selection;private static String[] PROJECTION = new String[]{    People._ID,    People.NAME,    People.NUMBER,};  @Override public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    list=(ListView)findViewById(android.R.id.list);    Cursor cursor = getContentResolver().query(People.CONTENT_URI,             PROJECTION, null, null, null);    startManagingCursor(cursor);    ListAdapter adapter = new SimpleCursorAdapter(this,android.R.layout.simple_list_item_multiple_choice,            cursor,new String[]{People.NAME},new int[]{android.R.id.text1});    getListView().setChoiceMode(2);   setListAdapter(adapter);    Selection = (TextView)findViewById(R.id.selection);   }  @Override  protected void onListItemClick(ListView parent,View v,int position,long id){  Selection.setText("""");  SparseBooleanArray chosen = parent.getCheckedItemPositions();  for(int i=0;i&lt;chosen.size();i++)  {          Log.d(""Selection"", ""index:""+i+"";key:""+chosen.keyAt(i) +"";value:""+chosen.valueAt(i)                  +"";""+PROJECTION[chosen.keyAt(i)]);          if(chosen.valueAt(i)){              Selection.append(PROJECTION[chosen.keyAt(i)]+"""");          }      }  }</code></pre><p>}</p><hr><p>This is my logcat:</p><pre class=""lang-none prettyprint-override""><code>12-02 03:10:49.840: INFO/ActivityManager(53): Starting activity: Intent {    act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.droidnova.android.samples/.SelectContact }12-02 03:10:49.930: INFO/ActivityManager(53): Start proc com.droidnova.android.samples for activity com.droidnova.android.samples/.SelectContact: pid=715 uid=10025 gids={1015}12-02 03:10:49.930: DEBUG/AndroidRuntime(709): Shutting down VM12-02 03:10:49.930: DEBUG/dalvikvm(709): DestroyJavaVM waiting for non-daemon threads to exit12-02 03:10:49.940: DEBUG/dalvikvm(709): DestroyJavaVM shutting VM down12-02 03:10:49.940: DEBUG/dalvikvm(709): HeapWorker thread shutting down12-02 03:10:49.940: DEBUG/dalvikvm(709): HeapWorker thread has shut down12-02 03:10:49.940: DEBUG/jdwp(709): JDWP shutting down net...12-02 03:10:49.940: INFO/dalvikvm(709): Debugger has detached; object registry had 1 entries12-02 03:10:49.960: DEBUG/dalvikvm(709): VM cleaning up12-02 03:10:49.990: ERROR/AndroidRuntime(709): ERROR: thread attach failed12-02 03:10:50.030: DEBUG/dalvikvm(709): LinearAlloc 0x0 used 639500 of 5242880 (12%)12-02 03:10:50.230: DEBUG/ddm-heap(715): Got feature list request12-02 03:10:50.910: INFO/ActivityManager(53): Displayed activity com.droidnova.android.samples/.SelectContact: 1000 ms (total 1000 ms)12-02 03:10:51.921: INFO/ActivityManager(53): Starting activity: Intent { act=android.intent.action.PICK cmp=com.droidnova.android.samples/.Contacts }12-02 03:10:52.441: INFO/ActivityManager(53): Displayed activity com.droidnova.android.samples/.Contacts: 431 ms (total 431 ms)12-02 03:10:53.521: DEBUG/Selection(715): index:0;key:0;value:true;_id12-02 03:10:54.391: DEBUG/Selection(715): index:0;key:0;value:true;_id12-02 03:10:54.391: DEBUG/Selection(715): index:1;key:1;value:true;name12-02 03:10:54.841: DEBUG/Selection(715): index:0;key:0;value:true;_id12-02 03:10:54.851: DEBUG/Selection(715): index:1;key:1;value:true;name12-02 03:10:54.851: DEBUG/Selection(715): index:2;key:2;value:true;number12-02 03:10:57.531: DEBUG/dalvikvm(220): GC freed 43 objects / 2024 bytes in 77ms12-02 03:11:24.040: DEBUG/Selection(715): index:0;key:0;value:false;_id12-02 03:11:24.040: DEBUG/Selection(715): index:1;key:1;value:true;name12-02 03:11:24.050: DEBUG/Selection(715): index:2;key:2;value:true;number12-02 03:11:25.120: DEBUG/Selection(715): index:0;key:0;value:false;_id12-02 03:11:25.120: DEBUG/Selection(715): index:1;key:1;value:false;name12-02 03:11:25.130: DEBUG/Selection(715): index:2;key:2;value:true;number12-02 03:11:25.670: DEBUG/Selection(715): index:0;key:0;value:false;_id12-02 03:11:25.680: DEBUG/Selection(715): index:1;key:1;value:false;name12-02 03:11:25.680: DEBUG/Selection(715): index:2;key:2;value:false;number12-02 03:11:26.641: DEBUG/Selection(715): index:0;key:0;value:true;_id12-02 03:11:26.641: DEBUG/Selection(715): index:1;key:1;value:false;name12-02 03:11:26.651: DEBUG/Selection(715): index:2;key:2;value:false;number12-02 03:11:27.171: DEBUG/Selection(715): index:0;key:0;value:true;_id12-02 03:11:27.181: DEBUG/Selection(715): index:1;key:1;value:true;name12-02 03:11:27.181: DEBUG/Selection(715): index:2;key:2;value:false;number12-02 03:49:00.191: DEBUG/dalvikvm(53): GC freed 17933 objects / 880976 bytes in 150ms12-02 04:22:34.131: DEBUG/dalvikvm(102): GC freed 11675 objects / 524064 bytes in 81ms12-02 04:38:00.181: DEBUG/dalvikvm(53): GC freed 20167 objects / 943152 bytes in 147ms</code></pre>","509141","","387076","","2013-08-06 08:36:11","2013-08-06 08:36:11","Why do the selected contacts not appear in the textview?","<android><textview><android-contacts>","1","2","","",""
"4331569","1","","","2010-12-02 04:04:50","0","539","<p>I developed small application .It contain a <code>ListView</code> in <code>Dialog</code> box .</p><p>I tested my application it work just fine all emulator except in a emulators with specification qvga 240*320 and wqvga432 in that Item separator are not shown all in ListView!.</p><p>I added </p><p><code>&lt;uses-sdk android:minSdkVersion=""6"" /&gt;</code></p><p>layout of item in listview</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  &gt;  &lt;TextView    android:layout_height=""60dip""    android:id=""@+id/ThemeLabel""    android:layout_width=""wrap_content""     android:layout_alignParentLeft=""true""     android:paddingRight=""50dip""    android:paddingLeft=""20dip""    android:paddingTop=""10dip""    android:text=""Theme 7""     android:textColor=""#fff""    android:textSize=""20dip""&gt;  &lt;/TextView&gt;  &lt;ImageView    android:layout_width=""50dip""    android:layout_height=""50dip""    android:paddingRight=""10dip""    android:layout_margin=""3dip""    android:id=""@+id/ThemeIcon""    android:background=""@drawable/icon""    android:layout_toRightOf=""@id/ThemeLabel""  &gt;  &lt;/ImageView&gt;&lt;/RelativeLayout&gt;</code></pre><p>tag in the manifest fileAnd tested in samasung Galaxy 3 ,I got same  result</p><p>Any Help will be highly appreciated</p><p>thanks in advance</p><p>Regards,kariyachan</p>","482604","","482604","","2010-12-08 03:09:19","2011-02-16 07:49:34","ListView with custom Adapter does not show all item seperator between different listItems","<android><gui><listview>","2","0","","",""
"4331735","1","4407441","","2010-12-02 04:40:04","2","731","<p>In my activity I am calling webservices. So after the webservice returns the result, I have to show an alert. Since alert is UI part, I think inside onPostExecute() I have to write the alert code. But when I do like that error is coming.</p><p>Error shown:</p><pre><code>12-02 09:59:08.508: ERROR/AndroidRuntime(451): Uncaught handler: thread main exiting due to uncaught exception12-02 09:59:08.528: ERROR/AndroidRuntime(451): android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@4378eb50 is not valid; is your activity running?12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at android.view.ViewRoot.setView(ViewRoot.java:456)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at android.view.Window$LocalWindowManager.addView(Window.java:409)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     atandroid.app.Dialog.show(Dialog.java:238)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at android.app.AlertDialog$Builder.show(AlertDialog.java:802)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at    com.myapp.android.activities.Register$PostCodeTask.onPostExecute(Register.java:291)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at     com.myapp.android.activities.Register$PostCodeTask.onPostExecute(Register.java:1)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     atandroid.os.AsyncTask.finish(AsyncTask.java:416) 12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at android.os.AsyncTask.access$300(AsyncTask.java:127)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:428)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at android.os.Handler.dispatchMessage(Handler.java:99)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at android.os.Looper.loop(Looper.java:123)android.app.ActivityThread.main(ActivityThread.java:4203)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at java.lang.reflect.Method.invokeNative(Native Method)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at java.lang.reflect.Method.invoke(Method.java:521)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)12-02 09:59:08.528: ERROR/AndroidRuntime(451):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Can anyone please help to solve my issue. Thanks in advance :)</p>","504162","","302328","","2010-12-02 05:44:22","2010-12-10 09:41:07","how to show alert after calling the webservice","<android><web-services><alertdialog>","2","4","","",""
"4331794","1","4332278","","2010-12-02 04:52:15","9","8756","<p>I use that Google Maps component <code>MapView</code> in an Android application. I can use the GPS location to show my location with a dot. But I would like to show an arrow instead, that points out the driving direction (bearing). I think that I can use the <code>bearing</code> value to get the angle of the arrow.</p><p>How can I do that?</p>","213269","","213269","","2010-12-02 05:03:28","2011-01-18 01:07:25","How can I draw an Arrow showing the driving direction in MapView?","<android><gps><overlay><android-mapview><bearing>","1","0","10","",""
"4331800","1","4798922","","2010-12-02 04:53:35","3","2619","<p>I have an android running on my dev board. How can i simulate the mouse pointer in that? </p><p>I will have an application which sends the (x,y) coordinates to a running deamon. It should be able simulate a tap at the corresponding point on the touch screen. </p><p>Can anyone suggest the ideas and feasibility of this ?</p>","180908","","","","","2012-04-29 16:17:37","Android mouse simulator","<android><mouseevent>","1","3","","",""
"4331808","1","4339593","","2010-12-02 04:55:20","1","1272","<p>I can't draw a texture with <code>glDrawTextOES</code> in my Android app. I've tried the SpriteMethodTest code and I can't get it to work...</p><p>However, here's the code:</p><p>Code for cropping when loading texture:</p><pre><code>GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);        int[] mCropWorkspace = new int[4];        mCropWorkspace[0] = 0;        mCropWorkspace[1] = bitmap.getHeight();        mCropWorkspace[2] = bitmap.getWidth();        mCropWorkspace[3] = -bitmap.getHeight();        bitmap.recycle();        ((GL11) gl).glTexParameteriv(GL10.GL_TEXTURE_2D,                 GL11Ext.GL_TEXTURE_CROP_RECT_OES, mCropWorkspace, 0);</code></pre><p>Code for drawing:</p><pre><code>gl.glBindTexture(GL10.GL_TEXTURE_2D, texture);((GL11Ext) gl).glDrawTexfOES(x, y, 0.0f, width, height);</code></pre><p>Any ideas? I got it to work with Vertex Arrays and Vertex Buffer Objects, but not with this...</p><p>Thanks in advance!</p>","522581","","44729","","2010-12-02 05:41:55","2010-12-02 20:36:10","Can't draw with glDrawTexfOES","<android><opengl-es>","1","0","","",""
"4331915","1","4335709","","2010-12-02 05:16:24","5","4657","<p>I searched google this morning and could not find an answer, so I would like folks on stackoverflow to help.</p><p>Until yesterday, everything was perfect, when I ran my android app from eclipse the emulator used to load, and I could test everything.</p><p>I used it today and the emulator does not load.</p><p>Here is the dump from the console</p><pre><code>[2010-12-02 10:39:42 - HomeScreen] ------------------------------[2010-12-02 10:39:42 - HomeScreen] Android Launch![2010-12-02 10:39:42 - HomeScreen] adb is running normally.[2010-12-02 10:39:42 - HomeScreen] Performing com.Dyforms.XMLGui activity launch[2010-12-02 10:39:42 - HomeScreen] Automatic Target Mode: launching new emulator with compatible AVD 'newAVD'[2010-12-02 10:39:42 - HomeScreen] Launching a new emulator with Virtual Device 'newAVD'</code></pre><p>I can see emulator.exe available in the task manager, but I do not see it launched.</p><p>Can you guys guide me what could be wrong?</p><p>Rupin</p>","527541","","14860","","2010-12-02 05:20:42","2013-02-05 13:21:46","Android emulator fails to start","<android><emulator><avd>","5","5","","",""
"4332046","1","","","2010-12-02 05:39:52","1","1200","<p>How to create a progressbar without border?</p>","520944","","1065190","","2012-07-03 09:50:40","2012-07-03 09:50:40","Progressbar in Android without border","<android><progress-bar>","1","1","1","",""
"4332130","1","","","2010-12-02 05:57:47","5","1429","<p>I am building a complex view based on dynamic data. Depending on the number of data elements in collections I am adding more views. Each of these subviews are complex and get inflated in the loop through the data collection.</p><p>This is of course inefficient and I would like to figure out a way to inflate the subview only once and then reusing them instead. Is this possible somehow?</p><p>PS: I do not want to build up the subviews in code (I know I could) because that would make things even messier due to the complexities and number of subviews, but if the performance would increase considerably I might take a look at that.</p><p>PPS: There is no visible performance problem but traceview that most of the time is spent inflating and if I can make it faster I would love to ;-)</p>","136445","","","","","2010-12-02 07:29:17","Reuse inflated views","<android>","1","3","2","",""
"4332137","1","4442558","","2010-12-02 05:58:35","1","3307","<p>I'm trying to use spring rest template to do a post request. And i need to return the status code. This is my approach. </p><p><code>RestTemplate restTemplate = new RestTemplate();<br>MultiValueMap mvm = new LinkedMultiValueMap();<br>mvm.add(""login"", ""100"");// and some more paramters<br>String result = restTemplate.postForObject(""http://localhost:8080/security_check"", mvm, String.class);<br></code></p><p>But this approach doesn't work for me. It generates an error saying no suitable message converter found. And i need to know can i use the resttemplate to manage my sessions. I need to manage the session from the android client side. </p><p>If any one come across android resttemplate post method and session management please help me. Any help would be greatly appreciated.<br>Thanks in advance. </p>","511737","","598170","","2012-06-11 11:57:24","2012-06-11 11:57:24","Android Spring Rest template","<android><spring><session><resttemplate>","1","0","1","",""
"4332150","1","4332790","","2010-12-02 06:01:09","3","403","<p>How to avoid the duplicates while inserting the contacts into android 2.2?</p>","488433","","1859444","","2014-03-28 16:42:54","2014-03-28 16:42:54","How to avoid duplicates while inserting the contacts into android 2.2?","<android>","1","0","","",""
"4332152","1","4395502","","2010-12-02 06:01:17","7","722","<p>i have done implementing mobile app on android,webos,blackberry,iphone.</p><p>now i integrate project with .net webservices.</p><p>while exchange data i need to encrypt in mobile platform and decrypt in .net webservices</p><p>which is best encryption algorithm i tried on internet and got zero.</p><p>Please suggest me.if you share any sample code.you save me a lot</p><p>Thanks in advance</p><p>MaHeSh</p>","699226","","","","","2010-12-09 06:29:43","encryption and decryption in mobile and .net webservices","<.net><iphone><android><web-services><blackberry>","3","0","4","",""
"4332344","1","4332380","","2010-12-02 06:36:31","0","826","<p>The Program keeps crashing when i try to run it on my handset. cant figure out why it is crashing</p><p>Main java</p><pre><code>public class ProgressBar extends Activity {WebView webview;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);this.getWindow().requestFeature(Window.FEATURE_PROGRESS);setContentView(R.layout.main ); final Activity MyActivity = this;// Makes Progress bar VisiblegetWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);webview = (WebView) findViewById(R.id.webview);webview.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);      }    });webview = (WebView) findViewById(R.id.webview);webview.setWebViewClient(new HelloWebViewClient());webview.getSettings().setJavaScriptEnabled(true);webview.loadUrl(""http://www.google.com/"");}private class HelloWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url)    {        view.loadUrl(url);    return true;    }    }    public boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {    webview.goBack();    return true;    }    return super.onKeyDown(keyCode, event);    }    }</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;WebView  xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/webview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;&lt;/LinearLayout&gt;</code></pre>","524592","","","","","2010-12-02 06:41:45","Progress Bar Error at runtime","<android><progress-bar><android-webview>","1","0","","",""
"4332413","1","4332571","","2010-12-02 06:46:32","1","1016","<p>I have tried to implement the ProgressBar in my application that gets displayed when I click on the Button which plays the sound.</p><p>I have done the coding but I get the run time exception and the application is not starting. Here I am posting my code for the reference.</p><pre><code>holder.imgPlaybtn.setOnClickListener(new View.OnClickListener()             {                public void onClick(View v)                 {                    ProgressDialog progressDialog;                    OnClickListener myContext = this;                    progressDialog = new ProgressDialog((Context) myContext);                    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);                    progressDialog.setMessage(""..."");                    progressDialog.setCancelable(false);                }            });</code></pre><p>The Logcat OutPut is :</p><pre><code>12-02 12:19:58.268: ERROR/AndroidRuntime(392): java.lang.ClassCastException: com.android.soundmachine.Switch2DataList$SoundMacHineAdapter$212-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.soundmachine.Switch2DataList$SoundMacHineAdapter$2.onClick(Switch2DataList.java:1645)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.View.performClick(View.java:2364)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.View.onTouchEvent(View.java:4179)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.View.dispatchTouchEvent(View.java:3709)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.os.Handler.dispatchMessage(Handler.java:99)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.os.Looper.loop(Looper.java:123)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.main(ActivityThread.java:4363)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at java.lang.reflect.Method.invokeNative(Native Method)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at java.lang.reflect.Method.invoke(Method.java:521)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at dalvik.system.NativeStart.main(Native Method)12-02 12:19:58.287: INFO/Process(52): Sending signal. PID: 392 SIG: 312-02 12:19:58.287: INFO/dalvikvm(392): threadid=7: reacting to signal 312-02 12:19:58.287: ERROR/dalvikvm(392): Unable to open stack trace file '/data/anr/traces.txt': Permission denied12-02 12:20:05.098: DEBUG/dalvikvm(99): GC freed 2375 objects / 139384 bytes in 81ms12-02 12:20:10.077: DEBUG/dalvikvm(212): GC freed 43 objects / 2096 bytes in 58ms</code></pre><p>Can any body please help me?</p><p>Thanks,david,</p>","422859","","345717","","2010-12-02 07:09:45","2010-12-02 07:13:02","Progress Bar in android","<android><button><progress-bar>","2","1","1","",""
"4332447","1","4332507","","2010-12-02 06:53:28","1","119","<p>Hey there,So I've been heavily focused on design/development using web technology for the last few years (php/mysql, javascript, etc), and I'm a bit hesitant to start learning C++.. At the same time, I see it as a potentially enjoyable learning experience.To keep things brief, right now I'm developing an online app that plots out certain locations on a map, and you can sort through these locations and do a bunch of other nifty things..sorry to be vague. The point is: I don't see any real advantages of making this an actual ""app"" when the entire functionality of the app itself can do quite fine through the modern mobile browser..</p><p>Not to mention that, by living in a browser, it's much less proprietarySo, my question is: Is there any way to make a simple app that's basically porting the user to my site? I guess it'd be convenient that as an app, the user has a nice little icon to click on when they do need to access it.. </p>","455852","","","","","2010-12-02 07:23:52","Web Developer curious about developing for the Android","<c++><android>","4","1","","",""
"4332460","1","","","2010-12-02 06:55:54","2","1797","<p>What would be the best strategy to have a network connection listener for my application that it is started when the application starts and closes when the activity exists. Could I use a service in which to register  a PhoneStateListener like this:</p><pre><code>((TelephonyManager)app.getSystemService(Context.TELEPHONY_SERVICE)).listen(PhoneStateListener,                                      PhoneStateListener.LISTEN_DATA_CONNECTION_STATE);</code></pre>","304866","","","","","2011-04-04 18:57:11","Strategy for a global network connection listener","<android>","1","1","1","",""
"4332485","1","4384761","","2010-12-02 07:00:08","1","243","<p>i am addind adds in my application using inmodi and admob adds,inmobi adds  not connect some problem .</p><p>please forward some suggestion </p>","254790","","","","","2010-12-08 06:33:57","problem occur in inmobi adds in android","<android>","1","0","2","",""
"4332568","1","","","2010-12-02 07:12:46","2","874","<p>I want to add image in email, if I add the file from sdcard then its working fine as given below.</p><pre><code>emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file///sdcard/Images/thumb.jpg)""));</code></pre><p>But I want to add the image from assest. I have tried so many pernutation and combination with uri.parse and uri.fromfile but nothing works, can anyone tel how exactly the path should be to add the file from assets. Its very urgent.</p>","262523","","","","","2011-11-05 13:54:44","Android : Adding image in email","<android><image><email>","2","0","","",""
"4332710","1","4332765","","2010-12-02 07:33:05","8","7948","<p>I'm trying to use an AsyncTask-extended class to handle connecting to a URL, parsing JSON, displaying an indeterminate ProgressDialog during parsing, and returning the results as key-value pairs in a HashMap to the main Activity. The results of the HashMap will then be read by the main Activity and put into form fields. However, even though I'm populating the HashMap in my AsyncTask (evidenced by println statements), calling a method in the main Activity that returns the HashMap yields an empty result. I can't figure out if this is something I'm doing wrong, or if I'm misunderstanding the capabilities of AsyncTask.</p><p>I'm debating converting my class that extends AsyncTask to an Activity. Essentially, the user should not be able to do anything else during this data search/parsing and should wait until the ProgressDialog goes away before they can interact with the application again (or by hitting the back button). Also, my application needs to be able to handle certain cases in my AsyncTask where exceptions are caught (can't connect to URL, bad JSON, product ID to search by cannot be found) and custom error dialogs are tailored for those exceptions. I could easily do this if this class were an Activity, as I could send back different result codes when calling finish(), depending on if an exception is caught.</p><p>Again, I'm not sure if AsyncTask is the best solution here, since the user will not be doing anything else while the information is being gathered and parsed. Please advise me if a new Activity would make sense or if I'm just mangling my implementation of a background thread.</p><p><strong>MainActivity.java</strong></p><pre><code>mInitiateProductLookupButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                ProductLookup pl = new ProductLookup(id, MainActivity.this);                pl.execute();                // The below variable is always empty!                HashMap&lt;String, String&gt; productInfo = pl.getProductInfo();                applyProductInfoToFormFields(productInfo);            }        });</code></pre><p><strong>ProductLookup.java</strong></p><pre><code>public class ProductLookup extends AsyncTask&lt;Object, Void, HashMap&lt;String, String&gt;&gt; {    private String mProductID;    private Context mContext;    HashMap&lt;String, String&gt; mProductInfo;    ProgressDialog mDialog;    public ProductLookup(String id, Context applicationContext) {        mProductID = id;        mContext = applicationContext;        mProductInfo = new HashMap&lt;String, String&gt;();    }    @Override    protected void onPreExecute() {        mDialog = new ProgressDialog(mContext);        mDialog.setMessage(""Loading product info. Please wait..."");        mDialog.setIndeterminate(true);        mDialog.setCancelable(false);        mDialog.show();    }    @Override    protected void onPostExecute(HashMap&lt;String, String&gt; result){       super.onPostExecute(result);       mDialog.dismiss();       mProductInfo = result;    }    @Override    protected HashMap&lt;String, String&gt; doInBackground(Object... params) {        try {            // Connect to URL, parse JSON, and add key-value pairs to mProductInfo...        } catch (MalformedURLException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        } catch (JSONException e) {            e.printStackTrace();        }        finally {            try {                // Close input/output reader variables            } catch (IOException e) {                e.printStackTrace();            }        }        return mProductInfo;    }    public HashMap&lt;String, String&gt; getProductInfo(){        return this.mProductInfo;    }}</code></pre>","453354","","","","","2010-12-02 07:42:42","Android - result from AsyncTask not being returned to main Activity","<android><thread-safety><android-asynctask>","2","0","","",""
"4332744","1","","","2010-12-02 07:37:06","3","2423","<p>HI!</p><p>I want make service in OnCreate(), and every five minute, the service show notification..</p><p>can you show me about it??</p><p>thanks before :)</p>","430280","","161161","","2010-12-02 07:42:44","2011-01-14 10:44:00","Service Timer Notification","<android><service><timer><notifications>","1","1","","",""
"4332819","1","","","2010-12-02 07:48:02","2","6185","<p>I want to put a textView in  homescreen, and I need the marquee effect</p><pre><code>public class MainWidget extends AppWidgetProvider {int a;RemoteViews remoteViews;AppWidgetManager appWidgetManager;ComponentName thisWidget;String[] s={""woddfdfdfdfdfdffffffffffffffffffffffffffffffff"",""dd"",""ddd"",""ffff""};public void onUpdate(Context context, AppWidgetManager appWidgetManager,      int[] appWidgetIds) {      Timer timer = new Timer();      timer.scheduleAtFixedRate(new WlanTimer(context, appWidgetManager), 100, 50000);}private class WlanTimer extends TimerTask {        RemoteViews remoteViews;        AppWidgetManager appWidgetManager;        ComponentName thisWidget;public WlanTimer(Context context, AppWidgetManager appWidgetManager) {        this.appWidgetManager = appWidgetManager;        remoteViews = new RemoteViews(context.getPackageName(), R.layout.marketwidget_main);        thisWidget = new ComponentName(context, MainWidget.class);}@Overridepublic void run() {a=(int) (Math.random()*3);                                    remoteViews.setTextViewText(R.id.TextView_marketwidget_main_marketmessage,s[a]);    appWidgetManager.updateAppWidget(thisWidget, remoteViews);    }}}</code></pre><p>If i use s[0] instead s[a], it does not run, only ""woddfdf"" shows up.</p><p>My textView xml is:</p><pre><code> &lt;TextView android:id=""@+id/TextView_marketwidget_main_marketmessage""    android:maxLines=""1"" android:focusable=""true""    android:ellipsize=""marquee""    android:inputType=""text""    android:focusableInTouchMode=""true"" android:marqueeRepeatLimit=""marquee_forever"" android:textColor=""#ffffff"" android:background=""@android:color/transparent"" android:layout_width=""80dip"" android:layout_height=""20dip""&gt;&lt;/TextView&gt;</code></pre>","233618","","548526","","2013-04-09 08:37:37","2013-04-09 08:37:37","textView marquee","<android><android-widget>","2","0","3","",""
"4332837","1","4333441","","2010-12-02 07:51:09","2","1116","<p>Does Google MapView in Android use OpenGL?</p>","243225","","44729","","2010-12-02 16:17:07","2010-12-02 16:17:07","Does Google MapView in Android use OpenGL?","<android><opengl-es>","1","0","","",""
"4332899","1","","","2010-12-02 08:03:37","3","454","<p>Alright, I've done my googling and found <a href=""http://malsandroid.blogspot.com/2010/05/admob-and-adwhirl.html"" rel=""nofollow"">this</a> article to help me out with my small app. However, that one is getting old so I just have to ask, do I really need admod and adwhirl accounts and jars to display simple google ads?From what I understand I could have used simple adsense .. if my app was a webapp, which it isn't.Are all those steps still necesarry?</p><p>regards</p>","498112","","","","","2011-08-22 16:21:55","android and ads","<android><admob><adwhirl>","2","2","","",""
"4332915","1","","","2010-12-02 08:06:02","0","1669","<p>I have been using the following code to establish which network the device is using :</p><pre><code>TelephonyManager tempManager;tempManager= (TelephonyManager)myContext.getSystemService(Context.TELEPHONY_SERVICE);int result = 0;    if(tempManager != null &amp;&amp; tempManager.getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS) //do we have a UMTS connection ?  {   result = 2;  }  else if(tempManager != null &amp;&amp; tempManager.getNetworkType() == TelephonyManager.NETWORK_TYPE_GPRS) //or is it just a shabby 2g connection ?  {   result = 1;  }  else if(tempManager != null &amp;&amp; tempManager.getNetworkType() == TelephonyManager.NETWORK_TYPE_UNKNOWN) //or is it just a shabby 2g connection ?  {   result = 4;  }return result;</code></pre><p>It works pretty well unless I get on a HSDPA connection, in that case it will always return 0 as a result, which in my case makes my software think it has no connection at all :(</p><p>Anyone who knows whats happening, has some experience regarding this and most importantly has some solution to this problem ???</p><p>Thanks in advance</p>","162147","","","","","2012-11-21 19:23:03","TelephonyManager.getNetworkType() and HSDPA problems :(","<android><telephonymanager>","2","0","","",""
"4333110","1","","","2010-12-02 08:39:10","1","860","<p>I'm trying to insert data into SqLite database by using a dialog wrapper. However, I am unable to do so. I have 2 texts called Title and Template to insert into the database. But it crashes. Below is my java code:<br>@Override    public boolean onCreateOptionsMenu(Menu menu)    {        menu.add(0,MENU_ITEM_INSERT,0,R.string.menu_insert);        return true;    }</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item){    switch(item.getItemId())    {        case MENU_ITEM_INSERT:            insert();            //startActivity(new Intent(Intent.ACTION_INSERT,getIntent().getData()));            return true;    }    return(super.onOptionsItemSelected(item));}@Override public void onCreateContextMenu(ContextMenu menu,View v,ContextMenu.ContextMenuInfo menuInfo){    AdapterView.AdapterContextMenuInfo info;    try {         info = (AdapterView.AdapterContextMenuInfo) menuInfo;    } catch (ClassCastException e) {        Log.e(TAG, ""bad menuInfo"", e);        return;    }    mCursor = (Cursor) getListAdapter().getItem(info.position);    menu.setHeaderTitle(mCursor.getString(COLUMN_INDEX_TITLE));    menu.add(0,MENU_ITEM_DELETE,0 ,R.string.menu_delete);    menu.add(1,MENU_ITEM_ADDTMESSAGE,1,R.string.menu_add);}@Overridepublic boolean onContextItemSelected(MenuItem item){    AdapterView.AdapterContextMenuInfo info;    try {         info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();    } catch (ClassCastException e) {        Log.e(TAG, ""bad menuInfo"", e);        return false;    }    switch(item.getItemId())    {        case MENU_ITEM_DELETE:            //delete selected row            delete(info.id);            return true;        case MENU_ITEM_ADDTMESSAGE:            //ADD TO MESSAGE            return true;    }    return(super.onContextItemSelected(item));}private void insert(){    LayoutInflater inflater = LayoutInflater.from(this);    View addView = inflater.inflate(R.layout.templates_editor,null);    final DialogWrapper wrapper = new DialogWrapper(addView);    new AlertDialog.Builder(this)    .setTitle(R.string.menu_insert)    .setView(addView)    .setPositiveButton(R.string.item_ok,new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int whichButton) {            processInsert(wrapper);        }    })    .setNegativeButton(R.string.item_cancel,new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int whichButton) {            // ignore, just dismiss        }    })    .show();}private void delete(final long rowId){    if(rowId &gt; 0)    {        new AlertDialog.Builder(this)                        .setTitle(R.string.menu_delete)                        .setPositiveButton(R.string.item_ok,                                 new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int which) {                                processDelete(rowId);                            }                        })                        .setNegativeButton(R.string.item_cancel,                                new DialogInterface.OnClickListener() {                                    public void onClick(DialogInterface dialog, int which) {                                        //dismiss dialog                                    }                                }).show();    }}private void processDelete(long rowId){    String[] args = {String.valueOf(rowId)};    db.getWritableDatabase().delete(""Templates"", Templates._ID, args);    mCursor.requery();}private void processInsert(DialogWrapper wrapper){    ContentValues cv = new ContentValues();    cv.put(""title"", wrapper.getTitle());    cv.put(""template"", wrapper.getTemplate());    db.getWritableDatabase().insert(""Templates"", ""title"", cv);    db.getWritableDatabase().insert(""Templates"", ""template"", cv);    mCursor.requery();}class DialogWrapper{    EditText titleField = null;    EditText templateField = null;    View base = null;    DialogWrapper(View base) {        this.base = base;    }    String getTitle(){        return(getTitleField().getText().toString());    }    String getTemplate(){        return(getTemplateField().getText().toString());                }    private EditText getTitleField(){        if(titleField == null){            titleField = (EditText) findViewById(R.id.title);        }        return titleField;    }    private EditText getTemplateField(){        if(templateField == null){            templateField = (EditText) findViewById(R.id.template);        }        return templateField;    }}</code></pre><p>Below is my logCat:</p><p>12-02 08:23:17.712: ERROR/AndroidRuntime(204): Uncaught handler: thread main exiting due to uncaught exception<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204): java.lang.NullPointerException<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at joel.GroupSMS.TemplatesList$DialogWrapper.getTitle(TemplatesList.java:214)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at joel.GroupSMS.TemplatesList.processInsert(TemplatesList.java:196)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at joel.GroupSMS.TemplatesList.access$0(TemplatesList.java:192)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at joel.GroupSMS.TemplatesList$1.onClick(TemplatesList.java:150)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at android.os.Handler.dispatchMessage(Handler.java:99)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at android.os.Looper.loop(Looper.java:123)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at android.app.ActivityThread.main(ActivityThread.java:4363)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at java.lang.reflect.Method.invokeNative(Native Method)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at java.lang.reflect.Method.invoke(Method.java:521)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)<br>12-02 08:23:17.862: ERROR/AndroidRuntime(204):     at dalvik.system.NativeStart.main(Native Method)  </p><p><strong>Edit</strong><br>This is my stacktrace requested pertaining to my comment:</p><p>12-06 16:54:12.466: INFO/ActivityManager(58): Starting activity: Intent { cmp=joel.GroupSMS/.TemplateEdit }<br>12-06 16:54:16.550: DEBUG/AndroidRuntime(254): Shutting down VM12-06 16:54:16.550: WARN/dalvikvm(254): threadid=3: thread exiting with uncaught exception (group=0x4001b188)<br>12-06 16:54:16.550: ERROR/AndroidRuntime(254): Uncaught handler: thread main exiting due to uncaught exception<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254): java.lang.RuntimeException: Unable to start activity ComponentInfo{joel.GroupSMS/joel.GroupSMS.TemplateEdit}: java.lang.NullPointerException<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.os.Handler.dispatchMessage(Handler.java:99)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.os.Looper.loop(Looper.java:123)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.app.ActivityThread.main(ActivityThread.java:4363)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at java.lang.reflect.Method.invokeNative(Native Method)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at java.lang.reflect.Method.invoke(Method.java:521)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at dalvik.system.NativeStart.main(Native Method)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254): Caused by: java.lang.NullPointerException<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.content.ContentResolver.acquireProvider(ContentResolver.java:754)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.content.ContentResolver.query(ContentResolver.java:197)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.app.Activity.managedQuery(Activity.java:1495)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at joel.GroupSMS.TemplateEdit.onCreate(TemplateEdit.java:77)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)<br>12-06 16:54:16.736: ERROR/AndroidRuntime(254):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)  </p>","504864","","504864","","2010-12-06 16:58:44","2010-12-06 16:58:44","Error with inserting data into sqlite database","<android><database>","1","0","","",""
"4333154","1","","","2010-12-02 08:47:28","2","1611","<p>I have in my code setInverseBackgroundForced set to true, but it doesn't appear to work. The code produces white text on a dark background. Here is my builder code:</p><pre><code>public class test {private void createMyLocationDisabledAlert() {      AlertDialog.Builder builder = new AlertDialog.Builder(this);      builder.setTitle(""Title"")        .setInverseBackgroundForced(true)        .setMessage(                  ""my message"")                  .setCancelable(false)                  .setPositiveButton(""Options"",                          new DialogInterface.OnClickListener() {                      public void onClick(DialogInterface dialog, int id) {                          showOptions();                      }                  });      builder.setNegativeButton(""Cancel"",                new DialogInterface.OnClickListener() {             public void onClick(DialogInterface dialog, int id) {                 dialog.cancel();             }        });      AlertDialog alert = builder.create();      alert.show(); }</code></pre><p>}</p><p>What could I be doing wrong? I have tried the method call in different positions of the code block but to no resolve.</p>","496625","","496625","","2010-12-02 09:36:19","2013-07-28 06:37:33","builder.setInverseBackgroundForced(true) does not work","<android><background><alertdialog>","1","0","","",""
"4333178","1","4409513","","2010-12-02 08:51:27","0","326","<p>I am developing an SMS security application for Android. My application requires account for users so I'll be using SQLite Database. I have already created tables but I don't know how to connect it to the emulator. Please do help in this. Thanks!  </p>","515883","","","","","2010-12-10 14:02:01","SMS security App - Database connection","<android><sms><android-emulator><database-connection>","1","2","1","",""
"4333206","1","4333260","","2010-12-02 08:56:23","5","780","<p>I'm about to finish my Android application. In the end I have found that I've been using bunch of logging statements, like:</p><pre><code>Log.d(TAG, ""Blah-blah"");</code></pre><p>The question is: for production release what should I do with them?</p><ol><li>Just comment/stripe log statements</li><li>Do something else more sophisticated? Like as I used to do with Log4J properties or so</li></ol><p>Please share your experience.</p>","472270","","","","","2011-12-24 13:40:20","Logging strategy","<android><logging>","5","0","1","",""
"4333259","1","4335237","","2010-12-02 09:03:38","0","766","<p>I know I can use android build in email app when I use the intent with ACTION_SEND, there is no problem for me. The problem comes after I defined the ACTION_SEND in my AndroidManifest.xml like follows:</p><pre><code>&lt;activity android:name="".activity.myActivity""&gt;  &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/png"" /&gt;        &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>Since I would like to see my own app to be added in the share option list when user click ""share"" in the gallery, I have to define the above <code>&lt;intent-filter&gt;</code> in my AndroidManifest.xml.</p><p>After I defined the above configuration in AndroidManifest.xml, whenever I call ""<code>Intent emailIntent = new Intent(Intent.ACTION_SEND);</code>"", my android app will go to call ""myActivity"" instead of calling android build in email app.</p><p>All of the above is understandable, my question is how to keep my configuration in AndroidManifest.xml as above (that's keep my app shown in the share option list when user click ""share"" in gallery), MEANWHILE, I can call the android default email app???</p>","475850","","","","","2010-12-02 12:58:39","Android default email app can not be called in my situation, how to resolve?","<android><email>","1","0","","",""
"4333325","1","","","2010-12-02 09:12:35","0","907","<p>I'm trying to simply grab every single row currently in my SQLite database on my Android and grab each individual column from each row. I believe the data is actually in the database, because I call a separate function DataHelper.selectAll() to print out to Log all of the data. The data I expect correctly shows up in LogCat in Eclipse. If it's important, the DataHelper.java program I'm basically using is found here: <a href=""http://www.screaming-penguin.com/node/7742"" rel=""nofollow"">http://www.screaming-penguin.com/node/7742</a>. I'll post relevant code below. The important stuff is in doPost().</p><pre><code>    // from inside onCreate of Main (which extends activity)...    Button buttonPost = (Button) findViewById(R.id.buttonPost);    buttonPost.setOnClickListener(new OnClickListener() {     // doesn't actually post to website yet     public void onClick(View v) {      Log.d(TAG, ""In onclicklistener."");         ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);         NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);         if (mWifi.isConnected()) {          Log.d(TAG, ""Connected, calling doPost()!"");          if (doPost()) {                      // ...                }            }     }    }); public boolean doPost() {   boolean outcome = false;   long ret = dh.insert(main.id++ + "","" + ""my test2"" + "","" + ""5:4:2:3"" + "","" + -300 + "","" + -300 + "","" + -1 + "","" +-70 + "","" + 3 + "","" + -3 + "","" + main.device_id);   Log.d(TAG, ""ret from static insert:"" + ret);   Cursor cursor = this.dh.db.query(DataHelper.TABLE_NAME,       new String[] { ""id"", ""rssi"", ""wap_id"", ""lat"" },      null, null, null, null, ""id desc"");   Log.d(TAG, ""Cursor column count: "" + cursor.getColumnCount());   if (cursor.moveToFirst()) {     do {        HttpPost post = new HttpPost(OUR_SERVER);       Log.d(TAG, ""rssi index:"" + cursor.getColumnIndex(""rssi""));       Log.d(TAG, ""the rssi: "" + cursor.getInt(cursor.getColumnIndex(""rssi"")));     } while (cursor.moveToNext());   }   // release connection here?   cm.shutdown();   if (cursor != null &amp;&amp; !cursor.isClosed()) {      cursor.close();   } return outcome;}</code></pre><p>Now what's strange about this is in my LogCat it successfully printed out the full rows (just as a string), so I know I'm able to access the database. The rssi values that I expect are not logged, instead I get:</p><pre><code>Cursor column count: 4id value: 6id index: 0rssi index:1the rssi: 0id value: 5id index: 0rssi index:1the rssi: 0</code></pre><p>I'm at a loss, because plenty of online examples all access data the same way. Does it have to do with the fact that I'm within an OnClickListener? There are no debugger warnings when I do this.</p><p>Thanks!</p>","527682","","527682","","2010-12-02 09:15:46","2010-12-02 18:15:41","Cannot select columns from Database with Android Cursor","<android><sqlite><cursor>","1","0","","",""
"4333432","1","5657798","","2010-12-02 09:26:43","3","1322","<p>I want to return back to the initiating activity after sending email by invoking email client in android. But it is not working at all.I have tried the below code.</p><pre><code>try {          path = android.provider.MediaStore.Images.Media.insertImage(              getContentResolver(), returnedBitmap, ""diploma.png"", null);          Uri diplomaUri = Uri.parse(path);                   //send email with the above generated image as attachment          final Intent emailIntent2 =                  new Intent(android.content.Intent.ACTION_SEND);          emailIntent2.putExtra(Intent.EXTRA_SUBJECT,                                ""Potty Diploma for Teddy"");          emailIntent2.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(""""));          emailIntent2.putExtra(Intent.EXTRA_STREAM, diplomaUri);          emailIntent2.setType(""image/png"");          startActivityForResult(Intent.createChooser(emailIntent2, ""Email:""),                                  EMAIL_SUCCESS);      } catch(Exception e) {          final AlertDialog.Builder builder =                 new AlertDialog.Builder(v.getContext());       builder.setTitle(""Device Media Access"");       builder.setMessage(""Failed to access media store of the device"");       builder.setCancelable(false);       builder.setPositiveButton(""OK"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which) {         dialog.cancel();        }       });       AlertDialog alert = builder.create();       alert.show();         }@Override    public void onActivityResult(int reqCode, int resultCode, Intent data){     super.onActivityResult(reqCode, resultCode, data);        switch(reqCode){          case (EMAIL_SUCCESS):            if (resultCode == RESULT_OK){             Intent myIntent = new Intent(Progress.this, iGoPotty.class);      myIntent.putExtra(""tab_id"", 2);      startActivity(myIntent);            }        }    }</code></pre>","525004","","213269","","2010-12-21 16:46:36","2014-04-11 19:06:36","Return back to initiating activity after sending email in android","<android><activity>","2","2","1","",""
"4333479","1","7528516","","2010-12-02 09:34:14","3","392","<p>Can someone help me out here. I have a Splash screen as an Activity in my fullscreen App (landscape). When the Splash screen calls the main activity (with no animation) i lose fullscreen momentarily and see the titlebar before the next activity pops up, how can I prevent this? It looks ugly and un-professional.</p>","353674","","","","","2011-09-23 11:51:09","Android Activity switch loses fullscreen temporarily","<android><animation><activity><splash-screen>","1","0","2","",""
"4333516","1","4333538","","2010-12-02 09:39:14","8","24404","<p>I've been trying to get started with Android programming for a while now. I'm mainly a .NET developer with no Java experience for 8 years (university).</p><p>I can compile and run samples no problem but the moment I try and rename my package/class it fails. I believe I've updated the manifest and triple checked it (Copied and pasted name, selected it with Eclipse) yet it always fails with a java.lang.ClassNotFoundException:</p><p><pre><code>12-02 09:12:21.088: ERROR/AndroidRuntime(233): Uncaught handler: thread main exiting due to uncaught exception12-02 09:12:21.178: ERROR/AndroidRuntime(233): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.anddev.cheesemp.helloandworld/org.anddev.cheesemp.helloandworld.HelloAndEngine}: java.lang.ClassNotFoundException: org.anddev.cheesemp.helloandworld.HelloAndEngine in loader dalvik.system.PathClassLoader@43d0c0d012-02 09:12:21.178: ERROR/AndroidRuntime(233):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at android.os.Handler.dispatchMessage(Handler.java:99)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at android.os.Looper.loop(Looper.java:123)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at android.app.ActivityThread.main(ActivityThread.java:4363)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at java.lang.reflect.Method.invokeNative(Native Method)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at java.lang.reflect.Method.invoke(Method.java:521)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at dalvik.system.NativeStart.main(Native Method)12-02 09:12:21.178: ERROR/AndroidRuntime(233): Caused by: java.lang.ClassNotFoundException: org.anddev.cheesemp.helloandworld.HelloAndEngine in loader dalvik.system.PathClassLoader@43d0c0d012-02 09:12:21.178: ERROR/AndroidRuntime(233):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)12-02 09:12:21.178: ERROR/AndroidRuntime(233):     ... 11 more</code></Pre>Manifest is here:<br><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>    &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>          android:versionCode=&quot;1&quot;<br>          android:versionName=&quot;1.0&quot; package=&quot;org.anddev.cheesemp.helloandworld&quot;&gt;<br>          &lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot;/&gt;<br>        &lt;application android:icon=&quot;@drawable/icon&quot; android:label=&quot;@string/app_name&quot;&gt;<br>            &lt;activity android:label=&quot;@string/app_name&quot; android:name=&quot;org.anddev.cheesemp.helloandworld.HelloAndEngine&quot;&gt;<br>                &lt;intent-filter&gt;<br>                    &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;<br>                    &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;<br>                &lt;/intent-filter&gt;<br>            &lt;/activity&gt;<br>        &lt;/application&gt;<br>        &lt;uses-sdk android:minSdkVersion=&quot;4&quot; \&gt;<br>    &lt;/manifest&gt;<br></code></pre>Class definition is here:</p><pre><code>package org.anddev.cheesemp.helloandworld;import org.anddev.andengine.engine.Engine;import org.anddev.andengine.engine.camera.Camera;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.text.Text;import org.anddev.andengine.entity.util.FPSLogger;import org.anddev.andengine.opengl.font.Font;import org.anddev.andengine.opengl.texture.Texture;import org.anddev.andengine.opengl.texture.TextureOptions;import org.anddev.andengine.ui.activity.BaseGameActivity;import org.anddev.andengine.util.HorizontalAlign;import android.graphics.Color;import android.graphics.Typeface;/** * @author Nicolas Gramlich * @since 11:54:51 - 03.04.2010 */public class HelloAndEngine extends BaseGameActivity</code></pre><p>This sample is from AndEngine but I've had the same issue with every sample I modify. I can't help but feel I've missed something and nothing I found searching has helped.</p><p>Any advice appreciated!</p>","507463","","","","","2013-02-20 10:53:00","java.lang.ClassNotFoundException on my android app but I have no idea why","<android><android-manifest>","2","0","1","",""
"4333547","1","4334235","","2010-12-02 09:43:17","0","575","<p>have a look at figure 2. in the link given below.. <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a>..</p><p>there it is being mentioned that ,The platform provides density independence to applications by default.(launcher icons are displayed at the same physical sizes, although screen sizes, aspect ratios, and densities are different.)</p><p>and showed with 3 emulator screens namely WVGA high density (left), HVGA medium density (center), and QVGA low density (right)...</p><p>i have created these 3 avd's and tested but the launcher icons are different in different emulator..can any one knows why it so and how should i get same sized launcher icons on those emulators...</p>","505580","","","","","2010-12-02 15:39:43","how to get same sized launcher icons on different emulator skins…(android)","<android><emulator><dip>","3","1","1","",""
"4333668","1","","","2010-12-02 10:00:12","0","916","<p>i have a androuid application and i want to access database lyng on database server,without using web service . can any one tell how to access databsae server.</p>","527777","","","","","2010-12-02 10:00:12","how to access database server through android?","<android>","0","3","","",""
"4333892","1","4334034","","2010-12-02 10:27:38","0","257","<p>I have this XML file which I parse into an ArrayList</p><p>In this ArrayList I have countries and the alarmnumbers for the countries in it.</p><p>I want to search to a country and get it's police, ambulance or firedep. number.</p><p>Here is the code to help you out.</p><p>Parsing XML into ArrayList:</p><pre><code>protected ArrayList&lt;Alarmdiensten&gt; getAlarmdiensten() {     ArrayList&lt;Alarmdiensten&gt; lijst = new ArrayList&lt;Alarmdiensten&gt;();     try {      DocumentBuilder builder =DocumentBuilderFactory.newInstance().newDocumentBuilder();      Document doc = builder.parse(getAssets().open(""alarmdiensten.xml""));      NodeList nl = doc.getElementsByTagName(""land"");      for (int i=0;i&lt;nl.getLength();i++) {       Node node = nl.item(i);       Alarmdiensten land = new Alarmdiensten();                land.land = Xml.innerHtml(Xml.getChildByTagName(node, ""naam""));       land.landcode = Xml.innerHtml(Xml.getChildByTagName(node, ""code""));       land.politie = Xml.innerHtml(Xml.getChildByTagName(node, ""politie""));       land.ambulance = Xml.innerHtml(Xml.getChildByTagName(node, ""ambulance""));       land.brandweer = Xml.innerHtml(Xml.getChildByTagName(node, ""brandweer""));       land.telamba = Xml.innerHtml(Xml.getChildByTagName(node, ""telamba""));       land.adresamba = Xml.innerHtml(Xml.getChildByTagName(node, ""adresamba""));       lijst.add(land);      }     } catch (Exception e) {;     }     return lijst;    }</code></pre><p>The method that will use the alarmnumbers:</p><pre><code>    public void AlarmMenu(){     String landcode;        ArrayList&lt;Alarmdiensten&gt; diensten = getAlarmdiensten();     if(fakelocation = true) {      landcode = sfakelocation;     }     else {      try {    landcode = getAddressForLocation(this, locationNow).getCountryCode();   } catch (IOException e) {    e.printStackTrace();   }     }</code></pre><p>So I have the landcode, and I want to search in the ArrayList diensten for the numbers that belong with the landcode.</p><p>How can I do this?</p>","517460","","418183","","2010-12-02 10:28:31","2010-12-02 10:49:56","Searching in an Array that is parsed from a XML in Android","<java><android><xml><arrays><parsing>","3","0","","",""
"4333930","1","","","2010-12-02 10:31:08","1","211","<p>Hi What are the new/modified default in android 2.2 .I want to know 2.2 extra features over 2.1 also</p>","487219","","","","","2010-12-02 10:34:36","Android 2.2 Default Intent","<android>","1","0","","",""
"4333946","1","4334474","","2010-12-02 10:32:40","4","2748","<p>When I click the notification on the status bar it launches an activity but the behavior is strange. If my app is in foreground and I click the notification the notification intent is fired once. If my app is in background then the notification intent is fired twice. If I exit the app (ie all activities have been popped by hitting the back button) then  notification intent is fired once. Can anyone explain this behaviour. The code snippet is as follows: </p><pre><code>_notification = new Notification(icon_id, ""Ticker Text"", System.currentTimeMillis());_showActivityIntent = new Intent();_showActivityIntent.setAction(MyActivityName);_showActivityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK + Intent.FLAG_ACTIVITY_NO_HISTORY);_showActivityPendingIntent = PendingIntent.getActivity(context, 0, _showActivityIntent, 0);_notification.setLatestEventInfo(context, ""My title"", ""My text"", _showActivityPendingIntent);_notificationMgr.notify(notificationId, _notification);</code></pre>","266272","","21234","","2010-12-02 10:34:35","2011-09-08 05:55:14","android notification launches same activity twice","<android><android-notifications>","1","0","1","",""
"4333990","1","4334451","","2010-12-02 10:36:01","0","1610","<p>i'm designing an android app atm and i wonder how it is possible to switch between views with a ""sliding"" animation as on the iphone.</p><p>what i mean is that i want to stay in an Activity and slide from left to right (or vice versa) and PART of the views slide in the respective direction, making room for another view. the rest of the ui stays where it is.</p><p>it is actually possible, since i've seen it in an actual working (not yet published) app. so - how do i do this?</p>","370969","","","","","2010-12-02 11:28:38","how to do iphone-style slide animations in android?","<java><iphone><android><slide>","1","0","","",""
"4334015","1","4334108","","2010-12-02 10:39:05","2","1225","<p>|--Button 1--|</p><p>|-Button 2-|</p><p>Using RelativeLayout how do I align Button 2's width to match that of Button 1.</p>","421372","","","","","2013-12-13 22:11:38","Aligning components in RelativeLayout","<android><user-interface><relativelayout>","3","0","","",""
"4334082","1","4334241","","2010-12-02 10:48:23","2","6308","<p>This one puzzles me since my first android project. Consider multi-language string resources with 'en' as the default:</p><pre><code>res/values/strings.xml     &lt;--- The default language 'en'res/values-de/strings.xml  &lt;--- deres/values-fr/strings.xml  &lt;--- frres/values-it/strings.xml  &lt;--- it</code></pre><p>With that folder structure the Android Market entry for this app shows language support for ""default, german, french and italian only"". Yes, english is missing in that list.</p><p>Is it possible to ""include"" the complete default strings resource from the ""values"" folder in an additional ""values-en"" folder. And yes, I don't want to maintain that file in that new folder because everything is declared in the default string resource already.</p><p>Many thanks in advance.</p><p>Harald</p>","471681","","","","","2010-12-02 11:13:34","Android: How to re-use strings in multi-language resources","<android><resources>","1","0","3","",""
"4334092","1","4451116","","2010-12-02 10:49:22","1","364","<p>When i set up Skype on Android and clik on phone button in QuickContact in default ""Contacts book"" system asks how to perform this action : ""Skypeout"" or ""Telephone"".I want to do similar function with sending sms from QuickContact bar, what i have to do to make system ask for user's choise when they click on the sms button in QuicContact bar ?</p>","527808","","","","","2011-06-29 17:05:48","Android Upgrade ""send SMS function"" in QuickContact","<android><contacts><contactscontract><android-contacts>","1","0","1","",""
"4334098","1","4649837","","2010-12-02 10:49:51","0","650","<p>I want to show progress bar until tab bar is loaded is it possible to show progress dialog in tab bar activity? if possible can anybody give example</p>","426344","","","","","2011-01-10 18:05:02","is it possible to show progress dialog in tab bar activity","<android>","1","0","","",""
"4334131","1","","","2010-12-02 10:52:20","0","383","<p>I am trying to call a webservice from an android app (Testing from an Emulator)</p><p>Now, i keep on getting ""request time failed : java.net.SocketConnection : Address family not supported by protocol""</p><p>So, went to 'Browser' app of Android-Emulator and wasn't able to open any website</p><p>Also, then wrote a java code (J2SE) for network connection and got a ""java.net.ConnectException: Connection timed out: connect""</p><p>Then looked here and there and guys had a say that some setting are to be done in eclipse and android-emulator to get the network connection going</p><p>Like in one of messages here --> ""http://192.9.162.102/thread.jspa?messageID=10631928""</p><p>But how and where is what i am looking for ?</p><p>Any suggestions ?</p><p>ThanksYogurt</p>","475243","","","","","2010-12-02 11:43:17","Network Connection","<android><android-emulator>","1","0","","",""
"4334268","1","4334295","","2010-12-02 11:07:18","4","7628","<p>from where i can download apidemos for android 2.1 ,please help me</p>","487219","","","","","2013-10-31 10:25:26","Android API DEMOS","<android>","3","0","","",""
"4334341","1","","","2010-12-02 11:18:04","18","12423","<p>The following code is what I got so far. However, there are 2 issues:</p><ol><li><p>I want both inner and outer glow effects, which looking similar to the Photoshop's blending options. But I only managed to make the outer glow, if I set BlurMaskFilter.Blur.INNER or other value, the whole image is blocked, instead of just edges.</p></li><li><p>Despite I set ""FF"" as alpha value, the glow color is still very dark.</p><pre><code>Bitmap alpha = origin.extractAlpha();BlurMaskFilter blurMaskFilter = new BlurMaskFilter(5, BlurMaskFilter.Blur.OUTER);Paint paint = new Paint();paint.setMaskFilter(blurMaskFilter);paint.setColor(0xffffffff);Canvas canvas = new Canvas(origin);canvas.drawBitmap(alpha, 0, 0, paint);return origin;</code></pre></li></ol><p><img src=""http://i.stack.imgur.com/IEl0v.png"" alt=""alt text""></p>","423989","","423989","","2010-12-02 11:50:20","2013-12-23 05:16:31","How to make glow effect around a bitmap?","<android><graphics><bitmap><glow>","6","0","13","",""
"4334374","1","","","2010-12-02 11:21:29","0","704","<p>Is Messenger class an alternative of AIDL in building &amp; consuming remote servicesand if so does messenger  handle thread safety for methods i will associated with custom commands of the handler messages? sure no, and the service keep track which client needs which method (thread safe methods)but the sample here for remote service <a href=""http://developer.android.com/reference/android/app/Service.html#RemoteMessengerServiceSample"" rel=""nofollow"">http://developer.android.com/reference/android/app/Service.html#RemoteMessengerServiceSample</a>made me confused?</p>","526474","","21234","","2010-12-02 11:52:28","2010-12-02 12:52:31","does Messenger Class usage replace AIDL services","<android><android-service>","1","0","","",""
"4334404","1","","","2010-12-02 11:23:48","15","833","<p>I have recently noticed, while debugging an app, that LogCat reports numerous error (""E"") messages with pid=92, tag=libagl and Message=""uses alphaPlaneWorkaround"".</p><p>The messages appear when my app's screen is redrawn, for example when it is scrolled.</p><p>I am using Android 2.1. I realized that these messages started appearing after I had turned on Animations in the phone's Sound &amp; Display settings, and testing indicates that they appear if either the ""All animations"" or the ""Some animations"" option is selected and that they do not appear if I choose ""No animations.""</p><p>What causes these messages? Do they indicate a bug in my app or are they caused by the operating system?</p>","250845","","1016716","","2012-05-06 16:15:56","2012-05-06 16:15:56","libagl alphaPlaneWorkaround error messages in LogCat","<android><logcat>","1","6","1","",""
"4334458","1","4335658","","2010-12-02 11:28:58","0","170","<p>i have developed a simple AsyncTask class that takes Handlers as its parameters and whilst sending HandlersendEmptyMessage(0) in the doBackground i load up a ProgressDialoge loading view but for some reason it doesnt show until the very end of executing the stuff thats inside my Handler object (in other words the progressDialogue blinks at the end).</p><p>here is my AsyncTask:</p><pre><code>package com.kc.util;import android.app.ProgressDialog;import android.content.Context;import android.os.AsyncTask;import android.os.Handler;import android.util.Log;public class LoadDialoge extends AsyncTask&lt;Handler, Integer, Void&gt; {    private ProgressDialog progressDialog;    private String TAG = ""LoadDialoge"";    private Context mContext;    @Override    protected void onPostExecute(Void result) {        // TODO Auto-generated method stub        super.onPostExecute(result);        progressDialog.dismiss();    }    @Override    protected void onPreExecute() {        // TODO Auto-generated method stub        super.onPreExecute();        showWait();    }    @Override    protected Void doInBackground(Handler... params) {        // TODO Auto-generated method stub        for(Handler mHandler : params){            mHandler.sendEmptyMessage(0);            Log.d(TAG, ""handler sending message"" );        }        return null;    }    private void showWait() {        Log.d(TAG, ""showWait"");        progressDialog = new ProgressDialog(mContext);        progressDialog.setTitle(""Retrieving contact details"");        progressDialog.setMessage(""Please wait..."");        progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);        progressDialog.show();        Log.d(TAG, ""    "");    }    public void setmContext(Context mContext) {        this.mContext = mContext;    }}</code></pre><p>And here is the handler i passed to this class from an Activity:</p><pre><code>private Handler mHandler = new Handler() {        @Override        public void handleMessage(Message msg) {            // TODO Auto-generated method stub            super.handleMessage(msg);            Log.d(TAG, ""handleMessage"");            initialiseOnItemClickListeners();            initialiseOnClickListeners();            initialiseListViewAdapters();            loadDataToDb();            initializeTitles();            initialize();        }    };    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.abstract_main_menu);        LoadDialoge load = new LoadDialoge();        load.setmContext(this);        load.execute(mHandler);    }</code></pre><p>Im trying to create a generic Async Load screen that works across any activity that wants to use it instead of copying and pasting the above LoadDialogue AsyncTask across each activity(which i was doing before and worked fine).</p>","444668","","","","","2010-12-02 13:46:11","Android progress dialoge view not showing","<android>","1","0","","",""
"4334464","1","","","2010-12-02 11:29:14","0","104","<p>ok so im very new to android and java but im trying to build my first app and im stuck here is  part of my code so far</p><pre><code>private void calculate() {        year = Double.parseDouble(edityear.getText().toString());        year = year / 12;        year = year * 10;        year = Math.round(year);        year = year / 10;</code></pre><p>now what i need to do it take the tenths place out and use it to pick what page im going to show.</p><p>so  if i started with 1985 i would end up with 165.4... so i want to take the 4 and use it in something like this</p><pre><code>if (year == 4)  {   setContentView(R.layout.splash);}</code></pre><p>thanks for the help</p>","527872","","527872","","2010-12-02 12:06:11","2010-12-02 12:06:11","android java need to use tenth place in equation","<java><android>","1","2","","",""
"4334559","1","4336523","","2010-12-02 11:42:11","0","792","<p>First of all, this is my first post here and i´m happy to be a part of stackoverflow, finally. :D</p><p>I want to build a AutoComplete-Search with a button on the right of the AutoCompleteTextView to submit the input string. The button may have different widths, cuz of localization or custom texts (""search"", ""search it now"",...). I want the AutoCompleteTextView growing dynamically over the full with until the localized search button.</p><p>My current approch is very static and i have to change the marginRight depending on the width of the button:</p><pre><code>&lt;RelativeLayoutandroid:id=""@+id/layout""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;AutoCompleteTextViewandroid:id=""@+id/searchText""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:layout_marginRight=""70dip""android:layout_alignParentLeft=""true""/&gt;&lt;Buttonandroid:id=""@+id/btn""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Search""android:layout_alignParentRight=""true""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>Is it possible in android to find a dynamic solution?</p><p>With best wishes,Jeff</p>","527878","","527878","","2010-12-02 11:48:47","2010-12-02 15:18:51","Dynamic Growing-Width AutoCompleteTextView","<android><width>","1","0","1","",""
"4334649","1","5592166","","2010-12-02 11:50:55","6","2296","<p>Hello Everybody?                Can you please tell me how to fetch contact groups programaticallystored in our android phone?</p><p>Thanks in advance</p>","395661","","","","","2013-08-07 21:49:54","Accessing Android Contact Group Names","<android>","2","0","7","",""
"4334669","1","4884072","","2010-12-02 11:53:17","1","639","<p>I'm working on an application which have 5 activities and any of the activity can access other 4.  In one of the activities i have a <code>Finish</code> button that should put my application on background thread. I want to notify my other activities to call <code>finish()</code>, and for that i have two ideas in mind. One is by using <code>intent</code> but other is using <code>interface</code> but i'm little confused to decide on which way should i go? </p><p>Are there any other way to notify all activities on same application from an event of one activity?</p><p>Thanks</p>","246942","","","","","2011-02-03 11:48:21","Notify other activities of the same application to finish it self from one activity","<java><android>","3","1","","",""
"4334684","1","4335502","","2010-12-02 11:54:32","3","3093","<p>Hi   how to set a label in spinner: ie the lable should initially visible when user clicke the spinner button options visible , when user select the option the label should replace with the new item,is it possible with spinner?</p>","487219","","","","","2013-07-01 15:43:48","Android setting label to spinner","<android>","4","0","","",""
"4334740","1","","","2010-12-02 12:00:42","2","921","<p>I'm using webview to show an image:</p><pre><code>webview.setInitialScale(10);String myHTML = (""&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;img src=\"""" + imgUri + ""\""&gt;&lt;/body&gt;&lt;/html&gt;"");webview.loadDataWithBaseURL(""file:///android_asset/"", myHTML, ""text/html"", ""utf-8"", """");</code></pre><p>The problem is that if imgUri points to a really large image (eg.2000 x 3000 px) then the downscaling doesn't work. I think the limit is somewhere around 30%, underneath that initialScale value the image just stays at around 30% size. So, for example setting initialValue to 10, 20 or 30 produces similar image size. </p><p>Is there a way to use WebView to show a large image scaled down to for example 10%?</p><p>Pom</p>","54155","","","","","2010-12-02 13:51:14","Android: WebView doesn't scale large images","<android>","1","0","","",""
"4334754","1","","","2010-12-02 12:02:15","0","139","<p>im using a particle system and have it so when it creates the particle it passes a starting x and y value and from that i get an angle to where i want to shoot the particle but i need it so i have a vertical speed and a horizontal speed so what can i can?</p><p>hack and slash of my particle:</p><pre><code>Particle(int x, int y,int x2,int y2) {  this.x = x;  this.y = y;  this.state = BulletParticle.STATE_ALIVE;  this.widht = MAX_DIMENSION;//rndInt(1, MAX_DIMENSION);  this.height = this.widht;//  this.height = rnd(1, MAX_DIMENSION);  this.lifetime = DEFAULT_LIFETIME;  this.age = 0;  this.xv = x2;//(rndDbl(0, MAX_SPEED * 2) - MAX_SPEED);  this.yv = y2;//(rndDbl(0, MAX_SPEED * 2) - MAX_SPEED);  // smoothing out the diagonal speed  if (xv * xv + yv * yv &gt; MAX_SPEED * MAX_SPEED) {   xv *= 0.7;   yv *= 0.7;  }</code></pre>","527926","","","","","2010-12-02 12:08:17","Finding 'suitable' horizontal and vertical speed from an angle - android","<android>","1","0","","",""
"4334805","1","4379719","","2010-12-02 12:08:19","2","290","<p>I'm writing an application that should supports gui themes. There is no problem with applying and configuring it, but there as a problem with understanding is theme changed for a particular activity. </p><p>There are several activities which use themes. And there is another one which extends <code>PreferenceActivity</code> and provides the functionality to choose a theme. The id of choosed theme is saved to shared preference. When some activity which uses themes gets <code>onResume()</code> called I want to check if the current theme id is equal to the one saved in shared preferences. But <code>Theme</code> object doesn't have any id or method to identify it.</p><p>UPDATE: Now I'm considering having a string name of current theme in each activity, but this solution looks rather ugly, because I would have to add the same variable to each activity in application.</p><p>What is the correct way of doing this check? Am I doing anything wrong?</p>","473070","","473070","","2010-12-03 12:47:10","2013-05-04 23:46:09","Resolving if theme is changed for the activity","<android><themes>","2","0","","",""
"4334908","1","4334932","","2010-12-02 12:21:02","17","40336","<p>I have a custom button layout </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""&gt;        &lt;shape&gt;            &lt;gradient android:startColor=""@color/pres1""                android:endColor=""@color/pres2"" android:angle=""270"" /&gt;            &lt;stroke android:width=""5dp"" android:color=""@color/stro3"" /&gt;            &lt;corners android:radius=""5dp"" /&gt;            &lt;padding android:left=""10dp"" android:top=""20dp""                android:right=""10dp"" android:bottom=""20dp"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;    &lt;item android:state_focused=""true""&gt;        &lt;shape&gt;            &lt;gradient android:endColor=""@color/focu1""                android:startColor=""@color/focu2"" android:angle=""270"" /&gt;            &lt;stroke android:width=""5dp"" android:color=""@color/stro2"" /&gt;            &lt;corners android:radius=""5dp"" /&gt;            &lt;padding android:left=""10dp"" android:top=""20dp""                android:right=""10dp"" android:bottom=""20dp"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;    &lt;item&gt;        &lt;shape&gt;            &lt;gradient android:endColor=""@color/norm1""                android:startColor=""@color/norm2"" android:angle=""270"" /&gt;            &lt;corners android:radius=""5dp"" /&gt;            &lt;padding android:left=""10dp"" android:top=""20dp""                android:right=""10dp"" android:bottom=""20dp"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;&lt;/selector&gt;</code></pre><p>And for the below lay out </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:background=""@color/all_white""&gt;    &lt;TextView android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:text=""@string/hello""        android:textColor=""@color/all_red"" /&gt;    &lt;Button android:id=""@+id/mq_categories"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:text=""Browse Quiz Categories""        android:background=""@drawable/custom_button"" /&gt;    &lt;Button android:id=""@+id/mq_random"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:text=""Enter Random Quiz""        android:background=""@drawable/custom_button"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>following output is generated</p><p><img src=""http://i.stack.imgur.com/FESrl.png"" alt=""alt text""></p><p>I need to add some margin between buttons, Any help appreciated..</p>","174261","","","","","2010-12-02 12:24:16","Android custom button margin","<android><android-layout>","2","1","10","",""
"4335114","1","4335153","","2010-12-02 12:45:32","2","221","<p>How can I make sure that only users with an accelerometer sensor can download my app? Even better, how can I enforce the accelerometer to be of a certain accuracy?</p>","481009","","","","","2010-12-02 12:49:22","How to enforce accelerometer for android market apps?","<android><google-play>","1","1","","",""
"4335206","1","4335771","","2010-12-02 12:55:18","3","8101","<p>I'm trying to get my imageview with a drawable png to fill the display (I don't care about ratios). However, fill_parent doesn't work, and as far as I know there are no background to be set to a RelativeLayout?</p><p>Regards</p><pre><code>RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:clickable=""true""android:onClick=""toggleAdvice""   ImageView    android:id=""@+id/advice_view""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:src=""@drawable/pratbubbla_gron""    android:layout_alignParentTop=""true""    android:layout_alignParentLeft=""true""</code></pre>","498112","","82118","","2011-01-26 21:50:41","2012-10-23 14:38:11","android, imageview stretch","<android><imageview>","2","2","","",""
"4335268","1","4335595","","2010-12-02 13:02:11","2","209","<p>We are downloading a file from a server and writing it to folder on sdcard. As soon as the write finishes, we perform a Media Scan on that folder. When the user tries to open the file for viewing, we try to leverage upon the Intent mechanism of Android and raise an Intent as follows:</p><pre><code>Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.fromFile(tempFile));// MIME_TYPE could be either of: image/*, video/*, audio/*, text/*myIntent.setType(MIME_TYPE);startActivity(Intent.createChooser(myIntent, ""Open file using...""));</code></pre><p>On emulator, the camera Application is launched for this Intent but the application crashes with NPE. And on MOTOROLA Milestone, we are getting a Toast which says: ""No image to show"". Note that the photo is actually displayed in Media Gallery of both emulator and phone as soon as the scan finishes. </p><p>Not sure what has been missed here; please help.</p>","236128","","","","","2010-12-02 13:38:59","Opening a recently written file using Intents","<android><android-intent><android-mediascanner>","1","0","1","",""
"4335389","1","4335596","","2010-12-02 13:15:25","0","1684","<p>Am following the tutorial here on creating a simple todo list app:<a href=""http://www.mydroid.apnafundaz.com/2010/07/todolist-application-in-android-step-by-step-guide-with-screen-shots/"" rel=""nofollow"">http://www.mydroid.apnafundaz.com/2010/07/todolist-application-in-android-step-by-step-guide-with-screen-shots/</a></p><p>Have completed and have no errors, however my app doesn't appear like in that example, rather it looks like this  - basically the EditText appears, but there's no ListView with previous tasks...</p><p>As there's no errors, it's rather hard to work out where I'm going wrong, but as my partner's also doing the same tutorial and has come up with exactly the same result, I am thinking there could be an issue with the tut - any advice much appreciated!</p><p><strong>Just in case, here's my java file:</strong></p><pre><code>package com.example.helloworld;import java.util.ArrayList;import android.R.string;import android.app.Activity;import android.os.Bundle;import android.view.KeyEvent;import android.view.View;import android.view.View.OnKeyListener;import android.widget.ArrayAdapter;import android.widget.EditText;import android.widget.ListView;public class HelloWorld extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Inflate your view    setContentView(R.layout.main);    // Get references to UI widgets    ListView myListView = (ListView)findViewById(R.id.myListView);    final EditText myEditText = (EditText)findViewById(R.id.myEditText);    // Create the array list of todo items    final ArrayList&lt;String&gt; todoItems = new ArrayList&lt;String&gt;();    // Create the array adaptor to bind the array to the listview    final ArrayAdapter&lt;String&gt; aa;    aa = new ArrayAdapter&lt;String&gt;(this,                   android.R.layout.simple_list_item_1,              todoItems);    // Bind the array adapter to the listview    myListView.setAdapter(aa);    myEditText.setOnKeyListener(new OnKeyListener(){     public boolean onKey(View v, int keyCode, KeyEvent event){      if(event.getAction() == KeyEvent.ACTION_DOWN)       if(keyCode == KeyEvent.KEYCODE_DPAD_CENTER)       {        todoItems.add(0,myEditText.getText().toString());        aa.notifyDataSetChanged();        myEditText.setText("""");        return true;       }      return false;     }    }    );}}</code></pre><p><strong>And here's my main.xml:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;EditText android:id=""@+id/myEditText"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:text=""New to Do Item""    /&gt;    &lt;ListView android:id=""@+id/myListView"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    /&gt;    &lt;/LinearLayout&gt;</code></pre>","528013","","180538","","2010-12-02 13:18:23","2011-06-24 08:14:46","Android Simple ToDo list app not rendering correctly","<android><listview>","3","2","","",""
"4335619","1","4335712","","2010-12-02 13:41:56","0","167","<p>I want to Update the Progress bar in my application.</p><p>I have created a new view by making use of inflater and in that newly created view I want to show the Horizontal Progress Bar Updating.</p><p>How can I do that particularly?</p><p>Also I got to know that when We create a new view by Inflater, we need to add it to the Current Activity Class by addContentView(), I don't know how to do these though I have tried a lot till now.</p><p>Can anybody help me here?</p>","422859","","244296","","2010-12-02 13:53:33","2010-12-02 13:53:33","Updating the Progress Bar achieved in the New View","<android><progress-bar><android-inflate>","1","0","","",""
"4335646","1","","","2010-12-02 13:45:20","1","1291","<p>i use a context-menu on a listview to open a dialog where i can set a certain rating (via a ratingbar) for the list items. the code is as follows:</p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {    if (v.getId() == R.id.myList) {        LayoutInflater inflater = (LayoutInflater) getApplicationContext().getSystemService(LAYOUT_INFLATER_SERVICE);        View layout = inflater.inflate(R.layout.rating_dialog, (ViewGroup) findViewById(R.id.rating_dialog_root));        AlertDialog.Builder dialog = new AlertDialog.Builder(Main.this);        rb = (RatingBar) layout.findViewById(R.id.RatingBar01);        rb.setRating((float) mensen.get(info.position).getRating());        dialog.setView(layout).setCancelable(true)            .setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    // write new rating to database        // update object representation of the database                dialog.cancel();                }            })        .show();    }}</code></pre><p>this works without any problems until the point where i want to re-open this rating-dialog for the same item twice: in this case, the program seems to have forgotten the rating i set in the last try.</p><p>when i log the rating i just set (and that goes into the database), everything seems ok... what am i doing wrong?</p><p>interesting detail: when i restart the app, the rating appears still without update - so it seems, that it isn't written correctly to the db... but when i set a rating, close the app and then re-build the app, the ""new"", correct rating appears... !?</p>","370969","","","","","2010-12-02 13:45:20","android rating bar: setting rating when starting","<android><rating>","0","1","","",""
"4335651","1","","","2010-12-02 13:45:42","2","946","<p>I am working on a map for my public transit app. I'm using SurfaceView, it's a tile based map, there are 2 threads besides the main thread - drawing thread and bitmap loading thread.</p><p>Bitmaps are 256x256 PNGs stored on the SD card, I am caching the loaded bitmaps, cache capacity is 64 bitmaps. There are different sets of bitmaps for every zoom level, my map has 4 zoom levels, every next level is 2x more zoomed.</p><p>Unfortunately scrolling and pinch zooming is not smooth on my Nexus One, FPS is 15 - 20. When no tiles are being loaded FPS is 35 - 40. If I lower priority of the bitmap loading thread, it becomes completely smooth but I often see not yet loaded (white) tiles on the map - which is even worse than the non-smoothness.</p><p>So what could I do? I have 2 ideas so far:</p><ul><li>Try OpenGL, but I don't want to spend time on it and then find out it my FPS only inreased by 3. Also I want to show popups (that scroll with the map) after user clicks on map markers, which I don't know how to do in GLSurfaceView.</li><li>Set low priority to bitmap loading thread only when user touches the screen or when there's an ongoing animation. I tried that but for unknown reason it seemed to even worsen the problem a little bit, touching / not touching the screen didn't have any effect. If it was just some bug I can fix, there's still another problem. If I use kinetic scroll to quickly move the map, I will see many not cached bitmaps.</li></ul>","243225","","44729","","2010-12-02 16:16:42","2010-12-02 16:16:42","Custom tile based map is slow","<android><opengl-es>","1","0","1","",""
"4335792","1","4335928","","2010-12-02 14:02:11","2","420","<p>a simple question but Ive realised im not sure of the answer for this one....</p><p>If I am creating an android application with a library package named</p><pre><code>com.example.one</code></pre><p>and then i create another app and include another package with the name</p><pre><code>com.example.one</code></pre><p>which has a slightly refactored class, could this cause any problems in either of the apps?</p><p>The reason i ask is recently I had a problem with some google source code and it was down to the fact that a device manufactorer had included the same libs in the custom OS that I had used in my apk, and it was not happy! (or so i was told)</p><p>If anyone can fill me in here, as i obviosuly dont understand something quite findamental here :)</p><p>thankx</p><p><strong>EDIT:</strong> a good link on the diff between Android and Java package names <a href=""http://blog.javia.org/android-package-name/"" rel=""nofollow"">http://blog.javia.org/android-package-name/</a></p>","236743","","236743","","2012-11-16 10:27:24","2012-11-16 10:27:24","Java Package names and conflicts","<java><android>","4","0","","",""
"4335857","1","","","2010-12-02 14:10:26","0","570","<p>Please forgive me my english is not very good and i'm new to anroid programming.</p><p>I have a picture/image in my main activity of my dictionary app and I would like to bring up the ""anroid search box"" in that activity when you 'tap' the image instead of using the menu key to search is this possible to do and how?</p>","528057","","","","","2010-12-02 14:48:16","How to trigger or bring up android search box by tapping an image?","<android><search>","2","0","","",""
"4335943","1","4335986","","2010-12-02 14:19:04","1","2292","<p>I need to delete the duplicate contacts and then inserting the new contact on Android 2.2.</p><p>How to do this?</p><p>give me any sample code or sites for this.</p>","488433","","488433","","2011-01-22 05:25:03","2011-12-28 18:57:23","How to delete the contacts on android 2.2?","<android><contacts>","2","0","1","",""
"4336060","1","5806001","","2010-12-02 14:30:47","47","22095","<p>For instance, the default button has the following dependencies between its states and background images:</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_window_focused=""false"" android:state_enabled=""true""        android:drawable=""@drawable/btn_default_normal"" /&gt;    &lt;item android:state_window_focused=""false"" android:state_enabled=""false""        android:drawable=""@drawable/btn_default_normal_disable"" /&gt;    &lt;item android:state_pressed=""true""         android:drawable=""@drawable/btn_default_pressed"" /&gt;    &lt;item android:state_focused=""true"" android:state_enabled=""true""        android:drawable=""@drawable/btn_default_selected"" /&gt;    &lt;item android:state_enabled=""true""        android:drawable=""@drawable/btn_default_normal"" /&gt;    &lt;item android:state_focused=""true""        android:drawable=""@drawable/btn_default_normal_disable_focused"" /&gt;    &lt;item        android:drawable=""@drawable/btn_default_normal_disable"" /&gt;&lt;/selector&gt;</code></pre><p>How can I define my own custom state (smth like <code>android:state_custom</code>), so then I could use it to dynamically change my button visual appearance?</p>","247013","","","","","2012-11-16 16:11:17","Android: how to add a custom button state","<android><button><state>","2","1","46","",""
"4336088","1","4346016","","2010-12-02 14:32:57","4","1089","<p>I'm using an intent to post a message via a Twitter client.When there is no Twitter application on the phone I want to redirect the user to the market.But the exception ActivityNotFoundException is not working. Everytime (when I don't have a Twitter app) I get the error ""No applications can perform this action""</p><pre><code>Intent intentTwitter = new Intent(Intent.ACTION_SEND);intentTwitter.putExtra(Intent.EXTRA_TEXT,msg);intentTwitter.setType(""application/twitter"");try{ startActivity(Intent.createChooser(intentTwitter,""tweet""));}catch(ActivityNotFoundException e){ // lead to the app market}</code></pre><p>I read ActivityNotFoundException is the exception handler for startActivity and its child. Maybe the solution is not in the exception handling.</p>","311420","","311420","","2011-07-08 09:43:04","2011-07-08 09:43:04","Android : Can I use this intent from a 3rd party application?","<android><twitter><exception-handling><android-intent>","2","0","0","",""
"4336095","1","4336157","","2010-12-02 14:33:50","0","1573","<p>I have a byte array that I want to save it as a bitmap image. what should I do? I saw android.graphics.Bitmap and found several methods but I don't know which one is suitable. createBitmap(int width, int height, Bitmap.Config config), for example. I have width and height but how can I give it my byte array?</p><p>Thanks</p>","513413","","","","","2010-12-02 14:40:11","Android: How shall I create Bitmap image bast on byte array?","<android><image><bitmap>","1","0","1","",""
"4336152","1","4340487","","2010-12-02 14:39:43","1","277","<p>This is actually two questions.  The first relates to my program, and the second is a more general question regarding debugging.</p><p>In my code, I have two button listeners.  When the first is clicked, the onClickListener creates the locationlistener, as well as the LocationManager which requests updates from the locationlistener.  (See below...)  </p><pre><code>LocationManager locationManager = (LocationManager)  getSystemService(Context.LOCATION_SERVICE);locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationlistener);</code></pre><p>On the click of the second button, I try to unregister the listener as follows... </p><p>locationManager.removeUpdates(locationlistener);</p><p>However, I end up with a force close and the following info in the debugger...</p><pre><code>ERROR/AndroidRuntime(310): FATAL EXCEPTION: mainERROR/AndroidRuntime(310): java.lang.NullPointerExceptionERROR/AndroidRuntime(310):     at com.ryan.gcal.GRunCal$2.onClick(GRunCal.java:94)ERROR/AndroidRuntime(310):     at android.view.View.performClick(View.java:2408)ERROR/AndroidRuntime(310):     at android.view.View$PerformClick.run(View.java:8816)ERROR/AndroidRuntime(310):     at android.os.Handler.handleCallback(Handler.java:587)ERROR/AndroidRuntime(310):     at android.os.Handler.dispatchMessage(Handler.java:92)ERROR/AndroidRuntime(310):     at android.os.Looper.loop(Looper.java:123)ERROR/AndroidRuntime(310):     at android.app.ActivityThread.main(ActivityThread.java:4627)ERROR/AndroidRuntime(310):     at java.lang.reflect.Method.invokeNative(Native Method)ERROR/AndroidRuntime(310):     at java.lang.reflect.Method.invoke(Method.java:521)ERROR/AndroidRuntime(310):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)ERROR/AndroidRuntime(310):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)ERROR/AndroidRuntime(310):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Line 94 of my code, where the error originates, is where I tried to remove the location listener.  So I assume I am not removing the location listener properly, but I am not sure what is wrong.  My LocationManager is declared at the start of my code...</p><pre><code>Locationmanager locationManager;</code></pre><p>My first question is, what am I doing wrong in removing the listener? And secondly, can anyone provide some tips/advice on learning to interpret debug errors meaningfully? Thanks.</p>","513939","","513939","","2010-12-02 23:13:30","2010-12-02 23:23:31","How to interpret Debugging information?","<android>","3","3","","",""
"4336217","1","","","2010-12-02 14:46:48","1","204","<p>I'm building a web app using PhoneGap and I'm planning to deploy it on iOS, Android and webOS (for sure). I might even go further with BlackBerry and Symbian.</p><p>I'm looking for an analytics solution that is available for the first three platform so it can track all the usage using one single ID. This way I have an easy view of my user base.</p><p>Any suggestions? Flurry and Localytics don't offer webOS support :(</p>","528096","","","","","2011-02-02 20:32:07","Looking for multi-platform analytics solution?","<android><ios><mobile><analytics><webos>","1","0","1","",""
"4336218","1","4336294","","2010-12-02 14:46:49","2","11674","<p>How do i apply color on the various states(focused, pressed, enabled) of the TextView ?</p><p>I have already referred this: <a href=""http://developer.android.com/reference/android/content/res/ColorStateList.html"" rel=""nofollow"">http://developer.android.com/reference/android/content/res/ColorStateList.html</a> , but doesn't know how do i apply this to the TextView? or is there any other way to do so ?</p><h2>Update:</h2><p><strong>I want to change the Background color.</strong></p>","379693","","379693","","2010-12-03 10:14:52","2013-12-20 13:10:36","Android - Textview change color on changing of state","<android><android-textview>","4","0","1","",""
"4336227","1","","","2010-12-02 14:47:46","2","281","<p>I have a ScrollView and views inside it.</p><p>I want to have special behaviour on one of the child views in the ScrollView. My question is, does the view itself know when it is scrolled? Is there a callback, like onScrollChanged or something that can notify my view that the scroll in the scrollView is changed? </p><p>The views should not know about the parent scrollview. </p><p>I tried using ViewTreeObsever, and registering a onScrollChangeListener callback, but for some reason I get no callback whatsoever when I scroll things.</p>","346583","","346583","","2010-12-02 15:44:32","2010-12-02 15:44:32","Android::Does a view know when it is scrolled?","<android><view><scrollview>","1","1","1","",""
"4336286","1","","","2010-12-02 14:54:46","43","7022","<p>I have a ListView whose items have a tiled background. To accomplish this, I use the following drawable xml:</p><pre><code>&lt;bitmap    xmlns:android=""http://schemas.android.com/apk/res/android""    android:src=""@drawable/tile""    android:tileMode=""repeat"" /&gt;</code></pre><p>Usually, this works. Sometimes, however, the src drawable isn't tiled, but stretched to fill the entire list item. (I've got several different tiles like this, and I use them mixed in one ListView. If there is stretching instead of tiling, it's never been in all of them at once, for what that's worth.)</p><p>I also tried to add <code>android:dither=""true""</code> to that xml, since I read somewhere that without it there might be bugs. That didn't change anything.</p><p>Has anyone had the same problem? How did you fix it?</p>","279363","","","","","2014-03-15 07:32:55","Tiled drawable sometimes stretches","<android><xml><drawable><tiling>","6","7","21","",""
"4336297","1","","","2010-12-02 14:55:36","2","1154","<p>I have ubuntu Linux 10.04, my collegue uses suse. We have Wi-Fi connection to the Internet. We use Android emulator with several virtual devices. We have problem with the Internet connection of the virtual devices. Normally it works well but sometimes (about 25%) the virtual device shows no GSM signal and no Internet even if the PC is connected. There is no clear reason of that behaviour. It will stay disconnected forever so if it happens, we will have to restart the virtual device and hope that the next attempt will be OK. It happens sometimes to all Android version virtual device but it is more common on Android 2.x than Android 1.x. Does anybody have the same error?</p>","449293","","881229","","2014-02-12 21:21:53","2014-02-12 21:21:53","Android emulator sometimes does not connect to the internet","<android><android-emulator>","2","3","","",""
"4336365","1","4337002","","2010-12-02 15:02:23","6","4411","<p>What's the best way to implement a download queue in Android?</p><p>I suspect there might be some platform classes that might do most of the work.</p>","143378","","","","","2014-02-04 11:58:02","Download queue in Android","<android><download><queue>","5","0","6","",""
"4336394","1","","","2010-12-02 15:05:12","6","2508","<p>I am getting google.com inside my WebView, but am not getting my localhost in that.Can anybody help me?</p>","522834","","321731","","2013-09-20 20:27:44","2013-09-20 20:29:12","WebView and localhost","<android><webview>","4","2","","",""
"4336470","1","","","2010-12-02 15:13:57","16","33962","<p>I am developing a quiz and I need the user to answer all the questions before proceeding.  When the user has not answered all the questions I display a simple alertdialog informing him or her. The problem is whatever I do I can't get the alertdialog to close.  Why isn't dialog.cancel working?`This is the code: </p><pre><code>AlertDialog.Builder ad = new AlertDialog.Builder(this);  ad.setTitle(""Unanswered Questions"");  ad.setMessage(""You have not answered all the questions."");   ad.setPositiveButton(""OK"", new DialogInterface.OnClickListener() {     public void onClick(DialogInterface dialog, int id) {       dialog.cancel(); }  });  ad.show(); </code></pre>","478244","","418183","","2010-12-02 16:07:55","2013-09-07 16:16:33","How do I close an Android alertdialog","<android>","8","3","0","",""
"4336474","1","","","2010-12-02 15:14:17","2","126","<p>I have one normal android package with an activity A.Now I am using a second independent test package in which I run several tests.for testing purposes i want to create an activity B which extends the activity A,in order to overwrite some aspects of A for testing.but since activity B is only for testing purposes I want to keep it in the test package.</p><p>Is there any possible way for this?</p>","528133","","759866","","2014-02-01 18:27:13","2014-02-01 18:27:13","android test package overwriting activity in other package","<android>","0","0","","",""
"4336637","1","4337886","","2010-12-02 15:30:58","39","14180","<p>As we know, Android apps are written in Java. In Java, no matter <a href=""http://www.galkonline.com/2010/09/15/how-to-prevent-java-from-being-decompiled/"">what you do</a>, it is impossible to protect compiled code from decompilation or reverse-engineering, as the Stack Overflow question <em><a href=""http://stackoverflow.com/questions/49379/how-to-lock-compiled-java-classes-to-prevent-decompilation"">How to lock compiled Java classes to prevent decompilation?</a></em> suggests.</p><p>How would one go about protecting an app that contains algorithmic trade secrets from reverse-engineering?</p><p>By ""how"" I mean not only software techniques, but also other <strong>creative</strong> approaches.</p>","418055","","63550","","2013-02-18 21:16:18","2013-02-18 21:41:26","Is it really impossible to protect Android apps from reverse engineering?","<java><android><reverse-engineering><decompiling>","8","3","29","",""
"4336696","1","4336911","","2010-12-02 15:36:52","0","1972","<p>Hi I'm setting up an android app and I'm using a tabbed interface.  I'd like three tabs, a text based tab (About), a webkit tab (Store) and a gridview tab of images (Gallery) like in the <a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">Gridview tutorial</a>.</p><p>I have the text and webkit tab working fine, but I cannot figure out the best way to format the gridview within the tab.  Using the <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">tabbed interface tutrial</a> as an example, I am declaring the tab's content within the onCreate() event of the main class.  </p><pre><code>public class Woodroid extends TabActivity  {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Resources res = getResources(); // Resource object to get Drawables        TabHost tabHost = getTabHost();  // The activity TabHost        tabHost.setCurrentTab(0);        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, AboutActivity.class);        // Initialize a TabSpec for each tab and add it to the TabHost        spec = tabHost.newTabSpec(""about"").setIndicator("""",                          res.getDrawable(R.drawable.ic_tab_about))                      .setContent(intent);        tabHost.addTab(spec);        // Do the same for the other tabs        intent = new Intent().setClass(this, StoreActivity.class);        spec = tabHost.newTabSpec(""store"").setIndicator(""Store"",                res.getDrawable(R.drawable.ic_tab_store))            .setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, GalleryActivity.class);        spec = tabHost.newTabSpec(""gallery"").setIndicator(""Gallery"",                          res.getDrawable(R.drawable.ic_tab_gallery))                      .setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(0);    }}</code></pre><p>So then in the GalleryActivity.java I have the following</p><pre><code>public class GalleryActivity extends Activity {  public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);            GridView gridview = new GridView(this);            gridview.setAdapter(new ImageAdapter(this));            setContentView(gridview);     }}</code></pre><p>Which is an interpretation from the gridview tutorial.  The thing that is missing then is the gridview layout definition.  It seems I can force some of the attributes like<code>gridview.setNumColumns(3);</code>but that does not allow for the more flexible looking equivelant from the /layout/main.xml of the gridview version </p><pre><code>android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:columnWidth=""90dp""android:numColumns=""auto_fit""</code></pre>","4594","","","","","2010-12-02 15:54:14","How to display an Android gridview within a tabbed layout","<android><android-layout><tabbed-view>","1","0","1","",""
"4336762","1","4726646","","2010-12-02 15:42:09","48","17027","<p>On Android devices that use soft keyboards, I want to prevent the fullscreen keyboard editing view (shown below) from appearing when in landscape mode (i.e. I want to see only the soft keyboard itself and my view behind it).</p><p>I assume this can be achieved using the <code>setExtractViewShown(false)</code> method on <code>InputMethodService</code>, but I am unable to access the default instance of this and do not want to implement a custom input method.</p><p><img src=""http://i.imgur.com/MB623.png"" alt=""Android fullscreen editing view"" title=""Android fullscreen editing view"" /></p><p><strong>Edited to add:</strong> the view to which input is going is not a <code>TextView</code> (it's a <code>View</code> with a custom <code>InputConnection</code> implementation), so <code>android:imeOptions=""flagNoExtractUi""</code> won't work here.</p>","204826","","204826","","2012-07-09 14:06:18","2013-11-13 02:19:10","Disabling the fullscreen editing view for soft keyboard input in landscape?","<android><android-softkeyboard><android-input-method>","5","1","21","",""
"4336780","1","","","2010-12-02 15:43:32","0","567","<p>I need to capture a signature on a Canvas Element on a touch Android Device (Droid X)</p><p>Does Signature PAD  by Thomas Bradley work in Native Android via Phonegap?</p>","528195","","21234","","2010-12-02 15:48:04","2010-12-02 17:32:19","Does Signature PAD by Thomas Bradley work in Android via Phonegap","<android><canvas><phonegap>","1","0","","",""
"4336865","1","4336895","","2010-12-02 15:50:33","1","4281","<p>I want to store my Bitmap image into project directory. How can I have access to my project folder or what is the address of my project folder?</p>","513413","","244296","","2010-12-02 15:58:09","2010-12-02 16:07:12","Android: Storing Image into project directory (files)?","<android><image><file><directory><store>","1","0","","",""
"4336926","1","","","2010-12-02 15:55:42","2","1309","<p>Hi i've a HTC Desire and want a date pciker to look like the spinning wheels in the datepicker i see in the agenda etc. If i use this code</p><pre><code> return new DatePickerDialog(this,                mDateSetListener,                mYear, mMonth, mDay);</code></pre><p>I always see the default datepicker with up and down buttons without the swipe to spin the wheels. Is there a sample of how to use these</p><p>Greetings Andre Mens</p>","510060","","","","","2010-12-02 19:58:05","DatePicker look and feel","<android><datepicker><android-layout>","1","1","","",""
"4336938","1","","","2010-12-02 15:56:55","2","114","<p>Basically I have a maps Activity that when started it starts up a thread that slowly loads in all of the map markers (overlays).  </p><p>Sometimes (probably like 75% of the time) when you attempt to interact with the map while this thread is running, it throws a RuntimeException with message ""sending message to a handler on a dead thread"".  I have concluded that this error is not thrown if you wait to interact with the map until after the thread is done.</p><p>So my initial questions are: does the maps API have known threading errors?  Is there a specific way one needs to go about loading maps data asynchronously?  Maybe there is some notify method I need to be calling?</p><p>Basically if I run the thread but comment this line:</p><pre><code>mv.getOverlays().add(pin);</code></pre><p>The thread runs like normal but does not add overlays, and the app does not crash.</p><p>I will show more code if we need it.</p><p>Thanks</p>","347359","","","","","2011-01-26 18:26:18","Google maps Force Closes when loading overlays Asyc","<java><android><google-maps>","1","2","","",""
"4336980","1","4337508","","2010-12-02 16:01:04","0","125","<p>I am following this tutorial:</p><p><a href=""http://knol.google.com/k/suk-woo-heo/creating-user-interfaces/1oqzmo14sfklf/20#"" rel=""nofollow"">http://knol.google.com/k/suk-woo-heo/creating-user-interfaces/1oqzmo14sfklf/20#</a></p><p>Have got to step 4 where it says:4. With the resources defined, you’re ready to customize the TodoListItemView appearance.Create new private instance variables to store the Paint objects you’ll use to draw the paper background and margin. Also create variables for the paper color and margin width values. Fill in the init method to get instances of the resources you created in the last two steps and create the Paint objects. </p><p>Can anyone tell me what this means?'Create new private instance variables to store the Paint objects'</p><p>Should this be created as a new class in eclipse under src? My existing class I had already calls lots of these things like init(), so it starts spitting errors if I put it in there...</p>","528013","","244296","","2010-12-02 16:08:44","2010-12-02 16:48:02","Quick guru interpretation of beginner android tutorial instructions!","<android>","1","0","","",""
"4336996","1","","","2010-12-02 16:02:01","0","1025","<p>i implemented a custom background for my EditText fields because i think the defaults for the EditTexts are too tall &amp; have too much padding.  anyway, the new EditText drawable backgrounds are displaying fine, BUT the fields shrink slightly when i open the keyboard and expand to their original (custom) size when i close the keyboard.  this behavior must be overridable in some way that i just haven't stumbled across.  can anyone help, please?  I've read the IMEOptions article at the dev android site and nothing there really jumps out at me at as a possible solution to this problem.  thanks!</p><p>here is my EditText - each EditText is in its own layout because i needed to add padding BETWEEN the fields:</p><pre><code>&lt;LinearLayout android:layout_height=""wrap_content""        android:layout_width=""fill_parent"" android:orientation=""vertical"" android:paddingBottom=""5dip"" android:paddingLeft=""3dip""  android:paddingRight=""3dip""&gt;        &lt;EditText android:id=""@+id/join_firstName""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content""            android:background=""@drawable/joinedittextselector"" android:padding=""5dip"" /&gt;  &lt;!-- android:layout_weight=""1"" --&gt;    &lt;/LinearLayout&gt;</code></pre><p>here is my selector:</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/join_field_bg_default"" /&gt;&lt;item android:state_window_focused=""false"" android:state_enabled=""false""    android:drawable=""@drawable/join_field_bg_default"" /&gt;&lt;item android:state_pressed=""true"" android:drawable=""@drawable/join_field_bg_default"" /&gt;&lt;item android:state_enabled=""true"" android:state_focused=""true""    android:drawable=""@drawable/join_field_bg_selected"" /&gt;&lt;item android:state_enabled=""true"" android:drawable=""@drawable/join_field_bg_default"" /&gt;&lt;item android:state_focused=""true"" android:drawable=""@drawable/join_field_bg_selected"" /&gt;&lt;item android:drawable=""@drawable/join_field_bg_default"" /&gt;</code></pre><p></p><p>i've tried adjustResize and adjustPan for the android:windowSoftInputMode setting of the activity that the EditText is used in and neither have worked. thanks again for any advice on this!</p>","528201","","528201","","2010-12-02 16:37:36","2011-06-10 19:03:27","Android Custom EditText is resized by keyboard open and close","<android><edittext>","1","3","","",""
"4337013","1","","","2010-12-02 16:03:36","26","746","<p>After several days to learn how Android works, I decided to build my first App : A simple app which displays the GMap from a address provided by the user with a simple <code>EditText</code> widget.<br>I use <code>Geocoder</code> to do that.</p><p>After a little bugtracking with logcat, here is the exception returned by adb :</p><pre><code>E/LocationMasfClient(   53): forwardGeocode(): RPC failed with status 1W/System.err(  262): java.io.IOException: RPC failed with status 1W/System.err(  262):    at   android.location.Geocoder.getFromLocationName(Geocoder.java:166)W/System.err(  262):    at fr.meetopia.tinymap.MapViewActivity.testGeoCoder(MapViewActivity.java:104)W/System.err(  262):    at fr.meetopia.tinymap.MapViewActivity.onCreate(MapViewActivity.java:38)W/System.err(  262):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)W/System.err(  262):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)W/System.err(  262):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)W/System.err(  262):    at android.app.ActivityThread.access$2200(ActivityThread.java:119)W/System.err(  262):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)</code></pre><p>And now here is the code pointed by the stack trace :</p><pre><code>Geocoder geoCoder = new Geocoder(this);MapView mapView = (MapView) findViewById(R.id.mapview);    MapController mc = mapView.getController();    GeoPoint p;    try {        List&lt;Address&gt; addresses = geoCoder.getFromLocationName(""paris france"", 50);        if (addresses.size() &gt; 0) {            p = new GeoPoint(                    (int) (addresses.get(0).getLatitude() * 1E6),                     (int) (addresses.get(0).getLongitude() * 1E6));            mc.animateTo(p);                mapView.invalidate();        }    } catch (Exception e) {        // TODO Auto-generated catch block        e.printStackTrace();    }</code></pre><p>Obviously, this code is a portion of a <code>MapActivity</code> instantiation.</p><p>I made some tests with different versions of Google APIS (8, 7, 4) and different versions of SDK platform (2.2, 2.1, 1.6), but no luck. I just noticed that the Google API 8 contains a known bug and returned a <code>Service Unavailable Exception</code> instead of <code>RPC Failed 1</code>.</p><p>On the other hand, I tried to run my app directly on my device (HTC Desire 2.1) and I noticed the same behavior (that's to say : no behavior, a Map with USA in its center).<br>Here comes the user-permission of the Android Manifest :</p><pre><code>&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>I'm sorry for my English (and hope my post is clear enough...), and thanks you for your attention and ideas :)</p>","528224","","839601","","2012-01-11 07:00:50","2012-04-16 13:22:14","RPC Error with Geocoder","<java><android><android-emulator>","4","3","0","",""
"4337034","1","4337703","","2010-12-02 16:04:59","9","2676","<p>Many of menus have always one item same to all.</p><p>Is there the way to define that item as extra menu and include it to all other?</p><p>Something like this:mainmenu.xml</p><pre><code>&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:title=""@string/text_mainmenu"" android:id=""@+id/menu_mainmenu""/&gt;&lt;/menu&gt;</code></pre><p>childmenu.xml</p><pre><code>&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android"" parent=""@values/menu_mainmenu&gt;    &lt;item android:title=""@string/text_anothermenu"" android:id=""@+id/menu_anothermenu""/&gt;&lt;/menu&gt;</code></pre><p>I know, that it's possible to do it programmaticaly, but I thought xml-way is nicer.</p><p>Thank you,</p><p>Mur</p>","408780","","408780","","2010-12-02 16:13:24","2011-02-10 08:22:35","Include menu in menu. Android","<android><menu>","2","0","1","",""
"4337061","1","","","2010-12-02 16:07:25","0","434","<p>i am making an app to make the hands of a clock.That is, i draw a simple line on the screen and want it rotate like the hands of a clock.how do i do this using a timer?(so that the position of the line refreshes).Only one end point of the line should rotate,while the other remains staionary.In the folllowing code,i only draw a line on the screen:</p><p>DrawView.java:</p><pre><code>package LineRefresh.xyz.com;import java.util.Timer;import java.util.TimerTask;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.view.View;public class DrawView extends View {Paint paint = new Paint();public DrawView(Context context) {    super(context);    }@Overridepublic void onDraw(final Canvas canvas) {  paint.setColor(Color.BLACK); canvas.drawLine(50, 200, 270, 200, paint);  }</code></pre><p>}</p><hr><p>LineRefresh.java:</p><pre><code>package LineRefresh.xyz.com;import android.app.Activity;import android.graphics.Color;import android.os.Bundle;public class LineRefresh extends Activity {DrawView drawView;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    drawView = new DrawView(this);    drawView.setBackgroundColor(Color.WHITE);    setContentView(drawView);}}</code></pre>","528227","","","","","2010-12-03 20:00:56","how do i add a timer to make the line refresh and appear after evry 2 seconds?","<java><android><timer>","1","0","","",""
"4337177","1","4852884","","2010-12-02 16:18:29","2","3010","<p>I'm trying to build a C++ file for using in my Android application over JNI. I'm building in Windows using Cygwin. I'm completely new to this and don't know what I am doing. </p><p>Here's part of the output:</p><pre><code>$ g++ -c test_wrap.cxx -I""C:\dev\android-ndk-r4b\build\platforms\android-4\arch-arm\usr\include"" -I./includeIn file included from C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h:40,                 from C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h:32,                 from C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h:34,                 from C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/strings.h:42,                 from C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdlib.h:42,                 from test_wrap.cxx:160:C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:44: error: conflicting declaration 'typedef long unsigned int size_t'/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h:213: error: 'size_t' has a previous declaration as `typedef unsigned int size_t'C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:44: error: declaration of `typedef long unsigned int size_t'/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h:213: error: conflicts with previous declaration `typedef unsigned int size_t'C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:44: error: declaration of `typedef long unsigned int size_t'/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h:213: error: conflicts with previous declaration `typedef unsigned int size_t'C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:46: error: conflicting declaration 'typedef long int ptrdiff_t'/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h:151: error: 'ptrdiff_t' has a previous declaration as `typedef int ptrdiff_t'C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:46: error: declaration of `typedef long int ptrdiff_t'/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h:151: error: conflicts with previous declaration `typedef int ptrdiff_t'C:/dev/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:46: error: declaration of `typedef long int ptrdiff_t'/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h:151: error: conflicts with previous declaration `typedef int ptrdiff_t'</code></pre><p>Can you please give me a hand?</p><p>Emmanuel</p>","442512","","442512","","2010-12-02 16:25:15","2014-01-18 16:16:23","Compiling C++ code with cygwin for JNI (Android NDK)","<java><c++><android><jni><android-ndk>","5","0","","",""
"4337285","1","4341552","","2010-12-02 16:27:59","3","1907","<p>I have an application which creates a series of Bitmaps.  I am holding these Bitmaps in SoftReferences, to avoid running out of memory.  I would like the heap size to grow to the maximum 16MBs before it starts collecting my SoftReferences.  However, the SoftReferences are collected very eagerly, prior to growing the heap to it's max.  Is there anyway to force the references to be collected less eagerly? or to manually grow the heap to the max?  Possibly a way to just start the application with 16mb allocated? </p>","426493","","","","","2011-09-30 11:52:16","Android heap size and SoftReferences","<android>","2","0","","",""
"4337475","1","4337709","","2010-12-02 16:44:15","1","1790","<p>My Android application allows users to read full articles from various blogs and share the posts using Android's in-built sent action:</p><pre><code>Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);</code></pre><p>When I share an article, Twitter indicates it is shared via Twitter for Android, and Facebook simply has an RSS icon with no ""shared via"" at all.</p><p>What is the procedure of getting my app's title to appear next to ""Shared via"" for those social networks?</p>","519908","","","","","2012-02-23 22:34:48","How to add Shared via [my app] when sharing content from an Android app to popular social networks?","<android><facebook><twitter><sharing>","3","0","","",""
"4337514","1","4897617","","2010-12-02 16:48:37","13","31881","<p>I am trying to find  way to be able to fire an onclick event on a tab when this tab is the current tab.</p><p>I did try this way (among several other) with no success thou.</p><pre><code>public void onTabChanged(String tabId) {    Log.d(this.getClass().getName(), ""&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; tabId: "" + tabId);    int tabs = getTabWidget().getChildCount();    Log.d(this.getClass().getName(), ""tabs: "" + tabs);    for(int i=0; i&lt;tabs; i++){        View tab = getTabWidget().getChildAt(i);        if(i==tabHost.getCurrentTab()){            Log.d(this.getClass().getName(), ""tab: "" + i);            tab.setOnClickListener(this);        }else{            tab.setOnClickListener(null);            tab.getOnFocusChangeListener();        }    }   }</code></pre><p>the point is that I set the <code>onClickListener</code> to <code>null</code> so, the next time I click on a tab nothing happens, but I would like to have the <em>normal</em> tab behavior.</p><p>Any idea there outside?</p>","448660","","1466188","","2012-08-27 09:20:41","2012-10-23 06:31:36","Android TabWidget detect click on current tab","<android><listener><android-tabhost><tabwidget>","4","4","11","",""
"4337530","1","","","2010-12-02 16:50:16","0","518","<p>I have to get xml data from a .net web service. The webservice returns an XMLDocument object. I have been unable to successfully retrive/interpret the data as XML with start tags etc. It looks like this </p><p>MethodResponse{MethodResult=anyType{BUILDINGPERMITS=anyType{PERMITS=anyType{APNO=     1829; YCOORD=36.09593993; XCOORD=-80.24505836; JOBADDRESS=200 W SECOND ST WINSTON-SALEM 27101-; STATUS=Closed; }; ...</p><p>I can succssfully retrieve XML data if it is sent as a string rather than XMLDocument.Is there a way to get XML data from a webservice that returns a .net object like XMLDocument or is that just not practical?</p>","528286","","","","","2010-12-02 17:51:44","Retrieving XmlDocument class object from .net web service in Android","<android><web-services><ksoap>","1","0","","",""
"4337563","1","4337603","","2010-12-02 16:52:53","2","1977","<p>I can do this programmatically, but it is really inefficient, and also time consuming if I ever need to do it for multiple TextViews.</p><p>I want a TextView to go to a new line after 15 characters, every 15 characters. I tried using <code>android:maxLength=""15""</code> but that just stopped the string at 15 characters. No new line or anything.</p>","348261","","","","","2010-12-02 16:57:35","Is there anyway to automatically make a TextView go to a new line after a certain amount of characters?","<android><newline><textview><character><maxlength>","2","0","3","",""
"4337723","1","4337909","","2010-12-02 17:09:40","0","142","<p>I have read about <a href=""http://developer.android.com/guide/topics/fundamentals.html#acttask"" rel=""nofollow"">activities, stacks and launch modes</a>, but have a hard time understanding how to apply this info to my specific problem.</p><p>Basically what I want to do is to launch a new activity, and make sure that it takes the parent's place in the stack, rather than being placed on top of it in the stack. I have the following two scenarios:</p><ol><li><p>I have a login-activity. When the user logs in, a new activity is launched. When the user hits ""back"", I don't want him to be sent back to the login-activity, but rather to exit the program.</p></li><li><p>I have an activity that is displayed in a tabhost (or rather in a framelayout inside a tabhost, I suppose). This activity has a button, an clicking on this launches a new activity. I would like this new activity to take the parents place. That is, i don't want to open a new full-screen activity, but instead I want it to take the parent's place inside the framelayout in the tabhost. Also, I don't want a press on the back-key to lead the user back to the parent activity. </p></li></ol><p>I would appreciate it if anyone could point me in the right direction. Thanks in advance.</p>","528312","","104117","","2010-12-02 17:30:17","2010-12-02 17:38:53","Make new activity take the place of the parent in the stack","<android>","2","0","","",""
"4337782","1","","","2010-12-02 17:16:07","0","206","<p>I have a video recording app in which I am setting camera parameters using the <code>Camera</code> object. After the recording is done, in the <code>onPause</code> I release the camera using the methods </p><p><code>camera.unlock();<br>camera.release();</code><br>The Moment my camera is released i get the following log</p><pre><code>12-02 22:23:05.824: INFO/DEBUG(4884): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***12-02 22:23:05.824: INFO/DEBUG(4884): Build fingerprint: 'google/passion/passion/mahimahi:2.2.1/FRG83D/75603:user/release-keys'12-02 22:23:05.824: INFO/DEBUG(4884): pid: 7299, tid: 7299  &gt;&gt;&gt; com.test.video.activity &lt;&lt;&lt;12-02 22:23:05.824: INFO/DEBUG(4884): signal 11 (SIGSEGV), fault addr 0000001012-02 22:23:05.824: INFO/DEBUG(4884):  r0 00000000  r1 44a56890  r2 bef83514  r3 44a5689012-02 22:23:05.824: INFO/DEBUG(4884):  r4 0002bbd8  r5 0000aa50  r6 bef83514  r7 4186bcb412-02 22:23:05.824: INFO/DEBUG(4884):  r8 bef83528  r9 4186bcac  10 4186bc94  fp bef8386812-02 22:23:05.824: INFO/DEBUG(4884):  ip a930d670  sp bef83500  lr a93077dd  pc a9032798  cpsr 6000003012-02 22:23:05.824: INFO/DEBUG(4884):  d0  643a64696f72646e  d1  647265676775626512-02 22:23:05.824: INFO/DEBUG(4884):  d2  0076006900740017  d3  004d00790074004612-02 22:23:05.824: INFO/DEBUG(4884):  d4  0068006300720061  d5  007400630061002e12-02 22:23:05.824: INFO/DEBUG(4884):  d6  0074006900760069  d7  00720050002e007912-02 22:23:05.824: INFO/DEBUG(4884):  d8  00000000422fc288  d9  00024053c1c0000012-02 22:23:05.824: INFO/DEBUG(4884):  d10 44a4b3804383c890  d11 0000000042d1dcb012-02 22:23:05.824: INFO/DEBUG(4884):  d12 0000000000000000  d13 000000000000000012-02 22:23:05.824: INFO/DEBUG(4884):  d14 0000000000000000  d15 000000000000000012-02 22:23:05.833: INFO/DEBUG(4884):  d16 bef832a844a57c18  d17 000000000000000012-02 22:23:05.833: INFO/DEBUG(4884):  d18 0000000000000000  d19 000000000000000012-02 22:23:05.833: INFO/DEBUG(4884):  d20 3ff0000000000000  d21 800000000000000012-02 22:23:05.833: INFO/DEBUG(4884):  d22 0000000000000000  d23 000000000000000012-02 22:23:05.833: INFO/DEBUG(4884):  d24 0000000000000000  d25 000000000000000012-02 22:23:05.833: INFO/DEBUG(4884):  d26 0100010001000100  d27 010001000100010012-02 22:23:05.833: INFO/DEBUG(4884):  d28 0100010001000100  d29 3ff000000000000012-02 22:23:05.833: INFO/DEBUG(4884):  d30 0000000000000000  d31 3ff000000000000012-02 22:23:05.833: INFO/DEBUG(4884):  scr 8000001212-02 22:23:05.893: INFO/DEBUG(4884):          #00  pc 00032798  /system/lib/libmedia.so12-02 22:23:05.893: INFO/DEBUG(4884):          #01  pc 000077da  /system/lib/libmedia_jni.so12-02 22:23:05.893: INFO/DEBUG(4884):          #02  pc 00016e34  /system/lib/libdvm.so12-02 22:23:05.893: INFO/DEBUG(4884):          #03  pc 000452c4  /system/lib/libdvm.so12-02 22:23:05.893: INFO/DEBUG(4884):          #04  pc 0001bd98  /system/lib/libdvm.so12-02 22:23:05.893: INFO/DEBUG(4884):          #05  pc 00022794  /system/lib/libdvm.so12-02 22:23:05.893: INFO/DEBUG(4884):          #06  pc 00021634  /system/lib/libdvm.so12-02 22:23:05.893: INFO/DEBUG(4884):          #07  pc 0005c78e  /system/lib/libdvm.so12-02 22:23:05.893: INFO/DEBUG(4884):          #08  pc 00064e58  /system/lib/libdvm.so12-02 22:23:05.904: INFO/DEBUG(4884):          #09  pc 0001bd98  /system/lib/libdvm.so12-02 22:23:05.904: INFO/DEBUG(4884):          #10  pc 00022794  /system/lib/libdvm.so12-02 22:23:05.904: INFO/DEBUG(4884):          #11  pc 00021634  /system/lib/libdvm.so12-02 22:23:05.904: INFO/DEBUG(4884):          #12  pc 0005c5cc  /system/lib/libdvm.so12-02 22:23:05.904: INFO/DEBUG(4884):          #13  pc 00047c96  /system/lib/libdvm.so12-02 22:23:05.904: INFO/DEBUG(4884):          #14  pc 0002d894  /system/lib/libandroid_runtime.so12-02 22:23:05.904: INFO/DEBUG(4884):          #15  pc 0002e990  /system/lib/libandroid_runtime.so12-02 22:23:05.904: INFO/DEBUG(4884):          #16  pc 00008ca8  /system/bin/app_process12-02 22:23:05.904: INFO/DEBUG(4884):          #17  pc 0000d3c0  /system/lib/libc.so12-02 22:23:05.904: INFO/DEBUG(4884): code around pc:12-02 22:23:05.904: INFO/DEBUG(4884): a9032778 2001e001 461861a0 bf00bd70 0002bc44 12-02 22:23:05.904: INFO/DEBUG(4884): a9032788 fffe90c3 fffe9105 fffe912a 4c1bb570 12-02 22:23:05.904: INFO/DEBUG(4884): a9032798 bf006903 1864a100 b94b4605 4a194818 12-02 22:23:05.904: INFO/DEBUG(4884): a90327a8 20061821 f7f318a2 f06fe9aa e0230025 12-02 22:23:05.904: INFO/DEBUG(4884): a90327b8 fe5af7ff 2b1069ab 2201d815 c048f8df 12-02 22:23:05.904: INFO/DEBUG(4884): code around lr:12-02 22:23:05.904: INFO/DEBUG(4884): a93077bc bd10ffd3 4c0cb573 ae01a500 46051964 12-02 22:23:05.904: INFO/DEBUG(4884): a93077cc 4630460a f7ff4629 9801ffa5 e8faf7fe 12-02 22:23:05.904: INFO/DEBUG(4884): a93077dc 4b074a06 18e318a2 46284601 ff24f7ff 12-02 22:23:05.904: INFO/DEBUG(4884): a93077ec f7ff4630 bd7cff3b 00005dd0 ffffce3d 12-02 22:23:05.904: INFO/DEBUG(4884): a93077fc ffffd43b 4c0cb573 ae01a500 46051964 12-02 22:23:05.904: INFO/DEBUG(4884): stack:12-02 22:23:05.904: INFO/DEBUG(4884):     bef834c0  00000007  12-02 22:23:05.904: INFO/DEBUG(4884):     bef834c4  a930dc98  /system/lib/libmedia_jni.so12-02 22:23:05.904: INFO/DEBUG(4884):     bef834c8  00000000  12-02 22:23:05.904: INFO/DEBUG(4884):     bef834cc  afd10280  /system/lib/libc.so12-02 22:23:05.904: INFO/DEBUG(4884):     bef834d0  a930d598  /system/lib/libmedia_jni.so12-02 22:23:05.904: INFO/DEBUG(4884):     bef834d4  000006f0  12-02 22:23:05.904: INFO/DEBUG(4884):     bef834d8  0000aa50  [heap]12-02 22:23:05.904: INFO/DEBUG(4884):     bef834dc  a930dc98  /system/lib/libmedia_jni.so12-02 22:23:05.904: INFO/DEBUG(4884):     bef834e0  bef83528  [stack]12-02 22:23:05.904: INFO/DEBUG(4884):     bef834e4  4186bcac  12-02 22:23:05.904: INFO/DEBUG(4884):     bef834e8  4186bc94  12-02 22:23:05.904: INFO/DEBUG(4884):     bef834ec  a9307759  /system/lib/libmedia_jni.so12-02 22:23:05.904: INFO/DEBUG(4884):     bef834f0  44a56890  /dev/ashmem/mspace/dalvik-heap/2 (deleted)12-02 22:23:05.904: INFO/DEBUG(4884):     bef834f4  bef83514  [stack]12-02 22:23:05.904: INFO/DEBUG(4884):     bef834f8  df002777  12-02 22:23:05.914: INFO/DEBUG(4884):     bef834fc  e3a070ad  12-02 22:23:05.914: INFO/DEBUG(4884): #00 bef83500  a930d598  /system/lib/libmedia_jni.so12-02 22:23:05.914: INFO/DEBUG(4884):     bef83504  0000aa50  [heap]12-02 22:23:05.914: INFO/DEBUG(4884):     bef83508  bef83514  [stack]12-02 22:23:05.914: INFO/DEBUG(4884):     bef8350c  a93077dd  /system/lib/libmedia_jni.so12-02 22:23:05.914: INFO/DEBUG(4884): #01 bef83510  0000aa50  [heap]12-02 22:23:05.914: INFO/DEBUG(4884):     bef83514  00000000  12-02 22:23:05.914: INFO/DEBUG(4884):     bef83518  bef83548  [stack]12-02 22:23:05.914: INFO/DEBUG(4884):     bef8351c  00000000  12-02 22:23:05.914: INFO/DEBUG(4884):     bef83520  4186bca8  12-02 22:23:05.914: INFO/DEBUG(4884):     bef83524  80816e38  /system/lib/libdvm.so12-02 22:23:06.103: INFO/ActivityManager(90): Process com.test.video.activity (pid 7299) has died.12-02 22:23:06.103: INFO/WindowManager(90): WIN DEATH: Window{44d8eef0 com.test.video.activity/com.test.video.activity.HomeScreen paused=false}12-02 22:23:06.113: INFO/WindowManager(90): WIN DEATH: Window{44e06a90 com.test.video.activity/com.test.video.activity.VideoRecordingScreen paused=true}12-02 22:23:06.113: INFO/WindowManager(90): WIN DEATH: Window{44e0f518 SurfaceView paused=false}</code></pre><p>As you can see at the bottom of the log, there are some WIN DEATH happening which is basically killing all my previous un-finished activities. This is creating a lot of issue for me as it hinders my application flow.</p><p>Any ideas what could be the issue?</p>","237403","","","","","2011-04-10 03:53:41","Releasing camera kills all activities in the task","<android><android-camera>","1","0","","",""
"4337819","1","","","2010-12-02 17:20:03","3","1448","<p>HelloMy application works like this.</p><p>StartUpActivity is called first, which does a lot of the init stuffThen it launches TvbTabActivity (TabActivity) that has other Activities as its tabs (e.g. BrowseActivity).</p><p>The problem that I am seeing is this - when a task-killer app is used to terminate my app on TvbTabActivity/Browse tab, and the app is relaunched again, the system forgoes the normal flow (StartUpActivity is not spawned), but instead restores the last visible activity directly (TvbTabActivity).</p><p>How can i force Android to ALWAYS run StartUpActivity first, so that it initializes the app? </p><p>Obviously, I dont have this problem when my app crashes on its own, lol, due to an exception, and is then relaunched again.</p><pre><code>&lt;application android:icon=""@drawable/appicon""  android:label=""@string/app_name"" android:name=""com.xyz.QPApplication""  android:debuggable=""true""&gt;  &lt;activity android:name="".activity.StartUpActivity"" android:configChanges=""locale|orientation""   android:label=""@string/app_name""    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;category android:name=""android.intent.category.DEFAULT"" /&gt;   &lt;/intent-filter&gt;  &lt;/activity&gt;  &lt;activity android:name="".catalogue.BrowseActivity"" android:configChanges=""locale|orientation""   android:label=""@string/app_name"" android:screenOrientation=""portrait""    android:launchMode=""singleTop""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""com.xyz.android.intent.action.BROWSE"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;   &lt;/intent-filter&gt;  &lt;/activity&gt;  &lt;activity android:name="".activity.TvbTabActivity"" android:configChanges=""locale|orientation""   android:screenOrientation=""portrait"" android:launchMode=""singleTask""&gt;  &lt;/activity&gt;</code></pre>","450741","","450741","","2010-12-02 17:26:19","2011-01-29 22:02:34","Android forcing full restart after an app is killed","<android><state><restore>","3","0","","",""
"4337824","1","4337877","","2010-12-02 17:20:34","1","4655","<p>I have implemented a widget but have problems refreshing it.I get the initial onUpdate , and again if I leave it for ages.</p><p>However I want changes in my main application to be automatically reflected on the widget.How do I get that to refresh ?Is there a way of calling the widget from my Activity (do I just do a static routine) or is there a way I can force my ""onUpdate"" to be called each time the phone returns back to the home screen ?</p>","507991","","","","","2011-06-15 01:56:01","Android Widget Refresh","<android><widget><onupdate>","2","1","","",""
"4337977","1","","","2010-12-02 17:35:32","2","1964","<p>I have defined preferences in my app using preferences.xml and a PreferenceActivity. The settings are presented in the phone in a ScrollView-like-way. I would like to always show the vertical scrollbars all the time. In Android 1.6 they do not fade away, but in Android 2.2 the fade away after about a second. In a ScrollView I can control this using android:scrollbarAlwaysDrawVerticalTrack or android:scrollbarDefaultDelayBeforeFade. How can I do this with the preference widget?</p><p>/P</p>","274426","","","","","2012-12-22 09:06:37","Always show scrollbars for PreferenceScreen","<android><scrollbars><preferenceactivity><preferencescreen>","5","0","","",""
"4338001","1","8392042","","2010-12-02 17:38:27","2","1345","<p>I have an app where I need to be able to send SMS messages.  I have the code to send them directly, but I would like to give the option to use Google Voice to users who don't have messaging plans.  Does anyone know how to do this?  I can't seem to find the way.  Here is the way I am doing it now:</p><pre><code>StringBuffer buffer = new StringBuffer();buffer.append(""GEOC "");buffer.append(mLogType.getSelectedItemPosition() == 0 ? ""@"" : ""x"");buffer.append(mGeocache.getWaypoint()).append("" "");if(mLogEdit.getText().length() &gt; 0){    buffer.append(mLogEdit.getText().toString());}SmsManager sms = SmsManager.getDefault();sms.sendTextMessage(""41411"", null, buffer.toString(), null, null);</code></pre>","236136","","236136","","2010-12-02 18:50:04","2011-12-05 21:21:42","Sending an SMS using Google Voice","<android><sms><google-voice>","3","0","1","",""
"4338081","1","4553309","","2010-12-02 17:47:38","6","8026","<p>I've got a problem with Admob not showing up Ads...</p><p>Here's the LogCat:</p><pre><code>WARN/AdMobSDK(502): Ignoring requestFreshAd() because we are requesting an ad right now already.INFO/AdMobSDK(502): No fill.  Server replied that no ads are available (1164ms)INFO/AdMobSDK(502): No fill.  Server replied that no ads are available (846ms)</code></pre><p>I've tried test mode, no test mode, emulator, real phone, etc. It never shows anything up, but <strong>I get requests and prints on Admob stats</strong>, like if it ever worked...</p><p>AFAIK, I did everything in the Admob Android SDK... the only thing that could be the cause of any problems, IMHO, would be the fact that I'm using tabbed layout with scrollview and then a relativelayout where the ad shows...</p><p>Here's a sample of the layout for a tab:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:myapp=""http://schemas.android.com/apk/res/com.xxx.xxx""    android:id=""@+id/tababout""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#FF000000""&gt;&lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#FF000000""    android:padding=""10px""&gt;    &lt;ImageView        android:id=""@+id/label_img""        android:src=""@drawable/about_header""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:adjustViewBounds=""true""        android:scaleType=""centerInside"" /&gt;    &lt;TextView android:id=""@+id/label_know_more_desc""        style=""@style/Desc""        android:layout_below=""@id/label_img""        android:text=""@string/tab_about_know_more_desc"" /&gt;    &lt;Button android:id=""@+id/bt_know_more""        style=""@style/Button""        android:gravity=""center_vertical|center_horizontal""        android:layout_below=""@id/label_know_more_desc""        android:text=""@string/tab_about_know_more_bt"" /&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;/RelativeLayout&gt;&lt;/ScrollView&gt;</code></pre><p>And here's the main.xml, not that I think you need it:</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:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""#FF000000""&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""#FF000000""        android:paddingTop=""5px""&gt;    &lt;/FrameLayout&gt;&lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>I've read in <a href=""http://stackoverflow.com/questions/3705651/admob-ads-will-not-display-when-placed-inside-a-tabview"">Admob ads will not display when placed inside a tabview</a> that the problem could be the 10px padding I'm throwing in, but even if I disable that, it doesn't work.</p><p>I even tried moving the xmlns:myapp to RelativeLayout, but obviously didn't change anything....</p><p>Also, I've made my first live ad request over 24 hours ago...</p><p><strong>EDIT</strong></p><p>Ok, now I'm getting somewhere, I've managed to get test ads showing up (my setTestDevices was too late in the onCreate code, I pushed it up to the first lines), but not real ones... am I missing something? I obviously commented out the setTestDevices line and no ads show up</p><p><strong>EDIT 2</strong></p><p>Well, I added two internal ads (I already had internal ads enabled, but no internal ads set), and suddenly ads started showing on my app (not only internal ads).</p><p>I guess everything altogether made it work?! :)</p><p>Thanks everyone!</p>","404541","","404541","","2011-01-03 22:06:40","2011-09-23 05:15:57","Admob ads not showing up","<android><admob>","2","0","5","",""
"4338185","1","4338234","","2010-12-02 17:57:58","6","6679","<p>I should want a non scrollable ListView, and show the entire ListView. It's because my entire screen is a ScrollView, and I dispatch widgets with a RelativeLayout, so I don't need the ListView scroll.</p><p>I set my ui with code, not with xml.</p><p>I've used <code>listView.setScrollContainer(false)</code>, but it's not work, I don't understand why.</p><p>Thanks.</p>","312025","","","","","2014-02-07 14:28:56","How to get a non scrollable ListView?","<android>","3","0","","",""
"4338305","1","4339193","","2010-12-02 18:11:01","27","17368","<p>I am trying to get my android webview app to open tel: links to the phone.  Every time I open up a telephone link it works great and opens up the phone.  However once I am done with my call and go back to the app it is at a page that says ""Web Page Not Found tel:0000000000"".  Then I have to hit the back button once more to get to the page that I clicked the telephone number on.</p><p>Is there a way to get it to open the TEL link without trying to find the page in webview as well as opening it up on the phone?</p><p>This is code I am using in WebView to override its handling of the TEL and Mailto links:</p><pre><code>        public boolean shouldOverrideUrlLoading(WebView view, String url) {        if (url.startsWith(""mailto:"") || url.startsWith(""tel:"")) {                 Intent intent = new Intent(Intent.ACTION_VIEW,                        Uri.parse(url));                 startActivity(intent);                 }         view.loadUrl(url);        return true;        }</code></pre><p>Any help would be appreciated.  I have spent the last 2 hours scouring goodle and have failed to produce any answers.</p>","528396","","","","","2012-06-14 18:18:00","Android WebView ""tel:"" links show web page not found","<android><android-webview>","3","7","10","",""
"4338400","1","4338439","","2010-12-02 18:22:54","2","13112","<p>I have a problem with caling the <code>getResources()</code> function in an standard class. All imports must be there to use the function. Is there any special class I need to extend my class? </p><p>Thanks for the immediate help.</p><pre><code>package com.example.helloandroid;import android.app.Activity;import android.content.ContentValues;import android.content.Context;import android.content.ContextWrapper;import android.content.res.Resources;import android.content.Intent;import android.os.Bundle;//import android.content.res.Resources;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;public class DbAdapter {    public DbAdapter() {     Resources res = getResources();//error: The method getResources() is undefined for the type DbAdapter            //also tyed context.getResources()    }}</code></pre>","528407","","251173","","2010-12-02 18:26:53","2010-12-02 18:28:52","getResources does not work / undefined Java","<java><android><undefined>","1","0","1","",""
"4338499","1","4338667","","2010-12-02 18:32:27","0","475","<p>it's been some time now, since I started reading about android.I've already made a few basic applications, but I still miss something: How is actually sharing application component being done?This is what the Android Dev Guide says:</p><blockquote>  <p>A central feature of Android is that one application can make use of elements of other applications (provided those applications permit it). For example, if your application needs to display a scrolling list of images and another application has developed a suitable scroller and made it available to others, you can call upon that scroller to do the work, rather than develop your own. Your application doesn't incorporate the code of the other application or link to it. Rather, it simply starts up that piece of the other application when the need arises.</p></blockquote><p>I think I came across some question like this, but I think I'm still confused.Is the only way of getting such a 'private application' information to contact the developers of that application?</p><p>Is information about the data that the application operates with private, too?If it is described in the AndroidManifest.xml file is it available for the other applications, or it is available only to Android?</p><p>When I started satisfying my interest in Android - one of the things that grabbed me was the impression of immense interoperability...</p><p>:)</p><p>Have I been wrong or I still haven't found the way?</p><p>Thanks!</p>","481828","","","","","2010-12-02 18:52:26","How does sharing application components happen in android?","<android><components><manifest><sharing>","1","0","","",""
"4338563","1","4409453","","2010-12-02 18:38:19","6","7636","<p>It is possible to do it in one query?</p><p>As far as I know content uri of sim contacts is <code>content://icc/adn</code></p>","338581","","338581","","2013-09-26 19:31:23","2014-01-21 13:22:04","How to get all android contacts but without those which are on SIM","<android><sim-card>","2","0","9","",""
"4338677","1","","","2010-12-02 18:53:48","2","1510","<p>I'm playing with text to speech to make my testapp a little more fun. It works in the emulator but not on my phone since my default locale isn't english.</p><p>However, the texts are english so the tts should of course use english. As far as I know I can implement an autoninstall, something like</p><pre><code>    public void onInit(int status) {    if (status == TextToSpeech.SUCCESS) {        // Set preferred language to US english.        int result = mtts.setLanguage(Locale.US);        if (result == TextToSpeech.LANG_MISSING_DATA ||            result == TextToSpeech.LANG_NOT_SUPPORTED) {           // Lanuage data is missing or the language is not supported.            Log.e(TAG, ""Language is not available."");        } else {            // The TTS engine has been successfully initialized.            speak();        }    } else {        // missing data, install it        Intent installIntent = new Intent();        installIntent.setAction(            TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);        startActivity(installIntent);    }}</code></pre><p>But, do I want to? Does installing locales take a lot of space? Does it mess up something else?</p><p>regards</p>","498112","","168868","","2012-01-01 22:03:01","2014-01-25 17:44:14","android, text to speech","<android><text-to-speech>","2","1","1","",""
"4338708","1","4339252","","2010-12-02 18:57:38","0","1015","<p>I’d like to open a dialog box with some simple information on it when a live wallpaper is tapped. Overriding onCommand in an Android live wallpaper, and adding a custom dialog almost straight out of the Android docs (with a layout info_dialog.xml not shown):</p><pre><code>@Overridepublic Bundle onCommand (String action, int x, int y, int z, Bundle extras, boolean resultRequested){ System.out.println(action);   Context mContext = getApplicationContext(); Dialog dialog = new Dialog(mContext); dialog.setContentView(R.layout.info_dialog); dialog.setTitle(""Custom Dialog""); TextView text = (TextView) dialog.findViewById(R.id.text); text.setText(""Hello, this is a custom dialog!""); dialog.show(); return null}    </code></pre><p>just generates an exception:</p><pre>12-02 07:14:40.880: ERROR/AndroidRuntime(295): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application12-02 07:14:40.880: ERROR/AndroidRuntime(295):     at android.view.ViewRoot.setView(ViewRoot.java:509)12-02 07:14:40.880: ERROR/AndroidRuntime(295):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)12-02 07:14:40.880: ERROR/AndroidRuntime(295):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)12-02 07:14:40.880: ERROR/AndroidRuntime(295):     at android.app.Dialog.show(Dialog.java:241)</pre><p>I’m assuming this is because I’m trying to raise the dialog from a WallpaperService rather than from an Activity. Overriding the WallpaperService.Engine’s onTouchEvent method just gets the same result. </p><p>Does this mean that I need to spin up a separate Activity to host the dialog?  Or is triggering a dialog from a live wallpaper not possible?</p>","389828","","645502","","2011-05-06 03:21:42","2011-05-06 03:21:42","Opening a dialog when an Android live wallpaper is touched","<android><dialog><live-wallpaper><touch-event>","1","0","","",""
"4338792","1","4338845","","2010-12-02 19:07:39","5","5784","<p>I am trying to organize 3 LinearLayouts, such that one is justified to the left, one to the right, and the 3rd is between the two with equal amount of blank space on either side.   I think I wrap these in a RelativeLayout to accomplish this.  Then set one layout to alignParentLeft and the 2nd layout to alignParentRight.  But for the 3rd layout, I would like to set layout_marginLeft = (RelativeLayout.width - (layout1.width + layout2.width + layout3.width))/2.  Though, I don't see how to do this in xml.  Any suggestions?</p><p>*Edit.  Based on suggestions, I am now using a LinearLayout.  This is closer to working, but the 3 Layouts are not evenly spaced, and the right layout is not right justified.  Below is my xml:</p><pre><code>&lt;LinearLayout         android:id=""@+id/toolbar""        android:orientation=""horizontal""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:layout_gravity=""bottom""        android:paddingTop=""4dip""        android:paddingBottom=""4dip""        android:background=""#50000000""        android:visibility=""visible""&gt;        &lt;LinearLayout            android:orientation=""horizontal""            android:layout_width=""wrap_content""            android:layout_weight=""1""            android:layout_height=""wrap_content""&gt;               &lt;ImageButton                     android:id=""@+id/open""                    android:src=""@drawable/open""                    android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""&gt;               &lt;/ImageButton&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout            android:orientation=""horizontal""            android:layout_width=""wrap_content""            android:layout_weight=""1""            android:layout_height=""wrap_content""&gt;            &lt;ImageButton                 android:id=""@+id/prev""                android:src=""@drawable/prev""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""&gt;            &lt;/ImageButton&gt;            &lt;TextView                android:id=""@+id/totalpages""                android:text=""0 of 0""                android:layout_gravity=""center""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:textColor=""#FFFFFFFF""&gt;            &lt;/TextView&gt;            &lt;ImageButton                 android:id=""@+id/next""                android:src=""@drawable/next""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""&gt;            &lt;/ImageButton&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout            android:orientation=""horizontal""            android:layout_gravity=""right""            android:layout_width=""wrap_content""            android:layout_weight=""1""            android:layout_height=""wrap_content""&gt;            &lt;ImageButton                 android:id=""@+id/zoomout""                android:src=""@drawable/zoomout""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""&gt;            &lt;/ImageButton&gt;            &lt;ImageButton                 android:id=""@+id/zoomin""                android:src=""@drawable/zoomin""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""&gt;            &lt;/ImageButton&gt;        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;</code></pre>","426493","","426493","","2010-12-02 21:03:33","2010-12-02 21:03:33","Android: how evenly space components within RelativeLayout?","<android>","1","0","2","",""
"4338794","1","","","2010-12-02 19:07:47","3","465","<p>Many Android game examples utilize a Thread to run a game engine on a particular interval. However, I've seen some other examples that use a TimerTask to run the game engine interval as well. I'm curious as to what other developers think the pros and cons of each approach are.</p>","32396","","","","","2010-12-02 19:36:36","Pros and cons of using a Thread or TimerTask for an Android game","<java><android>","1","1","","",""
"4338799","1","","","2010-12-02 19:08:33","0","422","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4909886/onclick-intents-not-working-after-launcher-restart"">onClick intents not working after Launcher restart.</a>  </p></blockquote><p>I have this custom digital clock widget with 2 onclick intents, one to open the calendar and one to open the alarmclock. Whenever the Launcher restarts, the onclick intent no longer fires. A reboot of the phone is needed. How can I make it work all the time? </p><p>This is my code:</p><pre><code>        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);</code></pre>","525720","","525720","","2010-12-09 20:42:31","2011-07-12 15:20:39","Widget onClick intent fails to fire after Launcher restart","<android><widget><onclick>","0","3","","2011-07-12 16:18:12",""
"4338915","1","","","2010-12-02 19:22:19","1","3192","<p>I'm using a WebView in an Android app. I periodically to be able to reset the WebView http session so that the server app it is accessing will initialise a new session. I can't find how to do this - is this possible ?</p><p>Rgds, Kevin.</p>","156477","","","","","2014-03-05 04:27:21","Android WebView - reset HTTP session","<android><webview>","3","0","","",""
"4339025","1","4340161","","2010-12-02 19:35:11","1","791","<p>I have the following situation: </p><ol><li>activity A -> resultA</li><li>activity B -> resultB</li><li>activity C -> resultC</li></ol><p>and I need all the results (A, B &amp; C) to build the final out put?</p><p>What's the better way:</p><pre><code>AA extends Activity  {startActivityForResult(A);startActivityForResult(A);startActivityForResult(A);}</code></pre><p>or to make AA subtype of ActivityGroup? </p><p>Activities A, B and C do not require to be visible (foreground) at the same time.</p><p>Thank you!</p>","481828","","481828","","2010-12-02 20:00:33","2010-12-02 21:30:30","android: Activity.startActivityForResult() or ActivityGroup?","<android><activity>","1","0","","",""
"4339053","1","4349806","","2010-12-02 19:38:11","10","6746","<p>Is there any list of Android phones and their supported native code?</p><p>For example I want to know which phones support only <code>armeabi</code> and which support <code>armeabi-v7a</code>. The latter is important because I'm doing a lot of floating-point calculation in native code.</p>","11238","","","","","2010-12-03 20:57:21","List of supported native code of Android phones","<android><arm><native><android-ndk><cpu-architecture>","2","3","1","",""
"4339082","1","4544091","","2010-12-02 19:40:33","18","10519","<p>I've started getting a </p><pre><code>DEBUG/skia(xxxx): --- decoder-&gt;decode returned false </code></pre><p>issue on a few profile images from Facebook that I use in ImageViews.  Most work perfectly, but every once in a while I discover one that never works.</p><p>I am compiling my application against Android 1.6 for backward compatibility reasons.</p><p>I did some digging and discovered a number of threads on the issue.  I'm already using the FlushedInputStream discussed here: <a href=""http://code.google.com/p/android/issues/detail?id=6066"">http://code.google.com/p/android/issues/detail?id=6066</a></p><pre><code>Bitmap b = BitmapFactory.decodeStream(new FlushedInputStream(is));imageView.setImageBitmap(b);</code></pre><p>Here's an example that's causing me trouble:<a href=""http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs269.snc3/23132_639284607_390_q.jpg"">http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs269.snc3/23132_639284607_390_q.jpg</a></p><p>Can someone check out the image and help me figure out what's causing the trouble?</p>","233202","","","","","2013-12-06 09:35:27","Android decoder->decode returned false for Bitmap download","<android><android-layout>","6","0","7","",""
"4339140","1","","","2010-12-02 19:46:22","0","406","<p>I basically want to have several views aligned with each other using a relative layout. I can do so using xml, but unfortunately I can't find any documentation that tells me what methods I need to call to get the same effect in code (All the examples and things just use xml). Since the imageviews are being made dynamically xml isn't an option for what I want to do. I've looked at layoutparameters which seems to let me change some options, but I'm not seeing a method that will let me change alignment relative to another view. Any help is appreciated.</p>","528502","","","","","2010-12-02 20:16:19","Android: Need help setting view alignment in code","<android>","2","0","","",""
"4339314","1","","","2010-12-02 20:03:51","1","738","<p>I have an app that downloads a podcast and saves it to the SDcard.  All of that works correctly, and I can see and play the audio file when I use a file manager like Astro, but it doesn't show up in the Android Music app (I'm testing on the Droid x and original Droid).  If I reboot the phone, or connect the SDcard to the PC (USB Mass Storage) and then disconnect, the Music app finds the newly added audio files.</p><p>I know that when you download pictures to the SDcard, you need to use the MediaScannerConnection to add them to the Android Gallery app.  Is there something that I need to do to add the mp3's to the Music app???</p><p>Thx in advance for the help...</p>","528521","","","","","2010-12-02 20:47:43","my app downloads audio file, but it doesn't show up in Android Music app","<android><audio><download><mp3><music>","1","0","","",""
"4339382","1","","","2010-12-02 20:12:55","0","1112","<p>I have a main java file that sets up a series of tabs where each one calls a seperate activity in this case each activity is linked to a webpage. I am trying to implemente a progress bar in the tab activity that will show a progress bar for when a link is clicked on regardless of what tab is currently selected. I have a progress bar that i can use for a single activity but i cant get it to work for the tabs</p><p>i have the progress bar defined as</p><pre><code>    getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);   setContentView(R.layout.main );   webview = (WebView) findViewById(R.id.webview);   webview.setWebChromeClient(new WebChromeClient() {       public void onProgressChanged(WebView view, int progress)          {        MyActivity.setProgress(progress * 100);           if(progress == 100)              MyActivity.setTitle(R.string.app_name);         }       });</code></pre><p>Which goes after oncreate()</p><p>Here is the main Java File</p><pre><code>import android.app.Activity;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.View;import android.view.Window;import android.webkit.WebChromeClient;import android.webkit.WebView;import android.widget.TabHost;import android.widget.TextView;public class UniversityofColorado extends TabActivity{    WebView webview;    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);        TabHost host=getTabHost();        Resources res = getResources();        host.addTab(host.newTabSpec(""one"")                .setIndicator("""",res.getDrawable(R.drawable.ic_tab_google))                .setContent(new Intent(this, Hello.class)));        host.addTab(host.newTabSpec(""two"")                        .setIndicator(""Colorado Main Site"")                        .setContent(new Intent(this, ColoradoMainSiteBrowser.class)));        host.addTab(host.newTabSpec(""three"")                        .setIndicator(""CULearn"")                        .setContent(new Intent(this, CULearnBrowser.class)));        host.addTab(host.newTabSpec(""four"")                .setIndicator(""CULink"")                .setContent(new Intent(this, CULinkBrowser.class)));        host.addTab(host.newTabSpec(""five"")                .setIndicator(""MyCUInfo"")                .setContent(new Intent(this, MyCUInfoBrowser.class)));        host.addTab(host.newTabSpec(""six"")                .setIndicator("""", res.getDrawable(R.drawable.ic_tab_map))                .setContent(new Intent(this, CampusBrowser.class)));        host.addTab(host.newTabSpec(""Seven"")                .setIndicator("""",res.getDrawable(R.drawable.ic_tab_notes))                .setContent(new Intent(this, NotesList.class)));        host.addTab(host.newTabSpec(""eight"")                .setIndicator("""", res.getDrawable(R.drawable.ic_tab_help))                .setContent(new Intent(this, CampusBrowser.class)));    }   </code></pre><p>Here is one of the activities that the main java file calls</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.KeyEvent;import android.webkit.WebView;import android.webkit.WebViewClient;public class CampusBrowser extends Activity {    WebView webview;    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    webview = (WebView) findViewById(R.id.webview);    webview.setWebViewClient(new HelloWebViewClient());    webview.getSettings().setJavaScriptEnabled(true);    webview.loadUrl(""http://amath.colorado.edu/department/Maps/bldgs.html"");    }    private class HelloWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url)    {    view.loadUrl(url);    return true;    }    }    public boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {    webview.goBack();    return true;    }    return super.onKeyDown(keyCode, event);    }    }</code></pre><p>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""    &gt;&lt;WebView  xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/webview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>If you could help me figure this out it would be appreciated</p>","524592","","","","","2010-12-02 20:46:17","how to put a progress bar in an application using tabs","<android><webview><progress-bar><tabactivity>","1","1","","",""
"4339391","1","4339511","","2010-12-02 20:13:45","0","156","<p><strong>Background:</strong><br>I am currently developing an Android application that makes use of a custom dialog to prompt for a password.  Thinking ahead, I would like to be able to use this dialog (in its entirety) in my future projects with a minimum of configuration.</p><p><strong>Question:</strong><br>Is there any way I can encapsulate all of the code and XML for this dialog into one package?  Ideally, I would like to simply import the dialog and be done with it.  This is easy enough to do with the code, but I am not sure how to do this with the XML layout and string resources files.  Basically, I just don't want to have to manually add the string elements to my strings.xml file for each project as well as not have to copy (and thus duplicate) my layout.  I gave thought to hard-coding strings / layout into the code, but that seems like bad practice (even for only 4-5 strings and 2 textboxes).</p><p>So, what would be the best way to do this?</p>","481075","","","","","2010-12-02 20:26:36","Reuse Class File and Resources for Multiple Projects","<java><android><design-patterns>","1","2","","",""
"4339403","1","4339443","","2010-12-02 20:15:27","1","335","<p>How can I take the printscreen of the android phone?? I am doing an application with GPS. So I cannot use emulator to take the printshot.. Is there any app to do this?</p>","363659","","121493","","2010-12-02 20:25:08","2012-07-12 16:54:22","Taking printscreens of Android Phones?","<android><gps><android-emulator><screenshot>","4","0","","",""
"4339556","1","","","2010-12-02 20:31:52","6","9593","<p>I have a requirement to restart the application when the user changes a preference. Clearing the stack doesnt help me since this doesnt cancel the backend service calls. I want to kill the application process itself. I am using </p><pre><code>Process.killProcess(Process.myPid());</code></pre><p>and it works for me to kill the application. But what i need is to restart the application. Means kill the process and trigger a new process so the application start fresh once again.</p><p>Is there a way to do this? </p><p>Thanks in advance.</p>","324446","","","","","2014-03-22 09:55:26","How to restart android application from within application","<android><lifecycle>","7","1","1","",""
"4339630","1","","","2010-12-02 20:41:13","0","150","<p>I am new to android and having this same problem every time I do something. Whenever I put a line this line in any of my codes it gives me an error in ""id"". The error says, ""id cannot be resolved or is not a field.""</p><p>What am I doing wrong?</p><pre><code>myImageView = (ImageView)findViewById(R.id.imageview);</code></pre>","524570","","313758","","2011-09-14 13:06:26","2011-09-14 13:08:23","Android id error","<android>","1","1","","",""
"4339785","1","","","2010-12-02 20:56:23","0","4275","<p>I modeled my code after the TicTacToe sample application, so my setup is that I have an Application which is basically a shell that starts a common Activity which is in a separate eclipse project flagged as a shared library ( properties->IsALibrary ). I have add the the library to the calling activity's properties. I invoke the shared library code as follows:</p><pre><code>    private void startGame()    { Intent i = new Intent( this, calendar.class ); startActivityForResult( i, START_APPLICATION );    }</code></pre><p>my AndroidManifest for the calling activity is as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""com.calendar"" android:screenOrientation=""portrait"" android:versionCode=""1"" android:versionName=""1.0""&gt; &lt;application android:label=""@string/app_name""  android:debuggable=""true"" android:icon=""@drawable/icon""&gt;  &lt;activity android:name="".MainActivity""   android:screenOrientation=""portrait"" android:label=""@string/app_name""   android:configChanges=""keyboardHidden|orientation""&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;!-- This is defined in CalendarLib. Right now we need to manually copy             it here. Eventually it should get merged automatically. --&gt;        &lt;activity             android:name=""com.library.calendar"" &gt;        &lt;/activity&gt;&lt;!--  &lt;activity android:name="".Preferences"" android:label=""@string/prefTitle""--&gt;&lt;!--   android:screenOrientation=""nosensor""&gt;--&gt;&lt;!--   &lt;intent-filer&gt;--&gt;&lt;!--    &lt;action android:name=""com.calendar.library.Preferences"" /&gt;--&gt;&lt;!--    &lt;catagory android:name=""android.intent.catagory.PREFERENCE"" /&gt;--&gt;&lt;!--   &lt;/intent-filer&gt;--&gt;&lt;!--  &lt;/activity&gt;--&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion=""4"" /&gt; &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt; &lt;supports-screens android:anyDensity=""false""  android:resizeable=""true"" android:largeScreens=""true""  android:normalScreens=""true"" android:smallScreens=""false"" /&gt;&lt;/manifest&gt; </code></pre><p>the AndroidManifest for the shared library is as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""com.calendar.library"" android:versionCode=""1"" android:versionName=""1.0""&gt; &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;  &lt;!-- The activity tag here is currently not used. The main project must    currently redefine the activities to be used from the libraries. However    later the tools will pick up the activities from here and merge them automatically,    so it's best to define your activities here like for any regular Android    project. --&gt;  &lt;activity android:name=""calendar"" /&gt;        &lt;activity android:name="".Preferences"" android:label=""@string/prefTitle""            android:screenOrientation=""nosensor""&gt;            &lt;intent-filer&gt;                &lt;action android:name="".Preferences"" /&gt;                &lt;catagory android:name=""android.intent.catagory.PREFERENCE"" /&gt;            &lt;/intent-filer&gt;        &lt;/activity&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion=""4"" /&gt;&lt;/manifest&gt;</code></pre><p>I define my menu in the shared library code's Activity class and invoke it as follows:</p><pre><code>case MENU_SETTINGS:     Intent intent = new Intent().setClass( this, Preferences.class );     this.startActivityForResult( intent, 0 );     return true;</code></pre><p>when I click on settings I get START_INTENT_NOT_RESOLVED in the method execStartActivity() in Instrumentation.java. Looking at the intent that execStartActivity is trying to start I see that</p><pre><code>mPackage=""com.barrett.calendar"" mClass=""com.ifundraizer.calendar.library.Preferences""</code></pre><p>and everything else is null, not surprisingly.</p><p>my question is:</p><p>Does the definition of the preferences activity belong in the calling activity's manifest or in the shared library's manifest and what should the definition of the class look like in xml?</p><p>thank you for your time, I hope I was clear, this is very confusing.</p>","330844","","","","","2012-02-08 10:15:55","How do I specify a .Preference activity in the manifest.xml of a library activity","<android><android-manifest>","1","0","","",""
"4339789","1","4339903","","2010-12-02 20:56:52","0","1479","<p>I've been writing an Android app that is mainly driven by hardware keyboard input. I'm in the process of adding soft keyboard support, but I'm not quite there yet. But I digress...</p><p>Originally I was checking the integer keyCode value passed in to my OnKey function against the enums in the KeyEvent class. Simple enough...</p><p>But I need to know if the user pressed the combination of keys that would generate the > symbol. I therefore checked if both ALT was pressed and the X keyCode was passed in...but it turns out that different keys on different phones generate the > symbol. </p><p>Now, instead, I'm checking the value of the getUnicodeChar method of KeyEvent against the known values for the Unicode characters. </p><p>My problem is solved - but is there an accepted way to do character checking? Do most people just not need the ALT-symbols, or are most people using software keyboards that are standard across devices? There's no built-in table of Unicode character enums (that I know of, anyhow), so that makes the code a little uglier too. Just curious!</p>","79177","","","","","2010-12-02 21:08:02","Android KeyEvent handling - KeyCode or GetUnicodeChar?","<android><keylistener><keyevent>","1","0","","",""
"4339812","1","","","2010-12-02 20:59:15","1","2431","<p>All-Has anyone used a CursorAdapter with a Gallery widget?  There are plenty of examples out there showing the Gallery and BaseAdapter(Array) as its data store.</p><p>My use-case is driving the Gallery from a SQLite cursor.  The cursor has the ImageURL to display.  </p><p>I have been using DroidFu's ImageLoader(with an ImageView) in other ListViews to async download the images.  </p><p>But this doesnt seem to be working with the Gallery.  It(Gallery) doesnt like the handler posting back to it.</p><p>So...Any thoughts of a Gallery and Cursor adapter pattern with AsyncDownload of URL based images?</p><p>Thanks</p>","511662","","","","","2011-01-04 19:39:08","Cursor Adapter and GalleryView on Android","<android><cursor><gallery>","1","0","1","",""
"4339868","1","","","2010-12-02 21:05:48","0","93","<p>I have an android app that has a listview on a LinearLayout with a custom arrrayadapter that is assigned in the activity onCreate. This works fine, but when I tried to add a simple button to the layout the app crashes when I assign the adaptor. I have seen other code where they use RelativeLayout and tried to adopt it but ran into the same issue. Is there a problem assigning a custom ArrayAdapter when the ListView is not the main object in the layout?</p>","82020","","82020","","2010-12-02 21:55:38","2010-12-02 21:55:38","Listview gets error when assigning a custom ArrayAdater","<android><listview><android-arrayadapter>","0","5","","",""
"4340095","1","","","2010-12-02 21:24:47","0","7646","<p>I copied this code from a tutorial site because I am trying to learn it. But I am getting an error at</p><pre><code>package com.android.test;import android.R;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.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.SeekBar;import android.widget.Spinner;import android.view.ViewGroup.LayoutParams;import android.widget.LinearLayout;import android.widget.ImageView.ScaleType;public class Rotate extends Activity {     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         LinearLayout linearLayout = new LinearLayout(this);   Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon);</code></pre><p><strong>On this last line, I get an error where "".icon"" is written. It says, ""icon cannot be resolved or is not a field.""</strong></p><blockquote>  <p>int width = bitmap.getWidth();         int height = bitmap.getHeight();</p><pre><code>   Matrix matrix = new Matrix();   matrix.postRotate(90);   Bitmap rotatedBitmap = Bitmap.createBitmap(bitmap, 0, 0,</code></pre>    <p>width,           height, matrix, true);         BitmapDrawable bmd = new BitmapDrawable(rotatedBitmap);</p><pre><code>   ImageView imageView = new ImageView(this);   imageView.setImageDrawable(bmd);   imageView.setScaleType(ScaleType.CENTER);   linearLayout.addView(imageView, new LinearLayout.LayoutParams(     LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));   setContentView(linearLayout);     } }</code></pre></blockquote>","524570","","","","","2013-04-18 03:29:24","Android icon error","<android><icons><bitmap><graphic>","4","0","1","",""
"4340111","1","4340166","","2010-12-02 21:26:22","0","519","<p>When I press <code>Load Url</code> button on my Activity, it starts a new browser instead of displaying the content in the WebView widget in the default <code>Activity</code>.</p><p>Here is the <code>res/layout/main.xml</code> :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout01""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;Button android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""Load Yahoo""            android:id=""@+id/buttonLoadYahoo""&gt;&lt;/Button&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout02""        android:layout_width=""match_parent"" android:layout_height=""fill_parent""&gt;        &lt;WebView android:id=""@+id/browserMine"" android:layout_height=""fill_parent""            android:layout_width=""fill_parent""&gt;&lt;/WebView&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>And also my <code>src/com/tariknotebook/NoteBook.java</code> file content :</p><pre><code>package com.tariknotebook;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.webkit.WebView;import android.widget.Button;public class NoteBook extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button buttonLoadYahoo = (Button) findViewById(R.id.buttonLoadYahoo);        final WebView web = (WebView) findViewById(R.id.browserMine);        buttonLoadYahoo.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                web.loadUrl(""http://www.seslisozluk.com"");            }        });     }}</code></pre>","44852","","","","","2010-12-02 22:24:38","WebView Using Problem in Android","<java><android><webview>","1","0","","",""
"4340206","1","4340231","","2010-12-02 21:35:46","1","2141","<p>Can you please tell me if it is possible to turn off the screen on android phone programmatically? So that it won't respond to any touch screen events but the application is still running?</p><p>Thank you.</p>","286802","","","","","2010-12-02 21:38:29","Is it possible to turn off the screen (just like pressing the power button) on android","<android>","1","0","","",""
"4340295","1","4340479","","2010-12-02 21:46:56","0","1158","<p>I have leveraged the ZXing barcode scanner intent, but it will only scan App barcodes (the barcodes that you take a picture of and it installs the app on your phone).  I want it to be able to scan the barcodes of everyday objects, such as those found on soda cans and boxes of food.  When I put it up to a normal barcode it won't detect it.  </p><p>Here is the code for when I call the intent.</p><pre><code>            public void onClick(View v) {            //Link to the Barcode Scanner intent.            Intent intent = new Intent(""com.google.zxing.client.android.SCAN"");            intent.putExtra(""SCAN_MODE"", ""QR_CODE_MODE"");                     startActivityForResult(intent, 0);        }</code></pre><p>Can you tell me what I'm doing wrong?  Any help is appreciated.</p>","341762","","","","","2010-12-02 22:07:33","ZXing BarCode Scanner Only Scans App Barcodes","<java><android><android-intent><zxing>","1","1","1","",""
"4340379","1","4350451","","2010-12-02 21:55:30","0","1332","<p>I cannot download (from web &amp; from e-mail) unkwown extentions such as (*.ini, *.zip, *.ddd)unless there exists an app that can understand the extention.</p><p>For example, I couldn't download *.ini file from the browser (or email) until I downloaded 'Astro' app.</p><ol><li>How can you by pass so that they are downloadable?</li><li>How can you register your app to understan certain extention so that it can be downloadable?</li></ol>","432056","","241590","","2010-12-02 22:33:02","2011-08-23 16:58:30","Cannot download unknown extensions","<android><download>","2","2","","",""
"4340431","1","5256680","","2010-12-02 22:01:00","10","10714","<p>Hey Guys, I am having a problem with the alarmManager and the pending intent with extras that will go along with it.  If I set multiple alarms, They will go off however the extras stay the same.  I have already read into these questions ( <a href=""http://stackoverflow.com/questions/3009059/android-pending-intent-notification-problem"">android pending intent notification problem</a> and <a href=""http://stackoverflow.com/questions/3140072/android-keeps-caching-my-intents-extras-how-to-declare-a-pending-intent-that-kee"">Android keeps caching my intents Extras, how to declare a pending intent that keeps fresh extras?</a> ) and tried assigning a unique id to each pending intent and have tried using all the pending intent flags to no avail.  I have no clue why it will not work.  Here is a code snippet:</p><pre><code>Intent intent = new Intent(con,                    AppointmentNotificationReciever.class);            intent.putExtra(""foo"", bar.toString());            int id = randomNum;            PendingIntent sender = PendingIntent.getBroadcast(con, id,                    intent, PendingIntent.FLAG_UPDATE_CURRENT);            AlarmManager am = (AlarmManager) con.getSystemService(Context.ALARM_SERVICE);            am.set(AlarmManager.RTC_WAKEUP, scheduleExecution, sender);</code></pre>","408079","","408079","","2010-12-03 05:59:47","2011-08-22 02:59:49","How can I correctly pass unique extras to a pending intent?","<android><android-intent><alarmmanager><android-pendingintent><extras>","3","0","4","",""
"4340522","1","","","2010-12-02 22:13:20","0","201","<p>I have my own view which i draw a few bitmaps in the onDraw() function but this slows down getting touch events(miss some of them) that is why i want to separate drawing Bitmaps' thread and getting touch events' thread(UI Thread) but i don't know how because they both seems to must be in the UI thread.</p>","476324","","1900417","","2013-03-06 19:36:42","2013-03-06 19:36:42","Using view with separate thread than UI thread.","<android><multithreading><canvas><view>","1","0","","",""
"4340542","1","","","2010-12-02 22:15:56","0","1662","<p>In the car home application, It has 2 panels of grids (2x3) and I can slide left and right using finger flicking. And there is animation during the transition from left to right panels (and vice versa).</p><p>Can you please tell me what kind of android widget they use for that?</p><p>Thank you.</p>","286802","","","","","2010-12-03 10:44:39","How can I create a GridView in android application which can slide left and right","<android>","2","0","","",""
"4340615","1","4341136","","2010-12-02 22:24:14","0","608","<p>On <a href=""http://developer.android.com/resources/tutorials/views/hello-webview.html"" rel=""nofollow"">this</a> page of Android Development, -at step 6- they say :</p><blockquote>  <p>Instead of adding an intent filter to  view web pages, you can override the  WebViewClient class and enable this  Activity to handle its own URL  requests.</p></blockquote><p>But I would like to learn how to do it with intent-filters as well.</p><p>I have a <strong>WebView</strong> widget and a <strong>Button</strong> widget on my default Activity and when user clicks on the Button, the WebView loads a page - pretty simple. But as it is mentioned in <a href=""http://developer.android.com/resources/tutorials/views/hello-webview.html"" rel=""nofollow"">Step-6</a>, I need to enable my <strong>Activity</strong> to do so.</p><p>Can somebody show me intent-filter which does the same things here as <code>WebViewClient</code> - overriding <code>shouldOverrideUrlLoading(WebView view, String url)</code> method.</p><p>Thanks in advance.</p>","44852","","","","","2010-12-02 23:36:18","Intent Filter for Viewing Web Pages","<java><android><webview>","1","0","","",""
"4340634","1","","","2010-12-02 22:26:45","0","4662","<p>I'm following along fairly closely in my code with Lauren Darcy's Teach Yourself Android Application Development in 24 Hours. I've hit a snag with ""R cannot be resolved."" on one line:</p><pre><code>final View layout=inflater.inflate(R.layout.password_dialog, (ViewGroup) findViewById(R.id.root));</code></pre><p>The ""R cannot be resolved"" shows up on this line twice, once for each reference to R.</p><ul><li>if I copy and paste the author's code, I get the same result, so it's not a typo</li><li>from reading posts of others who have encountered this same issue, it sounds like R is not resolved anywhere in the class. However, I do use R in other contexts in this class without any objection and with expected results.</li><li>another common piece of advice is to verify that I'm not importing android.R. I'm not.</li></ul><p>At wit's end here... where should I be looking?</p><p>The class in full:</p><pre><code>package com.oneinfinity.btdt;import java.util.Calendar;import android.app.DatePickerDialog;import android.app.Dialog;import android.content.Context;import android.content.SharedPreferences;import android.content.SharedPreferences.Editor;import android.os.Bundle;import android.text.format.DateFormat;import android.text.format.Time;import android.util.Log;import android.view.KeyEvent;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.DatePicker;import android.widget.EditText;import android.widget.Spinner;import android.widget.TextView;import android.widget.Toast;public class QuizSettingsActivity extends QuizActivity {    SharedPreferences mGameSettings;    static final int DATE_DIALOG_ID=0;    static final int PASSWORD_DIALOG_ID=1;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.settings);        mGameSettings=getSharedPreferences(GAME_PREFERENCES, MODE_PRIVATE);        initTextField(R.id.etNickname, GAME_PREFERENCES_NICKNAME);        initTextField(R.id.etEmail, GAME_PREFERENCES_EMAIL);        writeBirthday();        Button setPass=(Button) findViewById(R.id.ButtonPassword);        Button setBd=(Button) findViewById(R.id.ButtonBirthday);        setPass.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                //TODO - password dialog                Toast.makeText(QuizSettingsActivity.this, ""TODO: Password form"", Toast.LENGTH_LONG).show();            }        });        setBd.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                //TODO - birthday dialog                //Toast.makeText(QuizSettingsActivity.this, ""TODO: birthday form"", Toast.LENGTH_LONG).show();                showDialog(DATE_DIALOG_ID);            }        });        setSpinner(R.id.spinnerGender, R.array.genderSet, GAME_PREFERENCES_GENDER);    }    private void setSpinner(int whichSpinner, int whichArray, String whichPref) {        final String PutString=whichPref;        final Spinner spinner=(Spinner) findViewById(whichSpinner);        ArrayAdapter&lt;?&gt; adapter=ArrayAdapter.createFromResource(this, whichArray, android.R.layout.simple_spinner_item);        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        spinner.setAdapter(adapter);        if(mGameSettings.contains(PutString)) {            int toSelect=mGameSettings.getInt(PutString, 0);            spinner.setSelection(toSelect);        }        spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {                public void onItemSelected(AdapterView&lt;?&gt; parent, View itemSelected, int selectedItemPosition, long selectedId) {                    Editor editor = mGameSettings.edit();                    editor.putInt(PutString, selectedItemPosition);                    editor.commit();                    //test whether committed                    if(mGameSettings.contains(PutString)) {                        Log.i(""trace"", ""gender is set to "" + mGameSettings.getInt(PutString, 0)+"""");                                    }                    else {                        Log.i(""trace"", ""gender has not been specied yet"");                    }                }                public void onNothingSelected(AdapterView&lt;?&gt; parent) {                    Toast.makeText(QuizSettingsActivity.this, ""TODO:handle nothing selected"", Toast.LENGTH_LONG).show();                }            });    }    private void initTextField(int whichField, String whichSetting) {        final String PutSetting=whichSetting;        final EditText findField=(EditText) findViewById(whichField);        if(mGameSettings.contains(PutSetting)) {            String textString=mGameSettings.getString(PutSetting, """");            findField.setText(textString);        }        findField.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 strValueToSave=findField.getText().toString();                    Editor editor = mGameSettings.edit();                    editor.putString(PutSetting, strValueToSave);                    editor.commit();                    return true;                }                return false;            }        });    }    /* Just in case it really is necessary to repeat these instructions    private void initnicknameEntry() {        final EditText nicknameText=(EditText) findViewById(R.id.etNickname);        nicknameText.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 strValueToSave=nicknameText.getText().toString();                    return true;                }                return false;            }        });    }    */    @Override    protected Dialog onCreateDialog(int id) {        switch(id) {            case DATE_DIALOG_ID:                DatePickerDialog dateDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {                     public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {                         TextView dob=(TextView) findViewById(R.id.TextView_Bday_Info);                        Time dateOfBirth=new Time();                        dateOfBirth.set(dayOfMonth, monthOfYear, year);                        long dtDob = dateOfBirth.toMillis(true);                        dob.setText(DateFormat.format(""MMMM dd, yyyy"", dtDob));                        Editor editor=mGameSettings.edit();                        editor.putLong(GAME_PREFERENCES_DOB, dtDob);                        editor.commit();                    }                }, 0, 0, 0 );            return dateDialog;            case PASSWORD_DIALOG_ID:                //create the dialog                LayoutInflater inflater=(LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);                final View layout=inflater.inflate(R.layout.password_dialog, (ViewGroup) findViewById(R.id.root));                //return the dialog;        }        return null;    }    @Override     protected void onPrepareDialog(int id, Dialog dialog) {        switch(id) {        case DATE_DIALOG_ID:            DatePickerDialog dateDialog = (DatePickerDialog) dialog;            int iDay, iMonth, iYear;            if(mGameSettings.contains(GAME_PREFERENCES_DOB)) {                long bd=mGameSettings.getLong(GAME_PREFERENCES_DOB, 0);                Time birthday=new Time();                birthday.set(bd);                iDay=birthday.monthDay;                iMonth=birthday.month;                iYear=birthday.year;                Log.i(""trace"", ""verifying that it is no longer the year 2"");            }            else {                Calendar cal=Calendar.getInstance();                iDay=cal.get(Calendar.DAY_OF_MONTH);                iMonth=cal.get(Calendar.MONTH);                iYear=cal.get(Calendar.YEAR);            }            dateDialog.updateDate(iYear, iMonth, iDay);            return;        case PASSWORD_DIALOG_ID:            //prepare the dialog            return;                 }    }    private void writeBirthday() {        TextView dob=(TextView) findViewById(R.id.TextView_Bday_Info);        CharSequence myBirthday=getResources().getString(R.string.no_birthday);        if(mGameSettings.contains(GAME_PREFERENCES_DOB)) {            long bd=mGameSettings.getLong(GAME_PREFERENCES_DOB, 0);            myBirthday=DateFormat.format(""MMMM dd, yyyy"", bd);        }        dob.setText(myBirthday);    }}</code></pre>","473759","","308315","","2011-05-22 20:57:57","2012-01-03 01:23:49","Android development: ""R cannot be resolved"", but in only one context within the class","<java><android>","3","0","","",""
"4340757","1","4340876","","2010-12-02 22:41:30","0","623","<p>i need to develop an app that needs data from the accelerometer. could some one please suggest which android phone in the market would be good enough for accurate accelerometer data generator. since the entire app is based on data fetched by the accelerometer, the device has to be pretty accurate.</p>","377337","","","","","2010-12-02 23:01:02","accelerometer android query","<android><accelerometer>","1","0","","",""
"4340804","1","4343541","","2010-12-02 22:47:21","3","2836","<p>When I listen to orientation event in an android app, I get a SensorEvent, which contains 3 floats - azimuth, pitch, and roll in relation to the real-world's axis.  </p><p>Now say I am building an app like labyrinth, but I don't want to force the user the be over the phone and hold the phone such that the xy plane is parallel to the ground.  Instead I want to be able to allow the user to hold the phone as they wish, laying down or, perhaps, sitting down and holding the phone at an angle.  In other words, I need to calibrate the phone in accordance with the user's preference.</p><p>How can I do that?</p><p>Also note that I believe that my answer has to do with <code>getRotationMatrix</code> and <code>getOrientation</code>, but I am not sure how!</p><p>Please help!  I've been stuck at this for hours.</p>","481009","","","","","2010-12-03 08:03:17","Compute relative orientation given azimuth, pitch, and roll in android?","<android><math><orientation>","2","0","0","",""
"4340918","1","4341203","","2010-12-02 23:02:26","3","4463","<p>I'm an Android n00b so bare with me.</p><p>I'm trying to analyze audio using AudioRecord in a class.  My problem is that I have no idea if the route I'm going to try and thread that into a separate process is correct.  What I want to do is <em>listen</em> to that process in the main UI thread and keep updating a text box based on the data in the thread.</p><p>This is what I have so far:</p><pre><code>//RecordActivity.java[...]public class RecordActivity extends Activity {    final Handler mHandler = new Handler();    final Runnable mUpdateResults = new Runnable() {        public void run() {            updateResultsInUi();        }    };    RecordThread t = new RecordThread();private OnClickListener mClickListener = new OnClickListener() {  public void onClick(View v) {    t.start();  }}//RecordThread.javapublic class RecorderThread extends Thread {[...]@Overridepublic void run() {[...audio process code...]}</code></pre><p>Is there a way to post back data from my RecordThread class to the RecordActivity class?  Is there a way to connect the handler using 2 different .java files? </p><p>Also, is this even the correct way to go about this?  Should I be using AsyncTask instead?  </p>","235708","","235708","","2010-12-02 23:24:35","2011-07-14 06:34:58","How to pass data from separate thread class to activity in Android","<java><android><multithreading><android-asynctask>","2","0","1","",""
"4341020","1","4341422","","2010-12-02 23:18:39","0","1635","<p>I am creating a driver for a custom piece of input hardware that will attempt to pass data to the kernel as an input, which the kernel will then pass up through the OS and expose to the app level via MotionEvent.  Looking at some other device drivers, it looks like setting input events via some of the functions exposed in input.h of the Android 2.2 kernel (2.6.32) might do the trick, but I'd love to confirm this.  Before starting down this path I am trying to get a better understanding of how existing inputs, be it from the screen, trackball, etc are passed up through the OS.  The ultimate goal is to ensure that we can pass data from device to App-level before investing too much time going down this path.</p><p><strong>Input header of linux kernal 2.6.32</strong></p><p><a href=""http://lxr.free-electrons.com/source/include/linux/input.h?v=2.6.32"" rel=""nofollow"">http://lxr.free-electrons.com/source/include/linux/input.h?v=2.6.32</a></p><p>I've browsed through the Android class sources, but not sure where to look to see how the OS instatiates the MotionEvent class that can be accessed via the onTouchEvent() method of the View class.  Can anyone point me in the right direction in terms of how MotionEvent is populated by the OS and how the OS gets that data from the kernel?</p><p>Thanks,</p><p>Paul</p>","357801","","357801","","2010-12-02 23:48:05","2010-12-04 20:28:08","Tracing Input/Event Flow from Driver to APP","<android><input><driver><motion>","1","0","1","",""
"4341042","1","","","2010-12-02 23:22:42","0","461","<p>I cant seem to get the soft keys input to work while the main UI is on a new thread. I want to make it so when they hit the Back soft key it will toast or something.</p><p>Source Code:<a href=""http://pastebin.com/8gh41j9c"" rel=""nofollow"">http://pastebin.com/8gh41j9c</a></p><p>Thanks!</p>","528704","","","","","2010-12-03 01:24:00","Android: Getting user input (Soft keys) on a new thread","<java><android><multithreading><apk><progressdialog>","1","1","","",""
"4341114","1","","","2010-12-02 23:33:10","2","1524","<p>I am trying to get buttons to work in notification expanded view.  The goal is to use the buttons to launch activities from the notification view.  Is this even supported?  Here is a very simple outline with irrelevant details omitted:</p><ol><li>Create a RemoteView object using a layout with some ImageButtons.</li><li>Create pending intent for each button and set them using RemoteView.setOnClickPendingIntent(...)</li><li>Create a Notification object and set it's contentView as the RemoteView created in step 1.</li><li>Set Notification object's contentIntent.</li><li>Send the Notification.</li></ol><p>This works beautifully on my Droid X.  I can click on each button and launch it's associated activity successfully.</p><p>This works on my pal's Evo 4G as well, except that it launches the button's intent plus the notification's content intent.  So two intents launched.  But I can deal with that.  </p><p>This also works on HTC Incredible.</p><p>Unfortunately, it doesn't work on most other phones:  Vibrant, Hero, Vision, WildFire, MIleStone, Droid 1.  These are the ones I know so far based on user feedback.  On these phones, only the notification contentIntent is being launched.  It appears the button's click events aren't being captured/detected.</p><p>I am at my wit's end trying to work around this.  I am beginning to think it's impossible, but it works on some phones!  Any suggestion/help is appreciated.</p><p>Thanks!</p>","528710","","","","","2012-05-02 10:43:31","Android - Buttons supported in notification expanded view?","<android>","1","0","1","",""
"4341115","1","4341228","","2010-12-02 23:33:18","0","448","<p>when from a java class i try to acces a item of my strings.xml file, i got numbers, like a mem position, and i dont get the string value of the item</p><p>for example:</p><pre><code>if (parent.getItemAtPosition(pos).toString().equals(R.string.perdayspermission))</code></pre><p>this code: <code>R.string.perdayspermission</code> haves to give me ""Per Days"", but it gives me a extrange number: 234552634</p><p>why?</p>","479886","","","","","2010-12-03 00:56:15","Problems accessing my strings.xml items.... i got numbers and not the string value","<android><string>","2","0","","",""
"4341268","1","","","2010-12-02 23:58:52","2","4934","<p>I want an image to rotate for an indefinite time........which means I want to loop it. This is my attempt but unfortunately it does not work. Any suggestions?   </p><pre><code>package com.android.test;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.widget.ImageView;import android.view.ViewGroup.LayoutParams;import android.widget.LinearLayout;import android.widget.ImageView.ScaleType;public class imagerotate extends Activity { int x=1; int y=3;     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         LinearLayout linearLayout = new LinearLayout(this);         while (y==3) {   Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon);   int width = bitmap.getWidth();   int height = bitmap.getHeight();   Matrix matrix = new Matrix();   matrix.postRotate(x);   Bitmap rotatedBitmap = Bitmap.createBitmap(bitmap, 0, 0, width,height, matrix, true);   BitmapDrawable bmd = new BitmapDrawable(rotatedBitmap);   ImageView imageView = new ImageView(this);   imageView.setImageDrawable(bmd);   imageView.setScaleType(ScaleType.CENTER);   linearLayout.addView(imageView, new LinearLayout.LayoutParams(     LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));   setContentView(linearLayout);   x+=1;   }     } }</code></pre>","524570","","","","","2013-01-17 08:14:22","Android Image rotation","<android><image><rotation>","3","0","","",""
"4341361","1","4341383","","2010-12-03 00:15:33","1","614","<p>On android when reading from an input stream that represents a file on the internet if I request a read of the entire length of the file is there any reason why my byte array should only be partially filled after the call?</p>","122229","","","","","2010-12-03 05:11:09","Can I read an entire file with a single read in java on android?","<java><android><io>","3","0","","",""
"4341363","1","4341391","","2010-12-03 00:16:53","24","16076","<p>I have a try/catch block that throws an exception  and I would like to see information about the exception in the Android device log.</p><p>I read the log of the mobile device with this command from my development computer:</p><pre><code>/home/dan/android-sdk-linux_x86/tools/adb shell logcat</code></pre><p>I tried this first:</p><pre><code>try {    // code buggy code} catch (Exception e){    e.printStackTrace();}</code></pre><p>but that doesn't print anything to the log. That's a pity because it would have helped a lot.</p><p>The best I have achieved is:</p><pre><code>try {    // code buggy code} catch (Exception e){    Log.e(""MYAPP"", ""exception: "" + e.getMessage());                 Log.e(""MYAPP"", ""exception: "" + e.toString());}</code></pre><p>Better than nothing but not very satisfying.</p><p>Do you know how to print the full backtrace to the log?</p><p>Thanks.</p>","354742","","","","","2011-11-20 12:09:17","Android - print full exception backtrace to log","<android>","5","0","2","",""
"4341382","1","4341459","","2010-12-03 00:21:26","0","1903","<p>I have several columns from a Database I need to show on a ListView.  I also have the ID of the record, but would like to hide that column.  </p><p>Is there a way to create columns in the XML for the ListView and maybe hide it there?</p><p>UPDATE:</p><p>I tried the suggestion from the link in answer 1.  This is the code I cam up with but it dumps on the last line.  </p><p>Does anyone know what I am doing wrong?</p><pre><code> package com.mvw; import java.util.ArrayList; import java.util.HashMap; import android.app.ListActivity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.SimpleAdapter; public class test extends ListActivity {SimpleAdapter mSchedule;    ArrayAdapter&lt;String&gt; adapter;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);  //  setContentView(R.layout.test);    ListView list = (ListView) findViewById(R.id.list);    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;();    map.put(""train"", ""101"");    map.put(""from"", ""6:30 AM"");    map.put(""to"", ""7:40 AM"");    mylist.add(map);    map = new HashMap&lt;String, String&gt;();    map.put(""train"", ""103(x)"");    map.put(""from"", ""6:35 AM"");    map.put(""to"", ""7:45 AM"");    mylist.add(map);    mSchedule = new SimpleAdapter(this, mylist, R.layout.row,                new String[] {""train"", ""from"", ""to""}, new int[] {R.id.TRAIN_CELL, R.id.FROM_CELL, R.id.TO_CELL});    list.setAdapter(mSchedule);  &lt;--- DUMPS HERE}}</code></pre>","528130","","628090","","2011-07-11 16:58:24","2011-07-11 16:58:24","Hidden Column on ListView - Android","<android><listview>","1","4","","",""
"4341412","1","","","2010-12-03 00:27:44","-1","850","<p>I am trying to make a game. And I need to check collisions between images. I tried searching.......but couldn't find anything...........anyone have any idea....where I can find a tutorial that can help me in this matter? It would be very appreciated. </p>","524570","","1228","","2013-08-14 12:27:05","2013-08-14 12:27:05","Need collision checking tutorial","<android><collision>","1","1","","2013-08-14 12:59:45",""
"4341415","1","","","2010-12-03 00:28:13","2","823","<p>I have a TextView that I set as:</p><pre><code>android:autoLink=""web""</code></pre><p>But when I add the following text:</p><pre><code>TextView text = (TextView) findViewById(R.id.TextView01);        text.setText(""Test\n"" +           ""http://www.domain1.net\n"" +           ""\n"" +           ""http://www.domain2.me\n"""");</code></pre><p>Only the first domain is hotlinked, since the other one is .me</p><p>Is there a way to specify the correct urls for autoLink ?</p><p>Thanks!</p>","528746","","345717","","2010-12-03 00:31:44","2010-12-06 03:52:13","Android: android:autoLink=""web"" does not support .me domains","<android>","2","0","","",""
"4341482","1","4349452","","2010-12-03 00:40:44","3","1302","<p>I have three activities:</p><p><strong>Activity A</strong> - Displays a list of data from a website.  From this activity you can perform an action which would add something to this list (Activity B).</p><p><strong>Activity B</strong> - This is the activity that adds data to the website.  Upon successful completion this activity will need to tell Activity A to refresh its list.</p><p><strong>Activity T</strong> - A TabHost which contains Activity A.</p><p>My problem is:</p><p>Activity B needs to tell Activity A to refresh, but its intent must be Activity T, since I want the TabHost to display Activity A.</p><pre><code>//ActivityB.classIntent myIntent = new Intent(v.getContext(), ActivityT.class);myIntent.putExtra(""target"", ""ActivityA"");myIntent.putExtra(""refreshData"", true);startActivityForResult(myIntent, 0);</code></pre><p>I thought I could use the TabHost as an intermediary and just pass the extras through to Activity A if they were set, like so:</p><pre><code>//ActivityT.classBundle extras = getIntent().getExtras();// Create an Intent to launch an Activity for the tab (to be reused)intent = new Intent().setClass(this, ActivityA.class);// Check to see if we want to pass our bundle through to the activityif (extras != null &amp;&amp; extras.getString(""target"").equals(""activityA"")) {     intent.putExtras(extras);}// Initialize a TabSpec for each tab and add it to the TabHostspec = tabHost.newTabSpec(""Tab1"").setIndicator(""Tab1"",            res.getDrawable(R.drawable.ic_tab_tab1)).setContent(intent);tabHost.addTab(spec);</code></pre><p>This works great, except that when I change tabs to a different tab and change back, the extras are passed through yet again, and again - which causes my tab to refresh its data every time, even though I'm no longer coming from Activity B.  This is because the TabActivity doesn't get recreated on tab change and therefore the extras are always passed through to the child intents.</p><p>So, how I can tell Activity A to refresh ONLY from Activity B, but still get the TabHost to show up?</p>","443839","","","","","2010-12-03 20:09:26","TabActivity pass extras to child intents","<android>","2","2","3","",""
"4341531","1","4402462","","2010-12-03 00:53:19","0","834","<p>I have an android application that uses Google Maps. My first activity starts a mapview with some clickable icons. When an icon is clicked, a new activity (intent) is started with a different map. From the new map I then click the back button which takes me back to my first map. However, when I start zooming or moving around in the map, only the tiles that originally loaded will show up. How can I change this?</p><p>If you change the phone orientation the map will refresh and then it behaves normally (becuase the app restarted) so I added  android:configChanges=""orientation"" to stop the restarting on orientation change. I added that because I don't want to reload all the markers again (uses a web service and can take some time). </p><p>I just want the tiles to load when I click ""back"" to the original map. Any ideas?</p>","617057","","","","","2010-12-09 19:51:36","Android Google Maps tiles not loading on ""back"" button click","<android><maps><tiles><back>","1","0","1","",""
"4341600","1","","","2010-12-03 01:07:00","35","17718","<p>I've come across a bug in my application when it is launched using the ""Open"" button on the android market. It seems that lauching it from the market uses a different intent then launching it from the phone's applications menu. This is leading to multiple copies of the same activity being launched, which are conflicting with each other.</p><p>For example, if my app consists of the activities A-B-C then the above issue can lead to a stack A-B-C-A.</p><p>I tried using android:launchMode=""singleTask"" on all the activities to fix this problem, but it has the unwanted side-effect of clearing the activiy stack to root whenever I hit HOME. Example:A-B-C -> HOME -> A when what I need is A-B-C -> HOME -> A-B-C</p><p>Is there a good way to prevent launching multiple activities of the same type without reseting to the root activity when using HOME?</p>","528770","","","","","2014-04-05 15:10:58","How to prevent multiple instances of an activity when it is launched with different intents","<android><activity><android-intent><google-play>","7","0","35","",""
"4341692","1","4362279","","2010-12-03 01:27:33","1","1061","<p>I'm just writing a little test application to show a Gallery of images on Android (from the SD card), it all works quite well except the part where I get to see the photos.  If someone can spot the source of my trouble....</p><p>Much of the code has been copied and pasted from various examples I've found.</p><p><img src=""http://openhomesnz.com/alister/permalink/androidpictures.jpg"" alt=""Android Screenshot""></p><p>Notice the lack of images in the Gallery.</p><p>I'm guessing I'm doing something wrong in getView</p><pre><code>    public View getView(int position, View convertView, ViewGroup parent) {     ImageView imgView;     if (convertView == null)      imgView = new ImageView(cont);     else      imgView = (ImageView)convertView;        String filename = photos[position].getName();        Log.i(TAG, ""Loading File "" + filename);        Bitmap bMap = BitmapFactory.decodeFile(filename);        imgView.setImageBitmap(bMap);        imgView.setLayoutParams(new Gallery.LayoutParams(120, 90));        imgView.setScaleType(ImageView.ScaleType.FIT_XY);        imgView.setBackgroundResource(GalItemBg);        return imgView;    }</code></pre><p>The whole activity is as follows - in case the problem is elsewhere</p><pre><code> package nz.co.salespartner.gallerytest; import java.io.File; import java.io.FilenameFilter; import android.app.Activity; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Gallery; import android.widget.ImageView; import android.widget.TextView; public class GalleryTestActivity extends Activity {  File photos[];  private static String TAG = ""GalleryTest"";     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);         File f = new File(""/sdcard/pics1"");         photos = f.listFiles(new FilenameFilter() {      @Override    public boolean accept(File dir, String filename) {     return filename.endsWith(""jpg"");    }   });         String fileList = """";               for (File aFile : photos) {          fileList += aFile.getName() + ""\n"";         }         TextView v = (TextView)findViewById(R.id.FileList);         v.setText(fileList);         Gallery gallery = (Gallery)findViewById(R.id.Gallery);         gallery.setAdapter(new AddImgAdp(this));     }     public class AddImgAdp extends BaseAdapter {         int GalItemBg;         private Context cont;         public AddImgAdp(Context c) {             cont = c;             TypedArray typArray = obtainStyledAttributes(R.styleable.GalleryTheme);             GalItemBg = typArray.getResourceId(R.styleable.GalleryTheme_android_galleryItemBackground, 0);             typArray.recycle();         }         public int getCount() {             return photos.length;         }         public Object getItem(int position) {             return position;         }         public long getItemId(int position) {             return position;         }         public View getView(int position, View convertView, ViewGroup parent) {          ImageView imgView;          if (convertView == null)           imgView = new ImageView(cont);          else           imgView = (ImageView)convertView;             String filename = photos[position].getName();             Log.i(TAG, ""Loading File "" + filename);             Bitmap bMap = BitmapFactory.decodeFile(filename);             imgView.setImageBitmap(bMap);             imgView.setLayoutParams(new Gallery.LayoutParams(120, 90));             imgView.setScaleType(ImageView.ScaleType.FIT_XY);             imgView.setBackgroundResource(GalItemBg);             return imgView;         }     } }</code></pre>","48445","","345717","","2010-12-03 01:33:35","2010-12-06 00:42:36","Photos missing in Gallery on Android","<android><gallery>","1","0","","",""
"4341714","1","","","2010-12-03 01:32:00","1","795","<p>In my application : I have Find Home Tab..On clicking it and after passing the co-ordinates from emulator control it should show the map...</p><p>If I use intent</p><pre><code>Uri uri = Uri.parse(""http://maps.google.com/maps?saddr=42.35892,-71.05781&amp;daddr=40.756054,-73.986951"");Intent intent = new Intent(android.content.Intent.ACTION_VIEW, uri);        startActivity(intent);</code></pre><p>Its not showing the tabs of my application...</p><p>How do I associate intent with my application and make it show the map in my application..</p><p>Also is it possible to show textbox below the map displayed by this intent??</p><p>Please help..</p><p>Thanks.</p>","511280","","345717","","2010-12-03 01:34:22","2010-12-03 02:35:52","Android : maps from intent","<android><google-maps><android-emulator>","1","1","","",""
"4341789","1","","","2010-12-03 01:52:32","0","672","<p>I saw the question in <a href=""http://stackoverflow.com/questions/2074625/whats-a-good-free-source-control-system-for-eclipse-android-development"">this post</a> and I have a similar but perhaps more detailed question. I have just installed SVN and Subversive and I added an existing project to a repository. Then I checked out the project and opened it. Unfortunately, in Eclipse, the Subversive layout has taken over the Android layout in the Project Explorer view and I'm not too happy about that.</p><p>In other words, the Android layout organizes the project under src, gen, assests, res, and other nodes, whereas the Subversive layout organizes the project strictly by the folder structure under the repository. Is there any way to use a source control plug-in AND keep the Android layout? If not, I may just resort to removing the Eclipse version control plug-in and manually use TortoiseSVN.</p>","337456","","","","","2010-12-03 01:58:27","Another Eclipse/Android/version control system question","<android><version-control><eclipse-plugin>","1","0","2","",""
"4341838","1","","","2010-12-03 02:01:48","-1","914","<p>Anyone else having problems with getting the source from the <a href=""http://code.google.com/p/apv/source/checkout"" rel=""nofollow"">Android Pdf Viewer</a> ?</p><p>I'm using Tortoise and I always get something like ""Error: Server sent unexpected return value (405 Method Not Allowed) in response to   ""</p><p>I'm building a PDF Viewer for Android and i got to this promising <a href=""http://stackoverflow.com/questions/2456344/display-pdf-within-app-on-android"">post</a>... but I can't get the source... unlike many other projects (apdfviewer, daisyreader...). In fact i can see that the link is slightly different as it doesn't end with ""trunk"".</p><p>Thanks!!</p>","517501","","","","","2010-12-03 02:19:40","Android PDF Viewer","<android><pdf><viewer>","1","0","","",""
"4342110","1","","","2010-12-03 03:08:51","0","229","<p>I wonder if anyone else had problems running the ./ndk-build on <a href=""http://code.google.com/p/apdfviewer/"" rel=""nofollow"">apdfviewer</a>?</p><p>I've everything working and set.. but i get errors for missing files (SkCanvas.h, SkPaint.h) .. and others related to 'LOGE'..? (i get those on cygwin console)</p><p>Can't figure out what am I missing... well, besides those missing files... but i ""don't buy"" that the developer has forgotten... I think I'm missing some import...</p><p>Please help...</p><p>Thanks!!</p>","517501","","","","","2010-12-03 03:14:18","Able to compile native code from apdfviewer?","<android><pdf>","1","0","","",""
"4342284","1","4342725","","2010-12-03 03:44:29","0","1766","<p>I'm working on a 2D game for android using OpenGL ES 1.1 and I would like to know if this idea is good/bad/useless.</p><p>I have a screen divided in 3 sections, so I used scissors to avoid object overlapping from one view to the other.</p><p>I roughly understand the low level implementation of scissor and since my draws take a big part of the computation, I'm looking for ideas to speed it up.</p><p>My current idea is as follows:</p><p>If I put a glscissor around each object before I draw it, would I increase the speed of my application.</p><p>The idea is if I put a GLScissor, (center+/-sizetexture), then the OpenGL pipeline will have less tests to do (since it can discard 90~99% of the surface thanks to the glscissors.</p><p>So to all opengl experts, is this good, bad or will have no impact ? And why?</p>","440336","","1297272","","2013-04-03 01:37:50","2013-04-03 01:37:50","Can I increase performances using glscissor","<android><opengl-es>","1","0","","",""
"4342292","1","","","2010-12-03 03:46:41","0","373","<p>I'm not understanding how you pass variables to these adapter classes.  Most of the examples I've seen, you pass a context (Activity, usually).  How exactly do you pass the variables, the data that you want your view to display?</p>","522605","","","","","2011-08-08 19:48:22","Extending BaseAdapter, passing variables","<android><textview><imageview>","1","0","","",""
"4342294","1","4342467","","2010-12-03 03:47:04","5","446","<p>Is it possible to provide a service in which one free trial is given to each device without the possibility of an individual being able to get multiple free trials on a single device.  If its impossible,  do you know of a way of making it difficult to obtain multiple free trials.</p>","183528","","172322","","2011-01-21 06:51:13","2011-01-25 09:32:26","Is it possible to have a single trial per device?","<iphone><android><security>","5","3","3","",""
"4342299","1","","","2010-12-03 03:47:33","0","315","<p>Hi am using a custom phone book in my application, i want to make it dynamically updated when user edit/add new entries in android phone contact, currently i done it in onStart() ,but the problem is ,my application using some default intent,it cause the phone contact loader force to invoke,is there anyway to done this effectively.  I want to know that , when user edit/add new entries then only the phonecontact loader inoke,ie is there any lastmodification date or something in android phonebook, so that i can compare these date in onstart then invoke my phonecontact loader.</p>","487219","","","","","2011-08-25 10:06:39","Android Phone book","<android>","1","0","","",""
"4342405","1","4342625","","2010-12-03 04:09:55","7","8401","<p>I have a listview activity in which I set the selector color using the following code. But when I select an item, the whole list gets highlighted with the selector color, which I don't want. Where Am I doing wrong? Any help is appreciated.</p><pre><code>ListView lv = getListView();lv.setFocusableInTouchMode(true);lv.setBackgroundColor(Color.WHITE);lv.setSelector(R.color.blue);</code></pre>","527053","","","","","2013-09-04 08:06:43","Android: setselector color for listview not working","<android><listview>","5","0","","",""
"4342408","1","","","2010-12-03 04:10:13","3","5585","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1819142/androidhow-to-validate-an-e-mail-address"">Android:how to validate an e-mail address</a>  </p></blockquote><p>How to do email validation in android</p>","501859","","135152","","2010-12-03 04:11:16","2011-10-24 22:59:53","email validation android","<android>","0","0","0","2011-12-02 16:12:56",""
"4342419","1","4358518","","2010-12-03 04:13:50","0","1483","<p>I'm a beginner in Andoird, currently trying to write an application using the Camera class of Android in Eclipse. The problem is when I call the parameters.setPictureFormat() method with ImageFormat.JPEG as the argument, I get an error.</p><p>Here's how my code looks like:</p><pre><code>  public void surfaceChanged(SurfaceHolder holder, int format, int w, int h){   Camera.Parameters parameters = mCamera.getParameters();   parameters.setPreviewSize(854,480);  // (h,w)   parameters.setPictureFormat(ImageFormat.JPEG);   parameters.set(""jpeg-quality"", 100);   parameters.set(""orientation"", ""lanscape"");   parameters.set(""rotation"", 90);   mCamera.setParameters(parameters);   mCamera.startPreview();}</code></pre><p>And I get this error in return:</p><pre><code>ImageFormat cannot be resolved to a variable</code></pre><p>I've tried using PixelFormat.JPEG as well, but I get the same error that says ""PixelFormat cannot be resolved to a variable"". I've checked, it's not importing android.R. I also tried importing android.graphics.ImageFormat but it doesn't work.</p><p>Could anybody help point out what the problem is?</p>","528896","","","","","2010-12-05 11:19:39","Android: setPictureFormat() error","<java><android>","1","0","","",""
"4342421","1","","","2010-12-03 04:14:34","0","823","<p>I have seen the methods of simplified Android SAX XML Parsing.  </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>I have parsed the data, but I can't seem to get it to display to the screen using looped TextViews.</p><p>This is my AndroidSaxFeedParser class...</p><pre><code>public class AndroidSaxFeedParser extends BaseFeedParser{final MagazineList magazineList = new MagazineList();    protected AndroidSaxFeedParser(String magazinefeaturedURL) {        super(magazinefeaturedURL);        // TODO Auto-generated constructor stub    }    @Override    public List&lt;MagazineList&gt; parse() {        // TODO Auto-generated method stub        RootElement root = new RootElement(""maintag"");        final List&lt;MagazineList&gt; magazines = new ArrayList&lt;MagazineList&gt;();        Element item = root.getChild(""item"");        item.setEndElementListener(new EndElementListener(){            @Override            public void end() {                // TODO Auto-generated method stub                magazines.add(magazineList);            }        });        item.getChild(""name"").setEndTextElementListener(new EndTextElementListener(){            @Override            public void end(String name) {                // TODO Auto-generated method stub                magazineList.setName(name);            }        });        item.getChild(""imgurl"").setEndTextElementListener(new EndTextElementListener() {            @Override            public void end(String imgurl) {                // TODO Auto-generated method stub                magazineList.setImgurl(imgurl);            }        });        item.getChild(""date"").setEndTextElementListener(new EndTextElementListener() {            @Override            public void end(String date) {                // TODO Auto-generated method stub                magazineList.setDate(date);            }        });        item.getChild(""description"").setEndTextElementListener(new EndTextElementListener() {            @Override            public void end(String description) {                // TODO Auto-generated method stub                magazineList.setDescription(description);            }        });        item.getChild(""price"").setEndTextElementListener(new EndTextElementListener() {            @Override            public void end(String price) {                // TODO Auto-generated method stub                magazineList.setPrice(price);            }        });        item.getChild(""download"").setEndTextElementListener(new EndTextElementListener() {            @Override            public void end(String download) {                // TODO Auto-generated method stub                magazineList.setDownload(download);            }        });        return magazines;    }}</code></pre><p>This is my object model class...</p><pre><code>public class MagazineList {private ArrayList&lt;String&gt; name = new ArrayList&lt;String&gt;();private ArrayList&lt;String&gt; imgurl = new ArrayList&lt;String&gt;();private ArrayList&lt;String&gt; date = new ArrayList&lt;String&gt;();private ArrayList&lt;String&gt; price = new ArrayList&lt;String&gt;();private ArrayList&lt;String&gt; description = new ArrayList&lt;String&gt;();private ArrayList&lt;String&gt; download = new ArrayList&lt;String&gt;(); public ArrayList&lt;String&gt; getName() {    return name;}public void setName(String name) {    this.name.add(name);}public ArrayList&lt;String&gt; getImgurl(){    return imgurl;}public void setImgurl(String imgurl){    this.imgurl.add(imgurl);}public ArrayList&lt;String&gt; getDate() {    return date;}public void setDate(String date) {    this.date.add(date);}public ArrayList&lt;String&gt; getPrice() {    return price;}public void setPrice(String price) {    this.price.add(price);}public ArrayList&lt;String&gt; getDescription() {    return description;}public void setDescription(String description) {    this.description.add(description);}public ArrayList&lt;String&gt; getDownload() {    return download;}public void setDownload(String download) {    this.download.add(download);}}</code></pre><p>The question now is... how to make it display on the main Activity?</p><pre><code>public void onCreate(Bundle savedInstanceState) {    MagazineList magazineList = null;private List&lt;MagazineList&gt; magazines = null;    LinearLayout layout = new LinearLayout(this);    layout.setOrientation(1);    TextView name[];    TextView imgurl[];    TextView date[];    TextView description[];    TextView price[];    TextView download[];    AndroidSaxFeedParser saxparser = new  AndroidSaxFeedParser(&lt;my website&gt;);    magazines = saxparser.parse();    for(MagazineList magazineList : magazines){         name = new TextView[magazineList.getName().size()];         imgurl = new TextView[magazineList.getName().size()];         date = new TextView[magazineList.getName().size()];         description = new TextView[magazineList.getName().size()];         price = new TextView[magazineList.getName().size()];         download = new TextView[magazineList.getName().size()];    (Supposingly I should get my data from here... What's next? Perhaps I have some syntax errors when declaring TextViews, I'm not sure. Please help out.)    }}</code></pre>","409296","","321697","","2010-12-03 05:54:24","2010-12-03 05:54:24","Simplified Android SAX XML Parsing Problem","<android><xml><sax>","1","0","","",""
"4342443","1","","","2010-12-03 04:20:09","1","2686","<p>I have some code I have been experimenting with to see what I can do with the camera device. This following code works, but I have some issues with it that I cannot seem to solve.</p><ol><li><p>The first call never works. The first time running the code the onPictureTaken callback is never called, so the file is never written. However the camera goes through all the other steps, including making the fake shutter noise.</p></li><li><p>I can't seem to set the picture size to something other than whatever it defaults to. If I try to set it to something else, the code stops working. Does the same as above, where the camera goes through all the motions, but the onPictureTaken callback is never called.</p></li><li><p>When the pictures are saved to the DCIM folder, the taken pictures do not show up in the default 'Photos' app on my phone, unless i reboot the phone.</p></li><li><p>Is there any way through code to disable the shutter noise?</p></li></ol><p>Sorry, the code is a little messy because its an experiment. </p><p>Also, this code is executed in a BroadcastReceiver</p><pre><code>    @Overridepublic void onReceive(Context context, Intent intent) {    // TODO Auto-generated method stub    if(intent.getAction().equals(TAKE_PICTURE_INTENT))    {        Toast.makeText(context, ""Test"", Toast.LENGTH_LONG).show();                System.out.println(""GOT THE INTENT"");                    try                    {                        Camera camera = Camera.open();                        System.out.println(""CAMERA OPENED"");                        Parameters params = camera.getParameters();                        params.set(""flash-mode"", ""off"");                        params.set(""focus-mode"", ""infinity"");                        params.set(""jpeg-quality"", ""100"");                        //params.setPictureSize(2592, 1952);                        String str = params.get(""picture-size"" + ""-values"");                        System.out.println(str);                        String size = str.split("","")[0];                        System.out.println(size);                        //params.set(""picture-size"", size);                        camera.setParameters(params);                        System.out.println(""CAMERA PARAMETERS SET"");                        camera.startPreview();                        System.out.println(""CAMERA PREVIEW STARTED"");                        camera.autoFocus(new AutoFocusCallBackImpl());                    }                    catch(Exception ex)                    {                        System.out.println(""CAMERA FAIL, SKIP"");                        return ;                    }    }//if   }//onreceiveprivate void TakePicture(Camera camera){    camera.takePicture(new Camera.ShutterCallback() {        @Override        public void onShutter() {            // TODO Auto-generated method stub            System.out.println(""CAMERA SHUTTER CALLBACK"");        }    }     , null,         new Camera.PictureCallback() {                public void onPictureTaken(byte[] imageData, Camera c) {                    //c.release();                    System.out.println(""CAMERA CALLBACK"");                    FileOutputStream outStream = null;                    try {                        System.out.println(""Start Callback"");                        File esd = Environment.getExternalStorageDirectory();                        outStream = new FileOutputStream(esd.getAbsolutePath() + String.format(                                ""/DCIM/%d.jpg"", System.currentTimeMillis()));                        outStream.write(imageData);                        outStream.close();                        System.out.println( ""onPictureTaken - wrote bytes: "" + imageData.length);                    } catch (FileNotFoundException e) {                        e.printStackTrace();                          System.out.println(""File not found exception"");                    } catch (IOException e) {                        e.printStackTrace();                          System.out.println(""IO exception"");                    } finally {                          System.out.println(""Finally"");                          c.release();                    }                }            }         );    //camera.release();}//TAKE PICTUREprivate class AutoFocusCallBackImpl implements Camera.AutoFocusCallback {    @Override    public void onAutoFocus(boolean success, Camera camera) {        //bIsAutoFocused = success; //update the flag used in onKeyDown()        System.out.println(""Inside autofocus callback. autofocused=""+success);        //play the autofocus sound        //MediaPlayer.create(CameraActivity.this, R.raw.auto_focus).start();        if(success)        {            System.out.println(""AUTO FOCUS SUCCEDED"");        }        else        {            System.out.println(""AUTO FOCUS FAILED"");        }        TakePicture(camera);        System.out.println(""CALLED TAKE PICTURE"");    } }//AUTOFOCUSCALLBACK</code></pre>","178014","","","","","2010-12-03 04:59:15","Trouble with Android Camera","<java><android><camera>","1","0","","",""
"4342454","1","4343262","","2010-12-03 04:23:35","0","387","<p>Hi my application using a webview ,when the webpage contain a  particular text i want to start a new activity,is it possible?</p>","487219","","","","","2010-12-03 07:09:39","Android WebView","<android>","1","1","1","",""
"4342464","1","4348388","","2010-12-03 04:26:59","2","1211","<p>I've been raking my brains on this one for a while.</p><p>when I'm running my application (opengl game) eveyrthing goes fine but when I touch the screen my application slows down quite seriously (not noticeable on powerful phones like the nexus one, but on the htc magic it gets quite annoying).</p><p>I did a trace and found out that the touch events seem to be handled in a different thread and even if it doesn't take so much processing time I think androids ability to switch between threads is not so good...</p><p>What is the best way to handle touch when speed is an issue ? </p><p>Currently I'm using :in the GLSurfaceView</p><pre><code>@Override public boolean onTouchEvent(MotionEvent event) {     GameHandler.onTouchEvent(event);     return true; }</code></pre><p>Any ideas are welcome</p>","440336","","","","","2011-01-14 06:13:19","Android: Touch seriously slowing my application","<android><touch>","4","1","","",""
"4342482","1","4515982","","2010-12-03 04:31:08","1","2844","<p>I am trying to take small recordings to find the Sound Pressure Level from a service but Android wont give me access to the hardware.  I get the following errors in Logcat:</p><p><img src=""http://i.stack.imgur.com/VxWBh.png"" alt=""alt text""></p><p>The error comes from the following code:</p><pre><code>AudioRecord recordInstance = null;    // We're important...    android.os.Process            .setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);    short bufferSize = 4096;// 2048;    recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC, this //line 167            .getFrequency(), this.getChannelConfiguration(), this            .getAudioEncoding(), bufferSize); //object not created    tempBuffer = new short[bufferSize];    recordInstance.startRecording();</code></pre><p>What happens is that recordInstance is never properly created and so when it gets to the end and calls recordInstance.startRecording(), recordInstance is still null.  Android rejects my programs request at the definition.  Does anyone know what those errno's indicate?  I couldn't find a list online.</p><p><a href=""http://developer.android.com/reference/android/media/AudioRecord.html"" rel=""nofollow"">AudioRecord Docs</a></p><p>Thanks</p>","451037","","","","","2010-12-23 05:01:11","Cannot access AudioRecorder","<android><audio><audiorecord>","1","0","","",""
"4342491","1","","","2010-12-03 04:32:50","7","1259","<p>I have been trying to get a few sounds to play at the same time; currently i'm using a shared instance of SoundPool.  I would like 1, 2 or 3 sounds to be played at the exact same time with no lag. </p><p>When calling SoundPool.play(...) X number of times in succession, the sounds are played in that order as one might think.  what is the proper what to achieve this where i can prepare all of the sounds to be played at the same time and then play them as one?</p><p><strong>Sudo Code:</strong></p><pre><code>SoundPool _soundPool = new SoundPool(10, AudioManager.STREAM_MUSIC, 0);_soundPool.load(_context, soundId1, 1);_soundPool.load(_context, soundId2, 1);_soundPool.load(_context, soundId3, 1);_soundPool.play(soundId1, vol, vol, 1, 0, 1f);_soundPool.play(soundId2, vol, vol, 1, 0, 1f);_soundPool.play(soundId3, vol, vol, 1, 0, 1f);</code></pre>","142803","","491044","","2012-06-23 09:44:17","2012-06-23 09:44:17","How to Sync Sounds using SoundPool","<android><audio><soundpool><android-audiomanager>","1","4","2","",""
"4342496","1","","","2010-12-03 04:34:19","0","1363","<p>i am working on an application and it works fine but in log i can see the below mentioned error: PLease suggest what could be the reason behind this and how to fix this..I have closed all the cursors and also closing the database connection after use.PLease help...</p><p>12-02 17:16:48.500: ERROR/Database(388): close() was never explicitly called on database '/data/data/com.example.my/databases/my.db' 12-02 17:16:48.500: ERROR/Database(388): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here12-02 17:16:48.500: ERROR/Database(388): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1810)12-02 17:16:48.500: ERROR/Database(388): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:817)12-02 17:16:48.500: ERROR/Database(388): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:851)</p>","527933","","","","","2010-12-03 13:47:22","Database error in logcat","<android>","1","1","","",""
"4342537","1","4342667","","2010-12-03 04:43:10","0","1154","<p>I have designed a launcher icon <strong>48x48</strong> pixels and placed it in my res/drawable folder. When I install the application, the icon in the application menu seems to be smaller and it is wrapped in a box by default. Did I do something wrong? Any help is appreciated.</p>","527053","","","","","2010-12-03 05:13:52","Android: My 48x48 Launcher Icon looks smaller when compared to others","<android><icons><launcher>","1","0","","",""
"4342540","1","4342550","","2010-12-03 04:43:35","1","983","<p>I've created a new android AVD, but there is no android market installed. How can I install android market on emulator?</p>","516160","","","","","2011-06-22 07:47:10","How to install Android market?","<android><android-emulator>","3","3","1","",""
"4342548","1","4342621","","2010-12-03 04:44:58","0","3270","<p>I've the following layout </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:background=""@color/all_white""    android:gravity=""center""&gt;    &lt;Button android:id=""@+id/mq_categories"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_margin=""5dp""        android:text=""Browse Quiz Categories"" android:textColor=""#EDFF99""        android:background=""@drawable/custom_button"" /&gt;    &lt;Button android:id=""@+id/mq_random"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_margin=""5dp""        android:text=""Enter Random Quiz"" android:textColor=""#EDFF99""        android:background=""@drawable/custom_button"" /&gt;    &lt;Button android:id=""@+id/mq_profile"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_margin=""5dp""        android:text=""My Profile"" android:textColor=""#EDFF99""        android:background=""@drawable/custom_button"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>which gives the output as </p><p><img src=""http://i.stack.imgur.com/HsCQq.png"" alt=""alt text""></p><p><strong>Now I need to add a welcome text at the top section of the screen</strong> </p><p>When I added the text view like this, only welcome text is displayed and no buttons and no scroll</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:background=""@color/all_white""    android:gravity=""center""&gt;    &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/mg_userinfo"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:text=""Welcome""        android:gravity=""center"" /&gt;    &lt;Button android:id=""@+id/mq_categories"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_margin=""5dp""        android:text=""Browse Quiz Categories"" android:textColor=""#EDFF99""        android:background=""@drawable/custom_button"" /&gt;    &lt;Button android:id=""@+id/mq_random"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_margin=""5dp""        android:text=""Enter Random Quiz"" android:textColor=""#EDFF99""        android:background=""@drawable/custom_button"" /&gt;    &lt;Button android:id=""@+id/mq_profile"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_margin=""5dp""        android:text=""My Profile"" android:textColor=""#EDFF99""        android:background=""@drawable/custom_button"" /&gt;&lt;/LinearLayout&gt;</code></pre><p><img src=""http://i.stack.imgur.com/WQu6F.png"" alt=""alt text""></p><p>When tried below lay out welcome text is displayed at the bottom of the buttons, but buttons got shifted to the top of the 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:background=""@color/all_white""    android:gravity=""center""&gt;    &lt;Button android:id=""@+id/mq_categories"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_margin=""5dp""        android:text=""Browse Quiz Categories"" android:textColor=""#EDFF99""        android:background=""@drawable/custom_button"" /&gt;    &lt;Button android:id=""@+id/mq_random"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_margin=""5dp""        android:text=""Enter Random Quiz"" android:textColor=""#EDFF99""        android:background=""@drawable/custom_button"" /&gt;    &lt;Button android:id=""@+id/mq_profile"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_margin=""5dp""        android:text=""My Profile"" android:textColor=""#EDFF99""        android:background=""@drawable/custom_button"" /&gt;    &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/mg_userinfo"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:text=""Welcome""        android:gravity=""center"" /&gt;&lt;/LinearLayout&gt;</code></pre><p><img src=""http://i.stack.imgur.com/AcG02.png"" alt=""alt text""></p><p><strong>How can I need to add a welcome text at the top section of the screen with button on the center?</strong> </p>","174261","","","","","2010-12-03 05:02:25","Android Text view position with custom buttons in the layout","<android><android-layout>","2","0","1","",""
"4342572","1","","","2010-12-03 04:51:50","5","1681","<p>I would like to compare some XML binding tools for Android, however there does not seem to be many available. Any that are, are cumbersome or very limited in capability. What frameworks other than the <a href=""http://simple.sourceforge.net"">Simple</a> XML framework are available for the Android platform.</p><p>Here I am interested in frameworks that do all the heavy work, so KXML, DOM, and SAX are not really what I am looking for. Frameworks like JiBX and JAXB are more along the lines of what I am looking for.</p>","21896","","","","","2012-10-27 15:41:28","XML binding tools for Android","<java><android><xml><xml-serialization>","5","1","1","2012-10-27 15:40:14",""
"4342588","1","4342714","","2010-12-03 04:55:16","26","5860","<p>I feel silly asking this and even more silly to have this problem. I have a android project that has been executing fine until now.</p><p>but a couple of days ago, without me doing anything particular that I know of, my project has been always launching itself in debug no matter what I try (clicking on the debug or run gives me the same result). I try looking in the project settings and the build configuration but can't see anything justifying this.</p><p>so right now each time I launch the app I have to go to go to debug tab and click on disconnect...</p><p>Any ideas</p>","440336","","","","","2013-01-20 14:09:46","Eclipse android project always lauching in debug","<java><android><eclipse>","6","1","1","",""
"4342593","1","4342683","","2010-12-03 04:56:09","1","869","<p>I have the following XML and am not doing anything fancy with overriding scrolling behaviors:</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        android:id=""@+id/myscrollview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:fillViewport=""true""        android:layout_weight=""1""&gt;            &lt;ListView                android:id=""@+id/mylistview""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" /&gt;    &lt;/ScrollView&gt;    &lt;TextView         android:id=""@+id/my_empty""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:text=""@string/my_foo""        android:gravity=""center""        android:visibility=""gone""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>However, while the embedded listview does respond to presses and long presses, it does not scroll. What am I doing wrong?</p><p>The trailing TextView is the listview's emptyview.</p>","210920","","","","","2010-12-03 05:16:16","ScrollView Not Responding","<android><listview><scrollview>","3","1","","",""
"4342651","1","4407393","","2010-12-03 05:09:38","-1","75","<p>Please find the post in my link :</p><p><a href=""http://stackoverflow.com/questions/4331735/how-to-show-alert-after-calling-the-webservice"">how to show alert after calling the webservice</a></p><p>Can anyone please help on this issue???</p>","504162","","","","","2010-12-10 09:35:14","showing alert inside web-service","<android><web-services><alertdialog>","1","1","","",""
"4342688","1","4342855","","2010-12-03 05:17:57","0","734","<p>here is the scenario that i want to display the list of currently running task's packages and classes in my android application,i have written a code but it is giving me run time error..can anyone help me to solve this..Below is my code....is my idea is correct or i don't mind if another code for this program..</p><pre><code>ActivityManager actM = null;List&lt; ActivityManager.RunningTaskInfo&gt; Runningtasks= actM.getRunningTasks(5);for(i=0;i&lt;5;i++){    ComponentName comName=Runningtasks.get(i).topActivity;    String Packname = comName.getPackageName();    String Classname = comName.getClassName();    Toast toast1 = Toast.makeText(context, Packname, duration);    toast1.show();}</code></pre>","505580","","1288","","2011-03-15 13:40:30","2011-03-15 13:40:43","displaying the list of currently running task's packages and classes in my android application","<android><activity><packages>","1","1","","",""
"4342732","1","4342750","","2010-12-03 05:27:00","0","278","<p>I have an app that is running pretty stably (no more crashes actually), but as everybody knows your program crashes as soon as it gets in the hands of somebody else :D</p><p>What I would like is to find a(all) the place(s) where I can put a try{}catch(){} to be able catch and control what happens when the app crashes unexpectedly (display a better message, send log, possible recovery...)</p><p>I know its surely not that simple but still it would be good if there was a way to catch most of them.</p><p>(for example there is a small bug in GLSurfaceView that when it is being closed causes sometimes to crash because of an EGL swap buffer)</p><p>any ideas? </p>","440336","","","","","2010-12-03 05:40:59","Making my application crash more gracefully","<android>","2","0","1","",""
"4342761","1","11472684","","2010-12-03 05:32:52","26","54818","<p>I've read through several posts about using this, but must be missing something as it's not working for me. My activity A has launchmode=""singleTop"" in the manifest. It starts activity B, with launchmode=""singleInstance"". Activity B opens a browser and receives and intent back, which is why it's singleInstance. I'm trying to override the back button so that the user is sent back to the activity A, and can then press Back to leave the activity, rather than back to activity B again.</p><pre><code>// activity B@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event)  { if (android.os.Build.VERSION.SDK_INT &lt; android.os.Build.VERSION_CODES.ECLAIR  &amp;&amp; keyCode == KeyEvent.KEYCODE_BACK  &amp;&amp; event.getRepeatCount() == 0) onBackPressed(); return super.onKeyDown(keyCode, event);}@Overridepublic void onBackPressed() { startActivity(new Intent(this, UI.class) .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK)); return;}</code></pre><p>After returning from the browser, the stack is...A,B,Browser,B</p><p>I expect this code to change the stack to...A... so that pressing back once more takes the user back to the Home Screen.</p><p>Instead it seems to change the stack to...A,B,Browser,B,A...as though those flags aren't there.</p><p>I tried calling finish() in activity B after startActivity, but then the back button takes me back to the browser again!</p><p>What am I missing? Thank you!</p>","528934","","11238","","2011-02-23 07:21:16","2013-10-20 07:06:25","How do you use Intent.FLAG_ACTIVITY_CLEAR_TOP to clear the Activity Stack?","<android><activity>","5","0","13","",""
"4342798","1","6331158","","2010-12-03 05:39:34","12","8645","<p>i want to display image in imageview from sqlite database using cursor. i used below code to retrieve image but i am not able to display image in imageview.</p><pre><code>Cursor c=this.db.query(TABLE_NAME, new String[] { ""name"",""price"",""image"" },                null, null, null, null, null);name.setText(c.getString(0));price.setText(c.getString(1));byte b[]=c.getBlob(2);Bitmap bp=BitmapFactory.decodeByteArray(b, 0, b.length);ImageView image=(ImageView)findViewById(R.id.ImageView);//ByteArrayInputStream imageStream = new ByteArrayInputStream(b);               //Bitmap theImage = BitmapFactory.decodeStream(imageStream);//image.setImageBitmap(theImage);               image.setImageBitmap(bp); </code></pre><p>other than image, name and price will display but image will not display.any suggestion or code that will help me to solve this problem.</p><p>Please help me.</p><p>Thanks in advance..</p>","489902","","1109930","","2012-02-06 08:04:38","2012-02-06 08:04:38","Displaying image from the sqlite database using cursor in android","<android><image><sqlite>","3","1","4","",""
"4342801","1","4827838","","2010-12-03 05:39:59","0","298","<p>I am trying to load a list of images from an array. I got the images in list. Now I need to add a text for every image in the list. Can someone help me with this? I am new to Android.</p><pre><code>public class EfficientAdapter extends BaseAdapter {    public EfficientAdapter(Context c) {        mContext = c;    }    public int getCount() {        return mImageIds.length;    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        ImageView i = new ImageView(mContext);        i.setImageResource(mImageIds[position]);        i.setScaleType(ImageView.ScaleType.FIT_END);        i.setLayoutParams(new ListView.LayoutParams(60, 60));        return i;    }    private Context mContext;    private Integer[] mImageIds = { R.drawable.video3, R.drawable.video5, R.drawable.music2, };}</code></pre><p>This is my code where I have loaded list of images from an array. Please help me with this code.</p>","793679","","1128737","","2012-01-13 13:10:52","2012-01-13 13:10:52","How to use custom listView?","<android><android-listview>","1","0","1","",""
"4342814","1","","","2010-12-03 05:42:55","1","770","<p>I used WebView to launch the webpage of given address and added two buttons i.e BACK and FORWARD to navigate</p><p>i used webview.goBack() method to BACK and webview.goForward() to FORWARD,navigation of web pages works fine with the public domain urls like www.google.com but not with local urls like <a href=""http://localhost"" rel=""nofollow"">http://localhost</a></p><p>Why does this happen,Any Solution???</p>","528965","","","","","2010-12-14 08:43:01","Android2.2 Webview goback issue","<android>","1","0","","",""
"4342860","1","4343114","","2010-12-03 05:53:38","0","168","<p>In my project I have a Picture that through program, I extracted pixels, manipulate those pixels and then saved it in my package </p><blockquote>  <p>FileOutputStream fos = new  FileOutputStream(context.getFilesDir().getAbsolutePath()  + ""/newPicture.bmp"");</p></blockquote><p>so, it saves my picture in </p><blockquote>  <p>/data/data/my_package_name/files</p></blockquote><p>Now, I want to replace my default picture with this new picture. Actually, since I don't have this new picture, default picture should be shown. when new picture prepared, default picture should be replace with new one.</p><p>my main problem is How can I check to be assured that is new picture exist? if not exist show default picture, if exist show new picture.</p><p>Thanks.</p>","513413","","","","","2010-12-03 06:40:21","android: How can I check package to be assured that is a file exist?","<android><imageview><image>","1","0","","",""
"4342887","1","4525542","","2010-12-03 05:58:28","0","473","<p>I have been trying to make wall post from multiple pages but when i try to make post from other pages except original facebook page, it is giving me an exception of java.lang.NullPointerException</p><p>The method i am calling and created in a Facebook page</p><pre><code>public void postOnWall(String msg) {        Log.d(""Tests"", ""Testing graph API wall post"");         try {                String response = mFacebook.request(""me"");                Bundle parameters = new Bundle();                parameters.putString(""message"", msg);                parameters.putString(""description"", ""test test test"");                response = mFacebook.request(""me/feed"", parameters,                         ""POST"");                Log.d(""Tests"", ""got response: "" + response);                if (response == null || response.equals("""") ||                         response.equals(""false"")) {                   Log.v(""Error"", ""Blank response"");                }         } catch(Exception e) {             e.printStackTrace();         }    }</code></pre><p>and code to call this method.</p><pre><code>try {                    mFacebookObj.postOnWall(""Add poi"");                } catch(Exception e){                    e.printStackTrace();                }</code></pre><p>both are activity classes. </p><p>Now can anyone tell me how shall i call this method from outside this page and make post over facebook wall</p>","457146","","","","","2011-01-24 06:48:19","Facebook wall post from multiple pages","<android><facebook>","1","0","","",""
"4342927","1","4351137","","2010-12-03 06:07:44","2","3864","<p>I'm currently working on extending a TextView, adding an outline around the text.  Thus far, the only problem I've been having is my inability to position the ""outline"" correctly behind a text.  If I code the extended class like the one portrayed below, I get a label that looks like this:</p><p><img src=""http://i.stack.imgur.com/xmFtY.png"" alt=""""></p><p>Note: in the above screenshot, I set the fill color to white, and the stroke color to black.</p><p>What am I doing wrong?</p><pre><code>public class OutlinedTextView extends TextView {    /* ===========================================================     * Constants     * =========================================================== */    private static final float OUTLINE_PROPORTION = 0.1f;    /* ===========================================================     * Members     * =========================================================== */    private final Paint mStrokePaint = new Paint();    private int mOutlineColor = Color.TRANSPARENT;    /* ===========================================================     * Constructors     * =========================================================== */    public OutlinedTextView(Context context) {        super(context);        this.setupPaint();    }    public OutlinedTextView(Context context, AttributeSet attrs) {        super(context, attrs);        this.setupPaint();        this.setupAttributes(context, attrs);    }    public OutlinedTextView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        this.setupPaint();        this.setupAttributes(context, attrs);    }    /* ===========================================================     * Overrides     * =========================================================== */    @Override    protected void onDraw(Canvas canvas) {        // Get the text to print        final float textSize = super.getTextSize();        final String text = super.getText().toString();        // setup stroke        mStrokePaint.setColor(mOutlineColor);        mStrokePaint.setStrokeWidth(textSize * OUTLINE_PROPORTION);        mStrokePaint.setTextSize(textSize);        mStrokePaint.setFlags(super.getPaintFlags());        mStrokePaint.setTypeface(super.getTypeface());        // Figure out the drawing coordinates        //mStrokePaint.getTextBounds(text, 0, text.length(), mTextBounds);        // draw everything        canvas.drawText(text,                super.getWidth() * 0.5f, super.getBottom() * 0.5f,                mStrokePaint);        super.onDraw(canvas);    }    /* ===========================================================     * Private/Protected Methods     * =========================================================== */    private final void setupPaint() {        mStrokePaint.setAntiAlias(true);        mStrokePaint.setStyle(Paint.Style.STROKE);        mStrokePaint.setTextAlign(Paint.Align.CENTER);    }    private final void setupAttributes(Context context, AttributeSet attrs) {        final TypedArray array = context.obtainStyledAttributes(attrs,                R.styleable.OutlinedTextView);        mOutlineColor = array.getColor(                R.styleable.OutlinedTextView_outlineColor, 0x00000000);        array.recycle();         // Force this text label to be centered        super.setGravity(Gravity.CENTER_HORIZONTAL);    }}</code></pre>","434414","","418183","","2010-12-03 07:18:34","2011-04-27 22:19:50","How to correctly draw text in an extended class for TextView?","<java><android><textview><extend><outline>","4","1","5","",""
"4342932","1","4343932","","2010-12-03 06:08:58","1","2870","<p>I'm trying to POST the following xml to a server url, but i don't know how to go about it. GET requests are easy enough, but I'm having a problem with POST requests.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-16""?&gt;&lt;ArrayOfString xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""&gt;&lt;string&gt;the_command&lt;/string&gt;&lt;/ArrayOfString&gt;</code></pre><p>I need to be able to modify 'the_command' at run-time before making the request.Any help will be appreciated!!!!</p>","528987","","","","","2011-06-17 12:31:48","POST xml file using http request on Android","<java><android><http>","3","0","1","",""
"4342954","1","4343132","","2010-12-03 06:12:30","1","425","<p>I have a strange problem. I am setting the background color of the items of a listview like so:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    View row = convertView;    ...    if (status == true) {        row.setBackgroundColor(Color.argb(255,0,85,187));    }    else {        if (morestuff) {            row.setBackgroundColor(Color.argb(128,255,0,0));        }    }    ...}</code></pre><p>This seems to work. However, when i scroll on the listview, and then back, some of the rows have acquired a color from another row without being set by this code. I suspect the listview is recycling the views as an optimization. </p><p>How can I fix this?</p>","210920","","210920","","2010-12-03 08:28:25","2010-12-03 08:28:25","Background Color Recycled in ListView","<android><listview><background>","2","0","","",""
"4343008","1","","","2010-12-03 06:23:10","0","249","<p>I want to parse an XML from a string. This is working fine when the string length is small. But for a long string it is not parsing anything. It is suspended on calling parse(). I use the following code for parsing. Please tell me what is the wrong with my code?</p><pre><code>        //my xml code is string 'xmlString'         DocumentBuilderFactory objDocFactory=DocumentBuilderFactory.newInstance();         DocumentBuilder objDocBuilder=objDocFactory.newDocumentBuilder();           InputSource objInput=new InputSource();         objInput.setCharacterStream(new StringReader(xmlString));         Document objDoc=objDocBuilder.parse(objInput);         //appication is suspended at the above line         objDoc.getDocumentElement().normalize();</code></pre><p>Thank you...</p>","523058","","","","","2010-12-03 06:49:12","Problem with parsing xml from a string in Android","<android><xml><parsing>","2","2","","",""
"4343122","1","","","2010-12-03 06:40:48","3","3005","<p>I have the below code snippet in my the JNI part:</p><pre><code>JNIEnv* env = AndroidRuntime::getJNIEnv();</code></pre><p>The above statement always returns NULL in my function. Then I use env and call some method in Java code using callback mechanism.</p><p>It's this part of the code in getJNIEnv() that always returns NULL.</p><pre><code>if (vm-&gt;GetEnv((void**) &amp;env, JNI_VERSION_1_4) != JNI_OK){        return NULL;}</code></pre><p>Can anyone please tell me what's wrong with code? It looks pretty normal to me since other functions in JNI too have almost similar implementation.</p>","308131","","","","","2013-05-07 14:39:32","AndroidRuntime::getJNIEnv() returns NULL","<android>","1","0","2","",""
"4343155","1","4343295","","2010-12-03 06:47:17","1","361","<p>I have created a progress Bar which I need to show on clicking the Button that plays the particular sound. Now I want the timer to be displayed below the ProgressBar and want both the ProgressBar and Timer to run Simultaneously along with the length of the sound.</p><p>Also when the sound gets finished, I want the PregressBar and Timer to be invisible again so that I can start it again for the another Sound.</p><p>Can anybody please help me in this?</p><p>Thanks,david</p>","422859","","","","","2010-12-03 07:22:15","dissmissing the Progress Bar after sometime","<android><timer><progress-bar>","1","0","","",""
"4343304","1","4381903","","2010-12-03 07:18:56","6","1734","<p>Hello I am trying to change the text color of the items in a list on a <code>ListPreference</code> pop up window.  I have spent over an hour looking through all of the various style names but I can't find <code>TextAppearance</code> or anything that goes to this particular text.  Thanks for your help!</p>","384306","","","","","2010-12-07 21:42:33","How do you change the textcolor of the list items in an AlertDialog","<android><coding-style><themes><alertdialog><listpreference>","2","3","1","",""
"4343314","1","4343391","","2010-12-03 07:20:05","2","8483","<p>I am using relativelayout and inside it a scrollview and inside it a linear layout and a textview which is ensuring scrolling of textview, but I do not want to scroll the text after the particular condition. So, what can I do for this?</p>","493193","","63550","","2012-01-22 12:03:38","2012-11-07 06:30:30","How can i disable a scrollview?","<android>","3","0","","",""
"4343342","1","4343827","","2010-12-03 07:25:34","2","4611","<p>I'm trying to get both accelerometer and orientation data. Currently, I created an AccelerometerManager and OrientationManager. They both do the same thing; implement SensorEventListener and retrieve data from values[] in onSensorChanged() listeners. </p><p>Is there an easier way to do this? It seems like having 2 handlers with duplicate code is uneccessary. Is there a way to access a values[] array with the combined accelerometer and orientation data together? </p><p>Because of the 2 handlers, I'm also having to do this:</p><pre><code>    orientationManager = new OrientationManager(this);    orientationSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);    orientationSensorManager.registerListener(orientationManager,             orientationSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION),             SensorManager.SENSOR_DELAY_GAME);    accelerometerManager = new AccelerometerManager(this);    accelerometerSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);    accelerometerSensorManager.registerListener(accelerometerManager,             orientationSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),             SensorManager.SENSOR_DELAY_GAME);</code></pre>","117579","","","","","2010-12-03 08:49:40","Is there a way to retrieve multiple sensor data in Android","<android><orientation><accelerometer><sensor>","1","0","3","",""
"4343350","1","6867260","","2010-12-03 07:27:34","13","5513","<p>I have a VideoView which I want to use to play a movieclip. I use it like this to play it and it works.</p><pre><code>VideoView vv = new VideoView(this);vv.setVideoURI(Uri.parse(""android.resource://cortex2.hcbj/raw/intro""));setContentView(vv);vv.start();</code></pre><p>However I see a black flash just before and after the movie clip. The flash in itself isn't a big problem, but the blackness of it is. The background is white, so if the flash is white, or if it dissapears it will be okay.</p>","296293","","","","","2014-01-20 13:18:31","VideoView black flash before and after playing","<java><android><videoview>","12","3","6","",""
"4343393","1","","","2010-12-03 07:36:02","3","2821","<p>i start a activity,i need to show a alertdialog,so i write a dialog util class(dialoghandler) ,i pass the context to the dialoghandler ,the first start is ok,but when i start the second ,it happend the exception.what should i do,ps help me.</p><p>here is the bug report:</p><pre><code>12-03 07:23:26.000: ERROR/AndroidRuntime(21525): FATAL EXCEPTION: main12-03 07:23:26.000: ERROR/AndroidRuntime(21525): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at android.view.ViewRoot.setView(ViewRoot.java:509)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at android.app.Dialog.show(Dialog.java:241)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at com.eoemobile.api.update.EoeSdkUpdate.onCacheFetched(EoeSdkUpdate.java:170)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at com.eoemobile.api.net.CacheManager.handleCallBackMag(CacheManager.java:362)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at com.eoemobile.api.net.CacheManager.access$1(CacheManager.java:358)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at com.eoemobile.api.net.CacheManager$CallbackHandler.handleMessage(CacheManager.java:375)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at android.os.Handler.dispatchMessage(Handler.java:99)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at android.os.Looper.loop(Looper.java:123)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at java.lang.reflect.Method.invokeNative(Native Method)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at java.lang.reflect.Method.invoke(Method.java:521)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-03 07:23:26.000: ERROR/AndroidRuntime(21525):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","1837505","","473070","","2010-12-03 08:21:44","2010-12-03 08:23:27","BadTokenException","<android>","1","0","","",""
"4343418","1","4343779","","2010-12-03 07:40:37","5","2610","<p>I have an android application where the home screen is a tab view. One of the tab goes to an ""Inbox"" activity. I'd like to show a number that indicates the number new messages. This seem to be a standard feature on iPhone apps. Is there any sort of system support for this? If not, what's the easiest way to implement this effect for android tabviews?</p>","325072","","","","","2013-05-03 13:57:28","Android: Showing number of new items count on tabs","<android><tabview>","3","4","","",""
"4343509","1","4343651","","2010-12-03 07:57:49","0","1941","<blockquote>  <p>This is correct program and now running fine :) thank you sir</p></blockquote><p>I am new to Android. I have a String that contains XML format data (its an XML document) that servers returns to me. I want to parse it in Android with <code>XmlResourceParser</code> but it only accepts xml documents that are stored on your device e.g:</p><pre><code>XmlResourceParser xmlResourceParser = getResources().getXml(                R.xml.new_xml); ""&lt;?xml version=\""1.0\"" encoding=\""UTF-8\""?&gt;""+                     ""&lt;ItemInfo&gt;"" + ""&lt;Status&gt;Success&lt;/Status&gt;""                + ""&lt;Reason&gt;&lt;/Reason&gt;"" + ""&lt;IsMore&gt;yes&lt;/IsMore&gt;""                + ""&lt;ItemList&gt;""                + ""&lt;Item Name=\""Ahmad\"" Level=\""1\"" UserId=\""5\""&gt;&lt;/Item &gt;""                + ""&lt;Item Name=\""Ahmad\"" Level=\""1\"" UserId=\""5\""&gt;&lt;/Item &gt;""                + ""&lt;Item Name=\""Ahmad\"" Level=\""1\""UserId=\""5\""&gt;&lt;/Item &gt;""                + ""&lt;/ItemList&gt;"" + ""&lt;/ItemInfo&gt;"";</code></pre><p>I want XmlResourceParser to parse my this string. but how to make it accept this string as an xml document.using following method but crating exception</p><pre><code>private XmlPullParser xmlResourceParser; xml = xml.replaceAll(""\t"", """");                    try {                       XmlPullParserFactory factory = XmlPullParserFactory.newInstance();            factory.setNamespaceAware(true);            xmlResourceParser = factory.newPullParser();            xmlResourceParser.setInput(new StringReader(xml));        } catch (Exception ex) {            ex.printStackTrace();        }int eventType = -1;        while (eventType != XmlResourceParser.END_DOCUMENT) {            try {                if (eventType == XmlResourceParser.START_TAG) {                    String strNode = xmlResourceParser.getName();                    if (strNode.equalsIgnoreCase(""Status"")) {                        do {                            xmlResourceParser.next();                        } while (eventType == XmlResourceParser.TEXT);                        if (!xmlResourceParser.getText().equalsIgnoreCase(                                ""success"")) {                            do {                                eventType = xmlResourceParser.next();                            } while (eventType != XmlResourceParser.START_TAG);                            if (xmlResourceParser.getName().equalsIgnoreCase(                                    ""reason""))                                eventType = xmlResourceParser.next();                            todoItems.add(xmlResourceParser.getText());                            return todoItems;                        }                    }                    if (strNode.equals(""IsMore"")) {                        do {                            xmlResourceParser.next();                        } while (eventType == XmlResourceParser.TEXT);                        if (xmlResourceParser.getText().equalsIgnoreCase(""yes""))                            todoItems.add(""nextPage"");// if nextPage then there                        // is one more page                        // otherwise no next                        // page                        else                            todoItems.add(""lastPage"");// show user pervious                        // button instead of                        // next button                    }                    if (strNode.equals(""Item"")) {                        todoItems.add(xmlResourceParser.getAttributeValue(null,                                ""Name""));                        todoItems.add(xmlResourceParser.getAttributeValue(null,                                ""Level""));                        todoItems.add(xmlResourceParser.getAttributeValue(null,                                ""UserId""));                    }                                       }                eventType = xmlResourceParser.next();            } catch (XmlPullParserException xmlPullExp) {                xmlPullExp.printStackTrace();                todoItems.add(""XmlPullParserException"");            } catch (IOException ioExp) {                ioExp.printStackTrace();                todoItems.add(""IOException"");            } catch (Exception exp) {                exp.printStackTrace();                todoItems.add(""Exception"");            }        }        return todoItems;    }</code></pre>","185022","","185022","","2010-12-03 09:25:10","2010-12-03 09:25:10","create xml on the fly from a string android","<android><xml><generate><on-the-fly>","1","1","","",""
"4343724","1","","","2010-12-03 08:32:27","1","767","<p>How to upload a live video(instantaneous video capturing from camera) to a web server in android.</p>","414523","","","","","2010-12-03 08:40:33","android live uploading","<android><video><live>","2","0","1","",""
"4343834","1","","","2010-12-03 08:50:30","6","4214","<p>I have dynamically generated ListView, which consists radio-buttons as list items.</p><p>Is it possible to use radiogroup functionality in that listview or for these radiobuttons.</p><p>I mean, I'd like, that if the user select a radio button the radio button selected before would deselected.</p><p>That is my solution at the moment, which I don't like very much. I just save selected radio button and if another one will be selected, deselect the saved one.</p><p>Thank you for your suggestions or links.</p><p>Here is 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:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:orientation=""vertical"" android:background=""@drawable/bg_tile"" android:padding=""10dp""&gt; &lt;TextView  android:id=""@+id/text_station_name""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:padding=""5dp""  android:text=""TEST""  android:textColor=""@color/black""  android:background=""@color/transparent_white""/&gt; &lt;ListView  android:id=""@+id/list_lines""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""/&gt;    &lt;/LinearLayout&gt;</code></pre><p>item.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RadioButton xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/rb_lineId""     android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:textColor=""@color/black"" android:paddingLeft=""50dp"" android:background=""@drawable/selector_custombutton""/&gt;  </code></pre><p>But I also tried with this one:</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"" android:background=""@drawable/bg_tile"" android:padding=""10dp""&gt; &lt;TextView  android:id=""@+id/text_station_name""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:padding=""5dp""  android:text=""TEST""  android:textColor=""@color/black""  android:background=""@color/transparent_white""/&gt;    &lt;RadioGroup        android:layout_width=""fill_parent""       android:layout_height=""wrap_content""        android:orientation=""vertical""&gt;    &lt;ListView   android:id=""@+id/list_lines""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""/&gt; &lt;/RadioGroup&gt;    &lt;/LinearLayout&gt;</code></pre>","408780","","408780","","2010-12-03 09:30:57","2011-05-02 11:03:26","Android. RadioButtons in a ListView","<android><listview>","1","3","1","",""
"4343872","1","4344009","","2010-12-03 08:54:46","8","7794","<p>Are there some open-source media players on Android?</p>","482590","","242924","","2012-10-18 15:08:43","2014-02-08 01:33:35","Are there some open-source media players on Android?","<android><open-source><media>","3","0","8","",""
"4344046","1","4348309","","2010-12-03 09:19:59","1","1295","<p>i have create my first Application in Android And i want to put it on Android market, before that i want to know that, i want to check how much memory(CPU) used by my Application?</p>","472882","","","","","2010-12-03 17:47:26","Memory(CPU) usage by Application in Android","<android>","1","0","1","",""
"4344136","1","4344183","","2010-12-03 09:31:11","0","2173","<p>As described in question I want to start a broadcast receiver on some event say a button click so I don't want to use it in xml. Any idea how to do this I searched on net but most of example are using xml for this</p><p>Regard's Saurabh</p>","517247","","","","","2010-12-03 09:42:13","Android Broadcastlistener to start from code at some specifc event","<android><broadcastreceiver>","1","0","","",""
"4344182","1","4352502","","2010-12-03 09:35:54","3","1415","<p>I sometimes have a problem when setting sounds as ringtones / notifications from inside an activity:</p><pre><code>ContentValues values = new ContentValues();values.put(MediaStore.MediaColumns.DATA, source);values.put(MediaStore.MediaColumns.TITLE, ""abc"");values.put(MediaStore.MediaColumns.SIZE, new File(source).length());values.put(MediaStore.MediaColumns.MIME_TYPE, mime);values.put(MediaStore.Audio.Media.ARTIST, ""xyz"");values.put(MediaStore.Audio.Media.IS_RINGTONE, true);values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);final Uri curi = MediaStore.Audio.Media.getContentUriForPath(source);Uri uri = getContentResolver().insert(curi, values);</code></pre><p>most time uri is something like ""content://media/external/audio/media/23"", but sometimes it is null.I don't know where the problem lies, the audio files are ok (they play ok) and obviously the insert method does not throw any exception.I looked through the documentation but there is nothing about the method returning null.What could be the problem?</p>","398511","","398511","","2010-12-03 15:51:41","2010-12-04 07:34:48","ContentResolver.insert returns null","<android><ringtone><android-contentresolver>","2","0","","",""
"4344319","1","","","2010-12-03 09:51:49","0","554","<p><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><p>I tried for this tutorial for using javascript in android for google map,but I dont find any way to use the java script where to put the code of the javascript?</p>","274097","","274097","","2010-12-07 05:34:34","2011-01-15 22:13:08","How to Load Google Maps API site in a Android Application using JavaScript","<android>","1","0","","",""
"4344349","1","","","2010-12-03 09:56:12","8","15517","<p>Is there any working example for Marquee in android? I went through some sites, but that examples are not working.</p><p>Thank you for the answers.. But the following code is not working anyway. I am using Android 2.2. </p><pre><code>       &lt;TextView                 android:singleLine=""true""               android:ellipsize=""marquee""              android:marqueeRepeatLimit =""marquee_forever""             android:text=""Marquee..""/&gt; </code></pre>","523058","","523058","","2010-12-07 04:36:35","2013-03-05 16:28:24","Android Marquee","<android><marquee>","5","0","3","2013-03-21 12:25:35",""
"4344355","1","","","2010-12-03 09:56:46","3","1202","<p>Hey..I am quite new to android and still in learning process..currently i plan to make a app which will automatic turn on loudspeaker when the call is connected..and below are the codes..</p><pre><code>audiomanager = (AudioManager) contex.getSystemService(Context.AUDIO_SERVICE);  @Override    public void onCallStateChanged(int state, String incomingNumber) {               case TelephonyManager.CALL_STATE_OFFHOOK:                           am.setSpeakerphoneOn(true);                break;         }</code></pre><p>i was testing my code on android 2.1..sdk 7..i thaught using audiomanager.setSpeakerphoneOn(true); and add the permission of MODIFY_AUDIO_SETTINGS in manifest can turn on the loudspeaker..but it seems like it cant...so anyone can help?? thanks in advance..</p>","525939","","","","","2011-05-30 17:56:17","How to programmatically turn on loudspeaker when make/receiving call?","<android>","1","0","","",""
"4344382","1","4344583","","2010-12-03 09:59:22","2","1268","<p>how to solve this issue.... any alternative or how to increase memory??</p><pre><code>12-03 15:24:21.302: ERROR/AndroidRuntime(423): java.lang.OutOfMemoryError12-03 15:24:21.302: ERROR/AndroidRuntime(423):     at java.lang.String.&lt;init&gt;(String.java:468)12-03 15:24:21.302: ERROR/AndroidRuntime(423):     at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:659)12-03 15:24:21.302: ERROR/AndroidRuntime(423):     at java.lang.StringBuffer.toString(StringBuffer.java:720)12-03 15:24:21.302: ERROR/AndroidRuntime(423):     at com.example.my.Map.stringtoArray(Map.java:270)</code></pre>","527933","","329637","","2010-12-03 10:01:11","2010-12-05 15:06:46","java.lang.OutOfMemoryError","<android>","2","3","1","",""
"4344469","1","4345189","","2010-12-03 10:11:09","1","366","<p>I got 4 activites that all include a xml-footer which contains 4 buttons (one for each activity).I would now like to setup onclicklisteners to these buttons (it's a self made menu in the footer).</p><p>The question is, how do I use listeners so that I can reuse code?I have two ideas:</p><ol><li><p>Create a class that implements onclicklistener and in every activity i would get the buttons and then create a new instance of the listener class and do button.setOnClickListener(onClickListener)The problem is that in the listener class, how would i check which button called the event?And how would I create an intent to start an activity, usually i would do:Intent intent = new Intent(FromActivity.this, ToAcitivty.class)But i don't have the reference to FromActivity.</p></li><li><p>Create a base class that extends from activity and then the 4 activies will extend from the base class. I would then like to setup the listeners in the base class. The problem here is that i can't get the references to the buttons by doing Button button1 = (Button)findViewById(R.id.menu_button1);button1 will be null. I haven't even called setEventView because this should be done in the activity not in the base class.</p></li></ol><p>Any ideas?</p><p>Thank you</p>","396749","","","","","2010-12-03 11:43:51","Several activities using same listener","<android><listener><base-class>","1","0","","",""
"4344523","1","4344760","","2010-12-03 10:18:20","4","6832","<p>i want to Popup dialog at a specific time in any app my code :</p><pre><code> public class testPOPDialog extends Activity {/** Called when the activity is first created. */private Handler mHandler = new Handler();@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mHandler.postDelayed(mUpdateTimeTask, 1000);}private Runnable mUpdateTimeTask = new Runnable() {       public void run() {           AlertDialog d = new AlertDialog.Builder(testPOPDialog.this)            .setTitle(""tanchulai"")            .setMessage(""bucuo de tanchulai"")            .create();        d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);        d.show();            }    };}</code></pre><p>it give me </p><pre><code>12-03 10:12:18.162: ERROR/AndroidRuntime(571): android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRoot$W@43dd71c0 -- permission denied for this window type</code></pre><p>what is this permissionif i delete <code>d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);</code> my app is correct.....</p>","233618","","1007369","","2014-04-15 11:37:44","2014-04-15 11:37:44","Popup window in any app","<android><android-widget>","3","0","7","",""
"4344529","1","","","2010-12-03 10:19:03","0","135","<p>I need ur help..!</p><p>I m creating an app in android. The apps use the functions in the other apps which are already present. I want my app to be standalone. I can't use the functions in those app. </p><p>To be more clear, If i create an app for making video calls. The app needs to use the functions in the phone apps. can i just create an instance and use the functions or should i redo all the functions which are required?</p><p>It will be helpful if i get to know what will happen wen the app is inserted in the code base and compiled.? where ll the R.java file get created? </p><p>Could u suggest me some links to get a detail info about it? </p>","504712","","241475","","2010-12-03 11:06:21","2010-12-03 12:58:23","how to create an app using the functions in other apps","<android>","3","0","","",""
"4344636","1","4344697","","2010-12-03 10:30:53","0","6546","<p>I want to call an activity that is in another package....</p><p>Say for example I have an <code>Activity</code>(activity1) in my <code>package</code>(package1) and I need to call  another <code>Activity</code>(activity2) in another <code>package</code>(package2) from my activity1..</p><p>I have tried to import the package2 in my package1 but it did not work...Can anyone answer me and provide some sample code?</p>","505580","","1633305","","2012-11-07 06:09:52","2012-11-07 06:09:52","calling an activity that is in another package(android)","<android><activity><android-intent><package>","2","0","","",""
"4344695","1","","","2010-12-03 10:37:34","3","564","<p>My application blocks unwanted calls and accidentally it can prevent an emergency service to call back. </p><p>To solve this much critical issue I should be able to detect outgoing emergency call immediately when it just dialed and stop my call blocking activities instantly. Yes, actually I can detect outgoing call listening to phone off-hook events, but I can check if it was an emergency call only after it recorded in the CallLog. This helps a bit, but doesn't solve the issue.</p><p>Perhaps, not only a telephony application would be safer if it can detect an emergency call and suspend it's activities. We have ""onLowMemory ()"", why not to have ""onEmergencyCall()"".</p><p>Would appreciate any advice to help this problem. </p>","529250","","","","","2010-12-04 21:51:32","Emergency Call: no way to detect and help user","<android><telephony>","2","0","1","",""
"4344806","1","4346193","","2010-12-03 10:51:17","2","7436","<p>I'm currently doing a Widget in Android. It is on the market and it's free. I want to surprise the users by let them choose a picture they want to show in the widget.</p><p>Now...</p><p>If the widget is clicked, a PreferenceActivity appears. &lt;-- Works!</p><p>In this Activity the user should be able to choose a picture from the phone picture gallery. &lt;-- HOWTO?</p><p>After the User selected the prefered picture, the picture path or the drawable object should be stored in the SharedPreferences. &lt;-- Would be really nice!</p><p>Is there any solution?</p><p>Thx!</p>","527718","","527718","","2010-12-03 11:46:07","2012-09-14 18:27:14","Load an Image from the Gallery in Android","<java><android>","1","2","2","",""
"4344898","1","4345718","","2010-12-03 11:05:04","0","489","<p>I have got two location listeners in my app, GPS and Network. They work fine except sometimes while traveling, the location name (returned from Geocoding API) shows very incorrect location for a small period of time (like a continent away).</p><p>Is there a way we can validate that the returned location (from location API and Geocoding API) is valid and only then show it to the user?</p>","231849","","168868","","2013-12-06 21:58:35","2013-12-06 21:58:35","How to detect whether location is valid or not in android application?","<android><geolocation><geocoding>","1","0","","",""
"4344939","1","4345749","","2010-12-03 11:10:41","0","1270","<p>Hi i'm trying to show the menu when the user presses the menu button. I'm using the code from the <a href=""http://developer.android.com/guide/topics/ui/menus.html"" rel=""nofollow"">Documentation</a>  but the options menu won't show up. I guess i should have a listener for this menu button, but how?? This is my class so far:</p><pre><code>    public class AppMenu extends Activity { @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.about);    } @Override public boolean onCreateOptionsMenu(Menu menu) {     MenuInflater inflater = getMenuInflater();     inflater.inflate(R.menu.appmenu, menu);     return true; } @Override public boolean onOptionsItemSelected(MenuItem item) {     // Handle item selection     switch (item.getItemId()) {     case R.id.hello:         sayHello();         return true;     case R.id.bye:      finish();         return true;     default:         return super.onOptionsItemSelected(item);     } }}</code></pre><p><strong>Here is my xml file</strong></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/hello""          android:title=""Hello""           android:icon=""@drawable/icon""/&gt;    &lt;item android:id=""@+id/bye""          android:title=""Bye"" /&gt;&lt;/menu&gt;</code></pre><p>Thanks !</p>","526924","","526924","","2010-12-03 12:29:06","2010-12-03 14:10:00","menu won't show up android","<android><menu>","2","13","","",""
"4344988","1","4345112","","2010-12-03 11:18:44","1","87","<p>Is C a language that can be used on Android, BlackBerry, iPhone, Windows Mobile, and WebOS?</p>","1746300","","135850","","2013-01-22 15:34:42","2013-01-22 15:34:42","c support in mobile platforms","<iphone><android><blackberry><webos>","1","0","","2013-01-23 01:09:19",""
"4345032","1","4345084","","2010-12-03 11:23:05","2","7400","<p>im searching on google and here and i only find hard ways, that ican't understand, because i am starting on android.</p><p>I have a textfield on my app, and a button. I only want that when userpress the button, my app have to send a email with the text ""Hello"" tothe direction on the textfield.</p><p>there is a easy way to do it? </p>","479886","","","","","2010-12-03 16:29:27","How to send a simple email programatically? (exists a simple way to do it??)","<android><email>","1","0","7","",""
"4345037","1","4345206","","2010-12-03 11:23:50","0","436","<p>My server send message through c2dm serverOriginal msg: This is a string containing ?? character </p><p>But when i receive the message in my android appReceive: This+is+a+string+containing+%E4%B8%AD%E6%96%87+character </p><p>How to decode the message?</p><p>Thanks</p>","430926","","","","","2010-12-03 11:53:01","How to decode space and Chinese character","<android><decode><android-c2dm>","2","0","","",""
"4345119","1","4345384","","2010-12-03 11:33:56","8","10921","<p>i was wondering if there is a fast way to clear cache on a running Eclipse Android Emulator, apart from shutting it down and starting it after. </p><p>For the time being, caching proved to be a major drawback for me, since am new to Android and it eventually lead me to wrong conclussions about my code...</p><p>Thank you. </p>","485328","","","","","2010-12-03 12:11:34","How to clear cache on Eclipse Android Emulator","<android><caching>","1","2","2","",""
"4345228","1","4345288","","2010-12-03 11:49:27","0","89","<p>i am making a gigantic app for android, and i start doing it some moths ago for android 1.5, but now i know that some of the things i need for my app only can be done if you are programming for 1.6 api.</p><p>there is a easy, fast and safe way to migrate my app from 1.5 to 1.6 without having to lose time?</p><p>thanks</p>","479886","","","","","2010-12-03 12:37:57","How i can migrate my app from 1.5 to 1.6 api fast and safe?","<android><migration>","2","0","","",""
"4345252","1","","","2010-12-03 11:52:52","1","304","<p>i have the folowing custom adapter for a Gallery widget. everything works great except when i change screen orientation, the app crashes due to</p><pre><code> 12-03 12:45:48.897: ERROR/AndroidRuntime(3594): java.lang.OutOfMemoryError: bitmap size exceeds VM budget</code></pre><p>i know that the maximum VM budget is 16 mb. but how did i pass it? is there a way to clear the memory that is not used or on orientation change? i know there is a recycle method for bitmaps but how do i use it in my case?</p><pre><code>public class ImageAdapter extends BaseAdapter {int mGalleryItemBackground;private Context mContext;private Uri[] mUrls;String[] mFiles=null;public ImageAdapter(Context c) {    mContext = c;    readImagesFromSd();    TypedArray a = c.obtainStyledAttributes(R.styleable.Gallery1);    mGalleryItemBackground = a.getResourceId(        R.styleable.Gallery1_android_galleryItemBackground, 0);    a.recycle();  }public void readImagesFromSd(){    File images = new File(Environment.getExternalStorageDirectory().toString()+CameraView.FOLDER+""/"");     images.mkdirs();    File[] imagelist = images.listFiles();    //Toast.makeText(mContext, String.valueOf(imagelist.length), Toast.LENGTH_LONG).show();    /*new FilenameFilter() {        @Override        public boolean accept(File dir, String name) {            return ((name.endsWith("".jpg"")) || (name.endsWith("".png"")));        }    });*/    mFiles = new String[imagelist.length];    for (int i = 0; i &lt; imagelist.length; i++) {        mFiles[i] = imagelist[i].getAbsolutePath();    }    mUrls = new Uri[mFiles.length];    for (int i = 0; i &lt; mFiles.length; i++) {        mUrls[i] = Uri.parse(mFiles[i]);    }}public int getCount() {   // return mImageIds.length;    return mUrls.length;}public Object getItem(int position) {    return position;}public long getItemId(int position) {    return position;}public View getView(int position, View convertView, ViewGroup parent) {    ImageView i = new ImageView(mContext);   // i.setImageResource(mImageIds[position]);    i.setImageURI(mUrls[position]);    i.setLayoutParams(new Gallery.LayoutParams(150, 100));    i.setScaleType(ImageView.ScaleType.FIT_XY);    i.setBackgroundResource(mGalleryItemBackground);    return i;}</code></pre><p>}</p>","448192","","","","","2010-12-03 11:52:52","Application that contains gallery with images from sd card crashes onOrientation changed","<android><bitmap><gallery>","0","1","","",""
"4345279","1","4345921","","2010-12-03 11:56:52","7","15088","<p>I've got the following code to create a status bar notification:</p><pre><code>public void txtNotification(int id, String msg){    NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);    Notification notification = new Notification(android.R.drawable.sym_action_email, msg, System.currentTimeMillis());    // The PendingIntent will launch activity if the user selects this notification    Intent intent = new Intent(this, MainActivity.class)    intent.putExtra(""yourpackage.notifyId"", id);    PendingIntent contentIntent = PendingIntent.getActivity(this, 1, intent, 0);    notification.setLatestEventInfo(this, ""title"", msg, contentIntent);    manager.notify(id, notification);}</code></pre><p>When the notification is clicked, I want to call a method, preferrably with access to the id of the notification.</p><p>Thanks in advance,</p><p>Tim</p><p>(EDIT: I updated my code after reading the first answer, but I still don't know how to listen for the intent)</p>","451847","","451847","","2010-12-05 09:43:28","2014-02-12 07:15:37","Android: Click event for Status bar notification","<android><notifications>","2","2","1","",""
"4345346","1","","","2010-12-03 12:06:11","2","93","<p>I 've a web page which produces xml page.Now i need to know, how to read that xml and reproduces/show in a screen in android app</p>","","user466730","","","","2010-12-03 12:15:18","xml page retrieve in android","<android><xml><eclipse><android-emulator>","1","0","","",""
"4345400","1","4346008","","2010-12-03 12:14:23","0","3881","<p>Please Try the below code and guide me, my problem is that <strong>i am not getting the ""Pressed"" state for the TextView</strong>, is it possible to implement Pressed state for the TextView? how do i? </p><p>I am having a success using the below code for the Button but not having success for the TextView.</p><p>pls guide me</p><p>My Button and TextView code:</p><pre><code>&lt;Button     android:id=""@+id/Button01""     android:layout_width=""fill_parent""     android:layout_height=""50dp""    android:background=""@drawable/button_state""    android:padding=""20dp""&gt;&lt;/Button&gt;&lt;TextView     android:text=""Demo of Color on state change""      android:id=""@+id/TextView01""     android:layout_width=""fill_parent""     android:layout_height=""50dp""    android:background=""@drawable/button_state""    android:focusable=""true""&gt;&lt;/TextView&gt;</code></pre><p><strong><code>button_state.xml</code></strong> file (I have stored it in drawable folder):</p><pre><code>&lt;selector    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true""&gt;        &lt;shape&gt;            &lt;gradient                android:startColor=""@color/yellow1""                android:endColor=""@color/yellow2""                android:angle=""270"" /&gt;            &lt;stroke                android:width=""3dp""                android:color=""@color/grey"" /&gt;            &lt;corners                android:radius=""3dp"" /&gt;            &lt;padding                android:left=""10dp""                android:top=""10dp""                android:right=""10dp""                android:bottom=""10dp"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;    &lt;item android:state_focused=""true"" &gt;        &lt;shape&gt;            &lt;gradient                android:endColor=""@color/orange1""                android:startColor=""@color/orange2""                android:angle=""270"" /&gt;            &lt;stroke                android:width=""3dp""                android:color=""@color/grey"" /&gt;            &lt;corners                android:radius=""3dp"" /&gt;            &lt;padding                android:left=""10dp""                android:top=""10dp""                android:right=""10dp""                android:bottom=""10dp"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;    &lt;item&gt;                &lt;shape&gt;            &lt;gradient                android:endColor=""@color/blue1""                android:startColor=""@color/blue2""                android:angle=""270"" /&gt;            &lt;stroke                android:width=""3dp""                android:color=""@color/grey"" /&gt;            &lt;corners                android:radius=""3dp"" /&gt;            &lt;padding                android:left=""10dp""                android:top=""10dp""                android:right=""10dp""                android:bottom=""10dp"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;&lt;/selector&gt;</code></pre><p><strong><code>color.xml</code></strong> file:</p><pre><code>&lt;resources&gt;&lt;color name=""yellow1""&gt;#FFFF99&lt;/color&gt;&lt;color name=""yellow2""&gt;#FFCC00&lt;/color&gt;&lt;color name=""orange1""&gt;#FF9966&lt;/color&gt;&lt;color name=""orange2""&gt;#FF6600&lt;/color&gt;&lt;color name=""blue1""&gt;#99CCFF&lt;/color&gt;&lt;color name=""blue2""&gt;#0033CC&lt;/color&gt;&lt;color name=""grey""&gt;#736F6E&lt;/color&gt;&lt;/resources&gt;</code></pre>","379693","","","","","2010-12-03 13:32:07","Android - Problem whie TextView background color change on the different state of it","<android><android-textview>","1","1","2","",""
"4345403","1","4346061","","2010-12-03 12:14:48","3","2809","<p>I'm making a weather application that needs to know current location that uses to report status of weather near/around a persons phone.</p><p>It doesn't have to be more accurate than 100m maybe and quick (few seconds) in bad weather, so user doesn't get bored waiting for result.</p><p>So, how accurate and fast is androids network location provider?</p><p>Thanks!</p>","491320","","","","","2010-12-03 13:39:12","How accurate and fast is androids network location provider?","<android><geolocation>","1","2","1","",""
"4345405","1","4346048","","2010-12-03 12:15:01","9","1597","<p>I am reusing a legacy C library in an iOS app and in an Android app. I want to customize some macro definitions (e.g. for logging). Are there standard defines to check for (using #ifdef) whether the code is being compiled for iOS or Android/NDK?</p>","501976","","229745","","2010-12-03 15:36:13","2010-12-03 15:36:13","How to determine C code is compiled for Android/NDK or iOS","<android><c><ios><portability><android-ndk>","2","3","2","",""
"4345535","1","","","2010-12-03 12:31:16","2","13332","<p>I made an Application that gives me the location of my Android phone.</p><p>Now I want to make a method that helps me to retrieve the GPS location of my phone (latitude longitude or the address if possible) with an SMS.</p><p>Exemple: phone number 558899.I send an Sms with ""get location"" to 558899 an get a message back with the coordinates.</p>","519332","","213269","","2010-12-03 12:34:19","2013-04-22 21:30:18","How to retrieve the GPS location via SMS","<android><sms><gps><location><latitude-longitude>","2","5","1","",""
"4345721","1","4346246","","2010-12-03 12:56:13","0","1782","<p>In my project I have a Picture that through program, I extracted pixels, manipulate those pixels and then saved it in my package. The way that I saved it, is:</p><pre><code>private void createPicture(){    System.out.println(""Inside createPicture"");    System.out.println(contextPath);    try{        FileOutputStream fos = new FileOutputStream(contextPath + ""/"" + picName);        DataOutputStream dos = new DataOutputStream(fos);         for(int i=0; i&lt;splitedPixel.length; i++)            dos.writeByte(splitedPixel[i]);        dos.flush();        dos.close();    }    catch(IOException e){        System.out.println(""IOException : "" + e);    }    System.out.println(""Picture Created."");}</code></pre><p>so, it saves my picture in this directory</p><blockquote>  <p>/data/data/my_package_name/files/myPic.bmp</p></blockquote><p>Now, I want to read this new Picture and extract pixels of this picture. I have used this method:</p><pre><code>public Stego(Context context){    //Instantiate an ImageView and define its properties    contextPath = context.getFilesDir().getAbsolutePath();    image = BitmapFactory.decodeFile(contextPath + ""/"" + picName);    System.out.println(""Image= "" + image);    imWidth  = image.getWidth();    imHeight = image.getHeight();    getMaxMessageChars();    System.out.println(""Width: "" + imWidth);}</code></pre><p>Program crashes here. logcat  indicates that the result for the image is null and when program reaches to getWidth crashes.</p><p>are these ways for writing and reading correct?Can I go to the directory through emulator to check Whether this picture is created or not?</p><p>Thanks </p>","513413","","","","","2010-12-03 14:02:13","Android: problem in Decoding bitmap image","<android><image><bmp>","1","0","0","",""
"4345845","1","5009994","","2010-12-03 13:12:38","3","895","<p>I have created a class to handle my debug outputs so that I don't need to strip out all my log outputs before release.</p><pre><code>public class Debug {    public static void debug( String module, String message) {        if( Release.DEBUG )            Log.d(module, message);    }}</code></pre><p>After reading another question, I have learned that the contents of the if statement are not compiled if the constant Release.DEBUG is false.</p><p>What I want to know is how much overhead is generated by running this empty method? (Once the if clause is removed there is no code left in the method) Is it going to have any impact on my application? Obviously performance is a big issue when writing for mobile handsets =P</p><p>Thanks</p><p>Gary</p>","529386","","","","","2011-02-15 22:05:21","Android: How much overhead is generated by running an empty method?","<java><android><performance><overhead>","4","0","1","",""
"4345907","1","","","2010-12-03 13:19:50","1","483","<p>I'm not a programmer by trade but more of a tinkerer (noob)</p><p>I want to create a menu from titles contained in an array.I have done this successfully by looping through the array and using the value at each step of the loop as a title for my buttons/tabs.</p><p>I want to add an eventlistener to each button with a link to unique pages. I had intended to do this by checking the label of the button and if it is value A then it gets a corresponding link and so on, and then assigning it to currentLink which is then referenced by theLink[t] each time it goes through the loop.</p><p>I think I nearly have it working but just lost on the dynamically adding a link bit.</p><p>Any help would be much appreciated.</p><p>Here is my code:</p><pre><code>//function to check the label name and assign the relevant filename to be passed on    function winLink(currentTab){     if (currentTab == 'Audio'){      currentLink = 'audioPlayer.js';      pageWin.url = currentLink;     } else{      if (currentTab == 'Images'){      currentLink = 'images.js';      }     }     }//function to change button colours according to active buttonfunction button_colour(e){ if (clickedButton == ''){  clickedButton = e.source;   clickedButton.backgroundImage = tabBckImgSel; } else {  clickedButton.backgroundImage = tabBckImg;  clickedButton = e.source;   clickedButton.backgroundImage = tabBckImgSel;  }}    //Array that contains button names    var tabsArray =['Audio','Images','Video','Info','Materials','Further Reading','Map'];//loop through array and create a holder, label and eventlistener to attachfor (var t=0;t&lt;tabsArray.length;t++) { //create view to act as button/tab area viewButton[t] = Titanium.UI.createView({  borderWidth:1,  borderColor: tabBrdrColour,  width:tabWidth,  height:tabHeight,  left:leftTab + padding }); //add the tab to the main menu view/area menu.add(viewButton[t]); //increment the left position for the next button to be placed to the right of the previous button leftTab = viewButton[t].left + tabWidth; Buttonlabel[t] = Titanium.UI.createLabel({  text: tabsArray[t],  font:{fontSize:13},  color:'#fff',  width:labelWidth,  textAlign:'center',  height:'auto' }); viewButton[t].add(Buttonlabel[t]);    //pre declared variable  to hold the title of the current label currentTab = tabsArray[t];//call to function to check label and set the relevant file to load winLink(currentTab); viewButton[t].addEventListener('singletap', function(e)  {  button_colour(e);  win.add(pageWin);var theLink[t] = currentLink;  // alert (' Current link' + currentLink); });}</code></pre>","502427","","","","","2010-12-03 20:09:09","Creating a menu from and array that includes a title and a filename - Javascript/ Appcelerator","<javascript><android><appcelerator-mobile>","1","0","","",""
"4345920","1","4346035","","2010-12-03 13:21:30","14","4413","<p>Currently i am developing <strong>an application whose name is long , so i would like to display name in two line same</strong> as <strong>""Quick Calendar""</strong> and <strong>""Search People""</strong> in an attached home screen widget:</p><p>Please show me a way to implement this ?? is it possible to do so?</p><p><img src=""http://i.stack.imgur.com/9MeKh.png"" alt=""alt text""></p>","379693","","379693","","2010-12-08 12:30:49","2013-12-30 20:46:46","Application Launcher Text - Application Name in two lines","<android><android-widget>","2","0","3","",""
"4345973","1","4346387","","2010-12-03 13:27:41","4","1070","<p>I need to detect the MCC of the country in which the GSM/UMTS wireless modem is currently now.</p>","304866","","361319","","2010-12-03 14:26:30","2010-12-03 14:26:30","Get country based on GSM/UMTS network","<android>","1","2","0","",""
"4346050","1","","","2010-12-03 13:36:53","0","1548","<p>I'm trying to show a toast after a AlertDialog in my application but I don't have sucess!</p><pre><code> public class DeletePatient extends ListActivity{ private String[] listItems;    private static final int DIALOG_YES_NO_MESSAGE = 1; @Override protected void onCreate(Bundle savedInstanceState) {  // TODO Auto-generated method stub  super.onCreate(savedInstanceState);  setContentView(R.layout.deletepatient);        setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, listItems=new Patient().seePatient()));   } @Override    protected void onListItemClick(ListView l, View v, int position, long id) {      super.onListItemClick(l, v, position, id);      showDialog(DIALOG_YES_NO_MESSAGE);      }    @Override    protected Dialog onCreateDialog(int id) {        switch (id) {        case DIALOG_YES_NO_MESSAGE:            return new AlertDialog.Builder(DeletePatient.this)                .setTitle(R.string.deletepatient)                .setPositiveButton(R.string.dialog_ok, new DialogInterface.OnClickListener() {     public void onClick(DialogInterface dialog, int whichButton) {       Toast.makeText(getApplicationContext(), ""Something to display"", Toast.LENGTH_SHORT);                                        }                })                .setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int whichButton) {                    }                })                .create();        }  return null;    }}</code></pre>","529422","","244296","","2010-12-03 13:47:04","2013-08-21 20:59:11","Toast after a DialogAlert","<android><dialog>","1","1","","",""
"4346141","1","4428222","","2010-12-03 13:48:46","0","1006","<p>I'm using Eclipse-plugin to develop Android applications on mac.I've got a project and I followed the steps in 'Android Tools > Export signed Application Package' successfully, but all I end up with is a blank-icon .apk.<br>Is it supposed to look like that? I've followed the instructions from what I can tell.</p><p>And when I transfer it to a phone, it won't execute. It's just reads ""Can't use as a valid .apk-file"". For the record, the application works just fine in the emulator.Any help on this please?</p>","529436","","","","","2010-12-13 11:13:49","Android Eclipse Correct Export?","<java><android><eclipse><export><sign>","2","4","","",""
"4346146","1","","","2010-12-03 13:49:09","-2","1226","<p>I have hosted a web project in my system.I need to run the html content in Android application using WebView. I did that.My requirement is I need to get the content of the html page or Javascript inside it, in my activity.I sit possible.Please help me.</p><p>My html page contains one checkbox and some content inside <P></p>. I also have Save button. When I click the Save button I should get the content of the hidden fields inside the html page in My Activity .IS that possible. pls help me.</p>","522834","","","","","2013-12-25 19:49:33","Android: Webview and Activity","<android><webview>","1","7","1","",""
"4346228","1","4346342","","2010-12-03 13:59:15","1","499","<p>I am trying to get the date in Android using this code</p><pre><code>        final Date df = new Date();        final DateFormat dft;        dft = DateFormat.getDateInstance(DateFormat.SHORT, Locale.US);        final String  dftX = dft.format(df).toString();</code></pre><p>This works but it returns as 11/03/10 instead of 12/03/10. The emulator appears to be showing the correct date. What am I doing wrong?</p><p>Rick </p>","529458","","71034","","2010-12-03 14:03:16","2010-12-03 14:11:27","Android Emulator Returns Wrong Date","<java><android><date>","1","2","","",""
"4346365","1","4363417","","2010-12-03 14:14:09","2","2948","<p>I have built a face detection app where I get the frames from onPreviewFrame, do the face detection and then draw a circle on a canvas above my surfaceView. The problem is frames are automatically displayed using the surfaceview thread when Camera.StartPreview() is started. This is obviously necessary for the PreviewCallback to kick in. As the processing, face detection and drawing, is done in a separate thread(I am assuming here), there is a 2 second delay between the frame being displayed and the result of that frame being processed and drawn on the canvas. </p><p>What I want to do is stop the camera preview displaying the frames and display them myself after processing. I believe this has three benefits:</p><p>The delay with disappear.</p><p>I can draw straight to the bitmap instead of on a canvas which is useless as you can not undo what you have done.</p><p>It will help keep memory comsumption low by not having two threads using the same image.</p><p>I've read that it is possible to display frames from the previewCallback, does anybody know how and how to stop the frames being displayed automatically?</p><p>Many thanks in advance.</p>","514531","","514531","","2010-12-03 16:13:46","2010-12-06 05:12:14","How to manually display frames from Camera.PreviewCallback after processing, without Camera.Preview","<android><image-processing><camera>","1","0","1","",""
"4346536","1","4984076","","2010-12-03 14:33:24","1","1917","<p>I am trying to retrieve one node from a xml doc in android(java).</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt;&lt;config:Manifest xmlns:config=""http://leaflabs.com/manifest.config.xsd""&gt;   &lt;config:Text config:name=""siteowner"" config:desc=""Site owner"" config:transform=""title""/&gt;  &lt;config:Text config:name=""siteowner1"" config:desc=""Site owner"" config:transform=""title""/&gt;&lt;/config:Manifest&gt;</code></pre><p>XPATH</p><pre><code>config:Manifest/config:Text[@config:name='siteowner']</code></pre><p>I am using JAXP XPathFactory. The problem i am getting is get null back everytime.</p><p>I made sure my xpath was correct  made sure my document builder NamespaceAware is set to true and i even followed a <a href=""http://www.edankert.com/defaultnamespaces.html"" rel=""nofollow"">Example</a>(at the bottom of page) that implement the NamespaceContext but i still get nothing. </p><p>I looked at a stackoverflow Post but nobody answered the guy <a href=""http://stackoverflow.com/questions/3288892/jaxp-processing-xml-with-namespace"">Link</a></p><p>What am i doing wrong</p>","106955","","36305","","2010-12-04 00:05:10","2011-02-13 12:20:29","JAXP XPathFactory Namespaces","<java><android><xml><xpath>","3","2","","",""
"4346556","1","4346677","","2010-12-03 14:35:34","1","1164","<p>I'm developing an Android application with OpenGL ES 2.0.</p><p>I want to load an export made with Blender 2.49b in Wavefront OBJ format. I have identified verxtex position, normal and texture.</p><p>I want to use glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) to draw my mesh but I don't know how I can obtain the last parameter, indices, from a Wavefront OBJ file.</p><p>Are faces the 'indices' that I'm looking for?</p><p>I've found this on a forum:faces = indices starting with 1!</p><p>What is the meaning of 'starting with 1!'?</p><p>Thanks.</p>","68571","","","","","2010-12-03 14:55:16","Loading 'indices' from Wavefront OBJ format","<android><wavefront><opengl-es-2.0>","1","0","","",""
"4346643","1","4346730","","2010-12-03 14:45:49","1","167","<p>I am creating an android project from an existing source, The android project is a third party project that runs on every other machine but mine. The behavior, at the New Android Project creation wizard, it says Build Target BUT doesn't give any targets to build. How can I get the android sdks in the build target menu so i can open and run this project?</p>","525672","","3050","","2010-12-03 14:52:35","2010-12-03 14:55:45","Eclipse IDE build target question","<java><android><eclipse>","1","0","","",""
"4346698","1","4490825","","2010-12-03 14:52:08","1","791","<p>I have noticed that some Android applications adds a new Wallpaper-gallery to the ""Wallpaper-chooser"".</p><p>I am currently building a theme for Android and I would like to add some wallpapers with this feature.</p><p>How is it done?</p>","336150","","","","","2010-12-20 15:02:46","How to add a wallpaper-gallery to an Android application","<android><gallery><wallpaper>","1","0","1","",""
"4346710","1","4348228","","2010-12-03 14:53:45","3","3406","<p>I am trying to create a bitmap from a View that is not displayed yet to set it as a texture with OpenGL in android.The problem is that when I create my bitmap the layout parameters of my View have 0 value cause the onLayout() function has not been called yet.Is there a way to ""simulate"" a layout or do a ""background layout"" to get the right layout params ?I was thinking about a Frame layout having two views, the background one would be used to create my bitmap as the layout would have been done.</p><p>Thanks.</p>","520469","","206599","","2011-04-21 21:27:05","2011-04-21 21:27:05","Bitmap from View not displayed on Android","<android><layout><bitmap>","2","0","3","",""
"4346718","1","4346805","","2010-12-03 14:54:47","1","1595","<p>I have no idea why this behaviour is occuring, but I'll try and explain...</p><p>I would like to have a different image used in an application for a normal hdpi device, as I would for a large screen ('large' by android standards is over 5"" I believe) hpdi device.</p><p>As of such, I created this folder structure</p><pre><code>res   --&gt;    drawable-hdpi    drawable-hdpi-large</code></pre><p>.. And it was all good, no errors, things seemed fine. So I added my first image to the hdpi folder as per this:</p><pre><code>res   --&gt;    drawable-hdpi                --&gt;                  image.png    drawable-hdpi-large</code></pre><p>... And everything was fine, good. So I added my alternative image to the large hdpi folder like this:</p><pre><code>res   --&gt;    drawable-hdpi                --&gt;                  image.png    drawable-hdpi-large // Error 'cross icon' appear on this folder.                --&gt;                  image.png</code></pre><p>... And it breaks. There is no error text in any of the console out puts. Validate doesn't come up with any errors. Nothing. Just stops compiling the R class as per other resource errors.</p><p>So why does this happen? I've used folders for localisation before, with a layout and layout-large folder for the large devices to use and I didn't get this. Is there something special about drawable localisation, that isn't mentioned in the docs?</p><p>I've lost track of just how many bugs, in-consistencies and just plain annoyances I've found with android. Really is trying my patience!</p><p>Anyway, any help would be much appreciated! :)</p><p>Andy. </p>","187100","","","","","2010-12-03 15:04:17","Error in resource folder - Android / Eclipse","<android><resources>","1","0","","",""
"4346748","1","4346882","","2010-12-03 14:57:33","1","2193","<p>I've created an Android application which requires the user to register his username and password. My question is, how can I insert the input values(textbox) into my SQLite database?</p><p>Thanks in advance.</p>","516160","","","","","2010-12-03 15:25:39","Inserting values from a textbox into SQLite database","<android><eclipse><sqlite><android-emulator><database-connection>","1","2","","",""
"4346924","1","","","2010-12-03 15:19:08","2","24680","<p>I need to find a way to convert jar file to apk file. I have reached a road block!</p>","526792","","","","","2012-02-27 16:17:09","How can I convert a jar file into apk format?","<java><android><jar><apk>","4","1","0","",""
"4346992","1","4347860","","2010-12-03 15:27:29","2","812","<p>Hey, I've got my database connection setup in an Android Application but LogCat keep's telling me about a SQLite leak.</p><pre><code>12-03 15:07:23.169: ERROR/Database(2509): Leak found12-03 15:07:23.169: ERROR/Database(2509): java.lang.IllegalStateException: /data/data/com.domain/databases/db.db SQLiteDatabase created and never closed12-03 15:07:23.169: ERROR/Database(2509):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1784)12-03 15:07:23.169: ERROR/Database(2509):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:804)12-03 15:07:23.169: ERROR/Database(2509):     at com.domain.DatabaseConnection.openDataBase(DatabaseConnection.java:118)12-03 15:07:23.169: ERROR/Database(2509):     at com.domain.global.ZonesLoaded.InitZones(ZonesLoaded.java:32)12-03 15:07:23.169: ERROR/Database(2509):     at com.domain.ZoneActivity.onCreate(ZoneActivity.java:34)12-03 15:07:23.169: ERROR/Database(2509):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-03 15:07:23.169: ERROR/Database(2509):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)12-03 15:07:23.169: ERROR/Database(2509):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:2411)12-03 15:07:23.169: ERROR/Database(2509):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)12-03 15:07:23.169: ERROR/Database(2509):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)12-03 15:07:23.169: ERROR/Database(2509):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:648)12-03 15:07:23.169: ERROR/Database(2509):     at android.widget.TabHost.setCurrentTab(TabHost.java:320)etc...</code></pre><p>After reading other posts <a href=""http://stackoverflow.com/questions/4123749/android-sqlite-database-leak-found"">like here</a> or <a href=""http://stackoverflow.com/questions/2280345/sqlite-database-leak-found-exception-in-android"">here</a>, it would suggest that I wasn't implementing the <code>close</code> method in my DBAdapter class. However I did create this:</p><pre><code>public synchronized void close(){    if(myDatabase != null)        myDatabase.close();    super.close();}</code></pre><p>I'm starting to wonder if it is down to how I'm using the database adapter, although I just tested my app on a much faster device (Samsung Galaxy S) and this worked with no problems whatsoever! Does anyone have any tips here?</p><p>Thanks</p>","143979","","135152","","2011-05-25 03:05:53","2011-05-25 03:05:53","Android SQLite leak problems","<android><sqlite><memory-leaks>","1","3","1","",""
"4347128","1","","","2010-12-03 15:41:22","0","1020","<p>I am using the custome view class below and I want to change the ImageView icon when someone selects a view in my list in onListItemClick. How do I get the view? In my OnCreate, I have </p><pre><code>    iconicAdapter = new IconicAdapter();    setListAdapter(iconicAdapter);</code></pre><p>Then in my custom view class, I have</p><pre><code>class IconicAdapter extends ArrayAdapter {IconicAdapter() {    super(myApp.this, R.layout.row, title_list);}public View getView(int position, View convertView, ViewGroup parent) {    LayoutInflater inflater=getLayoutInflater();    View row=inflater.inflate(R.layout.row, parent, false);    TextView title=(TextView)row.findViewById(R.id.list_title);    title.setText(title_list.get(position).toString());    ImageView icon=(ImageView)row.findViewById(R.id.icon);    return(row);}</code></pre><p>}</p><p>What do I need in the method below to access the correct ImageView icon in my custom view class? Or should I access it a different way?</p><pre><code>public void onListItemClick(ListView parent, View v, int position, long id) {}</code></pre>","482619","","","","","2010-12-03 16:13:27","Need to change an ImageView in custom ArrayAdapter class","<android><listview><sdk>","1","0","","",""
"4347143","1","8379343","","2010-12-03 15:42:53","14","16148","<p>I find it very hard to get any consolidating information about which Android phones do have a gyroscope, or if there are Android phones with this sensor at all. I read about some (especially Samsung) phone models that have at least a 6-axis accelerometer, but I also read that this is different to a real gyroscope.</p><p>So my questions are:</p><ol><li>Which Android phones do have a gyroscope? (Should be usable with the Android API's <a href=""http://developer.android.com/reference/android/hardware/Sensor.html#TYPE_GYROSCOPE""><code>Sensor.TYPE_GYROSCOPE</code></a> which is available since API 3)</li><li>Which Android phones do have a 6-axis accelerometer?</li></ol><p>Any references like links, specs etc. are greatly appreciated and of course will be rewarded. :-)</p><p>Thanks for your help!</p>","446461","","","","","2013-01-26 08:53:39","Which Android phones out there do have a gyroscope?","<android><hardware><accelerometer><sensor>","2","1","8","2012-06-22 16:31:09",""
"4347326","1","4348481","","2010-12-03 16:00:45","1","11471","<p>I'd like to use a high detail image as backrgound in my app, and I've got a problem with my designer because of this :-D</p><p>By now, we've got three image sizes (one per density) according to the most common devices' screen size, as we know:</p><ul><li>low: 240 x 320 (e. HTC Tattoo)</li><li>mid:320 x 480 (e. HTC Magic)</li><li>high: 480 x 800 (e. Nexus One)</li></ul><p>The problem is that, when I set an image as background, it gets resized, and I can see several horizontal ""ghost"" lines on it. </p><p>So we decided to resize the images with ""height-minus-statusbar's height"" (only in high-density one, just as test), having finally a 480 + 752 px image (according to <a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design.html"" rel=""nofollow"">http://developer.android.com/guide/practices/ui_guidelines/icon_design.html</a> , the status bar's height is 48px)</p><p>But it still shows those ""ghost"" lines, so we think it's being resized again...</p><p>Could someone help me? I just want a normal background, with no resizing, but I don't know the real dimensions...</p><p>Thank you :-D</p>","453981","","","","","2011-04-04 16:38:38","Real background image size in android (with status bar)","<android><background><statusbar>","3","0","","",""
"4347411","1","4348208","","2010-12-03 16:08:24","4","4139","<p>I have a series of views in a vertical LinearLayout.  Each view generates and draws a Bitmap, when scrolled to.  For performance reasons, I would rather not generate the Bitmap each time onDraw() is called, but for memory reasons I can not keep hard references to the Bitmaps.  I could use advice on the strategy that I should take.</p><p>I already tried the obvious route of: generating the Bitmap, and then wrapping it with a SoftReference.  This failed for two reasons.  1.  The references get collected far more eagerly than I would expect.  2. I still get OOMs!  Which is shocking, because no Bitmap is particularly large, so a single view should not cause the OOM, making me assume that the OOM occurs because the offending SoftReference(s) had not been given a chance to be freed.  Also, the OOM occurs when my application is has an allocated heap size of 6mb (according to DDMS view), I would expect it to grow to 16mb before throwing OOM.</p><p>Any advice? </p>","426493","","","","","2010-12-03 17:34:18","Android: Bitmaps, SoftReferences, and OOMs?","<android><memory-management><bitmap><heap><soft-references>","1","4","6","",""
"4347444","1","4347561","","2010-12-03 16:12:07","2","2459","<p>I'm trying the Facebook Android SDK, but I don't know where to insert my API-key.</p><p>The error I get when trying to log in using the Example-app is: <br><code>""Login Failed: android_key_not_configured""</code> <br>where do I find this?</p>","523053","","222159","","2010-12-03 16:14:28","2010-12-03 16:23:02","Using Facebook Android SDK (API-key)","<android><facebook>","1","0","","",""
"4347462","1","4347513","","2010-12-03 16:14:07","9","3959","<p>I tried to convert all my buttons background to .9.png, but I have a problem with Eclipse.</p><p>I created my nine patch .png with the tool, but since I put it in my /res/drawable folder, I have the following errors in all my .xml files when I try to access any resource starting with @drawable:</p><pre><code>Error: No resource found that matches the given name (at 'drawable' with value '@drawable/my_resource').</code></pre><p>Here is my .9.png:<img src=""http://i.stack.imgur.com/HDxNq.png"" alt=""nine patch""></p><p>And here is a screenshot:<img src=""http://i.stack.imgur.com/Dpo3x.png"" alt=""screenshot""></p><p>Is there a problem in my .9.png or is it a problem with eclipse?</p><p>Thanks</p>","488054","","","","","2013-02-19 18:08:56","Eclipse bug with nine patch files?","<android><eclipse><resources><nine-patch>","5","2","3","",""
"4347507","1","4786455","","2010-12-03 16:18:09","3","2598","<p>I am running into a annoying problem with HTC Legend (Android 2.2). Not seeing this issue on Xperia, Galaxy, Nexus, etc.</p><p>When I launch my app on a 3G connection, fetch some data, then go into phone Settings and enable WIFI, the phone automatically obtains a WIFI connection which is favoured over 3G. The trouble is, once i switch back to the app, it appears to have lost all network connectivty and unable to connect to anything. However, other apps, like Web Browser for example, have no problem using the new Wifi connection. Ping works fine from the phone's shell.</p><p>If I wait long enough, (e.g. 15 minutes), the network stack seems to repair itself automatically and my app is able to make network connections once again. Of course, this delay is unacceptable.</p><p>Is there a way to re-init the network stack programmatically? I create a new java.net.HttpURLConnection each time, yet it still times out once the WIFI has been acquired.</p><p>Thanks</p><p>Code:</p><pre><code>byte[] response = null;    HttpURLConnection connection = null;    int responseCode = -1;    // check the cache first    String readyResponse = ResponseCache.getInstance().get(getUrl());    if (readyResponse != null) {        Log.d(LOG_TAG, ""Returning CACHED server response for "" + getUrl());        return readyResponse.getBytes();    }    try {        URL url = new URL(getUrl());        Log.i(LOG_TAG, ""Sending Request: "" + url.toExternalForm());        connection = (HttpURLConnection) url.openConnection();        connection.setUseCaches(false);        connection.setDoOutput(true);         connection.setDoInput(true);        connection.setConnectTimeout(ApplicationConfiguration.HTTP_CONNECT_TIMEOUT);        connection.setReadTimeout(ApplicationConfiguration.HTTP_READ_TIMEOUT);        if (BuildType.getHTTPMethod() == BuildType.METHOD_GET)        {            connection.setRequestMethod(""GET"");        }        else        {            connection.setRequestMethod(""POST"");            connection.setRequestProperty(""Content-Type"", ""application/x-www-form-urlencoded"");            String body = getParameters();            connection.setRequestProperty(""Content-Length"", Integer.toString(body.length()));            OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());            wr.write(getParameters());            wr.flush();         }        connection.connect();        responseCode = connection.getResponseCode();</code></pre><p>And stacktrace</p><pre><code>E/xxx.yyy.zzz(  927): java.net.SocketTimeoutException: Read timed outE/xxx.yyy.zzz(  927):  at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeread(Native Method)E/xxx.yyy.zzz(  927):  at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.access$200(OpenSSLSocketImpl.java:55)E/xxx.yyy.zzz(  927):  at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:532)E/xxx.yyy.zzz(  927):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.readln(HttpURLConnectionImpl.java:1279)E/xxx.yyy.zzz(  927):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.readServerResponse(HttpURLConnectionImpl.java:1351)E/xxx.yyy.zzz(  927):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.sendRequest(HttpURLConnectionImpl.java:1339)E/xxx.yyy.zzz(  927):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.doRequestInternal(HttpURLConnectionImpl.java:1656)E/xxx.yyy.zzz(  927):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.doRequest(HttpURLConnectionImpl.java:1649)E/xxx.yyy.zzz(  927):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:1374)E/xxx.yyy.zzz(  927):  at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:117)E/xxx.yyy.zzz(  927):  at xxx.yyy.zzz.executeRequest(zzz.java:95)</code></pre>","450741","","","","","2012-11-14 00:31:48","Android: 3G to WIFI switch while in the middle on the app = loss of network connectivity","<android><networking><wifi><3g><loss>","2","0","1","",""
"4347711","1","","","2010-12-03 16:36:41","10","13945","<p>I would like to show progress bar (in form of rotating circle or something similar) when loading image from remote location.</p><p>I don't want standard ProgressBar that gets shown in the middle of the screen. I would like to have it in the middle of the imageView (or Layout that holds ImageView). Is there easy way to do this? For example, do I have option to attach progressBar to some View?</p><p>I was reading about FrameAnimation. I think I will do that, but first I want to make sure that I am not reinventing the wheel.</p><p>Thanks.</p>","507153","","","","","2010-12-03 16:51:39","How to display load progress animation for some image?","<android><animation><image-processing><progress-bar>","2","1","6","",""
"4347715","1","","","2010-12-03 16:36:48","2","293","<p>I found a short tutorial describing how to use png's as custom designed numbers. However, I can't get it to work properly. The method <strong>intToImage()</strong> translates the number to the image, but I can't get it to show the clock using the images.</p><p>This is my code:</p><pre><code>    public static final class UpdateService extends Service {   static final String ACTION_UPDATE = ""android.tristan.widget.digiclock.action.UPDATE"";    private final static IntentFilter sIntentFilter;    private final static String FORMAT_12_HOURS = ""h:mm"";    private final static String FORMAT_24_HOURS = ""kk:mm"";    private String mTimeFormat;    private String mDateFormat;    private String mDayFormat;    private Calendar mCalendar;    static {        sIntentFilter = new IntentFilter();        sIntentFilter.addAction(Intent.ACTION_TIME_TICK);        sIntentFilter.addAction(Intent.ACTION_TIMEZONE_CHANGED);        sIntentFilter.addAction(Intent.ACTION_TIME_CHANGED);    }    @Override    public void onCreate() {        super.onCreate();        reinit();        registerReceiver(mTimeChangedReceiver, sIntentFilter);     }    @Override    public void onDestroy() {        super.onDestroy();        unregisterReceiver(mTimeChangedReceiver);    }    @Override    public void onStart(Intent intent, int startId) {        super.onStart(intent, startId);        if (ACTION_UPDATE.equals(intent.getAction())) {            update();        }    }    @Override    public IBinder onBind(Intent intent) {        return null;    }    private void update() {        mCalendar.setTimeInMillis(System.currentTimeMillis());        final CharSequence time = DateFormat.format(mTimeFormat, mCalendar);        final CharSequence date = DateFormat.format(mDateFormat, mCalendar);        final CharSequence day = DateFormat.format(mDayFormat, mCalendar);        RemoteViews views = new RemoteViews(getPackageName(), R.layout.main);              views.setTextViewText(R.id.Time, time);        views.setTextViewText(R.id.Day, day);        views.setTextViewText(R.id.Date, date);        **RemoteViews Timeview = new RemoteViews(getPackageName(), R.id.Timeview);        intToImage(context, time, 0, Timeview);**        ComponentName widget = new ComponentName(this, DigiClock.class);        AppWidgetManager manager = AppWidgetManager.getInstance(this);        manager.updateAppWidget(widget, views);    }    **        private void intToImage(Context context, int numberInt, int where, RemoteViews remoteView) {         if (numberInt &lt; 0 || numberInt &gt; 9) {            Log.d(""Tutorial"", ""Invalid number"" + numberInt);    }           else {            int whereArray[] = { R.id.Timeview }; // viewId            int images[] = { R.drawable.zero, R.drawable.one, R.drawable.two,                            R.drawable.three, R.drawable.four, R.drawable.five,                            R.drawable.six, R.drawable.seven, R.drawable.eight,                            R.drawable.nine }; // srcId            remoteView.setImageViewResource(whereArray[where], images[numberInt]);    }}**    private void reinit() {        mDayFormat = getString(R.string.day_format);        mDateFormat = getString(R.string.date_format);        mTimeFormat = is24HourMode(this) ? FORMAT_24_HOURS : FORMAT_12_HOURS;        mCalendar = Calendar.getInstance();    }    private static boolean is24HourMode(final Context context) {        return android.text.format.DateFormat.is24HourFormat(context);    }    private final BroadcastReceiver mTimeChangedReceiver = new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            final String action = intent.getAction();            if (action.equals(Intent.ACTION_TIME_CHANGED) ||                action.equals(Intent.ACTION_TIMEZONE_CHANGED))            {                reinit();            }            update();        }    }; } }</code></pre><p>It throws this <strong>error</strong>: <strong>context cannot be resolved</strong>.</p><p>I know that's because it's not been declared in <strong>update()</strong>, but how would I accomplish this? </p>","525720","","2271143","","2013-05-30 00:22:28","2013-05-30 00:22:28","how to use custom designed numbers in a widget","<android><numbers><widget>","0","1","","",""
"4347729","1","","","2010-12-03 16:38:51","0","1359","<p>I have successfully installed the Eclipse, and Android SDK to my Mac.  However when I run the program using the code below.  It always gives me the error.  ""Sorry! The application Hello, Harris(process com.example.helloandroid) has stopped unexpectedly. Please try again.</p><pre><code>//package com.example.helloandroid;import com.example.helloandroid.R;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, Harris Family."");        setContentView(tv);    }}</code></pre>","529614","","390989","","2010-12-03 16:47:01","2013-05-14 00:52:28","My Android Hello World Application will not execute or display?","<android>","3","2","","",""
"4347910","1","4348189","","2010-12-03 16:58:55","1","1674","<p>I am trying to debug a problem I am having with ExpandableListAdapter.getChildView.  </p><p>I have defined a Drawable with a shape containing a gradient and a corner with a radius of 1 for the background of the list item - nothing special there.</p><p>Then, in my adapter code, I have this snippet within getChildView:</p><pre><code>GradientDrawable background = (GradientDrawable) convertView.getBackground();float topRadius = 0;float bottomRadius = 0;// Make the corner radius obvious for debugging             if (childPosition == 0)    topRadius = 14;if (childPosition == (mValues.size() - 1))    bottomRadius = 14;background.setCornerRadii(new float [] { topRadius, topRadius,                                          topRadius, topRadius,                                           bottomRadius, bottomRadius,                                          bottomRadius, bottomRadius});convertView.setBackgroundDrawable(background);</code></pre><p>The attempt here is to round the top of the first list item, and the bottom of the last list item.  Via debugging, it would appear that I am setting the values I want for the items that I want.</p><p>However, the problem I'm having is that the corner radii are being set for all list items as if it were the bottom item.</p><p>As a slight aside, is there a way to get the corner radii of the GradientDrawable, at least for debugging purposes?</p><p>Thanks,<br />wTs</p>","285417","","","","","2010-12-03 18:47:38","Android GradientDrawable - Corner Radii issue","<android><expandablelistadapter><cornerradius>","2","4","","",""
"4347924","1","4348379","","2010-12-03 17:00:35","30","33576","<p>I'm very sorry to be asking you but I can't figure out how to get the Key Hash required to use the Facebook Android SDK. I am very new at this and figured out that i can use keytool with these commands:</p><blockquote>  <p>keytool -exportcert -alias [alias]  -keystore [keystore] | openssl sha1 -binary | openssl enc -a -e</p></blockquote><p>The only problem is that I have no idea where to insert this, i tried through command windows (win7) and I tried opening the file keytool.exe. Again, this is probably really simple and I just cant find any information made dumb enough for me about this.</p><p>Could you reach out your hand?</p>","523053","","","","","2014-03-23 06:27:02","Key hash for Facebook Android SDK","<java><android><keystore><keytool>","6","0","16","",""
"4347950","1","4350149","","2010-12-03 17:02:32","10","7338","<p>I have an <code>alarmManager</code> which I am using to send notifications to the user at specific times.  Since there are multiple alarms, I have multiple pending intents that I am creating and giving a unique ID, However there are certain situations in which I will need to get all the pending intents and then cancel them, so I can reset the alarms.  I have tried doing his and I still cant seem to get it right so I have a couple questions:</p><p>Is this how you would correctly get and cancel a <code>PendingIntent</code>?</p><pre><code>Intent intent = new Intent(con, AppointmentNotificationReciever.class);PendingIntent sender = PendingIntent.getBroadcast(con, id, intent,        PendingIntent.FLAG_CANCEL_CURRENT);AlarmManager am = (AlarmManager) con.getSystemService(Context.ALARM_SERVICE);am.cancel(sender);</code></pre><p>Does the intent need to exactly match that of the original pending intent(extras and all)?</p><p>Does the <code>PendingIntent</code> flag need to match that of the original pending intent?</p>","408079","","707111","","2013-05-26 13:55:33","2013-05-26 13:55:33","How to get and cancel a PendingIntent?","<android><android-intent><alarmmanager><android-pendingintent>","1","1","","",""
"4348022","1","4348307","","2010-12-03 17:11:35","1","392","<p>Well I have made a custom Android UI, and I need my UI view to handle this control.</p><blockquote>  <p>a) While my mouse button is pressed (onDown / Key pressed) , the view should keep doing a thing (For example : Key is down)</p>    <p>b) As soon as i release my mouse key , the view should say (example: Key is up).</p></blockquote><p>The Sample Flow should be something like when I press the view.</p><p>Output: (<em>I press mouse button on the view and hold it</em>)</p><blockquote>  <p>Key is down</p>    <p>Key is down</p>    <p>Key is down</p>    <p>Key is down</p>    <p>Key is down</p>    <p>Key is down</p></blockquote><p>(<em>I now release mouse button</em>)</p><blockquote>  <p>Key is up.</p></blockquote><p>To more explain my problem . I am posting a code snippet where the logic should go</p><pre><code>@Overridepublic boolean onTouchEvent(MotionEvent event) {    Log.d(TAG, event.getAction());}</code></pre><p><strong>When I press my mouse button , it prints ""0"" (meaning mouse is down), while if i leave it , it prints on the log ""1"", meaning mouse is up. That should help with the logic.</strong></p><p>Thanks for helping.</p><hr><p>Well I have tried something like </p><pre><code>private static int checkValue = 0;@Overridepublic boolean onTouchEvent(MotionEvent event) {    checkValue = event.getAction();    while (checkValue == 0 ){    Log.d(TAG, ""Pressed"");    checkValue = checkMethod(event.getAction);}    private int checkMethod(int test){    if (checkValue == 0){      checkValue = 0;      }    else checkValue = 1;}</code></pre>","435597","","492364","","2010-12-03 17:36:45","2010-12-10 03:14:31","How to do keypress checking and UI action maintainence?","<java><android><logic><gesturedetector>","4","3","","",""
"4348032","1","4352073","","2010-12-03 17:12:29","7","8893","<p>two Bars which shows the progress of a game. If the user get points or time is up etc the progressBars should be updated:</p><pre><code>private TextView tv;private ProgressBar levelHoldBar;private ProgressBar levelUpBar;//...private void updateViews() {    // ...    levelHoldBar.setMax(currentLevel.getThreshold());    levelHoldBar.setProgress(currentPoints &gt; currentLevel.getThreshold() ? currentLevel.getThreshold() : currentPoints);    levelUpBar.setMax(nextLevel.getThreshold());    levelUpBar.setProgress(currentPoints &gt; nextLevel.getThreshold() ? nextLevel.getThreshold() : currentPoints);    tv.setText(currentPoints+""/""+currentLevel.getThreshold());    Log.d(TAG, ""hold prog/max ""+levelHoldBar.getProgress()+""/""+levelHoldBar.getMax());    Log.d(TAG, ""up   prog/max ""+levelUpBar.getProgress()+""/""+levelUpBar.getMax());}</code></pre><p>ie. Outputs:</p><pre><code>12-03 17:48:33.918: DEBUG/MainActivity(6829): hold prog/max 20/2012-03 17:48:33.918: DEBUG/MainActivity(6829): up   prog/max 20/50</code></pre><p>The Log.d(...) in the end shows <strong>ALWAYS</strong> the correct values, but <strong>SOMETIMES</strong> the visual bars of the progressBars do not show the correct progesses. They show progresses that had been set previously even if the getters for ""max"" and ""progress"" return correct values (in the example the bar shows about 20% (instead of 100%) for the levelHoldBar and about 2% (instead of 40%) for the levelUp-bar). I cannot figure out, why the log-output is correct but the drawables are wrong!? The TextView (tv) is updated correctly! Whats going on here? How can I fix that?</p>","386201","","","","","2013-11-21 06:06:12","android progressBar does not update progress view/drawable","<android><progress-bar>","4","6","2","",""
"4348039","1","4349095","","2010-12-03 17:13:02","2","2496","<p>I have made a few simple apps on android, and thought it was time for something a bit more complex. So, i thought I'd try something that's already out there, but build it from scratch.<br /><br />The idea is to create an app that allows user to play piano by pressing virtual keys on the display. But I'm not sure how to go about synthesizing the sound of each note, is it best to have copies of of each note stored on file, or is there a more dynamic way of synthesising notes and chords on the fly.<br /><br />I have worked with C++ so NDK stuff is also okay.Thanks for any help.</p>","482994","","482994","","2010-12-03 18:11:15","2010-12-03 19:22:07","How to synthesize piano sounds in android/java","<java><android><audio><synthesis>","2","2","3","",""
"4348128","1","4348532","","2010-12-03 17:26:34","0","1349","<p>I am creating just a simple android app which will respond to received.I am using braodcastreceiver to receive sms.Code for activity is </p><pre><code>package com.om;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;import android.telephony.SmsManager;import android.telephony.SmsMessage;public class MyTest extends Activity {  public static final String SMS_RECEIVED = ""android.provider.Telephony.SMS_RECEIVED"";  /** Called when the activity is first created. */  BroadcastReceiver smsReceiver = new BroadcastReceiver() {    @Override    public void onReceive(Context _context, Intent _intent) {      System.out.println(""SMS Received"");    }  };  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);      setContentView(R.layout.main);      IntentFilter filter = new IntentFilter(SMS_RECEIVED);      registerReceiver(smsReceiver, filter);  }}</code></pre><p>When I run this activity on SDK 2.1 AVD and sends SMS to that port it says Force close.Please tell me what is error in code.Thanks in advance.</p>","529664","","180538","","2010-12-03 18:50:07","2010-12-03 18:58:26","BroadCastReceiver Force Close For Sms receive","<android><broadcastreceiver>","2","2","","",""
"4348146","1","4348252","","2010-12-03 17:28:26","0","231","<p>How do i make some code run when exactly 4 digits/letters have been entered in a edittext?</p>","484146","","","","","2010-12-03 17:39:49","How to run code when exactly 4 digits/letters have been entered in a edittext","<android><edittext>","1","2","","",""
"4348296","1","","","2010-12-03 17:45:49","0","2075","<p>this is is the code i have but everytime i click on the contact it force closes. and is there a code so that when i get the contact it adds it into a text view?</p><p>public static final String TAG = ""ContactManager"";</p><pre><code>private Button mAddAccountButton;private ListView mContactList;private boolean mShowInvisible;private CheckBox mShowInvisibleControl;/** * Called when the activity is first created. Responsible for initializing the UI. */@Overridepublic void onCreate(Bundle savedInstanceState){    Log.v(TAG, ""Activity State: onCreate()"");    super.onCreate(savedInstanceState);    setContentView(R.layout.main2);    // Obtain handles to UI objects    mAddAccountButton = (Button) findViewById(R.id.AddContact);    mContactList = (ListView) findViewById(R.id.ContactList);    mShowInvisibleControl = (CheckBox) findViewById(R.id.ShowInvisible);    // Initialize class properties    mShowInvisible = false;    mShowInvisibleControl.setChecked(mShowInvisible);    // Register handler for UI elements    mAddAccountButton.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            Log.d(TAG, ""mAddAccountButton clicked"");            launchContactAdder();        }    });    mShowInvisibleControl.setOnCheckedChangeListener(new OnCheckedChangeListener() {        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {            Log.d(TAG, ""mShowInvisibleControl changed: "" + isChecked);            mShowInvisible = isChecked;            populateContactList();        }    });    // Populate the contact list    populateContactList();}/** * Populate the contact list based on account currently selected in the account spinner. */private void populateContactList() {    // Build adapter with contact entries    Cursor cursor = getContacts();    String[] fields = new String[] {            ContactsContract.Data.DISPLAY_NAME    };    SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.main, cursor,            fields, new int[] {R.id.TextView01});    mContactList.setAdapter(adapter);}/** * Obtains the contact list for the currently selected account. * * @return A cursor for for accessing the contact list. */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 + "" = '"" +            (mShowInvisible ? ""0"" : ""1"") + ""'"";    String[] selectionArgs = null;    String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + "" COLLATE LOCALIZED ASC"";    return managedQuery(uri, projection, selection, selectionArgs, sortOrder);}/** * Launches the ContactAdder activity to add a new contact to the selected account. */protected void launchContactAdder() {    Intent i = new Intent(this,Class1.class);    startActivity(i);}</code></pre><p>}</p>","424421","","","","","2010-12-03 18:45:58","how to get contact number into Text view?","<android><android-sdk-2.2><android-contacts>","1","2","","",""
"4348438","1","4348491","","2010-12-03 18:03:07","4","10826","<p>Is there a way to check if a Thread object has had start called on it already?  </p><p>I'm trying to so something like:</p><pre><code>if(rt.isAlive() == true){    Log.v(TAG, ""START RECORD"");    rt.recording = true;}else{    Log.v(TAG, ""START THREAD/RECORD"");    rt.start();}</code></pre><p>where it would start the thread if it's not already running.</p>","235708","","235708","","2010-12-03 18:13:52","2014-03-17 14:01:51","How to check if an Android Thread is running","<java><android><multithreading>","3","0","1","",""
"4348509","1","4349046","","2010-12-03 18:14:30","1","849","<p>The idea is when there is no internet connection available, show my custom dialog to users which indicates there is no connection. Otherwise, when page is loading in WebView, show a ProgressDialog to show that page is loading and dismiss when loading is done. When there is an internet connection this code works, but if there is no, it crashes and I can't find where the error is.</p><pre><code>package com.tariknotebook;import android.app.Activity;import android.app.Dialog;import android.app.ProgressDialog;import android.content.Context;import android.graphics.Bitmap;import android.net.ConnectivityManager;import android.net.NetworkInfo;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.Button;public class NoteBook extends Activity {    /** Called when the activity is first created. */    WebView web;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        web = (WebView) findViewById(R.id.browserMine);        web.setWebViewClient(new HelloWebViewClient());        web.getSettings().setJavaScriptEnabled(true);    }    @Override    protected void onStart() {        // TODO Auto-generated method stub        super.onStart();        web.loadUrl(""http://m.seslisozluk.com"");    }    ProgressDialog dialog;    Dialog connDialog;    @Override    protected Dialog onCreateDialog(int id) {        switch(id)        {        case 1:            dialog = ProgressDialog.show(NoteBook.this, ""Loading"",            ""Loading.. Please wait."");            break;        case 2:                connDialog = new Dialog(getApplicationContext());                connDialog.setContentView(R.layout.connection);                connDialog.setTitle(""No Internet Connection"");                Button closeButton = (Button) findViewById(R.id.closeButton);                closeButton.setOnClickListener(new closeButtonOnClickListener());                connDialog.show();            break;        }        return super.onCreateDialog(id);    }    private class closeButtonOnClickListener implements OnClickListener    {        public void onClick(View v) {            connDialog.dismiss();        };    }    private class HelloWebViewClient extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return true;        }        @Override        public void onPageStarted(WebView view, String url, Bitmap favicon) {            // TODO Auto-generated method stub            super.onPageStarted(view, url, favicon);                ConnectivityManager conStatus = (ConnectivityManager) view.getContext().getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);                if(conStatus.getActiveNetworkInfo().isConnected() &amp;&amp; conStatus.getActiveNetworkInfo() != null)                    showDialog(1);                else                    showDialog(2);        }        @Override        public void onPageFinished(WebView view, String url) {            // TODO Auto-generated method stub            super.onPageFinished(view, url);            dialog.dismiss();        }    }}</code></pre><p>And this is the error log as well :</p><p><img src=""http://i.stack.imgur.com/j4KTk.jpg"" alt=""error log""></p>","44852","","","","","2010-12-03 19:15:35","Error when checking Internet Connection in Android","<java><android><webview>","1","1","","",""
"4348537","1","4349504","","2010-12-03 18:18:13","2","1037","<p>I have the following scenario:</p><p>I have a chat activity, in it's intent it gets the email of the contact for which to show the messages, the activity has singleTop as it's launchmode</p><p>By sliding my finger over the screen I switch between different conversations, I do this by calling startActivity with the new intent: onPause will be called, followed by onNewIntent, in which I do setIntent, followed by onResume. In onResume I get the new intent, all good so far.</p><p>Then I change the orientation: onPause is called, followed by onDestroy, at this point getIntent returns the correct intent, followed by onCreate which has the old intent, followed by onResume, which also has the old intent</p><p>I've found this -> <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/7f0389f349e1ee3b"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/7f0389f349e1ee3b</a> to explain this behavior but it doesn't happen on my HTC desire with android 2.2, using the emulator I found it happens on 1.5, but not on 1.6</p><p>So my question: Is this normal on 1.5 ? If so, how can I change the behavior of the activity so this doesn't happen again ?</p><p>I know I can change the launchmode from singleTop to standard but this will also affect android 1.6+ which I don't want because with singleTop, the changing of conversation goes fast (only onPause and onResume are called), with standard onCreate and onDestroy are also called...</p><p>Maybe there is something I can do with the intent flags I haven't found yet, the flags I change in the code so I can have a ""if sdk is 3"" check...</p><p>Thanks for reading, Danny</p>","488213","","","","","2010-12-03 20:17:29","getIntent returns wrong intent when setIntent is followed by a rotation","<android><orientation><android-intent>","1","0","","",""
"4348722","1","","","2010-12-03 18:39:16","0","361","<p>The release keys that the Map API service issues to me do not work. The debug key works fine, even with debuggable set to false.</p><p>I think this problem is with Google, I think I am doing everything correctly.</p><p>Has anyone else ever encountered such a problem? How about other explanations or fix ideas?</p>","529740","","","","","2010-12-04 06:20:35","release android map API keys from Google non-functional","<android>","2","1","","",""
"4348751","1","","","2010-12-03 18:43:34","0","334","<p>What is the best way to pull data from a DB server using android?</p>","529746","","","","","2010-12-03 18:58:16","sending data to and from a droid querying remote db server","<android><client>","1","0","","",""
"4348839","1","4348890","","2010-12-03 18:53:12","8","10053","<p>In my app, I start an eight step ""wizard"" from my landing page in which data is passed from step 1 all the way to step 8. For keeping the data intact while still in between steps, I am not calling finish() on either of the activities. However, when all the steps are complete, is there a way that I can close all the 8 activities I had started and return back to the landing page?</p><p>An illustration of sorts here:</p><p>Home - Step 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8</p><p>At this point, when the user clicks ""Save"", close all the Steps (8) and go back to the Home Page. I have been creating a new intent to do this so far, but i realize this is not the best solution. A simple back press takes him back to the 7th Step.</p><p>Any help appreciated.</p>","450534","","450534","","2010-12-03 20:08:59","2010-12-03 20:08:59","Closing activities stack after a button click","<android><activity>","2","3","4","",""
"4348974","1","","","2010-12-03 19:08:21","1","73","<p>I am a newbie in android dev...</p><p>I more or less copied the camera implementation from <a href=""http://marakana.com/forums/android/examples/39.html"" rel=""nofollow"">http://marakana.com/forums/android/examples/39.html</a>. However, it returns totally torn images like in the image link below. A notable thing is that the icon of that image in windows shows a correct image, therefore, there must be something wrong with the jpeg compression...</p><p>Does somebody had the same problem before?</p><p>thanks in advance!</p><p>lol cannot post images =.= how stupid</p>","529767","","","","","2010-12-03 19:08:21","Android Torn Images","<android><camera>","0","2","","",""
"4349075","1","9194259","","2010-12-03 19:19:39","13","18481","<p>I am developing an application and testing it on my device running Android 2.2.  In my code, I make use of a Bitmap that I retrieve using BitmapFactory.decodeResource, and I am able to make changes by calling <code>bitmap.setPixels()</code> on it.  When I test this on a friend's device running Android 1.6, I get an <code>IllegalStateException</code> in the call to <code>bitmap.setPixels</code>.  Documentation online says an <code>IllegalStateException</code> is thrown from this method when the bitmap is immutable.  The documentation doesn't say anything about <code>decodeResource</code> returning an immutable bitmap, but clearly that must be the case.</p><p>Is there a different call I can make to get a mutable bitmap reliably from an application resource without needing a second <code>Bitmap</code> object (I could create a mutable one the same size and draw into a Canvas wrapping it, but that would require two bitmaps of equal size using up twice as much memory as I had intended)?</p>","53501","","1618135","","2013-05-01 08:29:43","2013-09-26 11:38:59","BitmapFactory.decodeResource returns a mutable Bitmap in Android 2.2 and an immutable Bitmap in Android 1.6","<java><android><bitmap>","5","0","12","",""
"4349251","1","","","2010-12-03 19:40:05","2","2461","<p>I've activity that i want an option menu to be displayed on. But, i want the option menu to be displayed all the time the activity is displayed. I don't want my users to click (select) the menu button to display it. I want it to be there all the time. How can i do it?</p><p>thanks</p>","522784","","","","","2010-12-03 19:49:39","how to display an option menu when an activity starts","<android><menu><contextmenu><option>","2","1","","",""
"4349340","1","","","2010-12-03 19:53:05","4","989","<p>I have a ListPreference and it has a default value and it works great.  I also have a preference that resets all the shared preferences which works great.  The problem is that if you go back into the ListPreference it is still showing the old value.  If you exit the preferences completely and go back in, it shows correctly.</p><p>So the question is how can I force the ListPreference to use the correct value?  Every other preference seems to be working just fine.</p><p>I did find a work around but I am not happy with it as it seems dirty to me.  When the user clicks on the reset, after values have been reset, I set the value myself to the value it is already set too.</p><pre><code>( (ListPreference) findPreference( myListKey ) ).setValue( String.valueOf( DEFAULT_VALUE ) );</code></pre><p>Thanks in advance.</p>","153683","","","","","2012-10-28 10:37:43","How do you force a listPreference to reset it's value?","<android><listpreference>","2","0","","",""
"4349353","1","4349364","","2010-12-03 19:55:00","0","1882","<p>I'm wondering whether android broadcasts a intent when the screen orientation changes. I am programming a live wallpaper and want to deal with it when the screen orientation changes. I can handle the same with regular apps.</p>","421372","","","","","2012-01-31 13:28:48","Intent for screen orientation change","<android><orientation><screen-orientation>","3","0","","",""
"4349417","1","4349610","","2010-12-03 20:04:25","0","1158","<p>I am trying to 'block' the Camera action while my application is active. The <em>onReceive</em> method is being executed on the BroadcastReceiver, but by the LogCat it seems to be doing so after the Intent has already been executed.</p><p><strong>manifest.xml</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"" 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""        android:screenOrientation=""landscape"" android:debuggable=""true""        android:clearTaskOnLaunch=""true""&gt;        &lt;receiver android:name=""com.receiver.CameraReceiver""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.CAMERA_BUTTON"" /&gt;            &lt;/intent-filter&gt;        &lt;/receiver&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.DEFAULT"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.media.action.IMAGE_CAPTURE"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><p><strong>com.receiver.CameraReceiver</strong></p><pre><code>package com.receiver;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.util.Log;public class CameraReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Log.i(this.toString(), ""Suck It Android!"");        abortBroadcast();    }    @Override    public String toString() {        return ""com.receiver.CameraReceiver"";    }}</code></pre><p><strong>LogCat</strong></p><pre><code>12-03 14:47:41.171: INFO/ActivityManager(981): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x14000000 cmp=com.google.android.camera/com.android.camera.Camera }12-03 14:47:41.288: INFO/WindowManager(981): Setting rotation to 1, animFlags=112-03 14:47:41.304: INFO/ActivityManager(981): Config changed: { scale=1.0 imsi=310/4 loc=en_US touch=3 keys=2/1/2 nav=2/2 orien=2 layout=34 uiMode=17 seq=30}12-03 14:47:41.811: DEBUG/dalvikvm(981): GC_EXTERNAL_ALLOC freed 8025 objects / 388808 bytes in 208ms12-03 14:47:41.999: DEBUG/AlarmManagerService(981): Kernel timezone updated to 300 minutes west of GMT12-03 14:47:42.288: INFO/[com.specialed.receiver.CameraReceiver](13152): Suck It Android!</code></pre>","398012","","","","","2010-12-03 20:34:16","Android BroadcastReceiver not stopping Camera Intent action","<android>","2","0","","",""
"4349517","1","4349749","","2010-12-03 20:19:39","0","285","<p>I am new to android. I want to install an unreleased third party android apk file into my device  from a windows pc or mac osx machine without having to install Android SDK and going the whole nine yards. Can it be done? Appreciate any help/pointers.</p>","293859","","","","","2010-12-03 23:46:32","android third party app","<android>","3","5","","2010-12-04 17:13:51",""
"4349585","1","","","2010-12-03 20:30:13","1","329","<p>I have been developing an application for the Android for an organization but a problem has arisen.  While my knowledge of programming is relatively fair, my use of Java has been more recent.  Which is the largest part of my current issue, being that I need to know how to set up an application to fetch data from a server.  The closest example would be a form of ""news"" applications that are currently available.  Where you open the application, then it updates the currently available articles or audio.  I have almost no knowledge of how to create or implement the necessary code to perform such a data fetch.  Nor do I have the knowledge of what needs to be done server side to allow the application to fetch the relevant data.  (Once again, this would be text articles and audio files)  I have come to this forums to ask for help regarding my problem.</p>","529854","","213269","","2010-12-03 20:53:09","2011-02-18 18:30:20","Data fetch from server","<java><android><http>","3","0","","",""
"4349715","1","4349866","","2010-12-03 20:46:48","0","123","<p>Hey I am new to android development and most programing in general other then 2 semesters of C++. But my question revolves around this tutorial <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a> I was able to follow how to write the previous ones but when it comes to this one I am having trouble. My question is, what does it mean when it says to create a separate activity for each tab and how do I go about that?   </p>","529865","","46425","","2011-04-29 13:58:31","2011-12-29 18:54:29","Help with the tab tutorial","<android><xml><tabs>","1","2","","",""
"4349719","1","4350438","","2010-12-03 20:47:13","0","82","<p>I have a gridview of images in my android app. It is an image gallery for an artist, so there are about 180 relatively high quality images in the resource folder. It works fine in the emulator and on my HTC Evo in debug mode. However when I publish it to the market and install it from there it crashes when the gridview is attempted to be loaded. </p><p>Is there a limit on locally defined images or is there a better way to manage so many images?</p>","4594","","","","","2010-12-03 22:29:03","android gridview of images fails on compiled version","<android><gridview><google-play>","1","0","","",""
"4349803","1","4350761","","2010-12-03 20:56:49","2","4864","<p>I have simple ListView that displays data from database. Every after 1 min data are getting refresh automatically. Here is the code snippet I am using to do that :</p><pre><code>DataAdapter adp = (DataAdapter) DataList.getAdapter();adp.UpdateDataList(DataAdapter.DATA_LIST);adp.notifyDataSetChanged();DataList.invalidateViews();DataList.scrollBy(0, 0);</code></pre><p>I have created ListView i.e. DataView and dataAdapter that simply extends baseAdapter.UpdateDataList is simply get data from database and creates an arrayList.And Adapter notifies view to refresh the Data.</p><p>Everything is working perfect. Now one thing I am trying to do here is when data refresh I need to add some kind of animation so that it becomes eyecaching. And people mark that something happened.</p><p>Similar to iPhone application. I do not want to add spinner because data update is synchronize process so data change is quickly without making any new changes in view. Simply numbers got flipped.</p><p>Any help will be appreciated....</p>","464214","","","","","2010-12-06 18:24:18","Android Listview Refresh animation","<android><listview><animation>","2","0","3","",""
"4349947","1","4349966","","2010-12-03 21:16:16","10","3163","<p>I have the following code in my <code>AppWidgetProvider</code> class.</p><pre><code>@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    Log.i(""Custom"", ""Update"");}@Overridepublic void onReceive(Context context, Intent intent) {    Log.i(""Custom"", ""Recieve"");}</code></pre><p>If I comment out the <code>onReceive</code> method the <code>onUpdate</code> method will be invoked each time I add the widget to the homescreen, if I do not it does not run. Any thoughts?</p>","444538","","","","","2010-12-03 21:20:06","App Widget onUpdate not called when onReceive method exists","<android><appwidget>","1","0","","",""
"4350009","1","4350557","","2010-12-03 21:25:37","0","420","<p>In my onCreate method, I'd like to detect the orientation and set an appropriate background image.</p><p>I can get the orientation like so:</p><pre><code>    Display dis = getWindowManager().getDefaultDisplay();    int orientation = dis.getOrientation();</code></pre><p>I've tested this on both the Galaxy S and the Moment.</p><p>When I am in portrait mode, this returns a value of 0.  When I am in landscape mode, this returns a value of 1.</p><p>However, the define Configuration.ORIENTATION_LANDSCAPE has a value of 2 and the define Configuration.ORIENTATION_PORTRAIT has a value of 1.</p><p>So, when I turn the phone to landscape mode, it gives me Configuration.ORIENTATION_PORTRAIT.  And when I turn the phone to portrait mode, it gives me Configuration.ORIENTATION_UNDEFINED.</p><p>What is going on???</p><p>I'm using API level 7</p>","406790","","","","","2010-12-03 22:43:09","Problem detecting orientation of phone","<android><configuration><orientation>","2","1","","",""
"4350072","1","4964313","","2010-12-03 21:35:05","5","1863","<p>I want my app to construct some HTML and pass it over to an email so my user can send it to whomever they want. I found code on the web that shows how to pass the html via an Intent, but it appears that Html.fromHtml(String source) doesn't understand table tags. Is there anyway I can format an email with table tags? I want to send it through the user's preferred client instead of sending it myself with javamail.</p><pre><code>final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.setType(""text/html"");emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body));emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);activity.startActivity(Intent.createChooser(emailIntent, ""Email:""));</code></pre><p>Any suggestions?</p>","416631","","","","","2011-02-11 00:20:55","Use Table tag in Android Email","<html><android><email><android-intent>","1","2","1","",""
"4350147","1","4589443","","2010-12-03 21:46:46","2","607","<p>Every few times I open the emulator, it will appear to be in offline mode, with the ""X"" on the top of screen instead of the 3g symbol and no apparent network connectivity.</p><p>The only apparent difference in the logs I've found is:</p><pre><code>Network works:12-03 11:24:48.732 D/qemud   (   37): client_fd_receive: attempting registration for service 'gsm'12-03 11:24:48.732 D/qemud   (   37): client_fd_receive:    -&gt; received channel id 212-03 11:24:48.742 D/qemud   (   37): client_registration: registration succeeded for client 2Network fails:12-03 03:02:11.688 D/qemud   (   37): client_fd_receive: attempting registration for service 'gsm'12-03 03:02:11.688 D/qemud   (   37): client_fd_receive:    -&gt; received channel id 2</code></pre><p>Does anybody have an idea why the registration would not succeed from one run to another?</p>","208457","","","","","2011-01-03 23:43:42","Android Emulator occasionally fails to start network","<android><android-emulator><adb><gsm><avd>","1","2","2","",""
"4350212","1","","","2010-12-03 21:56:33","6","2831","<p>I am trying to play two sounds simutaneosly in android.I have created two MediaPlayers and am using the code below.They are currently playing one after another.Or not exactly one after another but kinda delayed into eachother.</p><pre><code>private void playSound(){       if (mp1 != null) {           mp1.release();         }       if (mp2 != null) {            mp2.release();          }        mp1 = MediaPlayer.create(this, soundArray[0]);         mp2 = MediaPlayer.create(this, soundArray[3]);        mp1.start();        mp2.start();      }</code></pre><p>Thanks</p>","529926","","491044","","2012-06-23 09:44:30","2014-01-20 11:47:43","Playing two sounds Simutaneosly","<android><audio><media-player><soundpool><android-audiomanager>","5","4","2","",""
"4350235","1","4350342","","2010-12-03 22:01:31","0","811","<p>I've had a similar question but the answer did not entirely fix my problem.</p><p>Here is what I am trying to do: I have a Service class that loops to receive TCP connections. If a connection is received, a string can be read. It can be one of those two: ""START"" or ""STOP"".</p><p>When ""START"" comes in, I create (start) a new activity which has some GUI, and also two threads (one sends UDP packets and records audio, the other one receives UDP and plays audio). This class holds 2 sockets, one AudioTrack object and one AudioRecord.</p><p>When the Service class receives a ""STOP"" as its data in a TCP connection, I would like to call a method inside that Activity class (not create a new one), to close those 2 sockets and call stop() and release() on the AudioTrack/AudioRecord object.</p><p>Right now, when I receive a ""STOP"", I am only able to create a whole new activity, so those objects are not initialized. Is there a way please, to actually call a method inside a previously started Activity? Could I keep a reference to that activity (or intent) and simply call a method about it, or do I have to change my whole designs? Suggestions would be welcomed in that case.</p><p>Thank you,</p><p>James</p>","522835","","","","","2012-12-31 09:58:58","Android: calling a method in an activity from a service (on same Activity)","<android><service><activity>","2","0","","",""
"4350344","1","4350447","","2010-12-03 22:17:52","2","6311","<p>I want to install Repo for working with the Android source files. so , how to install repo.</p>","412168","","","","","2013-11-21 11:56:24","How to istall Repo on my Ubuntu system?","<android>","2","0","1","",""
"4350455","1","","","2010-12-03 22:31:19","0","251","<p>Is their a way to format a link in a gmail, which when opened in a browser or a app, when clicked opens a different activity on a phone?</p><p>I mean let's say in an email you send a link and link has some formatting like YouTube and this when clicked opens the YouTube app on the android phone.</p>","402637","","402637","","2010-12-03 23:08:00","2010-12-03 23:25:35","When I click on link in my gmail message it should open an activity on my phone","<android><hyperlink><activity>","1","1","","",""
"4350580","1","4351403","","2010-12-03 22:46:27","2","6540","<p>There's a difference between RAM memory and internal flash memory right?I can get RAM memory by:</p><pre><code>cat /proc/meminfo</code></pre><p>However, I am not sure how to get Flash memory information.</p><p>I think I know how to get available memory:</p><pre><code>ActivityManager activityManager = (ActivityManager).getSystemService(Context.ACTIVITY_SERVICE);MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();activityManager.getMemoryInfo(memoryInfo);memoryInfo.availMem;</code></pre><p>Does this give available internal Flash memory?</p><p>How about total internal memory?</p><p>Does following unix command get me this info?</p><pre><code>df</code></pre><p>result:</p><pre><code>Filesystem           1K-blocks      Used Available Use% Mounted ontmpfs                    97744         0     97744   0% /devtmpfs                     4096         0      4096   0% /sqlite_stmt_journals/dev/block/mtdblock3    174080    154372     19708  89% /system/dev/block/mtdblock5    169728     57144    112584  34% /data/dev/block/mtdblock4    133120     89632     43488  67% /cache/dev/block/mtdblock4    133120     89632     43488  67% /data/dalvik-cache/dev/block//vold/179:1                       7970928   2358576   5612352  30% /sdcard</code></pre><p>if so, do I have to add all tmpfs &amp; /dev/block/mtdblock# to get total internal memory?</p>","432056","","1228","","2013-08-27 14:38:26","2013-08-27 14:38:26","Android: How do you get internal Total/Available memory?","<android><memory><internal>","2","0","1","",""
"4350858","1","4350875","","2010-12-03 23:27:20","4","1241","<p>I am converting an iphone app to android?</p><p>1- Is there anything similar to the ""iphones core data"" on android sdk?</p><p>2- If not, does android support using sqlite databases?</p>","242769","","","","","2012-01-14 20:32:41","Android - Data storage?","<iphone><android><core-data><data-storage>","2","0","","",""
"4350926","1","","","2010-12-03 23:42:24","0","3303","<p>I have a broadcast receiver that, upon receiving something, will create a pending intent, package it with some data, and use it to create a notification with NotificationManager.  The activity that is specified in the pending intent, when NotificationManager resumes the activity, always reads out the original pending intent's data -- it never reads out any new data when set by subsequent onReceive()'s from the broadcast receiver.  Here's a snippet from the broadcast receiver:</p><pre><code>public void onReceive( Context context, Intent intent ) {    String action = intent.getAction();    if( action.equals( ""someaction"" ) ) {        long now = System.currentTimeMillis();        int icon = R.drawable.icon;        CharSequence tickerText = context.getString( R.string.tickerText );        CharSequence contentTitle = context.getString( R.string.contentTitle );        CharSequence contentText = context.getString( R.string.contentText );        Intent notificationIntent = new Intent( context, MyActivity.class );        Log.d( TAG, ""Creating notification with data = "" + intent.getStringExtra( ""somestring"" ) );        notificationIntent.putExtra( ""somestring"", intent.getStringExtra( ""somestring"" ) );        notificationIntent.addFlags( Intent.FLAG_ACTIVITY_SINGLE_TOP );        notificationIntent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );        PendingIntent contentIntent = PendingIntent.getActivity( context, 0, notificationIntent, 0 );        Notification notification = new Notification( icon, tickerText, now );        NotificationManager notificationmgr = (NotificationManager)context.getSystemService( Context.NOTIFICATION_SERVICE );        notification.flags |= Notification.FLAG_AUTO_CANCEL |                              Notification.DEFAULT_SOUND |                              Notification.DEFAULT_VIBRATE;        notification.setLatestEventInfo( context, contentTitle, contentText, contentIntent );        notificationmgr.cancelAll();        notificationmgr.notify( 0, notification );    }}</code></pre><p>and here's that of the activity:</p><pre><code>protected void onStart() {    super.onStart();    Intent intent = getIntent();    String somestring = intent.getStringExtra( ""somestring"" );    Log.d( TAG, ""onStart(), somestring = "" + somestring );}protected void onResume() {    super.onResume();    Intent intent = getIntent();    String somestring = intent.getStringExtra( ""somestring"" );    Log.d( TAG, ""onResume(), somestring = "" + somestring );}protected void onNewIntent( Intent intent ) {    Log.d( TAG, ""onNewIntent(), intent = "" + intent );    super.onNewIntent( intent );    setIntent( intent );}</code></pre><p>So here's the scenario:From the home screen, my receiver receives some intent with, say, <em>somestring</em> set to ""hello world"".  The notification bar shows the notification, I slide down the notification bar, and tap on the notification to launch (create or resume) the activity.  The activity reads out ""hello world"" correctly.  I leave the activity in the foreground or background it with the home key.  The second time around my broadcast receiver receives, say, ""hello again"" as <em>somestring</em>.  It again creates the notification, this time with ""hello again"", except when resuming the activity via the notification, I see in the debug that <em>neither</em> getIntent() nor onNewIntent() reflects the updated value of <em>somestring</em> (i.e. ""hello again"").  That is, it's still holding onto the old value of ""hello world"".</p><p>Any ideas?  I can't seem to find a way to force an update of the intent's data.  Any help is appreciated; thanks in advance.</p>","530022","","","","","2011-02-05 02:11:17","Intent set by NotificationManager is not reflected in activity's onResume()","<android><activity><notifications><android-intent><android-pendingintent>","2","0","","",""
"4350928","1","4351010","","2010-12-03 23:42:52","15","8570","<p>I have a background image on my layout's outer-most LinearLayout.  I simply do the following:</p><pre><code>android:background=""@drawable/home_background""</code></pre><p>This stretches the image to the dimensions of my phone's screen (or more accurately, the dimensions of the LinearLayout).</p><p>Unfortunately, when a user clicks an EditText and the virtual keyboard shows, the image squishes because the height of the LinearLayout has shrunken.  How can I get this to not happen?</p>","406790","","","","","2010-12-03 23:57:35","Background image stretching","<android><background>","1","0","2","",""
"4351031","1","","","2010-12-04 00:02:27","4","597","<p>After installing a lot of apps, and building a few myself, I'm sure many people have been wondering about this. If I'm looking through my SD card it looks absolutely horrible, and its really hard to find folders that are mine for putting music/videos/pictures in between all the folders for different applications.</p><p>Is there any conventions here that we, the developers, should try to put their apps into one base folder or has Google forgot about this completely? </p>","451575","","","","","2010-12-04 00:22:01","Is There Any Convention for Android SD Card Storage?","<android><naming-conventions><folder><android-sdcard>","2","0","2","",""
"4351041","1","","","2010-12-04 00:05:15","0","1235","<p>HiWhat are the android life cycle method executed when an activity is started from another activity and also the method that should be executed in corresponds to home button click.Is there any way to detect that user has pressed a home button ?is there exist any unique method thatexecute as part of home button,am not meaning home button listener?</p>","487219","","487219","","2010-12-04 00:23:07","2010-12-04 00:23:07","Android life cycle method","<android>","1","0","","",""
"4351059","1","","","2010-12-04 00:09:02","0","347","<p>Please look at the code from <a href=""http://code.google.com/p/chainball/source/browse/trunk/src/com/tomten/android/chainball/OrientationManager.java?spec=svn18&amp;r=18"" rel=""nofollow"">here</a>.</p><p>To summarize the code in the above link, the code declares an interface ‘OrientationListener’ and ‘a class ‘OrientationManager’.  ‘OrientationManager’ listens to ‘SensorEvent’(s) and calls one of the foure decalred methods in ‘OrientationListenor’, ‘onTopUp()’, ‘onRightUp()’, ‘onBottomUp()’,  and ‘onLeftUp()’, if the device’s top, right, bottom, or left  side is facing up.</p><p>This works great if you assume that the users only use their devices such that the xy coordinates of the device are parallel to the ground.  The reality is, users usually use their device at angel will sitting down, or laying down while holding their phone upside down.</p><p>How can I modify this code to allow users to ‘calibrate’ their phone?</p><p>Help is very appreciated, this is my second day looking into this with no results.</p>","481009","","","","","2010-12-04 06:20:45","How to implement a 'calibratable' orientation listener in android?","<android><matrix><rotation><orientation>","1","0","","",""
"4351061","1","4368291","","2010-12-04 00:09:48","0","6503","<p>i've got a String that i need to convert to a CharSequence.  the data MUST necessarily be a String, as it's returned from:</p><pre><code>String ip = pref.getString(""ip"", ""0.0.0.0"");</code></pre><p>which grabs a user preference String.  the data needs to be passed to any of these functions:</p><pre><code>final void setText(int resid)final void setText(int resid, TextView.BufferType type)final void setText(char[] text, int start, int len)void setText(CharSequence text, TextView.BufferType type)final void setText(CharSequence text)</code></pre><p>i tried using the bottom function first, but you can't pass it a String (even though String implements CharSequence).  it'll compile but it crashes.  casting it to a CharSequence in the function call like this doesn't work either:</p><pre><code>ipIn.setText((CharSequence)ip);</code></pre><p>then i tried using the array version by calling:</p><pre><code>ipIn.setText(ip.toCharArray(), 0, ip.toCharArray().length-1);</code></pre><p>still crashes.  here's the output from 'adb logcat':</p><pre><code>E/AndroidRuntime(16642): FATAL EXCEPTION: mainE/AndroidRuntime(16642): java.lang.NullPointerExceptionE/AndroidRuntime(16642):    at com.conceptualsystems.android4api.sms.smsMobile.onCreateDialog(smsMobile.java:81)E/AndroidRuntime(16642):    at android.app.Activity.onCreateDialog(Activity.java:2472)E/AndroidRuntime(16642):    at android.app.Activity.createDialog(Activity.java:881)E/AndroidRuntime(16642):    at android.app.Activity.showDialog(Activity.java:2547)E/AndroidRuntime(16642):    at android.app.Activity.showDialog(Activity.java:2514)E/AndroidRuntime(16642):    at com.conceptualsystems.android4api.sms.smsMobile.onOptionsItemSelected(smsMobile.java:120)E/AndroidRuntime(16642):    at android.app.Activity.onMenuItemSelected(Activity.java:2195)E/AndroidRuntime(16642):    at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:730)E/AndroidRuntime(16642):    at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)E/AndroidRuntime(16642):    at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)E/AndroidRuntime(16642):    at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)E/AndroidRuntime(16642):    at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)E/AndroidRuntime(16642):    at android.view.View$PerformClick.run(View.java:8816)E/AndroidRuntime(16642):    at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime(16642):    at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime(16642):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(16642):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(16642):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(16642):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(16642):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(16642):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(16642):    at dalvik.system.NativeStart.main(Native Method)W/ActivityManager( 1099):   Force finishing activity</code></pre><p>what's interesting is that it crashes when AlertDialog.Builder.setView(View) is called if i set the text first, but crashes on setText if i call it after setView.  here's some code to put things into context:</p><pre><code>final View dialogLayout = inflater.inflate(R.layout.dialog_wifi_pref, null);builder = new AlertDialog.Builder(this);builder.setView(dialogLayout);builder.setTitle(R.string.opt_ip_config);String ip = pref.getString(""ip"", ""0.0.0.0"");String port = pref.getString(""port"", ""3005"");EditText ipIn = (EditText)findViewById(R.id.wifi_ip_in);EditText portIn = (EditText)findViewById(R.id.wifi_port_in);//ipIn.setText(ip.toCharArray(), 0, ip.toCharArray().length-1);//portIn.setText((CharSequence)port.toString());builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int id) {        // change to sqlite /////        /////////////////////////        //nothing here yet        dialog.dismiss();    }});builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int id) {        dialog.cancel();    }});dialog = builder.create();</code></pre><p>this is all part of the onCreateDialog override and exists inside a case statement.  'dialog', 'inflater', and 'builder' are defined above (properly).  and like i said, the error changes depending on whether call setView or setText first.  i'm not sure which one i'm actually supposed to do first.</p><p>the bottom line: i have to get a String into this EditText box.  how does i?</p>","329993","","","","","2010-12-06 16:01:01","convert String to CharSequence or char[] in Java (Android 1.6 API)","<java><android>","4","2","","",""
"4351154","1","4351224","","2010-12-04 00:32:05","1","1571","<p>I've checked the other questions asked here and didn't succeed in implementing the solutions.  My application uses controls, not drawing on the canvas.  Basically this sums up my issue: -</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    btn1 = (ToggleButton) findViewById(R.id.btn1);    btn2 = (ToggleButton) findViewById(R.id.btn2);    btn3 = (ToggleButton) findViewById(R.id.btn2);    btn4 = (ToggleButton) findViewById(R.id.btn4);    btn5 = (ToggleButton) findViewById(R.id.btn5);    btn6 = (ToggleButton) findViewById(R.id.btn6);    btn7 = (ToggleButton) findViewById(R.id.btn7); //blah blah blah    btn1.requestFocus();    wait(100);    btn2.requestFocus();    wait(100);    btn3.requestFocus();    wait(100);    btn3.setChecked(true);    wait(100);    btn4.requestFocus();    wait(100);    btn4.setChecked(true);    wait(100);    btn5.requestFocus();    wait(100);    btn6.requestFocus();    wait(100);    btn6.setChecked(true);    wait(100);    btn7.requestFocus();    wait(100); //etc}</code></pre><p>The point being the computer animates the moving to a the buttons and checking them so the user can see what it is doing.  So, my issue is, what goes in my wait() method that will pause for 100ms and also update the screen, and the focus?  Any help really appreciated, cheers Jonathan.</p><p>Solution applies, thanks Andrew :)</p><pre><code>int timerCounterInterval = 0;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final ToggleButton btn1 = (ToggleButton) findViewById(R.id.btn1);    final ToggleButton btn2 = (ToggleButton) findViewById(R.id.btn2);// more btns    timerCounterInterval = 0; //reset, for each pass of automation    setFocus(btn1);    setFocus(btn2);    setChecked(btn2);// tidy up    timerCounterInterval++;    new Handler().postDelayed(new Runnable() {         public void run() {            btn2.clearFocus(); //whatever button that had the focus last            }    }, 100*(timerCounterInterval));// etc - note any code from here will execute *before* the above timer}   public void setFocus(final ToggleButton btn) {    timerCounterInterval++;    new Handler().postDelayed(new Runnable() {         public void run() {            btn.setFocusableInTouchMode(true); //eww, messy i know            btn.requestFocus();            btn.setFocusableInTouchMode(false);         }     }, 100*timerCounterInterval);}public void setChecked(final ToggleButton btn) {    timerCounterInterval++;    new Handler().postDelayed(new Runnable() {         public void run() {            btn.setChecked(true);        }     }, 100*timerCounterInterval);}</code></pre><p>Hope this helps other people!</p>","530047","","530047","","2010-12-04 07:48:27","2010-12-04 07:48:27","Android: updating the screen during computer controlled UI changes","<android><refresh><screen><delay>","1","0","","",""
"4351195","1","4351781","","2010-12-04 00:39:01","0","2133","<p>From the Dev Guide for using SQLite databases...</p><blockquote>  <p>The recommended method to create a new SQLite database is to create a subclass of SQLiteOpenHelper and override the onCreate() method, in which you can execute a SQLite command to create tables in the database.</p></blockquote><p>Is this generally the 'only' way to do this or is it possible to include a pre-created empty (or even part populated) db with an apk distribution? Obviously, I can design my database on my PC and then just generate the 'CREATE TABLE' strings and cut/paste into my strings.xml but I was wondering about alternative approaches which might save the extra work.</p><p>EDIT: In light of KevinDTimm's answer, assuming this is possible, how do I include a pre-created SQLite db with my apk distribution? Any examples/pointers gratefully received.</p><p>Thanks.</p>","488241","","488241","","2010-12-04 02:11:41","2010-12-04 03:32:03","Distribute db with apk?","<android>","2","0","","",""
"4351204","1","4353274","","2010-12-04 00:40:31","1","6337","<p>I've read a hell of a lot about this, and can't see anyone who's done or tried it before.</p><p>So I've got an object that extends ImageView, then within this I call a progress dialog and set the progress dialogs's content to the imageview (i.e. attempting to draw the progress dialog in the imageview..view.)</p><pre><code>    loadingProgressDialog.setContentView(this); //this is: LoaderImageView extends ImageView            loadingProgressDialog.setIndeterminate(true);    loadingProgressDialog.show();</code></pre><p>And I get the error: requestFeature() must be called before adding content</p><p>Now I've seen this error before on loads of posts and yes the answer seems obvious. I've tried to set all the features:</p><pre><code>loadingProgressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);loadingProgressDialog.requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);loadingProgressDialog.getWindow().requestFeature(Window.FEATURE_PROGRESS);loadingProgressDialog.getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);</code></pre><p>But first I don't understand why I need this? And second none of them work anyway!</p><p>So the question is can I set the ProgressDialog contentView to an ImageView? If so what have I gotten wrong?</p>","413127","","413127","","2010-12-04 10:05:17","2014-02-12 15:45:54","Android ProgressDialog with setContentView","<android><imageview><progressdialog><custom-view>","3","0","1","",""
"4351268","1","4466988","","2010-12-04 00:55:43","0","422","<p>I'm porting an Android app to Windows Phone 7. The Android app uses a KeyStore. From what I read <a href=""http://onjava.com/pub/a/onjava/2004/01/28/javavsdotnet.html"" rel=""nofollow"">here</a>, it looks like the equivalent in C# / .NET is X509CertificateStore. However, the containing namespace doesn't appear to be part of Windows Phone 7. Is there an alternative specifically for WP7?</p><p>Edit: Looks like there is an X509Certificate class. I'm not familiar with certificates on either platform, but I'll give this a try. Any other suggestions is still greatly appreciated</p>","209981","","209981","","2010-12-04 01:10:24","2011-09-10 09:00:39","Porting Android to WP7. How do I handle KeyStore?","<.net><android><windows-phone-7><certificates><keystore>","2","0","","",""
"4351306","1","","","2010-12-04 01:04:37","2","2518","<p>I'm using the Camera class to take a picture and want to do some processing on the image inside onPictureTaken.  How can I interpret the byte array?  Is it in RGB format or something else?  Thanks.</p>","530062","","","","","2012-06-11 06:24:25","Interpret raw image data from Android Camera onPictureTaken(byte[] data)","<java><android><image><camera><bytearray>","2","0","","",""
"4351344","1","4351451","","2010-12-04 01:14:51","0","279","<p>I am trying to have a counter (count seconds and minutes) and update it on the display every second.</p><p>I have this code in the onCreate of my class, which extends Activity:</p><pre><code>        timeOnCall = (TextView) findViewById(R.id.time);        minutes = seconds = 0;        timeOnCall.setText(minutes + "":"" + seconds);        // Implements the timer        Timer timer = new Timer();        timer.scheduleAtFixedRate(new TimerTask() {            public void run() {                ++seconds;                if (seconds == 60) {                    seconds = 0;                    ++minutes;                }                // Display the new time                timeOnCall.setText(minutes + "":"" + seconds);            }        }, 1000, 1000);</code></pre><p>Unfortunately, I get the following error:</p><pre><code>android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</code></pre><p>I am not sure how to fix this as it's already in the onCreate method.</p><p>Does anyone please know a solution?</p><p>Thank you very much,</p><p>James</p>","522835","","","","","2010-12-04 01:56:21","Android: modifying an XML element in a timer","<android><xml><textview>","3","0","","",""
"4351439","1","4352162","","2010-12-04 01:37:18","2","7568","<p>I have some images I want to show in thumbnails, and I want them to center crop and not scale. The images themselves are almost always rectangular, and I want to crop them around their center and have them fit into a square ImageView. The bitmaps themselves either have a height that matches the size of the ImageView, or a width that matches. So essentially I just want to crop off the left/right or the top/bottom of each photo, and not lose any quality.</p><p>When I try to use <code>ScaleType.CENTER_CROP</code> my images are becoming blurry. Any suggestions?</p>","413414","","","","","2010-12-04 05:46:55","Android: How to center crop images without scaling","<android><bitmap><imageview><crop>","1","0","2","",""
"4351459","1","4351481","","2010-12-04 01:42:20","4","2727","<p>For a widget I use a simple layout which contains a TableLayout</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout  xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TableRow &gt;         (...)    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>But when a I want to update its content by creating a <code>RemoteViews</code></p><pre><code>RemoteViews eventElementLayout = new RemoteViews( this.getPackageName(), R.layout.widget_events_element );</code></pre><p>I got an exception telling me that <code>TableLayout</code> is not allowed to be inflated.</p><pre><code>12-04 01:36:12.548: WARN/AppWidgetHostView(195): updateAppWidget couldn't find any view, using error view12-04 01:36:12.548: WARN/AppWidgetHostView(195): android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.TableLayout12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.widget.RemoteViews.apply(RemoteViews.java:930)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.widget.RemoteViews$ViewGroupAction.apply(RemoteViews.java:513)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.widget.RemoteViews.performApply(RemoteViews.java:955)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.widget.RemoteViews.apply(RemoteViews.java:932)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.appwidget.AppWidgetHostView.updateAppWidget(AppWidgetHostView.java:219)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.appwidget.AppWidgetHost.updateAppWidgetView(AppWidgetHost.java:250)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.appwidget.AppWidgetHost$UpdateHandler.handleMessage(AppWidgetHost.java:73)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.os.Handler.dispatchMessage(Handler.java:99)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.os.Looper.loop(Looper.java:123)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at java.lang.reflect.Method.invokeNative(Native Method)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at java.lang.reflect.Method.invoke(Method.java:521)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at dalvik.system.NativeStart.main(Native Method)12-04 01:36:12.548: WARN/AppWidgetHostView(195): Caused by: android.view.InflateException: Binary XML file line #2: Class not allowed to be inflated android.widget.TableLayout12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.view.LayoutInflater.failNotAllowed(LayoutInflater.java:525)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.view.LayoutInflater.createView(LayoutInflater.java:472)12-04 01:36:12.548: WARN/AppWidgetHostView(195):     ... 19 more</code></pre><p>Why ?</p><p>Thanks in advance</p>","231417","","","","","2013-08-29 23:04:50","Why my TableLayout isn't allowed to be inflated?","<android><layout>","1","0","","",""
"4351507","1","4351563","","2010-12-04 01:53:49","1","1168","<p>I am working on my first Android Application and I am trying to implement a database with a bunch of food types (strings) such as ""Beef, Pork, Chicken"" and have cook time values (int) for them such as 10000,50000,30000 etc. My question is what is the best way to implement this. I feel like the best way may be using an external database, but i am also thinking if it will make my life hell. Basically should I do something like an example I found that works off the internal SQlite:</p><pre><code>public void onCreate(SQLiteDatabase db) {                   db.execSQL(""CREATE TABLE IF NOT EXISTS ""                +NAMES_TABLE                +"" (_id INT PRIMARY KEY ,name VARCHAR);""        );        db.execSQL(""INSERT INTO ""+NAMES_TABLE+"" values(1,'marco');"");        db.execSQL(""INSERT INTO ""+NAMES_TABLE+"" values(2,'luca');"");        db.execSQL(""INSERT INTO ""+NAMES_TABLE+"" values(3,'qlimax');"");    }</code></pre><p>This would add the values to the internal database when launched, only if they are not there.<br>OR<br>should I create a database with SQlitebrowser and place it in /assets and read from it?</p><p>Right now I am reading my values from an ArrayAdapter, and I am trying to replace it and read it from a database instead, it looks like this:</p><pre><code>final FoodType type[] = new FoodType[3];    type[0] = new FoodType(""Filet Mignon"",50000);    type[1] = new FoodType(""Skirt Steak"",0);    type[2] = new FoodType(""Flank Steak"",25000);    ArrayAdapter&lt;FoodType&gt; typeAdapter = new ArrayAdapter&lt;FoodType&gt;(this,android.R.layout.simple_spinner_item,type);    typeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);</code></pre><p>How should I go about this? Internal or External?</p>","484707","","","","","2010-12-04 02:12:47","Android External vs Internal Database Confusion","<android><sqlite><database-connection><android-arrayadapter>","1","0","2","",""
"4351535","1","","","2010-12-04 02:02:33","-2","70","<p>New to Java but experienced at C#. </p><p>I have done ""Hello Android"" Tutorial and ""Hello Listview"" Tutorial but would like to have both on same screen.<br>i.e. ""Welcome to my site blah blah.. choose from the list below.."" but can't see any lessons on how to combine them. </p><p>I have tried merging layout.xml files but stuck after an hour of clutching at straws.<br>Anyone got any pointer to a simple example of similar code?</p>","530095","","1228","","2013-08-09 13:44:57","2013-08-09 13:44:57","Newbie developer.android.com tutorials","<android><merge>","1","1","","2013-02-14 23:47:59",""
"4351678","1","4372481","","2010-12-04 02:54:56","21","9651","<p>I see that the Heap Size is automatically increased as the app needs it, up to whatever the phone's Max Heap Size is.  I also see that the Max Heap Size is different depending on the device.</p><p>So my first question is, what are the typical Max Heap Sizes on Android devices?  I have tested memory allocation on one phone that was able to use a heap over 40mb while another gave out OutOfMemory errors in the 20's mbs.  What are the lowest that are in common use and what are the highest that are on common devices?  Is there a standard or average?</p><p>The second question, and more important one, is how to ensure you are able to use the resources available per device but avoid using too much?  I know there are methods such as onLowMemory() but those seem to be only for the entire system memory, not just the heap for your specific application.</p><p>Is there a way to detect the max heap size for the device and also detect when the available heap memory is reaching a low point for your application?</p><p>For example, if the device only allowed a max heap of 24mb and the app was nearing that limit in allocation, then it could detect and scale back.  However, if the device could comfortably handle more, it would be able to take advantage of what is available.</p><p>Thanks</p>","445348","","","","","2013-05-01 20:54:37","Two questions about max heap sizes and available memory in android","<android><memory><heap>","2","2","3","",""
"4351748","1","4793369","","2010-12-04 03:17:33","10","4333","<p>I need to detect when a MapView has been scrolled or zoomed, like the ""moveend"" event in the javascript API.  I'd like to wait until the view has stopped moving, so I can then detect if I need to query my server for items withing the viewing rectangle, and if so send out a request.  (actually I send a request for a slightly larger area than the viewing rectangle)</p><p>Obviously, I'd rather not send out a request for data if the view is still moving.  But even worse is that I don't know that I need to send another request, leaving areas of the map missing markers.</p><p>Currently I am subclassing MapView and handling the onTouchEvent as follows:</p><pre><code> public boolean onTouchEvent(android.view.MotionEvent ev) {        super.onTouchEvent (ev);        if (ev.getAction() == MotionEvent.ACTION_UP) {            GeoPoint center = getMapCenter();            int latSpan = getLatitudeSpan(), lngSpan = getLongitudeSpan();            /* (check if it has moved enough to need a new set of data)  */            }        return true;    }</code></pre><p>Problem is, I don't know if the view has stopped, since scrolling tends to have inertia and can keep going past the ""ACTION_UP"" event.</p><p>Is there some event I can tap into that will alert me when a mapview is done moving (or zooming)?  If not, has anyone written logic to detect this?  In theory I could make a guess by looking at all the actions, and set something to come along bit later and check it...but...that seems messy and a PITA.  But if someone has already written it.... :)</p>","226507","","","","","2012-11-13 00:14:54","knowing when map has stopped scrolling (like ""moveend"" in javascript API)","<android><google-maps>","4","0","6","",""
"4351751","1","","","2010-12-04 03:20:07","3","7489","<p>I am very new to developing Android apps, and I hope I am posting this in the right place.  I am trying learn how to get the phone bluetooth to connect to my bluetooth module.  I am trying to use code that I found in a reference book, but it is giving me an error.  I have written in java before but I am having a hard time understanding the structure of an Android app.  Anyway the error I am getting is Unknown Error: java.lang.nullPointerException.  Am I maybe forgetting to import a library that I need, or did I make a packaging mistake when I created the project?Here is the code:</p><pre><code>package android.app.bluetooth;//import java.io.InputStream;//import java.io.OutputStream;import java.util.ArrayList;import java.util.UUID;import java.io.IOException;import android.app.Activity;import android.os.AsyncTask;import android.os.Bundle;//import android.os.Handler;import android.bluetooth.BluetoothAdapter;import android.bluetooth.BluetoothDevice;import android.bluetooth.BluetoothServerSocket;import android.bluetooth.BluetoothSocket;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;//import android.view.View.OnKeyListener;import android.widget.ArrayAdapter;import android.widget.AdapterView;import android.widget.Button;import android.widget.EditText;import android.widget.ListView;    import android.widget.TextView;import android.widget.AdapterView.OnItemClickListener;public class bluetooth extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //Get the bluetooth adapter (phone)    configureBluetooth();    //Setup ListView of discovered devices    setupListView();  //Setup search button    setupSearchButton();    //Setup listen button    setupListenButton();}private BluetoothAdapter bluetooth;private BluetoothSocket socket;private UUID uuid = UUID.fromString(""985c75a3-66ae-4b5b-9fac-894659d6f6ee"");private void configureBluetooth(){     BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();     }//Create switchUI method that will be called once a connection is //established to enable views for reading and writing messages  private ListView list;private void switchUI(){    final TextView messageText = (TextView)findViewById(R.id.text_messages);    final EditText textEntry = (EditText)findViewById(R.id.text_message);    messageText.setVisibility(View.VISIBLE);    list.setVisibility(View.GONE);    textEntry.setEnabled(true);    }//Create server listener.  Listen button will prompt user to enable discovery//When discovery window returns, open bluetooth socket to listen for connection       requests for discovery duration//Once a connection has been made, make a call to switchUI private static int DISCOVERY_REQUEST = 1;private void setupListenButton(){ Button listenButton = (Button)findViewById(R.id.button_listen); listenButton.setOnClickListener(new OnClickListener(){  public void onClick(View view){   Intent disc;   disc = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);   startActivityForResult(disc, DISCOVERY_REQUEST);      }     });    }//Find out if user has accepted or rejected the request@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data){    if(requestCode == DISCOVERY_REQUEST){     boolean isDiscoverable = resultCode &gt; 0;     if (isDiscoverable){      String name = ""bluetoothserver"";      try{       final BluetoothServerSocket btserver =    bluetooth.listenUsingRfcommWithServiceRecord(name, uuid);       AsyncTask&lt;Integer, Void, BluetoothSocket&gt; acceptThread = new AsyncTask&lt;Integer, Void, BluetoothSocket&gt;(){        @Override        protected BluetoothSocket doInBackground(Integer ... params){         try{          socket = btserver.accept(params[0]*1000);          return socket;          } catch (IOException e){           Log.d(""BLUETOOTH"", e.getMessage());          }          return null;         }         @Override         protected void onPostExecute(BluetoothSocket result){          if (result != null)           switchUI();         }        };        acceptThread.execute(resultCode);       } catch (IOException e){        Log.d(""BLUETOOTH"", e.getMessage());        }      }      //int discoverableDuration = resultCode;     }    }//Provide a means for client device to search for listening serverprivate ArrayAdapter&lt;BluetoothDevice&gt; aa;private ArrayList&lt;BluetoothDevice&gt; foundDevices;private void setupListView(){    aa = new ArrayAdapter&lt;BluetoothDevice&gt;(this, android.R.layout.simple_list_item_1, foundDevices);    list = (ListView)findViewById(R.id.list_discovered);    list.setAdapter(aa);    //Include onItemClickListener that will attempt to asynchronously initiate a client-side connection    //with the selected remote Bluetooth Device    //If successful, keep a reference to the socket it creates and make a call to switchUI    list.setOnItemClickListener(new OnItemClickListener() {     public void onItemClick(AdapterView&lt;?&gt; arg0, View view, int index, long arg3){      AsyncTask&lt;Integer, Void, Void&gt; connectTask = new AsyncTask&lt;Integer, Void, Void&gt;(){       @Override       protected Void doInBackground(Integer ... params){        try{         BluetoothDevice device = foundDevices.get(params[0]);         socket = device.createRfcommSocketToServiceRecord(uuid);         socket.connect();        } catch(IOException e){         Log.d(""BLUETOOTH_CLIENT"", e.getMessage());         }         return null;        }        @Override        protected void onPostExecute(Void result){         switchUI();        }       };       connectTask.execute(index);      }     });    }//Create a broadcast receiver that listens for Bluetooth Device discovery broadcasts,//adds each discovered device to the array of found devices and notifies the Array  Adapter//Discover remote bluetooth devicesBroadcastReceiver discoveryResult = new BroadcastReceiver(){@Overridepublic void onReceive(Context context, Intent intent){ //String remoteDeviceName = intent.getStringName = intent.getStringExtra(BluetoothDevice.EXTRA_NAME); BluetoothDevice remoteDevice; //remote bluetooth device remoteDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if(bluetooth.getBondedDevices().contains(remoteDevice)){  foundDevices.add(remoteDevice);  aa.notifyDataSetChanged();  } }};    //Register Broadcast Receiver and initiate discovery session    private void setupSearchButton(){     Button searchButton = (Button)findViewById(R.id.button_search);     searchButton.setOnClickListener(new OnClickListener(){      public void onClick(View view){       registerReceiver(discoveryResult, new IntentFilter(BluetoothDevice.ACTION_FOUND));       if (!bluetooth.isDiscovering()){        foundDevices.clear();        bluetooth.startDiscovery();       }      }     });    }}</code></pre><p>This is the layout file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;EditText android:id=""@+id/text_message"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_alignParentBottom=""true"" android:enabled=""false""/&gt;&lt;Button android:id=""@+id/button_search"" android:text=""Search for listener"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_above=""@id/text_message""/&gt;&lt;Button android:id=""@+id/button_listen"" android:text=""Listen for connection"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_above=""@id/button_search""/&gt; &lt;ListView android:id=""@+id/list_discovered"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:layout_above=""@id/button_listen"" android:layout_alignParentTop=""true""/&gt;&lt;TextView android:id=""@+id/text_messages"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:layout_above=""@id/button_listen""android:layout_alignParentTop=""true"" android:visibility=""gone""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>and here is the 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""  android:versionCode=""1""  android:versionName=""1.0"" package=""android.app.bluetooth""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".bluetooth""              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.BLUETOOTH""/&gt;&lt;uses-permission android:name=""android.permission.BLUETOOTH_ADMIN""/&gt;&lt;/manifest&gt; </code></pre><p>Like I said I am very new to this so I apologize if this doesn't make much sense but any help would be greatly appreciated.</p>","530125","","180538","","2010-12-16 13:32:56","2012-09-18 21:54:30","Beginner Developer: Unknown Error:java.lang.nullPointerException","<java><android>","5","8","","",""
"4351783","1","5024137","","2010-12-04 03:33:40","0","681","<p>I am currently using admob for a couple of my apps.  This seems to work well, except the fill rates can get down to as low as 78%.  So I decided to signup for AdWhirl. </p><p>So, I followed the instructions, what they are, on the setup instructions page for AdWhirl, but can not get anything to work.  I either wind up with code that throws no errors and does not work, or if I add  to my xml the app will not run at all.</p><p>Can someone please explain to me what I need to do to get this working?</p><p>It appears there are some steps that are assumed and not explained.</p>","440968","","","","","2011-02-21 06:51:09","Adwhirl Layout Help","<android><layout><adwhirl>","1","2","0","",""
"4351942","1","4351950","","2010-12-04 04:30:08","13","5286","<p>One known way to develop your android application directly onto the device is using the usb connector and install the driver using eclipse. As such, is there a known way to do this wireless?</p><p>EDIT:Ideally this shouldn't require rooted device.</p>","135448","","494543","","2010-12-04 04:57:07","2013-03-05 12:46:01","Developing on android-based device via wireless","<android><eclipse><adb>","2","0","4","",""
"4351947","1","","","2010-12-04 04:32:10","0","2489","<p>can anyone help me out for this?</p><p>whats the use of .qmg file for Bootanimation.</p><p>Thanx</p>","530162","","","","","2014-02-25 04:09:44","What is the use of .qmg file in android?","<android>","2","0","","",""
"4351990","1","","","2010-12-04 04:46:53","2","1970","<p>I want to implement credit card payment process in my android application. There is a form in my application. User will enter his card information and on submission the service will verify and accept or reject the card. I have no idea if there is any API or a tutorial available in android. Please help me if someone knows how to do that.</p><p>//Zeeshan</p>","367121","","302328","","2010-12-04 08:48:29","2013-10-21 06:56:30","creditcard payment implementation in Android application","<android><credit-card><payment-processing>","1","3","","2013-10-25 19:04:19",""
"4352059","1","5016705","","2010-12-04 05:09:05","2","2869","<p>I want a  filter for my <code>ListView</code> in Android. I have found this <a href=""http://stackoverflow.com/questions/1737009/how-to-make-a-nice-looking-listview-filter-on-android/4333859#4333859"">link</a> but I do that I cannot get the filter effect. Can somebody tell me what is wrong? my code is </p><pre><code> public class testListViewFilter extends ListActivity {/** Called when the activity is first created. */private EditText filterText = null;ArrayAdapter&lt;String&gt; adapter = null;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);filterText = (EditText) findViewById(R.id.search_box);filterText.addTextChangedListener(filterTextWatcher);setListAdapter(new ArrayAdapter&lt;String&gt;(this,               android.R.layout.simple_list_item_1,                mStrings));adapter = new ArrayAdapter&lt;String&gt; (this,        android.R.layout.simple_spinner_item,  mStrings);}private TextWatcher filterTextWatcher = new TextWatcher() {@Overridepublic void beforeTextChanged(CharSequence s, int start, int count,        int after) {}@Overridepublic void onTextChanged(CharSequence s, int start, int before,        int count) {    adapter.getFilter().filter(s);}@Overridepublic void afterTextChanged(Editable s) {    // TODO Auto-generated method stub}};@Overrideprotected void onDestroy() {super.onDestroy();filterText.removeTextChangedListener(filterTextWatcher); }   private String[] mStrings = {    ""Abbaye de Belloc"", ""Abbaye du Mont des Cats"", ""Abertam"", ""Abondance"", ""Ackawi"",    ""Acorn"", ""Adelost"", ""Affidelice au Chablis"", ""Afuega'l Pitu"", ""Airag"", ""Airedale"",    ""Aisy Cendre"", ""Allgauer Emmentaler"", ""Alverca"", ""Ambert"", ""American Cheese"",    ""Ami du Chambertin"", ""Anejo Enchilado"", ""Anneau du Vic-Bilh"", ""Anthoriro"", ""Appenzell"",    ""Aragon"", ""Ardi Gasna"", ""Ardrahan"", ""Armenian String"", ""Aromes au Gene de Marc"",    ""Asadero"", ""Asiago"", ""Aubisque Pyrenees"", ""Autun"", ""Avaxtskyr"", ""Baby Swiss"",    ""Babybel"", ""Baguette Laonnaise"", ""Bakers"", ""Baladi"", ""Balaton"", ""Bandal"", ""Banon"",    ""Barry's Bay Cheddar"", ""Basing"", ""Basket Cheese"", ""Bath Cheese"", ""Bavarian Bergkase"",    ""Baylough"", ""Beaufort"", ""Beauvoorde"", ""Beenleigh Blue"", ""Beer Cheese"", ""Bel Paese"",    ""Bergader"", ""Bergere Bleue"", ""Berkswell"", ""Beyaz Peynir"", ""Bierkase"", ""Bishop Kennedy"",    ""Blarney"", ""Bleu d'Auvergne"", ""Bleu de Gex"", ""Bleu de Laqueuille"",    ""Bleu de Septmoncel"", ""Bleu Des Causses"", ""Blue"", ""Blue Castello"", ""Blue Rathgore"",    ""Blue Vein (Australian)"", ""Blue Vein Cheeses"", ""Bocconcini"", ""Bocconcini (Australian)"",    ""Boeren Leidenkaas"", ""Bonchester"", ""Bosworth"", ""Bougon"", ""Boule Du Roves"",    ""Boulette d'Avesnes"", ""Boursault"", ""Boursin"", ""Bouyssou"", ""Bra"", ""Braudostur"",    ""Breakfast Cheese"", ""Brebis du Lavort"", ""Brebis du Lochois"", ""Brebis du Puyfaucon"",    ""Bresse Bleu"", ""Brick"", ""Brie"", ""Brie de Meaux"", ""Brie de Melun"", ""Brillat-Savarin"",    ""Brin"", ""Brin d' Amour"", ""Brin d'Amour"", ""Brinza (Burduf Brinza)"",    ""Briquette de Brebis"", ""Briquette du Forez"", ""Broccio"", ""Broccio Demi-Affine"",    ""Brousse du Rove"", ""Bruder Basil"", ""Brusselae Kaas (Fromage de Bruxelles)"", ""Bryndza"",    ""Buchette d'Anjou"", ""Buffalo"", ""Burgos"", ""Butte"", ""Butterkase"", ""Button (Innes)"",    ""Buxton Blue"", ""Cabecou"", ""Caboc"", ""Cabrales"", ""Cachaille"", ""Caciocavallo"", ""Caciotta"",    ""Caerphilly"", ""Cairnsmore"", ""Calenzana"", ""Cambazola"", ""Camembert de Normandie"",    ""Canadian Cheddar"", ""Canestrato"", ""Cantal"", ""Caprice des Dieux"", ""Capricorn Goat"",    ""Capriole Banon"", ""Carre de l'Est"", ""Casciotta di Urbino"", ""Cashel Blue"", ""Castellano"",    ""Castelleno"", ""Castelmagno"", ""Castelo Branco"", ""Castigliano"", ""Cathelain"",    ""Celtic Promise"", ""Cendre d'Olivet"", ""Cerney"", ""Chabichou"", ""Chabichou du Poitou"",    ""Chabis de Gatine"", ""Chaource"", ""Charolais"", ""Chaumes"", ""Cheddar"",    ""Cheddar Clothbound"", ""Cheshire"", ""Chevres"", ""Chevrotin des Aravis"", ""Chontaleno"",    ""Civray"", ""Coeur de Camembert au Calvados"", ""Coeur de Chevre"", ""Colby"", ""Cold Pack"",    ""Comte"", ""Coolea"", ""Cooleney"", ""Coquetdale"", ""Corleggy"", ""Cornish Pepper"",    ""Cotherstone"", ""Cotija"", ""Cottage Cheese"", ""Cottage Cheese (Australian)"",    ""Cougar Gold"", ""Coulommiers"", ""Coverdale"", ""Crayeux de Roncq"", ""Cream Cheese"",    ""Cream Havarti"", ""Crema Agria"", ""Crema Mexicana"", ""Creme Fraiche"", ""Crescenza"",    ""Croghan"", ""Crottin de Chavignol"", ""Crottin du Chavignol"", ""Crowdie"", ""Crowley"",    ""Cuajada"", ""Curd"", ""Cure Nantais"", ""Curworthy"", ""Cwmtawe Pecorino"",    ""Cypress Grove Chevre"", ""Danablu (Danish Blue)"", ""Danbo"", ""Danish Fontina"",    ""Daralagjazsky"", ""Dauphin"", ""Delice des Fiouves"", ""Denhany Dorset Drum"", ""Derby"",    ""Dessertnyj Belyj"", ""Devon Blue"", ""Devon Garland"", ""Dolcelatte"", ""Doolin"",    ""Doppelrhamstufel"", ""Dorset Blue Vinney"", ""Double Gloucester"", ""Double Worcester"",    ""Dreux a la Feuille"", ""Dry Jack"", ""Duddleswell"", ""Dunbarra"", ""Dunlop"", ""Dunsyre Blue"",    ""Duroblando"", ""Durrus"", ""Dutch Mimolette (Commissiekaas)"", ""Edam"", ""Edelpilz"",    ""Emental Grand Cru"", ""Emlett"", ""Emmental"", ""Epoisses de Bourgogne"", ""Esbareich"",    ""Esrom"", ""Etorki"", ""Evansdale Farmhouse Brie"", ""Evora De L'Alentejo"", ""Exmoor Blue"",    ""Explorateur"", ""Feta"", ""Feta (Australian)"", ""Figue"", ""Filetta"", ""Fin-de-Siecle"",    ""Finlandia Swiss"", ""Finn"", ""Fiore Sardo"", ""Fleur du Maquis"", ""Flor de Guia"",    ""Flower Marie"", ""Folded"", ""Folded cheese with mint"", ""Fondant de Brebis"",    ""Fontainebleau"", ""Fontal"", ""Fontina Val d'Aosta"", ""Formaggio di capra"", ""Fougerus"",    ""Four Herb Gouda"", ""Fourme d' Ambert"", ""Fourme de Haute Loire"", ""Fourme de Montbrison"",    ""Fresh Jack"", ""Fresh Mozzarella"", ""Fresh Ricotta"", ""Fresh Truffles"", ""Fribourgeois"",    ""Friesekaas"", ""Friesian"", ""Friesla"", ""Frinault"", ""Fromage a Raclette"", ""Fromage Corse"",    ""Fromage de Montagne de Savoie"", ""Fromage Frais"", ""Fruit Cream Cheese"",    ""Frying Cheese"", ""Fynbo"", ""Gabriel"", ""Galette du Paludier"", ""Galette Lyonnaise"",    ""Galloway Goat's Milk Gems"", ""Gammelost"", ""Gaperon a l'Ail"", ""Garrotxa"", ""Gastanberra"",    ""Geitost"", ""Gippsland Blue"", ""Gjetost"", ""Gloucester"", ""Golden Cross"", ""Gorgonzola"",    ""Gornyaltajski"", ""Gospel Green"", ""Gouda"", ""Goutu"", ""Gowrie"", ""Grabetto"", ""Graddost"",    ""Grafton Village Cheddar"", ""Grana"", ""Grana Padano"", ""Grand Vatel"",    ""Grataron d' Areches"", ""Gratte-Paille"", ""Graviera"", ""Greuilh"", ""Greve"",    ""Gris de Lille"", ""Gruyere"", ""Gubbeen"", ""Guerbigny"", ""Halloumi"",    ""Halloumy (Australian)"", ""Haloumi-Style Cheese"", ""Harbourne Blue"", ""Havarti"",    ""Heidi Gruyere"", ""Hereford Hop"", ""Herrgardsost"", ""Herriot Farmhouse"", ""Herve"",    ""Hipi Iti"", ""Hubbardston Blue Cow"", ""Hushallsost"", ""Iberico"", ""Idaho Goatster"",    ""Idiazabal"", ""Il Boschetto al Tartufo"", ""Ile d'Yeu"", ""Isle of Mull"", ""Jarlsberg"",    ""Jermi Tortes"", ""Jibneh Arabieh"", ""Jindi Brie"", ""Jubilee Blue"", ""Juustoleipa"",    ""Kadchgall"", ""Kaseri"", ""Kashta"", ""Kefalotyri"", ""Kenafa"", ""Kernhem"", ""Kervella Affine"",    ""Kikorangi"", ""King Island Cape Wickham Brie"", ""King River Gold"", ""Klosterkaese"",    ""Knockalara"", ""Kugelkase"", ""L'Aveyronnais"", ""L'Ecir de l'Aubrac"", ""La Taupiniere"",    ""La Vache Qui Rit"", ""Laguiole"", ""Lairobell"", ""Lajta"", ""Lanark Blue"", ""Lancashire"",    ""Langres"", ""Lappi"", ""Laruns"", ""Lavistown"", ""Le Brin"", ""Le Fium Orbo"", ""Le Lacandou"",    ""Le Roule"", ""Leafield"", ""Lebbene"", ""Leerdammer"", ""Leicester"", ""Leyden"", ""Limburger"",    ""Lincolnshire Poacher"", ""Lingot Saint Bousquet d'Orb"", ""Liptauer"", ""Little Rydings"",    ""Livarot"", ""Llanboidy"", ""Llanglofan Farmhouse"", ""Loch Arthur Farmhouse"",    ""Loddiswell Avondale"", ""Longhorn"", ""Lou Palou"", ""Lou Pevre"", ""Lyonnais"", ""Maasdam"",    ""Macconais"", ""Mahoe Aged Gouda"", ""Mahon"", ""Malvern"", ""Mamirolle"", ""Manchego"",    ""Manouri"", ""Manur"", ""Marble Cheddar"", ""Marbled Cheeses"", ""Maredsous"", ""Margotin"",    ""Maribo"", ""Maroilles"", ""Mascares"", ""Mascarpone"", ""Mascarpone (Australian)"",    ""Mascarpone Torta"", ""Matocq"", ""Maytag Blue"", ""Meira"", ""Menallack Farmhouse"",    ""Menonita"", ""Meredith Blue"", ""Mesost"", ""Metton (Cancoillotte)"", ""Meyer Vintage Gouda"",    ""Mihalic Peynir"", ""Milleens"", ""Mimolette"", ""Mine-Gabhar"", ""Mini Baby Bells"", ""Mixte"",    ""Molbo"", ""Monastery Cheeses"", ""Mondseer"", ""Mont D'or Lyonnais"", ""Montasio"",    ""Monterey Jack"", ""Monterey Jack Dry"", ""Morbier"", ""Morbier Cru de Montagne"",    ""Mothais a la Feuille"", ""Mozzarella"", ""Mozzarella (Australian)"",    ""Mozzarella di Bufala"", ""Mozzarella Fresh, in water"", ""Mozzarella Rolls"", ""Munster"",    ""Murol"", ""Mycella"", ""Myzithra"", ""Naboulsi"", ""Nantais"", ""Neufchatel"",    ""Neufchatel (Australian)"", ""Niolo"", ""Nokkelost"", ""Northumberland"", ""Oaxaca"",    ""Olde York"", ""Olivet au Foin"", ""Olivet Bleu"", ""Olivet Cendre"",    ""Orkney Extra Mature Cheddar"", ""Orla"", ""Oschtjepka"", ""Ossau Fermier"", ""Ossau-Iraty"",    ""Oszczypek"", ""Oxford Blue"", ""P'tit Berrichon"", ""Palet de Babligny"", ""Paneer"", ""Panela"",    ""Pannerone"", ""Pant ys Gawn"", ""Parmesan (Parmigiano)"", ""Parmigiano Reggiano"",    ""Pas de l'Escalette"", ""Passendale"", ""Pasteurized Processed"", ""Pate de Fromage"",    ""Patefine Fort"", ""Pave d'Affinois"", ""Pave d'Auge"", ""Pave de Chirac"", ""Pave du Berry"",    ""Pecorino"", ""Pecorino in Walnut Leaves"", ""Pecorino Romano"", ""Peekskill Pyramid"",    ""Pelardon des Cevennes"", ""Pelardon des Corbieres"", ""Penamellera"", ""Penbryn"",    ""Pencarreg"", ""Perail de Brebis"", ""Petit Morin"", ""Petit Pardou"", ""Petit-Suisse"",    ""Picodon de Chevre"", ""Picos de Europa"", ""Piora"", ""Pithtviers au Foin"",    ""Plateau de Herve"", ""Plymouth Cheese"", ""Podhalanski"", ""Poivre d'Ane"", ""Polkolbin"",    ""Pont l'Eveque"", ""Port Nicholson"", ""Port-Salut"", ""Postel"", ""Pouligny-Saint-Pierre"",    ""Pourly"", ""Prastost"", ""Pressato"", ""Prince-Jean"", ""Processed Cheddar"", ""Provolone"",    ""Provolone (Australian)"", ""Pyengana Cheddar"", ""Pyramide"", ""Quark"",    ""Quark (Australian)"", ""Quartirolo Lombardo"", ""Quatre-Vents"", ""Quercy Petit"",    ""Queso Blanco"", ""Queso Blanco con Frutas --Pina y Mango"", ""Queso de Murcia"",    ""Queso del Montsec"", ""Queso del Tietar"", ""Queso Fresco"", ""Queso Fresco (Adobera)"",    ""Queso Iberico"", ""Queso Jalapeno"", ""Queso Majorero"", ""Queso Media Luna"",    ""Queso Para Frier"", ""Queso Quesadilla"", ""Rabacal"", ""Raclette"", ""Ragusano"", ""Raschera"",    ""Reblochon"", ""Red Leicester"", ""Regal de la Dombes"", ""Reggianito"", ""Remedou"",    ""Requeson"", ""Richelieu"", ""Ricotta"", ""Ricotta (Australian)"", ""Ricotta Salata"", ""Ridder"",    ""Rigotte"", ""Rocamadour"", ""Rollot"", ""Romano"", ""Romans Part Dieu"", ""Roncal"", ""Roquefort"",    ""Roule"", ""Rouleau De Beaulieu"", ""Royalp Tilsit"", ""Rubens"", ""Rustinu"", ""Saaland Pfarr"",    ""Saanenkaese"", ""Saga"", ""Sage Derby"", ""Sainte Maure"", ""Saint-Marcellin"",    ""Saint-Nectaire"", ""Saint-Paulin"", ""Salers"", ""Samso"", ""San Simon"", ""Sancerre"",    ""Sap Sago"", ""Sardo"", ""Sardo Egyptian"", ""Sbrinz"", ""Scamorza"", ""Schabzieger"", ""Schloss"",    ""Selles sur Cher"", ""Selva"", ""Serat"", ""Seriously Strong Cheddar"", ""Serra da Estrela"",    ""Sharpam"", ""Shelburne Cheddar"", ""Shropshire Blue"", ""Siraz"", ""Sirene"", ""Smoked Gouda"",    ""Somerset Brie"", ""Sonoma Jack"", ""Sottocenare al Tartufo"", ""Soumaintrain"",    ""Sourire Lozerien"", ""Spenwood"", ""Sraffordshire Organic"", ""St. Agur Blue Cheese"",    ""Stilton"", ""Stinking Bishop"", ""String"", ""Sussex Slipcote"", ""Sveciaost"", ""Swaledale"",    ""Sweet Style Swiss"", ""Swiss"", ""Syrian (Armenian String)"", ""Tala"", ""Taleggio"", ""Tamie"",    ""Tasmania Highland Chevre Log"", ""Taupiniere"", ""Teifi"", ""Telemea"", ""Testouri"",    ""Tete de Moine"", ""Tetilla"", ""Texas Goat Cheese"", ""Tibet"", ""Tillamook Cheddar"",    ""Tilsit"", ""Timboon Brie"", ""Toma"", ""Tomme Brulee"", ""Tomme d'Abondance"",    ""Tomme de Chevre"", ""Tomme de Romans"", ""Tomme de Savoie"", ""Tomme des Chouans"", ""Tommes"",    ""Torta del Casar"", ""Toscanello"", ""Touree de L'Aubier"", ""Tourmalet"",    ""Trappe (Veritable)"", ""Trois Cornes De Vendee"", ""Tronchon"", ""Trou du Cru"", ""Truffe"",    ""Tupi"", ""Turunmaa"", ""Tymsboro"", ""Tyn Grug"", ""Tyning"", ""Ubriaco"", ""Ulloa"",    ""Vacherin-Fribourgeois"", ""Valencay"", ""Vasterbottenost"", ""Venaco"", ""Vendomois"",    ""Vieux Corse"", ""Vignotte"", ""Vulscombe"", ""Waimata Farmhouse Blue"",    ""Washed Rind Cheese (Australian)"", ""Waterloo"", ""Weichkaese"", ""Wellington"",    ""Wensleydale"", ""White Stilton"", ""Whitestone Farmhouse"", ""Wigmore"", ""Woodside Cabecou"",    ""Xanadu"", ""Xynotyro"", ""Yarg Cornish"", ""Yarra Valley Pyramid"", ""Yorkshire Blue"",    ""Zamorano"", ""Zanetti Grana Padano"", ""Zanetti Parmigiano Reggiano""};} </code></pre>","233618","","418183","","2010-12-06 09:45:34","2013-05-08 04:20:17","How to make ListView filter on Android","<android><android-widget>","3","0","2","",""
"4352137","1","4352157","","2010-12-04 05:36:15","0","622","<p>I want to copy a picture from asstets folder and paste it in my package, just for test. but final image doesn't show anything. when I want to open picture with paint, it says that ""This is not a valid bitmap file"".</p><p>In my program, I start to read original image in this way:</p><pre><code>private void copyImage(){    AssetManager am = getResources().getAssets();                   try{        image = BitmapFactory.decodeStream(am.open(""tasnim.png""));        imWidth  = image.getWidth();        imHeight = image.getHeight();    }     catch(IOException e){        e.printStackTrace();        System.out.println(""Error accoured!"");    }}</code></pre><p>next, I'll get pixels of image or extract pixels, and save pixels in array of integer (rgbstream).</p><pre><code>private void getPixelsOfImage(){    rgbStream = new int[imWidth * imHeight];    image.getPixels(rgbStream, 0, imWidth, 0, 0, imWidth, imHeight);}</code></pre><p>finally, I want to save it in my package,</p><pre><code>private void createPicture(){    contextPath = context.getFilesDir().getAbsolutePath();    String path = contextPath + ""/"" + picName;    try{        FileOutputStream fos = new FileOutputStream(path);        DataOutputStream dos = new DataOutputStream(fos);         for(int i=0; i&lt;rgbStream.length; i++)            dos.writeByte(rgbStream[i]);        dos.flush();        dos.close();        fos.close();    }    catch(IOException e){        System.out.println(""IOException : "" + e);    }    System.out.println(""Picture Created."");}</code></pre><p>Code works fine but result, nothing!!! :( When I check DDMS it creates new file and store all pixels (because it shows the size of this file is 13300 and dimension of my original picture is 100*133). when I click ""pull a file from the device"" I can save it on my desktop. However, when I open it :) nothing.</p><p>What you think? is there any problem in my code? Thanks</p>","513413","","345717","","2010-12-04 05:53:30","2010-12-04 07:09:14","Android: Copy and paste of an image do not work!","<android><image>","1","5","","",""
"4352172","1","4352194","","2010-12-04 05:49:23","15","27116","<p>Suppose I have an activity to select an image from the gallery, and retrieve it as a BitMap, just like the example: <a href=""http://stackoverflow.com/questions/2227209/how-to-get-the-images-from-device-in-android-java-application/2229154#2229154"">here</a></p><p>Now, I want to pass this BitMap to be used in an ImageView for another activity. I am aware bundles can be passed between activities, but how would I store this BitMap into the bundle?</p><p>or is there another approach I should take?</p>","490703","","","","","2013-08-13 07:22:47","how do you pass images (bitmaps) between android activities using bundles?","<android><image><bundle>","4","0","6","",""
"4352238","1","","","2010-12-04 06:17:05","0","1593","<p>I have 7 apps on the market - all free. In total I have had 10k impressions and have made $11. What do you think of this? Search 'Lewicki' to see my apps. Thanks</p>","530211","","","","","2010-12-04 06:31:19","Admob or Adsense for my android apps?","<android>","1","0","","",""
"4352268","1","","","2010-12-04 06:25:16","0","221","<p><a href=""http://i.stack.imgur.com/JT0NX.png"" rel=""nofollow"">alt text</a>I am writing an application in sms encryption. I encrypted the sms and successfully send that encrypted sms to the recepient(Used 2 android emulators). My problem is in the decryption side. How can i decrypt that received encrypted sms. From the broadcast receiver i cant write tat application.My UI is given below I am a beginner in this.Any help will be appreciated.Thank u..</p>","530218","","","","","2010-12-04 06:25:16","Seeking help for sms decryption","<android>","0","2","","",""
"4352450","1","","","2010-12-04 07:15:01","2","1077","<p>I am New to Android. My Requirement is to implement a color picker which scrolls the colors in rainbow model from that I want to pick a color.</p>","530259","","168175","","2013-11-10 12:22:22","2013-11-10 12:22:22","Rainbow type color picker in Android","<android>","2","0","1","",""
"4352482","1","4353815","","2010-12-04 07:25:34","0","239","<p>hii i am developing an app in which i m getting locations and speed. now when the user in speed , i m showing a screen in front of user on which user has 2 buttons. and doing same in a zone which we make restricted. user has to send sms to parent if he is in speed or zone. but i m getting a problem that as user got speed my screen is not coming, phone got hanged and app is in App not responding mode. i apply threading for this also but didn't get succeed , please check my code and guide me is there is anything goes wrong.if the first screen is coming than on click of button it is going in same situation as above.</p><pre><code>public class CheckLocation extends Service{    private static final String TAG = ""CheckLocation"";    private LocationManager lm;    LocationListener locationListener;    private float speed,speedinMiles,Speedvalue,lastSpeed;    private double lattitude=25.66;    private double longtitude=32.45;    private Context context;    String IMEI,result,speedStatus,wantSpeedAlert,addwithData,alertAdd,status;    String []child,parentNumber;    String serverAdd= SERVER ADDRESS FOR SAVING LOCATION DATA IN DATABASE;    String speedAlert=SERVER ADDRESS FOR SENDING MAIL    PendingIntent pendingIntent;    CursorHandler cursorHandler;    boolean zoneFlag,isState,isRestrictedZone,alreadyRunning=false;     JSONArray jArray;     JSONObject  json_data=new JSONObject();     SendingSmsEmail sendingSmsEmail;     int enter=0,exit=0,speedIntent=0;    public CheckLocation(Context context)    {        this.context = context;    }    public CheckLocation()     {        Log.d(TAG,""in constructor of check location"");    }    @Override    public IBinder onBind(Intent intent) {        return null;    }    @Override    public void onCreate()     {        Log.d(TAG, ""onCreate()"");        super.onCreate();        cursorHandler=new CursorHandler(this);        TelephonyManager telephonyManager=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);        IMEI = telephonyManager.getDeviceId();        Log.d(TAG,""imei number of phone..got it..""+IMEI);        status=getStatus();        Log.d(TAG, ""status of speed sms..""+status);        Log.d(TAG, ""starting service"");        startService();    }    private void startService()     {        Log.d(TAG, ""startService()"");        lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);        locationListener = new MyLocationListener();        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,locationListener);        Log.d(TAG, ""calling location listener"");    }    private class MyLocationListener implements LocationListener     {        public void onLocationChanged(Location loc)        {            Log.d(TAG, ""onLocationChanged()"");            if (loc != null)            {                lattitude=loc.getLatitude();                longtitude=loc.getLongitude();                lastSpeed = speed;                speed = loc.getSpeed();// CHANGING SPPEED IN MILES PER SECOND                speedinMiles=(float) (speed*2.2369362920544);                Log.d(TAG, ""speed in miles..""+speedinMiles);                loc.setSpeed(speedinMiles);//BROADCASTING SPEED INTENT                             Intent intent = new Intent(SOMECLASS.INTENT_SPEED_CHECK);                intent.putExtra(""speed"", speedinMiles);                intent.putExtra(""lattitude"",lattitude);                intent.putExtra(""longitude"", longtitude);                sendBroadcast(intent);                Log.d(TAG, ""Intent Broad casted"");//SAVING LOCATION DATA IN DATABSE                               saveData(lattitude,longtitude);//  CHECKING SPEED                if(speedinMiles&gt;20)                {                    new CheckSpeedTask().execute(status);// HERE STATUS IS FOR IF WE WANT TO SEND SMS OR NOT                }                else                {                    Log.d(TAG, ""user is not in speed "");                    speedIntent=0;                }                }            }        public void onProviderDisabled(String provider)        {            Log.d(TAG, ""onProviderDisabled,enableing network provider"");            lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,0,0,locationListener);            Log.d(TAG, ""Network provider enabled"");        }        public void onProviderEnabled(String provider) {            Log.d(TAG, ""onProviderEnabled"");        }        public void onStatusChanged(String provider, int status, Bundle extras) {            Log.d(TAG, ""onStatusChanged)"");        }    }    public float getCurrentSpeed() {        return speedinMiles;    }    public double getCurrentLattitude() {        return lattitude;    }    public double getCurrentLongitude() {        return longtitude;    }    public float getLastSpeed() {        return lastSpeed;    }    private String getStatus()     {        //child=conntectionHandler.post(childstatus);        child=cursorHandler.getData(""status"");         for (int i = 0; i &lt; child.length; i++)             {                  Log.d(TAG,""status[""+i+""]""+child[i]);                  speedStatus=child[i];                 System.out.println(""status.""+speedStatus);            }         wantSpeedAlert=speedStatus.substring(speedStatus.indexOf("","")+1,speedStatus.lastIndexOf("",""));        System.out.println(""speed alert is..""+wantSpeedAlert);        return wantSpeedAlert;    }    void saveData(double lattitude2, double longtitude2)    {        try{                    Log.d(TAG,""Saving...latt..""+lattitude+""..long..""+longtitude);            addwithData=serverAdd+IMEI+""&amp;latitude=""+lattitude2+""&amp;longitude=""+longtitude2;            Log.d(TAG,""completeServerAdd..""+addwithData);         HttpClient httpclient = new DefaultHttpClient();           HttpGet httpGet=new HttpGet(addwithData);            HttpResponse response = httpclient.execute(httpGet);            Log.d(TAG, response.toString());            Log.d(TAG,""server Connected"");             Log.i(TAG,""data inserted"");        }        catch(Exception e)        {            Log.e(TAG, ""Error converting result ""+e.getMessage());        }    }    private class CheckSpeedTask extends AsyncTask&lt;String,Void,Void&gt;    {        @Override        protected Void doInBackground(String... status)         {            Log.d(TAG, ""CHECK SPEED TASK"");            String statusForMail=status[0];            if(statusForMail.equalsIgnoreCase(""y""))            {                           System.out.println(""speed Alert status is...""+statusForMail);                if(speedIntent==0)                {                        //sending mail and sms to parent                        alertAdd=speedAlert+IMEI+""&amp;speed=""+speedinMiles;                        Log.d(TAG, ""address for speed alert.""+alertAdd);                        Log.d(TAG, ""prompting server "");                        try                         {                         HttpClient httpClient = new DefaultHttpClient();                        HttpGet  httpGet=new HttpGet(alertAdd);                        HttpResponse response = httpClient.execute(httpGet);                          Log.d(TAG,""mail send"");                          speedIntent=1;                        }                         catch (Exception e)                        {                            Toast.makeText(context,""Sever Connection Problem"",Toast.LENGTH_LONG);                            e.printStackTrace();                        }                }                else                {                    Log.d(TAG, ""speed intent value is 1 so not sending mail"");                }            }            else            {                Log.d(TAG, ""Speed alert status is negative"");            }            return null;        }        @Override        protected void onPostExecute(Void result)        {            Log.d(TAG, ""Starting Intent"");            Intent screenIntent=new Intent(getApplicationContext(),SpeedScreen.class);            screenIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            screenIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);            getApplicationContext().startActivity(screenIntent);                Log.d(TAG, ""new Activity Starts"");        }    }}</code></pre><p>i also put a thread in on button click method. please guide me if anything goes wrong.  thanks in advance</p>","450601","","450601","","2010-12-04 07:54:51","2010-12-04 13:49:44","using threads in class","<android><multithreading>","1","2","0","",""
"4352493","1","4352675","","2010-12-04 07:31:12","1","930","<p>Hi friends    How to show splash screen until tab bar is loaded in android can anybody give example</p><p>I have login screen from login screen if user click login button  I am getting data from webservice and loading tab bar in android  activity at that time screen will be black it take time upto tabbar loaded I want to display splash screen</p><p>thanks</p>","426344","","426344","","2010-12-04 09:39:57","2010-12-04 09:39:57","How to show splash screen until tab bar is loaded in android","<android>","1","2","2","",""
"4352534","1","4352553","","2010-12-04 07:45:20","1","943","<p>Suppose I want to have a certain image on the main screen of my map. Also, there is a menu option that lets the user select an image from the gallery and once selected, it will downsize/crop the image and store it on internal storage for the app (<a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesInternal"" rel=""nofollow"">using something like here</a>). If I understand correctly, then the image will persist even after the app is killed.</p><p>Now, there should only ever be one image at a time so the previous image file should just be overwritten every time the menu option is run. However, if the user does not change the image, there should still be some default image file that will display, where should this image be stored in my project?</p><p>Alternatively, should I just keep a default image in my drawable or raw resource directory, and keep a boolean flag to know whether it is necessary to load another image?). However, I would need to make sure the boolean value persists after the app dies. Possibly using shared preferences?)</p>","490703","","","","","2010-12-04 07:53:00","where do you store a default image on internal storage of android?","<android><image><storage><internal>","1","0","","",""
"4352548","1","4352567","","2010-12-04 07:50:42","6","5856","<p>As you can guess, i register an alarm by AlarmManager. And the BroadcastReceiver will be called correctly. But when it called, my phone screen is still locked. I notice the default AlarmClock application is not like this. So my question is, how to unlock the screen when the BroadcastReceiver is called ? (Unlock the screen can make the user to operate my Activity directly) Thanks in advance.</p>","459062","","","","","2010-12-04 08:57:27","how to unlock the screen when BroadcastReceiver is called?","<android><broadcastreceiver>","1","0","6","",""
"4352764","1","4352909","","2010-12-04 09:04:21","-1","2026","<p>I have one android application in i have to create a service that run 24 hours a day it also use xml parsing based on that data it gives notification on the particular time?</p><p>How can I do this?</p>","461503","","17413","","2011-04-16 18:05:34","2011-04-16 18:05:34","Android Service With Notification","<android>","1","2","","",""
"4352771","1","4352813","","2010-12-04 09:05:50","0","83","<p>I am building an Android app in which there is a list of items in a gridview, and I would like the user to select any of them.I do not want to use a radio group/radios, but an icon and a name of the item next to it.</p><p>Once the user has selected something, I have three buttons at the bottom, back, cancel and set as default.</p><p>The problem is arranging this stuff so that it appears fine on a landscape mode as well as portrait mode.</p><p>Can someone suggest a good layout skeleton?</p><p>Here is the Android layout file content</p><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br/>&lt;RelativeLayout<br/>android:id=&quot;@+id/widget30&quot;<br/>android:layout_width=&quot;fill_parent&quot;<br/>android:layout_height=&quot;fill_parent&quot;<br/>xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br/>&gt;<br/>&lt;GridView<br/>  xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br/>  android:id=&quot;@+id/GridView01&quot;<br/> android:layout_width=&quot;fill_parent&quot;    <br/>   android:layout_height=&quot;370dip&quot;    <br/>    android:numColumns=&quot;auto_fit&quot;    <br/>    android:stretchMode=&quot;columnWidth&quot; <br/>    android:layout_alignParentTop=&quot;true&quot;   <br/>    android:gravity=&quot;center&quot;&gt;<br/>&lt;/GridView&gt;<br/><br/>&lt;Button<br/>android:id=&quot;@+id/back&quot;<br/>android:layout_width=&quot;wrap_content&quot;<br/>android:layout_height=&quot;wrap_content&quot;<br/>android:text=&quot;  Back  &quot;<br/>android:layout_alignParentBottom=&quot;true&quot;<br/>android:layout_alignParentLeft=&quot;true&quot;<br/>android:layout_below=&quot;@+id/GridView01&quot;<br/><br/>&gt;<br/>&lt;/Button&gt;<br/><br/>&lt;Button<br/>android:id=&quot;@+id/setDefault&quot;<br/>android:layout_width=&quot;wrap_content&quot;<br/>android:layout_height=&quot;wrap_content&quot;<br/>android:text=&quot;  Set as Default  &quot;<br/>android:layout_alignParentBottom=&quot;true&quot;<br/>android:layout_toLeftOf=&quot;@+id/cancel&quot;<br/>android:layout_below=&quot;@+id/GridView01&quot;<br/>&gt;<br/>&lt;/Button&gt;<br/>&lt;Button<br/>android:id=&quot;@+id/cancel&quot;<br/>android:layout_width=&quot;wrap_content&quot;<br/>android:layout_height=&quot;wrap_content&quot;<br/>android:text=&quot;  Cancel  &quot;<br/>android:layout_alignParentBottom=&quot;true&quot;<br/>android:layout_alignParentRight=&quot;true&quot;<br/>android:layout_below=&quot;@+id/GridView01&quot;<br/>&gt;<br/>&lt;/Button&gt;<br/>&lt;/RelativeLayout&gt;<br/>    </code></pre>","527541","","527541","","2010-12-09 07:08:06","2010-12-09 07:08:06","Android Layout suggestions required","<android><layout>","1","0","","",""
"4352792","1","4353002","","2010-12-04 09:10:54","0","877","<p>In main.xml, I have a table layout that it has two buttons in the first row, and two EditTexts in the second row.</p><p>when I run the application, first column in smaller than the other. what should I do to divide the screen equally?</p><p>Thanks</p>","513413","","","","","2010-12-04 10:02:55","android: how can I divide a screen exactly in two parts through XML?","<android><screen><tablelayout>","1","0","","",""
"4352826","1","4352955","","2010-12-04 09:20:58","0","1163","<p>I am new to android,actually this is my second program.I am programming from last night and i am trying to find a solution for hours!!!I read everything here and i google my problem but i still cant fix it!!My problem is the usual as i understood that i cannot stop audio playback when i click another button.I tried mp.release,stop,everything but keeps crashing when i press stop button or back!!What i am doing wrong??I have 22 buttons and i play 21 songs(one button at top for stop).Also i forgot to mention that i tried to make button when clicking 2nd time to stop playing but i couldn't do it that's why i put stop button.</p><p>this is my code  </p><pre><code>package org.kidsongs;import android.app.Activity;import android.media.AudioManager;import android.media.MediaPlayer;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.View;import android.widget.Button;public class menu extends Activity {    public MediaPlayer mp=null;    Button playerButton;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        setVolumeControlStream(AudioManager.STREAM_MUSIC);        final Button button = (Button) findViewById(R.id.Button01);         button.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                      MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song1);                                     mp.start();            }        });        final Button button2 = (Button) findViewById(R.id.Button02);         button2.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song2);                                     mp.start();            }        });        final Button button3 = (Button) findViewById(R.id.Button03);         button3.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song3);                                     mp.start();            }        });        final Button button4 = (Button) findViewById(R.id.Button04);         button4.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song4);                                     mp.start();            }        });        final Button button5 = (Button) findViewById(R.id.Button05);         button5.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song5);                                     mp.start();            }        });        final Button button6 = (Button) findViewById(R.id.Button06);         button6.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song6);                                     mp.start();            }        });        final Button button7 = (Button) findViewById(R.id.Button07);         button7.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song7);                                     mp.start();            }        });        final Button button8 = (Button) findViewById(R.id.Button08);         button8.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song8);                                     mp.start();            }        });        final Button button9 = (Button) findViewById(R.id.Button09);         button9.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song9);                                     mp.start();            }        });        final Button button10 = (Button) findViewById(R.id.Button10);         button10.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song10);                                     mp.start();            }        });        final Button button11 = (Button) findViewById(R.id.Button11);         button11.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song11);                                     mp.start();            }        });        final Button button12 = (Button) findViewById(R.id.Button12);         button12.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song12);                                     mp.start();            }        });        final Button button13 = (Button) findViewById(R.id.Button13);         button13.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song13);                                     mp.start();            }        });        final Button button14 = (Button) findViewById(R.id.Button14);         button14.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song14);                                     mp.start();            }        });        final Button button15 = (Button) findViewById(R.id.Button15);         button15.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song15);                                     mp.start();            }        });        final Button button16 = (Button) findViewById(R.id.Button16);        button16.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song16);                                     mp.start();            }        });        final Button button17 = (Button) findViewById(R.id.Button17);         button17.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song17);                                     mp.start();            }        });        final Button button18 = (Button) findViewById(R.id.Button18);         button18.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song18);                                     mp.start();            }        });        final Button button19 = (Button) findViewById(R.id.Button19);         button19.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song19);                                     mp.start();            }        });        final Button button20 = (Button) findViewById(R.id.Button20);         button20.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song20);                                     mp.start();            }        });        final Button button21 = (Button) findViewById(R.id.Button21);         button21.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                                     MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.song21);                                     mp.start();            }        });        final Button stopbutton = (Button) findViewById(R.id.Button22);         stopbutton.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                       mp.stop();                    mp.release();             }        });     }     @Override    public boolean onCreateOptionsMenu(Menu menu) {        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.info, menu);        return true;    }    @Override    protected void onPause() {        super.onPause();        if(mp.isPlaying()){             mp.stop();        }    }    @Override     public void onDestroy(){     super.onDestroy();        mp.release();    }}</code></pre>","515843","","","","","2011-03-20 11:08:49","mp.stop() problem","<android><button><android-widget><media-player>","2","1","","",""
"4352879","1","5784382","","2010-12-04 09:36:27","1","1437","<p>So I am working on a UI that use a tab interface to change activities. I have been trying to modify the code found here: <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a> so that it will fit my needs. </p><p>But the issue I am having right now is that the size of the text required for the tabs is longer then the width of the tab its self. So what I was wondering is if either there is a way to make it so that there is no image but have two lines of text instead or that there is two lines of text and an icon. The second option is the one i prefer though.</p><p>Here is the code I am trying to modify:</p><pre><code>        spec = tabHost.newTabSpec(""screen"").setIndicator(""Screen Ratio"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    tabHost.addTab(spec);</code></pre><p>The code is straight out of the tutorial except for where I changed the text. This is the first app I have tried to write so it is very much a work in progress but are either of these methods even a good way to go about it or is there a better way all together. Any suggestions would be great appreciated.</p>","529865","","","","","2013-11-25 09:29:55","Putting a break in to a tabs text","<android><tabs>","1","3","","",""
"4352908","1","4353434","","2010-12-04 09:42:31","0","997","<p>I'm still struggling with my tts. Everything works nicely in my emulator, but since my phone is swedish I need to check for the Locale.US (my texts are in english) and install it.And.. that's what I thought I did, but the Locale is unavailable and returns -1? Am I doing something wrong, I thought the english languages were always available?</p><pre><code>   public void onInit(int status) {    // status can be either TextToSpeech.SUCCESS or TextToSpeech.ERROR.    if (status == TextToSpeech.SUCCESS) {        // Set preferred language to US english.        // Note that a language may not be available, and the result will indicate this.        int result = mtts.setLanguage(Locale.US);        if (result == TextToSpeech.LANG_MISSING_DATA ||            result == TextToSpeech.LANG_NOT_SUPPORTED) {           // Lanuage data is missing or the language is not supported.            Log.e(TAG, ""Language is not available."");           //install it?            result = mtts.isLanguageAvailable(Locale.US);            if (result == TextToSpeech.LANG_AVAILABLE) {            AlertDialog.Builder builder = new AlertDialog.Builder(this);            builder.setMessage(""Language missing, install English speech?"")                   .setCancelable(false)                   .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                       public void onClick(DialogInterface dialog, int id) {                           //installera                           Intent installIntent = new Intent();                           installIntent.setAction(                               TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);                           startActivity(installIntent);                       }                   })                   .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                       public void onClick(DialogInterface dialog, int id) {                            dialog.cancel();                       }                   });            AlertDialog alert = builder.create();            }            //not installable            Log.e(TAG, ""Language not installable"");        } else {            // The TTS engine has been successfully initialized.            speak();        }    } else {        // Initialization failed.        Log.e(TAG, ""Could not initialize TextToSpeech."");    }}</code></pre>","498112","","168868","","2012-01-01 21:31:15","2012-01-01 21:31:15","android TextToSpeech.LANG_AVAILABLE","<android><locale><text-to-speech>","1","1","","",""
"4352988","1","","","2010-12-04 10:01:21","0","628","<p>I have written a basic java http server using sockets. It has simple REST interface and responds to GET/POST requests. I set out to do a small android app connecting to this interface. I can connect to my servers using browsers from my pc and also I tried out from vmware player virtual machines ubuntu and xp. All work well. I was afraid of testing on emulator so deployed the app on android phone. It cannot connect to the java servers. Both device and PC is connected to same network. Am I missing something here like port forwarding etc ? If that's the problem how come I was able to connect from my virtual machines?</p><p>Any help/suggestions are appreciated.</p><p>Regards,Lalith</p>","297119","","","","","2010-12-04 13:43:06","Android connecting to local java ServerSocket?","<android><networking>","2","0","","",""
"4353076","1","4353601","","2010-12-04 10:26:05","2","2039","<p>I read <a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch"" rel=""nofollow"">article (Android Developers)</a> on 9patch PNG in Android. But I'm not getting what is the real use of it ? If i use Gradient Image then it is going to behave same as 9Patch PNG. </p><p>I had discussion with my graphics designer, he was telling me that it is same as Image Repeat used in CSS. Is it so ?</p><p>-Thanks   </p>","236732","","","","","2010-12-04 13:00:21","What is the use of 9patch PNG?","<android><android-ui>","2","1","1","",""
"4353128","1","4355032","","2010-12-04 10:44:24","3","661","<p>I am developing an Android app as a research tool. The idea behind is that a researcher hands out a couple of Android device to participants and they use the device to gather data on behalf of the researcher.</p><p>Now I would like to make use of Android's C2DM (cloud to device messaging). The problem here is that a Google account is required. This is not going to work for me since the researcher would have to pre-configure one account for each device. That would be feasible but the actual problem arises from the Market access. Participants could use that account to buy anything from the Market. So my question is how to limit the Market's functionality to just free apps while maintaining C2DM.</p><p>Thanks everyone</p>","289849","","","","","2011-09-13 09:38:45","Using Android's C2DM with market disabled","<android><google-play>","2","2","","",""
"4353132","1","","","2010-12-04 10:45:31","1","7543","<p>Hi, I want to create Tab dynamically in android  and under each tab I have one listview. So I want the content of the listview to also change dynamically. How can I do this ?</p><p>Thanks in advance. Any help will be appreciated.</p>","307585","","724516","","2012-05-26 05:27:49","2012-08-27 13:37:37","Dynamic tab in android with dynamic tab content","<android><listview><tabs>","3","0","","",""
"4353134","1","","","2010-12-04 10:45:56","0","743","<p>I have an app using the MediaPlayer class... It has always worked on 1.6 and 2.1 devices, but since I have beentesting on a 2.2 device (and the emulator) I have noticed that it won't stream a mp3 file if a redirect takes place first...It will return the following :</p><pre><code>12-04 11:40:48.813: ERROR/HTTPDataSource(34): HTTP request failed w/ http status 30712-04 11:40:48.813: INFO/AwesomePlayer(34): mConnectingDataSource-&gt;connect() returned -100412-04 11:40:48.813: ERROR/MediaPlayer(2305): error (1, -1004)12-04 11:40:48.813: ERROR/MediaPlayer(2305): Error (1,-1004)</code></pre><p>I was wondering if anyone has noticed this behavior and if so if anyone has any solution for the problem ? It might be an ""AwesomePlayer"" but it doesnt behave any better than it predecessor :(</p>","162147","","","","","2010-12-04 11:30:57","MediaPlayer Redirect return http 307 on Android 2.2","<android><media-player><android-2.2-froyo><http-status-code-307>","1","0","","",""
"4353265","1","4353514","","2010-12-04 11:25:05","6","7740","<p>As the title says, I've seen EditTexts where they are just plain white with no smooth corners or orange android border when you highlight it etc.</p><p>Like it looks in this app:<a href=""http://s1.appbrain.com/screen?id=-2631427781674403509&amp;i=1"">http://s1.appbrain.com/screen?id=-2631427781674403509&amp;i=1</a></p>","427234","","","","","2010-12-04 12:36:42","Android Development: How Can I Make An EditText Plain So It's Just A White Square?","<android><view><edittext>","1","1","1","",""
"4353317","1","","","2010-12-04 11:37:57","3","5870","<p>I want to call an application's activity from within an activity of another application. What I'm doing here is:</p><pre><code>                Intent intent = new Intent();                intent.setClassName(""another_app_package_name"", ""another_app_package_name.class_name_in_that_package"");                startActivity(intent);</code></pre><p>But my application is quitting throwing NoActivityFound exception saying that unable to find explicit activity class another_app_package_name.class_name_in_that_package.</p><p>I'm missing something obvious. Can anybody please help?</p><p>I'm fairely new to Android platform.</p><p>Thanx in advance.</p>","227943","","","","","2012-12-12 10:05:12","Calling an activity from an application from another application android","<android><activity>","4","0","4","",""
"4353350","1","4353394","","2010-12-04 11:51:34","0","45","<p>I created a list view with two labels and a image view.I need to hide the image view in some rows . I dont know how to hide it.I tried <code>mycell.imagecomponent.setVisibility(View.INVISIBLE);</code> Please help</p>","450487","","450487","","2010-12-04 12:03:06","2010-12-04 12:03:45","List view issue","<java><android><listview>","1","0","","",""
"4353448","1","4365661","","2010-12-04 12:16:57","0","393","<p>I think I understood the Activity lifecycle on Android, but I still can't figure why the followin is happening.</p><ul><li>Login activity - Login screen</li><li>Main activity - Main application interface</li></ul><p>In Login activity, I connect to a service to validate the login. If the password is correct, I switch to Main activity using:</p><pre><code>Intent intent = new Intent(this, MainActivity.class);startActivity(intent);</code></pre><p>There is no Options menu in Login activity. I have an Options menu in Main activity that I inflate with:</p><pre><code>    @Override public boolean onCreateOptionsMenu(Menu menu) {     MenuInflater inflater = getMenuInflater();     inflater.inflate(R.menu.option, menu);     return true; }</code></pre><p>So far so good. But I want the user to be able to log out and go back to login screen.So in Main activity I have an option in the menu that allows logging out:</p><pre><code>   @Override public boolean onOptionsItemSelected(MenuItem item) {     // Handle item selection     switch (item.getItemId()) {     case R.id.menuReset:      getModel().deleteCredentials // stuff to logout from my service      startActivity(new Intent(this, LoginActivity.class));      finish();      return true;     } } </code></pre><p>If I press that menu button, the application displays Login activity again. But if I press the MENU key, the application displays the menu from Main activity even if it's not visible.</p><p>Furthermore, if I go back to home screen (pressing HOME) and come back to my activity after a while, the application displays the Login activity, but if I press the MENU key the Main application menu still shows.</p><p>How do I remove the menu from the Login activity?</p><p>Thanks</p>","412927","","412927","","2013-08-20 20:12:50","2013-08-20 20:12:50","Android menu shared between activities (unwanted)","<android><menu>","2","2","","",""
"4353494","1","","","2010-12-04 12:31:08","2","4550","<p>Ok so whats the best way to detect collisions in android, as the only examples i can find on it all involes finding when the two objects are directly over each other. personally i was thinking about using bounding boxes but even that i do not know how to do and then i still desire something a little more percise (per-pixel?)</p>","527926","","513598","","2011-01-29 02:56:55","2012-08-20 16:38:59","Collision Detection In Android","<android><collision-detection>","3","0","","",""
"4353558","1","","","2010-12-04 12:50:59","1","1595","<p>1) I am wondering if the Android SDK has already predefined encryption functions or if one would have to write this all from scratch?</p><p>2) Suppose you have classes for encryption, either written by yourself or provided by the SDK, how to make sure, that the content of the RAM (that contains the key in plaintext) is never written to the permanent storage of the android device? I guess if too much RAM is used, there's some kind of swapping, besides that there are techniques like HTC's fastboot that write the whole content to the storage if I am not wrong? Any chance to prevent the RAM content for your software being saved on a permanent storage? Or is there maybe some kind of event before the RAM content is written to the permanenent storage, so one could wipe the key before that?</p><p>Thanks you very much for any hint!</p>","298288","","","","","2010-12-04 13:20:58","Encryption on Android devices","<android><security><encryption>","1","1","1","",""
"4353570","1","4353653","","2010-12-04 12:53:56","8","11369","<p>Please explain an Android Service. How does it differ from an Activity?  Does it depend on an application state such as running in the foreground/background?</p>","487219","","267702","","2013-04-24 22:42:43","2013-09-06 16:44:11","Android Service","<android><service>","2","0","5","",""
"4353580","1","4357858","","2010-12-04 12:56:36","4","2801","<p>I'm currently doing some research on smali/""code obfuscator"" and I'm trying to get familar with the decompiled source codes at the moment. For this I created a simple app and decompiled it by smali. </p><p>I'm trying to understand the decompiled source code now to improve and compare the security (against decompiling) after using a code obfuscator later. While most of the smali source code is not that difficult, I'm still having sometimes problems with the format conversion of figures.</p><p>May you explain to me e.g. the following line. I guess it should have a value of five, but I'm not sure, which kind of binary format this is. How to calculate it 0x4014 = 5 ???</p><pre><code>const-wide/high16 v0, 0x4014       // 100000000010100        (5 = 101)</code></pre><p>Attached are the full java and smali code sources of this test function :</p><p>Java source:</p><pre><code> boolean test(int a, double d) {        if (a &lt; 5 &amp;&amp; d &lt; 5)            return true;        else             return false;    }</code></pre><p>Smali source:</p><pre><code>.method test(ID)Z    .locals 2    .parameter ""a""    .parameter ""d""    .prologue    .line 28    const/4 v0, 0x5    if-ge p1, v0, :cond_0    const-wide/high16 v0, 0x4014    cmpg-double v0, p2, v0    if-gez v0, :cond_0    .line 29    const/4 v0, 0x1    .line 31    :goto_0    return v0    :cond_0    const/4 v0, 0x0    goto :goto_0.end method</code></pre>","331556","","429063","","2013-05-20 16:51:30","2013-05-20 16:51:30","Android smali question","<android><floating-point><decompiling><opcodes>","3","2","4","",""
"4353608","1","","","2010-12-04 13:01:47","4","765","<p>I am getting this error in my application, and this happens <strong>only</strong> on <em>UPC300-2.2 Viewsonic G-Tablet</em>. All answers I've found so far (including <a href=""http://stackoverflow.com/questions/3011285/android-2-2-google-map-error"">this one</a>) adviced on putting </p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;</code></pre><p>to the manifest file, but it doesn't help.</p><p>Here is the complete stacktrace:</p><blockquote><pre><code>java.lang.NoClassDefFoundError: android.net.NetworkConnectivityListener</code></pre>    <p>at  com.google.android.maps.MapActivity.onCreate(MapActivity.java:199)  at  myapp.Activity.ActivityMapSearch.onCreate(ActivityMapSearch.java:99)  at  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)  at  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)  at  android.app.ActivityThread.access$2300(ActivityThread.java:125)  at  android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)  at  android.os.Handler.dispatchMessage(Handler.java:99)  at  android.os.Looper.loop(Looper.java:123)  at  android.app.ActivityThread.main(ActivityThread.java:4627)  at  java.lang.reflect.Method.invokeNative(Native  Method) at  java.lang.reflect.Method.invoke(Method.java:521)  at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)  at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)  at  dalvik.system.NativeStart.main(Native  Method)</p></blockquote>","431502","","","","","2010-12-04 13:11:45","NetworkConnectivityListener class not found on UPC300-2.2 Viewsonic G-Tablet","<android>","1","0","","",""
"4353703","1","10516508","","2010-12-04 13:24:45","2","561","<p>Im trying to use grid but I need to change direction of inserting children from ( left to right ) to ( right to left ). is there any way to do so , simple example would help me more.</p><p>Thanks in advance.</p>","2267723","","","","","2012-07-01 10:14:09","How to change direction of drawing children of grid to Right_To_Left in Android","<android><gridview><android-layout>","3","0","","",""
"4353740","1","4353756","","2010-12-04 13:33:19","9","15044","<p>I am developing an android application.In my application,I want to display paragraph string in TextView,so I want to rounded Textview look like given bellow. Textview shout be center position of the screen same like given bellow.How is possible?</p><p><img src=""http://i.stack.imgur.com/j5HC1.jpg"" alt=""alt text""></p><p>Thanks Friends.</p>","500595","","182668","","2010-12-04 13:38:40","2012-06-12 09:12:26","How to make rounded TextView in Android?","<android>","2","0","4","",""
"4353770","1","4353966","","2010-12-04 13:39:55","3","3237","<p>I want to develop an Android multiplayer real time game.But I'm still confuse what is the best way to do the communication.I found a few options:</p><ol><li>TCP</li><li>UDP</li><li>Ajax/Comet/Messaging services i.e.pubnub.com, beaconpush.com</li><li>Push notification</li><li>XMPP</li><li>Android Cloud To Device Messaging</li><li>The Pubsubhubub Protocol</li><li>Smartfoxserver</li></ol><p>I just wondering how the other realtime games did it? I would like to know the most common way of doing it with acceptable result.</p><p>I appreciate your thought. Thanks!</p>","530438","","263525","","2012-09-13 07:34:01","2012-09-13 07:34:01","Android Multiplayer Real Time game, what is the best protocol/communication?","<android><real-time><game-engine><multiplayer>","1","4","","2013-04-29 14:31:47",""
"4353775","1","4353813","","2010-12-04 13:42:05","1","860","<p>I'm starting Android app development and just after my very first app more complex than <em>Hello World</em> I found out that you cannot hold any state in Activity because Android will recreate them in some cases... ouch, failure.I'm guessing that strict model separation from view is a common practice, even for simple apps. Are there any settled patters I should follow? Some variant of Model-View-Controller?</p>","514306","","","","","2010-12-04 13:49:20","architectural patters for developing on android","<android><design-patterns><architecture>","1","0","0","",""
"4353792","1","5594713","","2010-12-04 13:45:37","3","2649","<p>Is there any way I can increase my EditText's scrolling?I want to make it scroll like it does on the web browse, smooth and fast.Is this possible?</p><p>Thanks,Alex.</p>","427234","","","","","2011-04-08 12:57:00","Android Development: Improve EditText Scrolling?","<android><scroll><edittext>","3","2","2","",""
"4353836","1","","","2010-12-04 13:55:31","27","3980","<pre><code>   &lt;TextView android:id=""@+id/prodLbl""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_centerHorizontal=""true""        android:layout_centerVertical=""true""        android:textColor=""#FFFFFF""        android:textSize=""30dip""        android:textStyle=""italic""        android:text=""Magnifico""        /&gt;</code></pre><p>Seems to clip few pixels from the rightmost character, at least on 480x800 emulator or Nexus One.</p><p>To me it looks like a bug, but I'm just an Android beginner.I tried to add margins to left and right, but it still kept on clipping.In the end my hack around it was to add a single space on both sides of the text.Any other solutions?</p>","530459","","","","","2013-10-10 07:27:58","Italic TextView with wrap_contents seems to clip the text at right edge","<android><textview><italic>","8","4","3","",""
"4353840","1","4353846","","2010-12-04 13:56:08","4","2483","<p>I have a simple layout as follows. Even though, I set all attributes as wrap_content, the resulting layout fills the entire screen height wise. The individual layouts in themselves are small. So the top level container should only be as big as to wrap all its elements. But it seems to fill the full screen. Width wise, the same attributes work fine. What am I missing here? </p><p></p><pre><code>&lt;LinearLayoutandroid:id=""@+id/lowercontainer""android:orientation=""horizontal""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:paddingBottom=""10dip""android:layout_centerHorizontal=""true""android:paddingLeft=""0dip""android:paddingRight=""0dip""android:layout_alignParentBottom=""true""android:background=""@drawable/solid_blue""&gt; &lt;ImageView android:id=""@+id/lefticon"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:background=""@drawable/ic_settings_display"" android:layout_alignParentLeft=""true"" android:layout_alignParentBottom=""true"" android:paddingRight=""0dip"" /&gt;   &lt;ImageView android:id=""@+id/righticon"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:background=""@drawable/ic_settings_display"" android:layout_alignParentRight=""true"" android:layout_alignParentBottom=""true"" android:paddingLeft=""0dip"" /&gt; &lt;/LinearLayout&gt; &lt;TextView android:id=""@+id/test""    android:text=""Test text""    android:textStyle=""bold""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:paddingTop=""10dip""    android:gravity=""center""    android:layout_centerHorizontal=""true""    android:textSize=""20dip""    android:layout_above=""@id/lowercontainer""    android:background=""@drawable/solid_green""    /&gt;         </code></pre><p></p><p><img src=""http://i.stack.imgur.com/iJ9MV.png"" alt=""alt text""></p>","458942","","458942","","2010-12-04 14:02:42","2010-12-04 14:08:53","What does Relative layout wrap_content do?","<android><relativelayout>","1","0","","",""
"4353938","1","","","2010-12-04 14:21:36","1","286","<p>I am trying to create a layout in Android for a notification.  My goal is to have the following displayed:</p><p>1: Icon for the app2: Vertically stacked LinearLayout with Session title and Room to be held in3: The start time of the session</p><p>The problem I am facing is that #2 has a variable width depending on the size of the title. Hardcoding a width would look terrible if the user turns the handset sideways and goes into Landscape mode.  Therefore here is my question:</p><p>How can I layout three components horizontally in Android such that #1 and #3 are left and right aligned respectively, and #2 simply takes the space remaining?</p>","55840","","928814","","2013-04-18 09:31:51","2013-04-18 09:31:51","Layout components Horizontally in Android","<android><xml><layout><mobile>","4","0","1","",""
"4354176","1","4354417","","2010-12-04 15:16:09","2","2452","<p>Consider an Android <code>ListView</code> with a context menu set up with <code>registerForContextMenu</code>. The context menu of a <code>ListView</code> item is shown when the user long taps over the item view. </p><p>Additionally, I would like to show the context menu when the user taps (not long taps) on the item (if certain conditions are met). Is it possible to do this? How?</p>","143378","","143378","","2010-12-04 15:25:56","2010-12-07 05:30:23","Show context menu on demand in Android","<android><listview><contextmenu>","2","2","1","",""
"4354254","1","4354334","","2010-12-04 15:29:27","0","122","<p>I'm working on an Android application. I have an activity that has this method:</p><pre><code>protected void onCreate(Bundle savedInstanceState){    Bundle extraData = getIntent().getExtras();    if (extraData == null) {        throw new NullPointerException(""We need a bundle object."");    }    else {        String modelFileName = extraData.getString(Constants.MODEL_FILE_NAME);        try {            FileInputStream file = new FileInputStream(new File(modelFileName));            ObjectParsed = Parse.parseFile(file);        } catch (FileNotFoundException e) {            return;        }    }    // Call the base class version to initialize QCAR and setup    // the required view:    super.onCreate(savedInstanceState);}</code></pre><p>I'm parsing a text file on <code>onCreate</code> method this can be slow.</p><p>The <code>ObjectParsed</code> is defined on base class and it needs to be instated very <code>super.onCreate(savedInstanceState);</code> will be called.</p><p>And doing it right? Maybe <code>Parse.parseFile(file)</code> can be done in another method or by an asynchronous task.</p><p>Thanks.</p>","68571","","","","","2010-12-04 15:44:52","Paring a file on onCreated method","<android><activity><oncreate>","1","0","","",""
"4354319","1","","","2010-12-04 15:41:44","0","1072","<p>am getting a slight issue on using shared preferences in my widget. i keep getting this debug message on my shared preference, but id foes not come as an error.</p><pre><code>unable to unlink'/data/data/com.MyApps.WeatherViewer/shared_prefs/USER_PREFERENCE_WEATHER.xml.bak': No such file or directory (errno=2)</code></pre><p>what could be the problem cos the values stored in my shared preferences are returning null when i try to access them. </p><p>2.) is it possible to retrieve values from a shared preferences immediatelyfrom an activity  that created them?..</p><p>here is my code for creating the SharedPreference:</p><pre><code>     public static final String USER_PREFERENCE_MODE = ""USER_PREFERENCES_WEATHER"";        public static final String PREF_CITY_ENTRY = ""PREF_CITY_ENTRY"";        public static final String PREF_TOGGLE_CELSIUS = ""PREF_TOGGLE_CELSIUS"";        public static final String PREF_FREQ_UPDATE = ""PREF_FREQ_UPDATE"";        SharedPreferences prefs;        public void onCreate(Bundle icicle) {            super.onCreate(icicle);                  setContentView(R.layout.weather_view_configuration);            cityText =(EditText)findViewById(R.id.editCity_id);            chk_celsius = (CheckBox) findViewById(R.id.celsius_toggle_id);            save =(Button)findViewById(R.id.SaveButton);            update =(Spinner)findViewById(R.id.spinner_update_id);            cityText.setOnClickListener(this);            save.setOnClickListener(this);            prefs = this.getSharedPreferences(USER_PREFERENCE_MODE,0);            updateUIFromPreferences();       }        @Override        public void onClick(View v) {            final Context context = WeatherForecastConfigure.this;            int selection = v.getId();            switch(selection){            case R.id.SaveButton:                   savePreferences();   prefs = getSharedPreferences(USER_PREFERENCE_MODE,0); RemoteViews views = new RemoteViews(context.getPackageName(),R.layout.weather_appwidget );     String text = prefs.getString(WeatherForecastConfigure.PREF_CITY_ENTRY,null);                     views.setTextViewText(R.id.weather_city_id, text);                 AppWidgetManager widgetManager = AppWidgetManager.getInstance(context);                                  widgetManager.updateAppWidget(appWidgetID, views);            }        }        private void updateUIFromPreferences() {            String cityEntry = prefs.getString(PREF_CITY_ENTRY, cityText.getText().toString());            boolean celsiusToggle = prefs.getBoolean(PREF_TOGGLE_CELSIUS, false);            int updateIndex = prefs.getInt(PREF_FREQ_UPDATE, 0);            cityText.setText(cityEntry);            update.setSelection(updateIndex);            chk_celsius.setChecked(celsiusToggle);        }        private void savePreferences() {            prefs = this.getSharedPreferences(USER_PREFERENCE_MODE,0);            int updateIndex = update.getSelectedItemPosition();            boolean celsiusToggle =  chk_celsius.isChecked();            String city = cityText.getText().toString();            Editor editor = prefs.edit();            editor.putString(PREF_CITY_ENTRY, city);            editor.putBoolean(PREF_TOGGLE_CELSIUS, celsiusToggle);            editor.putInt( PREF_FREQ_UPDATE, updateIndex);            editor.commit();        }</code></pre><p>Thanks in advance</p><p>Here is my Service code: </p><pre><code>public class weatherForecast extends Service  {     public static final String UPDATE = ""update"";     int appWidgetID = AppWidgetManager.INVALID_APPWIDGET_ID;     String city;     Boolean chk_celsius;     SharedPreferences prefs;    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return null;    }    public void onCreate(){        Log.d(TAG, ""onCreate"");prefs = getApplicationContext().getSharedPreferences(WeatherForecastConfigure.USER_PREFERENCE_MODE, 0); city = prefs.getString(WeatherForecastConfigure.PREF_CITY_ENTRY,""""); chk_celsius = prefs.getBoolean(WeatherForecastConfigure.PREF_TOGGLE_CELSIUS, false);        Log.i(TAG, ""city is "" + city);    }    public void onStart(Intent intent, int startId){        URL url;        Log.d(TAG,""onStart"");     Bundle extra = intent.getExtras();    if(extra != null){  appWidgetID = extra.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);    Log.v(""WIDGET_TAG_ID"", ""appWidgetId = "" + appWidgetID);           }    /* prefs = this.getSharedPreferences(""prefs"", 0);  city = prefs.getString(WeatherForecastConfigure.PREF_CITY_ENTRY + appWidgetID,"""");  chk_celsius = prefs.getBoolean(WeatherForecastConfigure.PREF_TOGGLE_CELSIUS, false);            Log.i(TAG, ""city is "" + city);*/       RemoteViews updateViews = buildUpdate(this);       ComponentName thisWidget = new ComponentName(this, WeatherWidgetProvider.class);       AppWidgetManager widgetManager = AppWidgetManager.getInstance(this);       widgetManager.updateAppWidget(thisWidget, updateViews);        } catch (Exception e) {            // TODO Auto-generated catch block            e.printStackTrace();        }            super.onStart(intent, startId);        }   public RemoteViews buildUpdate(Context context) {   GoogleWeatherHandler gwh = new GoogleWeatherHandler();   WeatherSet weather = gwh.getWeatherSet();   RemoteViews remote = RemoteViews(context.getPackageName(), R.layout.weather_appwidget );   AppWidgetManager widgetManager = AppWidgetManager.getInstance(this);  remote.setTextViewText(R.id.editCity_id,weather.getCondition().getCity().toString());remote.setTextViewText(R.id.weather_condition_id,weather.getCondition().getCondition().toString());remote.setTextViewText(R.id.weather_tempreture_id,weather.getCondition().getTempCelcius().toString());widgetManager.updateAppWidget(appWidgetID, views);   return views;  }}</code></pre>","316843","","316843","","2010-12-05 16:20:27","2010-12-05 16:20:27","no file or directory exist on Shared Preference","<android>","1","2","0","",""
"4354431","1","","","2010-12-04 16:07:37","0","262","<p>So my android app shows ads, sometimes. Not often though, usually it says ""ads not available"" and the fill rate is like 7%.I read that I need more networks to keep the fill rate high, but I have no clue how to ad those networks. Do I need to download all those sdk's and modify my app by code?Then what would be the point with an adwhirl aggregator?</p><p>Regards</p>","498112","","","","","2010-12-04 16:07:37","android adwhirl and networks","<android><adwhirl>","0","3","0","",""
"4354465","1","4354545","","2010-12-04 16:15:55","0","300","<p>Very new to Android development, and I am importing a bitmap that is 799 in width.  However, when I bring the bitmap into Android, it is saying the bitmap is now 533 in width.  Is there a reason for that?  </p><p>Here's the code I'm using:</p><p>Bitmap texture = BitmapFactory.decodeResource(getResources(),R.drawable.image);</p><p>Preferably, I'd like to have the image be the same size as when I originally created it.  That way I know ahead of time what I'm dealing with rather than checking again what the code has done to the image.</p>","530546","","","","","2010-12-04 16:38:17","Why is my bitmap being re-sized in Android?","<android><resize><bitmap>","2","0","","",""
"4354660","1","4355004","","2010-12-04 17:01:24","1","226","<p>If an Activity starts another by startActivityForResult(), what happens to that subactivity if the parent is finished?</p>","474326","","","","","2010-12-04 18:08:50","Lifecycle of a subactivity","<android><activity><subactivity><activity-lifecycle>","1","2","","",""
"4354759","1","","","2010-12-04 17:19:05","0","327","<p>I have 3 sounds that I would like to play sequentially in Android.  I have created a SoundPool and set the ""maxStreams"" to ""1"" thinking that in the for loop the sounds would play ""one at a time"" not all at once.  This, unfortunately, is wrong.  How do I play the sounds sequentially and NOT all at once using soundPool.  Thanks.</p>","520925","","","","","2012-09-25 01:08:24","Android SounPool not Overlap","<android><sequence><sounds><soundpool>","0","2","","",""
"4354787","1","4354817","","2010-12-04 17:23:44","3","2267","<p>In the app, I'm struggling with I have a custom view.I cannot declare it in layout XML file, because I'm going to use in from the activity that holds my custom view instance and I need to have access to it (cannot override findViewById...).</p><p>Thereof I decided to declare all of the GUI elements into the Activity.</p><p>But I simply cannot make a single step forward, since I even cannot instantiate viewGroup...</p><p>This is what I'm trying:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    ViewGroup vg = new ViewGroup(this.getApplicationContext());    setContentView(vg);}</code></pre><p>and I get 'Cannot instantiate ViewGroup'...</p><p>Can someone give a straight-forward example, of how to declare a viewGroup, that holds views?</p><p>The documentation of the class is also not very beginner-friendly... all the examples are focused on describing the layout in a layout XML file...?</p><p>Appreciate your efford, giving an example! </p>","481828","","481828","","2010-12-04 17:26:32","2011-11-08 22:37:04","android: a newby GUI question - how to declare viewGroup, without layout XML file?","<android><gui><view>","1","0","","",""
"4354807","1","4354842","","2010-12-04 17:28:11","3","1184","<p>I have a list activity, and I chose to manually add the first item which is ""add new item..."".</p><p>I have registered the context menu for the whole listview, using <code>registerForContextMenu(getListView());</code> straight into the <code>onCreate</code>.</p><p>When the context menu is build, the system calls <code>onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo)</code>. The <code>View v</code> is the listView, and I cannot find a way to know which item in the listview is being long-pressed.</p><p>I could create a xml layout, with a layout for the ""add new item..."" and add a listview after, which would be populated by the activity, and that would react to the context menu, but I'm sure there is a way to solve this problem without any xml layout.</p><p>I have tried to register each view inside my listview using <code>registerForContextMenu</code>, which works, however the listview doesn't respond to touch anymore.</p><p>Here is my activity code listing:</p><pre><code>public class AMain extends ListActivity {    private List&lt;String&gt; pregList;    private List&lt;Long&gt; pregIds;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        pregList = new ArrayList&lt;String&gt;();        pregIds = new ArrayList&lt;Long&gt;();        registerForContextMenu(getListView());    }    @Override    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {        super.onCreateContextMenu(menu, v, menuInfo);        // TODO: hide the menu for the 1st item!!        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.context_menu, menu);    }    @Override    public boolean onContextItemSelected(MenuItem item) {        AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();        Logger.d(""id = ""+info.id);        switch (item.getItemId()) {        case R.id.menu_show:            showPregnancy((int) info.id);            return true;        case R.id.menu_edit:            editPregnancy((int) info.id);            return true;        case R.id.menu_delete:            //TODO: do the deletion            return true;        default:            return super.onContextItemSelected(item);        }    }    protected void onStart() {        super.onStart();        clearPregList();        loadPregList();        getListView().setAdapter(new PregnancyListAdapter(this));    }    void clearPregList() {        pregList.clear();        pregIds.clear();    }    void loadPregList() {        PregnanciesDbAdapter db = new PregnanciesDbAdapter(this);        db.open();        Cursor c = db.getPregnancies();        if (c != null) {            do {                pregList.add(c.getString(c.getColumnIndex(PregnanciesDbAdapter.KEY_PREG_NOM)));                pregIds.add(c.getLong(c.getColumnIndex(PregnanciesDbAdapter.KEY_PREG_ROWID)));            } while (c.moveToNext());            c.close();        }        db.close();    }    private class PregnancyListAdapter extends BaseAdapter {        private Context context;        public PregnancyListAdapter(Context ctx) {            context = ctx;        }        @Override        public int getCount() {            return pregList.size()+1;        }        @Override        public Object getItem(int position) {            if (position == 0) { // add button                return getString(R.string.addPreg);            } else {                return pregList.get(position-1);            }        }        @Override        public long getItemId(int position) {            if (position == 0) {                return -1;            }            return pregIds.get(position-1);        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            LinearLayout itemLayout;            itemLayout= (LinearLayout) LayoutInflater.from(context).inflate(R.layout.homelist_item_pregnancy, parent, false);            ImageView logo = (ImageView) itemLayout.findViewById(R.id.logo);            TextView pregName = (TextView) itemLayout.findViewById(R.id.pregName);            if (position == 0) {                itemLayout.setFocusable(false);                itemLayout.setFocusableInTouchMode(false);                pregName.setText(getString(R.string.addPreg));            } else {                logo.setVisibility(View.INVISIBLE);                pregName.setText(pregList.get(position-1));            }            itemLayout.setId(position);            return itemLayout;        }    }    @Override    protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        if (position == 0) {            startActivity(prepareIntent(AShowPregnancy.class, 0));        } else {            showPregnancy(position-1);        }    }    void showPregnancy(int pregId) {        startActivity(prepareIntent(AShowPregnancy.class, pregId));    }    void editPregnancy(int pregId) {        startActivity(prepareIntent(ANewPregnancy.class, pregId));    }    Intent prepareIntent(Class&lt;?&gt; className, int pregId) {        Intent i = new Intent(this, className);        if (pregId &gt; 0) {            PregnanciesDbAdapter db = new PregnanciesDbAdapter(this);            db.open();            Pregnancy p = db.load(pregIds.get(pregId));            db.close();            i.putExtra(C.EXTRA_PREGNANCY, p);        }        return i;    }}</code></pre><p>Thanks for reading. Hope you can help.</p>","334493","","334493","","2012-06-06 13:59:30","2012-06-06 13:59:30","How to set specific context menu depending on which item is long-pressed in a ListActivity?","<android><listview><contextmenu>","1","0","","",""
"4354833","1","","","2010-12-04 17:34:37","0","846","<p>Ok so I'm making a game and I'm having a problem, that Is I don't haveanyway of going about this, Making a line that looks like a pencil stroke.I start out with </p><pre><code>drawLine(float startX, float startY, float stopX,float stopY, Paint paint);</code></pre><p>of courseand then I I use all the stuff involved with <code>Paint()</code> and the paintclass so I set the color and the thickness in the paint...</p><p>So What I'm wondering is how do I give my paint a texture thatresembles a pencil stroke. is there a way I can make the paint looklike a repeated bitmap, what are my options with this.</p><p>Thanks, Brian</p><p>p.s. if you want more detail I can expound on it a little more likegive you the exact code that I'm using and explain more about mygame....also here are links to the paint class and the canvas class if youneed them.</p><p><a href=""http://developer.android.com/reference/android/graphics/Paint.html"" rel=""nofollow"">http://developer.android.com/reference/android/graphics/Paint.html</a></p><p><a href=""http://developer.android.com/reference/android/graphics/Canvas.html"" rel=""nofollow"">http://developer.android.com/reference/android/graphics/Canvas.html</a></p><p>Also</p><pre><code>void drawBitmap(int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, Paint paint)</code></pre><p>Treat the specified array of colors as a bitmap, and draw it.""Can I use that I'm really not sure what its saying. </p><p>please even if you have a little information please reply.</p>","530605","","760489","","2012-01-03 11:17:19","2012-01-03 11:17:19","Using the Drawline function to create a ""pencil stroke""","<android>","1","0","1","",""
"4354939","1","7917978","","2010-12-04 17:54:52","48","20895","<p>I'm working on a UI for an app, and I'm attempting to use grayscale icons, and allow the user to change the theme to a color of their choosing. To do this, I'm trying to just apply a ColorFilter of some sort to overlay a color on top of the drawable. I've tried using PorterDuff.Mode.MULTIPLY, and it works almost exactly as I need, except that whites get overlayed with the color as well. What I'm ideally looking for is something like the ""Color"" blending mode in Photoshop, where the graphic retains its transparency and luminosity, and only modifies the color of the image. For example:<br><br><img src=""http://i.stack.imgur.com/CjaPC.png"" alt=""alt text""> becomes <img src=""http://i.stack.imgur.com/Z0OOY.png"" alt=""alt text""><br><br>After doing some research, it appears that the ColorMatrixColorFilter class may do what I need, but I can't seem to find any resources pointing to how the matrix is used. It's a 4x5 matrix, but what I need to know is how I go about designing the matrix. Any ideas?</p><p>EDIT: So okay, what I've found so far on this is as follows:</p><pre><code>1 0 0 0 0 //red0 1 0 0 0 //green0 0 1 0 0 //blue0 0 0 1 0 //alpha</code></pre><p>Where this matrix is the identity matrix (when applied, makes no changes), and the numbers range from 0 to 1 (floats). This matrix will be multiplied with each pixel to convert to the new color. So this is where it starts to get fuzzy for me. So I would think each pixel would be a 1 x 4 vector containing the argb values (e.g. <code>0.2, 0.5, 0.8, 1</code>) that would be dotted with the transformation matrix. So to double the red intensity of an image, you would use a matrix such as:</p><pre><code>2 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 </code></pre><p>which would give you a vector (color) of <code>0.4, 0.5, 0.8, 1</code>. From limited testing, this seems to be the case, and works properly, but I actually still end up with the same problem (i.e. whites gain coloring). Further reading tells me that this is because it's doing the conversion on RGB values, whereas for hue shifting, the values should first be converted to HSL values. So possibly I could write a class that would read the image and convert the colors, and redraw the image with the new colors. This creates ANOTHER problem with StateListDrawables, as I'm not sure how I would go about getting each of these in code and modifying all of them, and how slow a process it would be. :/</p><p>Hmm, okay, so I suppose another question I would have is whether a matrix can be used to convert RGB to another color space with luminosity information, such as L*a*b or HSL? If so, I could just multiply the matrix for that converstion, then make the hue adjustment to THAT matrix, then apply that matrix as the ColorFilter.</p>","321697","","321697","","2010-12-05 21:09:56","2014-04-06 09:55:17","Understanding the Use of ColorMatrix and ColorMatrixColorFilter to Modify a Drawable's Hue","<android><drawable><colormatrix><colorfilter>","8","1","53","",""
"4355122","1","4355199","","2010-12-04 18:36:14","8","2250","<p>Android's <code>&lt;include /&gt;</code> element allows you to include other XML layouts. Useful for a common header across several activities.</p><p>But, what if you want to include a layout <em>several</em> times in the same view? For instance, I have a carefully crafted layout that I want to display three times in my view. Every of those instances would need different values. Since the <code>include</code> is basically a <em>take that XML and paste it here</em>, I'd need something more powerful.</p><p>Is there some mechanism to do this?</p><p>(Did I explain myself correctly?)</p>","106342","","","","","2012-05-30 18:17:20","How to include a layout twice in Android?","<android><layout><include>","4","0","1","",""
"4355296","1","4355378","","2010-12-04 19:12:02","7","7525","<p>Hope my Question is clear from the title. Still I will explain. Is there any way to install my application directly to SD Card without storing in phone memory first. Cause My Application is huge in size. Or is there any way to provide the option ""<strong>Move To SD Card</strong>"" to the users to move manually. If yes, How do I do it? Thanks for your answers.</p>","527053","","","","","2010-12-04 19:28:53","Android: Install My Application on SD Card By Default","<android><install>","1","0","","",""
"4355548","1","5129698","","2010-12-04 20:02:31","1","372","<p>I hope my question is clear from the title. But still I will explain briefly my problems. I tried <strong>ogg</strong> and faced the problem of looping. I added a tag <strong>ANDROID_LOOP=true</strong> for ogg file to enable loop while it is set as ringtone. But when I play in the soundboard app, it continues to play in infinite loop. When I googled about this, I found it to be a bug with ogg files. Then I tried mp3, and I am not able to set the TITLE, or ARTIST or any metadata to the mp3 file even after when i enter the mediastore database as follows</p><pre><code>       values.put(MediaStore.MediaColumns.TITLE, ""foo"");         values.put(MediaStore.MediaColumns.DISPLAY_NAME, ""foo"");        values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/mp3"");         values.put(MediaStore.Audio.Media.ARTIST, ""Sound Board"");  </code></pre><p>When I open the mp3 file in the Media Player, it says <strong>Unknown Artist</strong> and <strong>Unknown Album</strong>. Anybody knows how to fix this? Also suggest me a good format which will save me some space. Your help is really appreciated. Thanks.</p>","527053","","","","","2011-02-26 20:57:26","Android: Which Audio Format is Preferable for SoundBoard Application","<android><media>","1","0","","",""
"4355569","1","","","2010-12-04 20:07:03","1","3009","<p>I have two images,One image will be static meaning it will not move at all,another image a 10*10 circle will need to move to exact pixels on top of the other image.Doing some research I see I need to override the onDraw() method.Although I could not really find any sample code to get me started.</p><p>So what I am asking is a link to a good tutorial or some help getting started.</p><p>Thanks</p>","529926","","","","","2010-12-04 23:19:34","Subclassing view and onDraw()","<android>","2","0","1","",""
"4355614","1","4355644","","2010-12-04 20:16:21","6","8845","<p>I am wondering what's the difference between <code>@+id/android:list</code> and <code>@+id/list</code>. I know the last one which is a regular id assignment but the first looks different. What makes it special?</p><p><strong>Where I saw it:</strong>I was studying on ListView, ListAdapter and things like that and the author define the ListView in layout xml file as 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:orientation=""vertical""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   &gt;&lt;ListView    android:id=""@+id/android:list""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    /&gt;&lt;TextView    android:id=""@+id/android:empty""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/main_no_items""/&gt;&lt;/LinearLayout&gt;</code></pre><p>and also let me mention <code>@+id/android:empty</code> id as well.</p><p>And he also extends <code>ListActivity</code> class.</p><p>Here is the <a href=""http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/"" rel=""nofollow"">source of the article</a>.</p><p><strong>And also what's in my mind as questions are :</strong></p><ol><li>Should we extend <code>ListActivity</code>? Maybe I want an Activity which also contains other Views.</li><li>We use <code>@+id/android:list</code> just because we extend <code>ListActivity</code> or we can use the same convention if we extend <code>Activity</code>?</li></ol><p>Thanks.</p>","44852","","497356","","2011-09-11 03:54:41","2011-09-11 03:54:41","What is difference between @+id/android:list and @+id/list","<java><android><listview>","2","0","3","",""
"4355707","1","4356755","","2010-12-04 20:38:03","0","867","<p>I'm working on a live wallpaper. The wallpaper requires small movable images to be behind a large fixed image with transparent areas. The smaller images will only be visible when they are in the transparent parts of the large image. </p><p>Here's how I've been doing it so far:</p><pre><code>Canvas c = holder.lockCanvas();c.save()drawSmallImages(c); //draw the movable imagesdrawLargeImage(c); //draw the fixed large imagec.restore();</code></pre><p>I ran this through traceview and it looks like android is spending a good chunk of processing power to draw the large image, and ideally I'd only want it to be drawn once when the wallpaper starts. I don't know how to get the smaller images to be drawn behind the larger image without re-drawing the large image after the smaller images on each frame.</p>","193179","","19750","","2011-03-31 15:42:50","2011-03-31 15:42:50","Android Canvas Multiple Layers for WallpaperService.Engine","<android><canvas><live-wallpaper>","1","1","","",""
"4355830","1","4356098","","2010-12-04 21:06:03","0","402","<p>I want to make some ""skins"" for my Android app, and sell them on the Android market so that when the user downloads the paid skin, it becomes available in my app, perhaps in settings. I'm just not sure how this is done. If anyone could lead me in the right direction that would be awesome.</p>","413414","","","","","2010-12-04 22:09:11","Android: How could I add paid skins to my app?","<android><skinning>","1","1","3","",""
"4355870","1","","","2010-12-04 21:16:03","2","220","<p>i'm new for android. i try to write HelloAnroid but when i run program. there are two errors.     1. Unable to open class file C:\Documents and Settings\Administrator\workspace\HelloAndroid\gen\com\example\helloandroid\R.java: No such file or directory    2. Error generating final archive: Debug Certificate expired on 22/11/2497, 2:29 ?.  </p><p>i don't know what it happen. please help me for these errors.</p>","530759","","","","","2010-12-05 18:12:31","Problem with run my first android program","<android>","3","1","","",""
"4355916","1","","","2010-12-04 21:24:57","1","853","<p>I am working on a simple android app that needs to access data entries from a database. our server is set up in django and mySQL. From what I understand we need to make a service on the server that will take in the requests from the app in a RESTful manner and send the data back as XML.So how do I start? Is there a python library?what about on the app side?</p>","529896","","","","","2010-12-04 21:37:08","making a RESTful http service for android app and django database?","<android><database><django><http><rest>","1","1","1","",""
"4355919","1","4356205","","2010-12-04 21:26:06","6","2133","<p>This I want I want to achieve:</p><ol><li><p>An activity starts with no ClickListener and has four textviews all with white background</p></li><li><p>I want to change the color of textview 1 to blue. Wait for 2 seconds and then change it back to white and change the textview 2 to blue. wait for 2 seconds and then change it back to white... so on till i have turned textview 4 to blue and back to white.</p></li><li><p>Once that is complete, I want to add the ClickListener and wait for user input.</p></li></ol><p>How can I achieve this? I am new to Android but understands bits and pieces.</p>","516357","","","","","2010-12-04 22:35:54","Android Handler Periodically","<android><handler>","3","0","1","",""
"4355992","1","","","2010-12-04 21:42:37","2","1052","<p>I'm developing an Android program to analyze a user's text input and measure typing speed, error rate, average key presses to enter a single character. By doing so, I can compare characteristics of different input methods. To do this, I need to count and record all key presses made by the user during the text entry process.</p><p>For example, a user using a basic qwerty keyboard would have to press at least one key for each letter. However, a user using a keyboard with word completion would need to press fewer keys. But how many key presses are made (on average)? Does word completion actually improve typing speed? These are the questions my program will help answer.</p><p>Reading other posts, I know that (by default), onscreen keyboards don't send key events for all key presses. Physical (hardware) keyboards do, but most mobile devices don't have a physical keyboard. I also know that I can implement a TextWatcher to detect when a letter is typed in an EditText field. However, some IMEs might require the user to press a sequence of keys to enter a single letter (or word). I need to handle the intermediate key events (i.e., by counting and logging key presses).</p><p>My question: How would I capture every key press event from an IME (even events that don't trigger a typed character) without modifying the IME's user experience (e.g., auto completion, word prediction, T9 disambiguation, etc.)? Is this even possible?</p><p>Thanks in advance for your time.</p>","530774","","","","","2012-08-21 09:11:28","Android Dev: Getting key events from onscreen (soft) keyboard","<android><keyboard-events>","2","0","1","",""
"4356087","1","4356110","","2010-12-04 22:06:44","2","1536","<p>Im having a problem in stretching my GridView to fit Display-Width. Any one knows how so solve the problem? I want the GridView to occupy the whole width including the blue marked field (see pic below)</p><p></p><pre><code>&lt;TableRow&gt;    &lt;ProgressBar        android:id=""@+id/timeBar""        style=""?android:attr/progressBarStyleHorizontal""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:layout_weight=""4""    /&gt;       &lt;TextView        android:id=""@+id/points""        android:gravity=""center""        android:textColor=""#FFE7BA""        android:textSize=""18px""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:layout_weight=""1""    /&gt;&lt;/TableRow&gt;&lt;TableRow android:layout_weight=""1"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;TextView      android:text=""KANJI""      android:gravity=""center_horizontal""      android:background=""#aa0000""      android:layout_width=""fill_parent""       android:layout_height=""fill_parent""       android:layout_weight=""2""      /&gt;&lt;/TableRow&gt;&lt;TableRow&gt;    &lt;GridView        android:id=""@+id/gridview""        android:numColumns=""2""        android:layout_gravity=""center""        android:stretchMode=""columnWidth""         /&gt;&lt;/TableRow&gt;</code></pre><p></p><p>SCREENSHOT: <a href=""http://i53.tinypic.com/2poy136.jpg"" rel=""nofollow"">http://i53.tinypic.com/2poy136.jpg</a></p>","530793","","516138","","2013-01-09 21:18:31","2013-01-09 21:18:31","Stretching GridView","<android><gridview>","1","1","","",""
"4356146","1","4356181","","2010-12-04 22:20:42","2","420","<p>I am having problems launching my application from my widget when it's clicked upon.Here is a cut of some code</p><pre><code>// Create an Intent to launch activityIntent intent = new Intent(context, Entry_MainTabView.class);PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);             updateViews.setOnClickPendingIntent(R.id.Widget, pendingIntent);</code></pre><p>Now take the scenario.I launch my app, exit to the home page , then click on my widget.It launches a second instance of the application, so when I hit ""back"" , the application goes away and reveals the other copy. I then hit back again and finally go back to the homescreen.</p><p>How can I make the Intent only create a new instance if none already exists in ram ?</p>","507991","","","","","2010-12-04 22:40:50","Widget launching a second instance of application","<android><widget>","1","2","1","",""
"4356353","1","4356555","","2010-12-04 23:10:38","1","871","<p>Please help, what should i do about the error? I got error in ""In Helper executing"" and it says ""String literal is not properly closed by a double quote.""</p><pre><code>public class SMS extends Activity {//   public static final String DEBUG_TAG = ""FullDatabase Log"";    public static final int DB_version = 2;    //public static final String DB_name = ""User.db"";    public static final String TABLE_NAME = ""login"";    //public static final String TABLE_NAME = ""tbl_temp"";    //public static final String DB_name = ""User_temp"";    public static final String DBNAME = ""login"";    public DatabaseHelper database_helper;    public SQLiteDatabase database;    public SQLiteDatabase database_rd;    /** Called when the activity is first created. */    public void onCreate1(Bundle savedInstanceState) {    super.onCreate1(savedInstanceState);    setContentView(R.layout.main);    Toast.makeText(this,""Before Bundled"",    Toast.LENGTH_SHORT).show();    createDataBase();    //LogIn login = new LogIn();    Button submit = (Button)findViewById(R.id.widget71);    Toast.makeText(this,""after Bundled"",    Toast.LENGTH_SHORT).show();    submit.setOnClickListener(new View.OnClickListener()    {                    @Override                    public void onClick(View v) {                    // TODO Auto-generated method stub             SMS createaccount = new SMS();             Toast.makeText(createaccount.getApplicationContext(), ""In Helper executing             onCreate1()"", Toast.LENGTH_SHORT).show();                            String[] success = insertRecords();                            if(success[0].equalsIgnoreCase(""1""))                            {                              Intent mIntent = new Intent(LogIn.this,DisplayUser.class);                                    mIntent.putExtra(""username"",success[1]);                                    mIntent.putExtra(""retype"",success[2]);                                    mIntent.putExtra(""password"",success[3]);                                     startActivity(mIntent);                            }                    }            });    //database.close(); } </code></pre>","516160","","516160","","2010-12-04 23:38:48","2010-12-05 00:01:31","String literal is not properly executing","<java><android><eclipse><sqlite>","2","2","","",""
"4356372","1","4356392","","2010-12-04 23:15:42","10","4127","<p>Am learning android and am struggling to get my head around this particular layout attribute, reading the google dev docs it says:</p><p>*android:layout_column*</p><p>*Since: API LevelThe index of the column in which this child should be.Must be an integer value, such as ""100"".This may also be a reference to a resource (in the form ""@[package:]type:name"") or theme attribute (in the form ""?[package:][type:]name"") containing a value of this type.This corresponds to the global attribute resource symbol layout_column.*</p><p>Can anyone explain how this maps to an html equivalent (as table rows appear to borrow heavily from them)?</p><p>Is it the number of columns it take sup - eg colspan?</p>","528013","","","","","2010-12-04 23:21:05","What exactly does android:layout_column do?","<android>","1","0","5","",""
"4356465","1","4356553","","2010-12-04 23:40:40","1","2687","<p>I can't understand why my radio buttons aren't on one line, I've pasted my code so far below - I know it's not the same as the tutorial, but I'm really trying to understand every line, so want to know what the equivalent to 'float' is in android - tried playing with gravity, weight etc, but didn't seem to put them onto one line..</p><p>Many thanks in advance!</p><pre><code>&lt;RadioGroup android:id=""@+id/RadioGroup01"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content""android:layout_column=""0""android:layout_span=""3""&gt;    &lt;RadioButton         android:id=""@+id/RadioButton01""         android:layout_height=""wrap_content""         android:freezesText=""true""         android:textSize=""10sp""         android:text=""15%"" android:layout_width=""wrap_content""&gt;    &lt;/RadioButton&gt;&lt;RadioButton android:id=""@+id/RadioButton02"" android:layout_height=""wrap_content"" android:text=""20%"" android:textSize=""10sp"" android:layout_width=""wrap_content""&gt;</code></pre><p></p>","528013","","1700486","","2013-01-16 11:51:08","2013-01-16 11:51:08","show radio buttons on one line?","<android>","2","1","","",""
"4356584","1","4356841","","2010-12-05 00:07:42","0","1244","<p>I used advanced task killer (many other task killer) to kill processes in my android phone, most of the cases do work, but sometimes I find you kill the process in task killer doesn't mean the process get really killed, it still works in background, Is there any tool that have more privilege and can see all background processes ?(I think advanced task killer can only see the ""user"" level processes)</p><p>If you don't mind, can you explain me how these task killer applets actually work ?</p>","140899","","103167","","2010-12-05 00:09:00","2010-12-05 02:17:36","How does process killing work in android?","<android><taskkill>","2","0","2","",""
"4356705","1","4356733","","2010-12-05 00:37:07","2","650","<p>In my android application I get a reference to the GL10 object in the methods: onSurfaceCreated, onSurfaceChanged, and onDrawFrame.  Is it safe to hold onto that reference?</p>","122229","","44729","","2010-12-05 04:08:47","2012-08-17 23:05:28","Can I maintain a reference to the GL10 safely?","<android><opengl-es>","1","0","","",""
"4356729","1","4357463","","2010-12-05 00:43:26","2","435","<p>I have a class that extends GLSurfaceView and implements Renderer in my android app that takes care of the opengl rendering.  When I try to execute an asynctask from the onSurfaceCreated event, the application crashes (no exceptions thrown).  If run the same async task from the main activity everything is fine.  The asynctask implementation is at this point just a place holder:</p><pre><code>public class DownloadImageTask extends AsyncTask&lt;String, Void, Integer&gt;{        @Override        protected Integer doInBackground(String... myParams) {            return 1;         }        @Override        protected void onPostExecute(Integer result)        {        }     }</code></pre><p>being called from onSurfaceCreated()</p><pre><code>new DownloadImageTask().execute(""myParam"");</code></pre><p>Why can't I start an AsyncTask from the onSurfaceCreated event?</p>","122229","","122229","","2010-12-05 14:55:10","2010-12-05 14:55:10","AsyncTask crashes when used from onSurfaceCreated","<java><android><opengl-es>","1","4","","",""
"4356799","1","","","2010-12-05 01:03:29","0","1954","<p>I'm trying to develop a basic AIDL service on Android 2.2.1. Everything seems to build and install ok, but bindService() just won't -- well, bind. My ServiceConnection class isn't called. I've really no idea why not, so any help would be appreciated. Here is my client activity:</p><pre><code>public class go extends Activity {    protected static final String TAG = ""HOSPlayerClient"";    private IHOSPlayerService hosPlayerService = null;    private ServiceConnection serviceConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName name, IBinder service) {            Log.v(TAG, ""onServiceConnection"");            hosPlayerService = IHOSPlayerService.Stub.asInterface(service);            callService();        }        public void onServiceDisconnected(ComponentName name) {            Log.v(TAG, ""onServiceDisconnected"");        }    };    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Log.v(TAG, IHOSPlayerService.class.getName());        boolean bound = bindService(                new Intent(IHOSPlayerService.class.getName()),                serviceConnection, Context.BIND_AUTO_CREATE);        Log.v(TAG, bound ? ""service bound"" : ""service bind failed"");    }    private void callService() {        try {            hosPlayerService.go();        } catch (RemoteException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }}</code></pre><p>... and here are what I believe to be the relevant parts of my AIDL service:</p><pre><code>public class HOSPlayerService extends Service{ private static final String TAG = ""HOSPlayerService""; public class HOSPlayerServiceImpl extends IHOSPlayerService.Stub {  public void go() throws RemoteException  {   Log.v(TAG, ""go called"");  } } @Override public IBinder onBind(Intent intent)  {  // TODO Auto-generated method stub  return new HOSPlayerServiceImpl(); }}</code></pre><p>... and the AIDL file:</p><pre><code>package com.HOS.ahos.HOSPlayerService;interface IHOSPlayerService{ void go();}</code></pre>","523066","","562139","","2011-04-12 07:53:46","2013-04-01 09:00:38","Android: bindService won't connect to remote (AIDL) service, and i've no idea why ","<android><service><aidl>","1","2","1","",""
"4356818","1","4356886","","2010-12-05 01:08:43","2","2843","<p>I have an issue when changing my screen orientation. I have an activity with 2 intents that gets called by a service.</p><p>When I rotate the screen, going into landscape mode, it recalls onCreate. The issue is I have a button, and TextField which gets updated through a handler), and they don't seem to react anymore.</p><p>Like this is the code when I try also to add the button in the onCreate but it doesn't respond once the view is changed to landscape mode:</p><pre><code>public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.call);  Button endCall = (Button) findViewById(R.id.stopCall);  endCall.setOnClickListener(new View.OnClickListener() {   @Override   public void onClick(View v) {    /// ...   }  });  handleIntent(getIntent()); }</code></pre><p>How do people treat this reorientation please? Is there a way to have it not recall onCreate please or what is the most common way to treat this case please?</p>","530891","","244296","","2010-12-05 01:29:19","2012-11-08 23:39:10","Changing screen orientation issue: onCreate","<android><screen><orientation><oncreate>","2","2","2","",""
"4356888","1","4356895","","2010-12-05 01:29:13","1","242","<p>I have a ListActivity which queries a web service for data.  I've implemented a paging system with the web service so only 25 rows get returned at a time.</p><p>I'd like my ListActivity to work like so:  When the user scrolls to the bottom of the list, the ListActivity will query the web service for the next page of data.</p><p>How can I tell if the user has scrolled to the bottom of the list?</p>","406790","","","","","2010-12-05 01:32:19","Knowing when list scrolling reaches the bottom","<android><listview>","1","0","","",""
"4356919","1","5098420","","2010-12-05 01:40:02","7","15311","<p>Android noob here. I learn the best by seeing the source code of a functional example, but I have been unable to find a simple-but-complete example of using a socket in its own thread.</p><p>I have an Android service that needs to communicate with the Internet. I want to open a TCP socket that connects to a server on the Internet. The service needs to send data to the Internet, and data coming back from the net will need to go to the service. Since the service is doing other things as well, the socket connection needs to live in its own thread.</p><p>Any idea where I could find an example of a socket in a thread with communication to/from the socket?</p><p>Thanks</p><p><img src=""http://i.stack.imgur.com/riPex.gif"" alt=""enter image description here""></p>","127287","","840973","","2011-12-29 17:48:52","2011-12-29 17:48:52","How to get data to/from a socket in a thread?","<android><multithreading><sockets>","2","0","5","",""
"4356920","1","","","2010-12-05 01:40:09","0","1094","<p>i want to develop a widget which can set update frequency and enable/disable auto update?</p><p>i don’t know how to program it.can any one hep or give me some sample?</p><p>thank yoy v.much.</p>","530908","","","","","2010-12-12 18:54:13","android widget update problem","<android><widget>","1","0","","",""
"4356979","1","","","2010-12-05 02:05:19","7","4935","<p>The error:</p><pre><code>BUILD FAILEDC:\workspace\projectName\add-proguard-release.xml:35: Expecting class path separator ';' before 'Files\eclipse\android-sdk-windows\platforms\android-3\android.jar' in argument number 1</code></pre><p>I am fully aware that my problem is that I have eclipse+android in the c:\program files\eclipse directory - and the space between 'program' and 'files' is causing this problem.</p><p>I am also aware that a solution is to put this path in quotes.</p><p>My problem is WHERE to put these quotes.  I'm a bit of an ANT noob: and am following the directions I found here: <a href=""http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html"">http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html</a></p><p>I'm currently trying to figure out enough more about how ANT works with PROGUARD to know where to wrap a path with quotes - and how (I'm worried it's in XML and not sure what kind of processing is going to happen to escape characters etc)</p><p>I have as a backup plan to move everything out of ""program files"" - but I'd really like to solve this problem correctly, and feel moving the project is a hack/admitting defeat.</p>","500650","","","","","2013-07-15 08:02:40","Proguard error: Expecting class path seperator - not sure where I need to put a path in quotes","<android><windows><ant><proguard>","6","1","2","",""
"4357006","1","4357566","","2010-12-05 02:17:26","0","3076","<p>I'm looking to create a simple calculator that will generate the sunrise and sunset for a given location (gps) for android.</p><p>I've come across these two approaches:</p><p><a href=""http://www.codeproject.com/KB/cs/suntimes.aspx"" rel=""nofollow"">http://www.codeproject.com/KB/cs/suntimes.aspx</a><a href=""http://williams.best.vwh.net/sunrise_sunset_algorithm.htm"" rel=""nofollow"">http://williams.best.vwh.net/sunrise_sunset_algorithm.htm</a></p><p>I'd just like some advice on the best way to approach this. I have a feeling that I could spend a lot of time on either approach and discover it's too compicated.</p><p>What approach would you suggest is best?I think the C# would probably be best. The lack of the .NET libraries would be a pain to convert.</p><p>Any advice appreciated.</p><p>Thanks.</p>","225885","","1131435","","2013-04-11 18:12:18","2013-12-14 08:47:19","Calculate Sunrise and Sunset times - port code to Android","<android><algorithm><time>","2","3","2","",""
"4357008","1","4365197","","2010-12-05 02:17:55","4","3303","<p>I built this for Android 2.2</p><p>Here is my code. The java is generated by eclipse. The xml I changed.</p><pre><code>package foo.bar.radiobuttontest;import android.app.Activity;import android.os.Bundle;import foo.bar.radiobuttontest.R;public class rbt 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>here is my res/layout/main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;    &lt;RadioGroup      android:id=""@+id/orientation""      android:orientation=""horizontal""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:padding=""5px""&gt;        &lt;RadioButton            android:id=""@+id/horizontal""            android:background=""#aa0000""            android:text=""horizontal""        /&gt;        &lt;RadioButton            android:id=""@+id/vertical""            android:text=""vertical""        /&gt;    &lt;/RadioGroup&gt;&lt;/LinearLayout&gt;</code></pre><p>While experimenting with radiobuttons I started making a very simple app. It looks like this:</p><p>* horizontal * vertical</p><p>For no good reason I thought I would change the background color. I started by changing the background of the RadioGroup element, everything worked just as expected. Then just for fun I though I would change the background of only one of the radio buttons in the group. This can be seen in main.xml above. After doing this I noticed the text of the radiobutton is now covered by the radiobutton, the page now looks something like:</p><p>*rizontal * vertical</p><p>Except you can still kind of see the 'ho' from horizontal they are just covered by the radiobutton</p><p>Is this expected behavior?</p>","442585","","442585","","2010-12-05 02:23:34","2010-12-06 10:02:05","setting android:background is messing up the text for my radiobutton","<android>","1","3","2","",""
"4357071","1","","","2010-12-05 02:43:07","2","3853","<p>I'm trying to find the right approach for creating an Android OpenGL live wallpaper i.e. a way to convert an app written to use GLSurfaceView into a live wallpaper. There appears to be nothing in the official Android documentation about this surprisingly and it's not obvious what to do.</p><p>I've found a few discussions about this elsewhere where most end up linking to the following code written an Android developer:<a href=""http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers"" rel=""nofollow"">http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers</a></p><p>However, the comments on the page suggest there are problems with the code (memory leaks, lock ups). Does anyone know of any alternatives? If I upload a wallpaper to the market, I'd obviously like to avoid complaints caused by buggy code.</p>","483701","","19750","","2011-08-31 14:25:06","2013-03-18 18:44:43","How to create an OpenGL live wallpaper?","<java><android><mobile><live-wallpaper>","2","2","","",""
"4357094","1","4357322","","2010-12-05 02:52:28","9","3007","<p>This is my first Android app and I've encountered an exception when trying to use the ListPreference. The application loads along with the preferences... but when i touch the ListPreference entry the applications ""stops unexpectedly"".</p><p>Settings.java</p><pre><code>public class Settings extends PreferenceActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.addPreferencesFromResource(R.layout.settings);    }}</code></pre><p>settings.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreenxmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;CheckBoxPreference        android:key=""chk_enabled""        android:summary=""SMS response based on settings""        android:title=""Enable""    /&gt;    &lt;ListPreference        android:title=""Contacts""        android:summary=""Contacs that will be sent SMSs""        android:key=""list_contacts""        android:defaultValue=""0""        android:entries=""@array/list_entries""        android:entryValues=""@array/list_values""     /&gt;&lt;/PreferenceScreen&gt;</code></pre><p>arrays.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string-array name=""list_entries""&gt;        &lt;item&gt;All&lt;/item&gt;        &lt;item&gt;WhiteList&lt;/item&gt;        &lt;item&gt;BlackList&lt;/item&gt;    &lt;/string-array&gt;    &lt;integer-array name=""list_values""&gt;        &lt;item&gt;0&lt;/item&gt;        &lt;item&gt;1&lt;/item&gt;        &lt;item&gt;2&lt;/item&gt;    &lt;/integer-array&gt;&lt;/resources&gt;</code></pre><p>This is the logcat output:</p><pre><code>D/AndroidRuntime( 3187): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;D/AndroidRuntime( 3187): CheckJNI is OFFD/AndroidRuntime( 3187): --- registering native functions ---I/jdwp    ( 3187): received file descriptor 16 from ADB/ddm-heap( 3187): Got feature list requestI/ActivityManager(   86): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=tml.UI.main/.MainActivity }D/AndroidRuntime( 3187): Shutting down VMD/dalvikvm( 3187): DestroyJavaVM waiting for non-daemon threads to exitI/ActivityManager(   86): Start proc tml.UI.main for activity tml.UI.main/.MainActivity: pid=3194 uid=10039 gids={1015}D/dalvikvm( 3187): DestroyJavaVM shutting VM downD/dalvikvm( 3187): HeapWorker thread shutting downD/dalvikvm( 3187): HeapWorker thread has shut downD/jdwp    ( 3187): JDWP shutting down net...D/jdwp    ( 3187): +++ peer disconnectedI/dalvikvm( 3187): Debugger has detached; object registry had 1 entriesD/dalvikvm( 3187): VM cleaning upD/dalvikvm( 3187): LinearAlloc 0x0 used 676380 of 4194304 (16%)I/jdwp    ( 3194): received file descriptor 10 from ADBD/ddm-heap( 3194): Got feature list requestW/Resources( 3194): Converting to string: TypedValue{t=0x10/d=0x0 a=-1}I/ActivityManager(   86): Displayed activity tml.UI.main/.MainActivity: 977 ms (total 977 ms)D/AndroidRuntime( 3194): Shutting down VMW/dalvikvm( 3194): threadid=3: thread exiting with uncaught exception (group=0x4001da28)E/AndroidRuntime( 3194): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 3194): java.lang.NullPointerExceptionE/AndroidRuntime( 3194):    at android.preference.ListPreference.findIndexOfValue(ListPreference.java:169)E/AndroidRuntime( 3194):    at android.preference.ListPreference.getValueIndex(ListPreference.java:178)E/AndroidRuntime( 3194):    at android.preference.ListPreference.onPrepareDialogBuilder(ListPreference.java:190)E/AndroidRuntime( 3194):    at android.preference.DialogPreference.showDialog(DialogPreference.java:291)E/AndroidRuntime( 3194):    at android.preference.DialogPreference.onClick(DialogPreference.java:262)E/AndroidRuntime( 3194):    at android.preference.Preference.performClick(Preference.java:811)E/AndroidRuntime( 3194):    at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:190)E/AndroidRuntime( 3194):    at android.widget.AdapterView.performItemClick(AdapterView.java:284)E/AndroidRuntime( 3194):    at android.widget.ListView.performItemClick(ListView.java:3246)E/AndroidRuntime( 3194):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:1635)E/AndroidRuntime( 3194):    at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime( 3194):    at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime( 3194):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 3194):    at android.app.ActivityThread.main(ActivityThread.java:4203)E/AndroidRuntime( 3194):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 3194):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 3194):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)E/AndroidRuntime( 3194):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)E/AndroidRuntime( 3194):    at dalvik.system.NativeStart.main(Native Method)I/Process (   86): Sending signal. PID: 3194 SIG: 3I/dalvikvm( 3194): threadid=7: reacting to signal 3I/dalvikvm( 3194): Wrote stack trace to '/data/anr/traces.txt'I/Process ( 3194): Sending signal. PID: 3194 SIG: 9I/ActivityManager(   86): Process tml.UI.main (pid 3194) has died.I/WindowManager(   86): WIN DEATH: Window{4341fd00 tml.UI.main/tml.UI.main.MainActivity paused=false}W/UsageStats(   86): Unexpected resume of com.android.launcher while already resumed in tml.UI.mainW/InputManagerService(   86): Got RemoteException sending setActive(false) notification to pid 3194 uid 10039</code></pre>","304461","","304461","","2010-12-05 03:09:48","2013-01-21 11:00:00","Exception on ListPreferences","<android><listpreference>","2","4","4","",""
"4357131","1","7534382","","2010-12-05 03:01:27","0","67","<p>as you can see from the code below im just trying to get the coords pushed out to the logcat.  however i never see the message or the coords.  it shows me the sql string then finishes.  so i believe the try is failing but even the catch statement doesnt return anything.</p><pre><code>Button ButtonMap = (Button) findViewById(R.id.ButMap);   ButtonMap.setOnClickListener(new View.OnClickListener() {          public void onClick(View v) {           try {         /* Query for some results with Selection and Projection. */            String sql = ""SELECT _id,Longitude,Latitude FROM "" + MY_DATABASE_TABLE + "" WHERE _id = ""+ID;          Cursor c = db.rawQuery(sql,null);           //db.query(MY_DATABASE_TABLE, new String[] {""_id"", ""Longitude"", ""Latitude""},                       // ""_id = "" + ""'%""+ID+""%'"", null, null, null, null);                  Log.e(""SQL Select"", sql);         /* Get the indices of the Columns we will need */         int longitude, latitude ;            longitude = c.getColumnIndex(""Longitude"");            latitude = c.getColumnIndex(""Latitude"");         /* Check if our result was valid. */          if (c.moveToFirst()) {           int i = 0;           /* Loop through all Results */            do {            i++;            /* Retrieve the values of the Entry             * the Cursor is pointing to. */             double lat = c.getDouble(latitude);              double lon = c.getDouble(longitude);                                     Log.e(""GPS"", ""location for this record is: lat=""+lat+"", lon=""+lon);           } while (c.moveToNext());          }        } catch (Throwable t) {                  Log.e(""GPS"", t.toString());       }           finally {         if (db != null)          db.close();        }            Intent intent = new Intent();                 setResult(RESULT_OK, intent);                 finish();       }      }); }</code></pre>","530933","","345717","","2010-12-05 03:02:40","2011-09-23 20:19:48","trying to get coords from database but nothing happens","<java><android>","1","6","","",""
"4357328","1","4357458","","2010-12-05 04:09:05","0","581","<p>I'm looking for a way to code on a Galaxy Tab, running Android 2.2. I'm not very particular on the language, as long as it can do loops, random number generation, and output. Is there a way to currently do this?</p>","530964","","995926","","2012-05-22 08:01:49","2012-05-22 08:01:49","Program on an Android mobile device","<android><programming-languages><android-2.2-froyo>","4","3","","",""
"4357483","1","4357860","","2010-12-05 05:12:47","0","667","<p>In my activity I have two thumbnail pictures. I want to show the pictures in real size if I click on each thumbnail. Is it possible? If yes what is the procedure?</p>","513413","","","","","2010-12-05 07:42:36","Android: Showing thumbnail pictures in real size","<android><thumbnails><image>","1","1","0","",""
"4357531","1","","","2010-12-05 05:32:57","1","267","<p>I have been trying to figure this out to compile source code for 2 weeks now, i keep getting errors. I tried 10 different combinations of eclipse and the sdk</p><p>I read the step by step things and still cant figure it out. </p><p>I created an app on buzztouch.com and downloaded the source code, all i have to do is compile it should be simple but no. </p><p>so step one. could someone give a direct link to an eclipse version that works with the windows SDK found here<a href=""http://developer.android.com/sdk/index.html"" rel=""nofollow"">http://developer.android.com/sdk/index.html</a>?I have been installing eclipse first is the right way to do it, should i download and install the sdk first? or does it just not make a difference?</p><p>thanks</p>","530995","","","","","2012-01-10 06:33:56","Android app creation with Eclipse and SDK","<android><eclipse><sdk>","4","0","","",""
"4357602","1","4357618","","2010-12-05 06:00:37","0","1539","<p>I have a requirement of getting a full screen image on clicking the tagged points on the map...I short to call an activity from a class extending Overlay,however i am getting the following error</p><p>""The method startActivity(Intent) is undefined for the type MapLocationFace""</p><p>when i use this piece of code to call the activity from the onTap function :</p><p>Intent intent = new Intent(); intent.setClass(mapView.getContext(), getnohsib.class); startActivity(intent);</p><p>Note : MapLocationFace class is extending Overlay...</p><p>whats the solution....thanks in advance...</p>","530993","","","","","2011-07-05 11:13:42","How to call an activity from a class extending Overlay","<android>","1","0","","",""
"4357620","1","4357629","","2010-12-05 06:05:35","0","778","<p>I am making an extremely simple Android App (my first app...) which will display some Hebrew Text.  When I run this app, the Hebrew text displays as boxes because there is no Hebrew font to display them.  I want to bundle a Hebrew font with this app.  I am pretty sure this has been done before.</p><p>I'm looking for help as to where to get started with this.  It seems like this should be simple, but if it's not please let me know and I'll use a rendered image of the text instead.</p><p>I have seen other apps do this.</p><p>Thanks.</p>","107083","","","","","2012-03-15 21:37:47","Android App with Bundled Font?","<android><fonts>","1","4","1","",""
"4358017","1","4358160","","2010-12-05 08:42:22","0","436","<p>good daywe are developing game for android and have some trouble with resource loading on high dpi devices.</p><p>our resources are located in res/drawable directoryon a standart dpi device the game work properly, but on hdpi (tested on HTC Desire) all resources which located in res/drawable-hdpi load are loaded correctly, but the resources which miss in drawable-hdpi directory but present in res/drawable are ignored</p><p>but everything works fine on the virtual device with hdpi.</p><p>does anybody encounter this problem and know how to solve it?</p>","357366","","387076","","2012-05-12 20:34:36","2012-05-12 20:34:36","Android hdpi resource load problem","<android><hdpi>","1","0","","",""
"4358047","1","","","2010-12-05 08:52:51","8","4990","<p>I have built FFMPEG executables and libraries as provided by Bambuser (http://bambuser.com/opensource). So I managed to build the Android executables and libraties. How can I link these libs in my Eclipse project and invoke the FFmpeg functions from Java? The open source code includes the C header-files.  </p><p>I am new to native coding for Android, and I could not find an easy answer for this. In basic : having a bunch of Android compatible libraries and some C header files what do I have to do to reuse those libaries' functionality from java (+Android SDK)?</p><p>Any help would be appreciated. </p><p>Kind regards,</p><p>WhyHow</p>","522212","","193892","","2012-11-26 08:24:55","2014-02-04 09:15:46","FFMpeg jni in Android?","<android><ffmpeg>","1","3","3","",""
"4358078","1","4358101","","2010-12-05 09:03:59","3","4622","<p>I've made an android application which needs to connect to a database. I've done making the database. Now my application is not working properly. My question is how can I import my created database into my android application that is running in android emulator?</p>","516160","","135152","","2011-05-25 03:05:36","2011-05-25 03:05:36","Import SQLite database into Android emulator","<android><sqlite><android-emulator>","1","0","1","",""
"4358106","1","","","2010-12-05 09:10:35","4","982","<p>I want to load all of my contacts' names and phone numbers into an AutoCompleteTextView's adapter. How can I achieve that? for example, when i type ""G"", it will show ""Good, &lt;111111>"", ""Good, &lt;222222>"" in its drop-down list.</p><p>with the api demo, i can only put the DISPLAY_NAMEs in the result cursor. I don't know how to combine both names and numbers into one cursor. thanks! </p><p>codes from the api demo:</p><pre><code>ContentResolver content = getContentResolver();Cursor cursor = content.query(ContactsContract.Contacts.CONTENT_URI,      PEOPLE_PROJECTION, null, null, null);ContactListAdapter adapter = new ContactListAdapter(this, cursor);mAutoCompleteTextView.setAdapter(adapter);private static class ContactListAdapter extends CursorAdapter implements Filterable {      private ContentResolver mCR;    public ContactListAdapter(Context context, Cursor c) {          super(context, c);          mCR = context.getContentResolver();      }      @Override    public View newView(Context context, Cursor cursor, ViewGroup parent) {        final LayoutInflater inflater = LayoutInflater.from(context);        final TextView view = (TextView) inflater.inflate(                android.R.layout.simple_dropdown_item_1line, parent, false);        view.setText(cursor.getString(1));        return view;    }    @Override    public void bindView(View view, Context context, Cursor cursor) {          ((TextView) view).setText(cursor.getString(1));    }    @Override    public String convertToString(Cursor cursor) {          return cursor.getString(1);    }    @Override    public Cursor runQueryOnBackgroundThread(CharSequence constraint) {        if (getFilterQueryProvider() != null) {            return getFilterQueryProvider().runQuery(constraint);        }        StringBuilder buffer = null;        String[] args = null;        if (constraint != null) {            buffer = new StringBuilder();            buffer.append(""UPPER("");            buffer.append(ContactsContract.Contacts.DISPLAY_NAME);            buffer.append("") GLOB ?"");            args = new String[] { constraint.toString().toUpperCase() + ""*"" };        }        return mCR.query(ContactsContract.Contacts.CONTENT_URI, PEOPLE_PROJECTION,                buffer == null ? null : buffer.toString(), args, null);    }}private static final String[] PEOPLE_PROJECTION = new String[] {      ContactsContract.Contacts._ID,    ContactsContract.Contacts.DISPLAY_NAME,    ContactsContract.Contacts.HAS_PHONE_NUMBER};</code></pre>","436186","","436186","","2010-12-05 09:19:57","2011-02-18 02:39:20","how to combine both DISPLAY_NAME and NUMBER in a customized CursorAdapter?","<android><contacts><autocompletetextview>","1","1","","",""
"4358152","1","","","2010-12-05 09:25:28","2","1634","<p>I know that with Camera.open() and getParameter to check focus mode will work.</p><p>But it seems open the camera will have a little bit of sound,which I don't want to ...</p><p>Any other way I can get whether the camera support autofocus or not ?</p>","441316","","","","","2013-10-23 17:42:15","how to check whether an android phone's camera support autofocus","<android><camera><android-camera><autofocus>","1","0","","",""
"4358205","1","","","2010-12-05 09:44:14","0","1014","<p>I have this code I got off dev.android.com...</p><pre><code>@Override    protected void onStop(){        FileOutputStream fos = openFileOutput(filename, MODE_PRIVATE);        fos.write(levelComplete);        fos.close();    }</code></pre><p>Supposedly this should create the file if it's not there, otherwise, it should write to it. However, I'm getting a FileNotFoundException. Help?</p><p>EDIT: Input:</p><pre><code>@Overrideprotected void onStart(){    FileInputStream fis = openFileInput(filename);    levelComplete = fis.read();    fis.close();}</code></pre>","420617","","420617","","2010-12-05 10:27:14","2011-09-28 19:29:25","Saving an int to a file in Android","<java><android><file>","2","2","","",""
"4358242","1","4358281","","2010-12-05 09:57:18","3","5249","<p>I have a UI, I build it dynamically. I should want to put some component in a xml resource file. So I do :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView  xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+android:id/titreItem""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;</code></pre><p>... in a file <code>res/layout/titreitem.xml</code> as I see anywhere. But I don't understand how get it to put inside my UI. So, inside <code>activity.onCreate</code>, I want to do something like :</p><pre><code>RelativeLayout myBigOne = new RelativeLayout(this);TextView thingFromXML = [what here ? ];myBigOne.addView(thingFromXML);setContentView(myBigOne);</code></pre>","312025","","","","","2010-12-05 10:08:24","How to get a view from a resource?","<android>","2","0","","",""
"4358342","1","4361164","","2010-12-05 10:28:13","0","1293","<p>I have a problem with <code>EditText</code> fields in a <code>ListActivity</code>.</p><p>The code complies all right, but the functionality is strange, typing in the first field and hiding the keyboard after this the text appears in another editfield.</p><p>Help me with my logical issue</p><pre><code>package com.example.helloandroid;import android.app.ListActivity;import android.content.Context;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.EditText;import android.widget.TextView;public class AddComp extends ListActivity {static final int DATE_DIALOG_ID = 0;        private class EfficientAdapter extends BaseAdapter {            private LayoutInflater mInflater;            private String[] attitude_names;            private String[] attitude_values;            public EfficientAdapter(Context context) {                mInflater = LayoutInflater.from(context);                attitude_names = context.getResources().getStringArray(R.array.COMP_ATTITUDE_NAME);                attitude_values = new String[attitude_names.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) {                    convertView = mInflater.inflate(R.layout.addcomp_attitude_row, null);                    holder = new ViewHolder();                    holder.Attitude_Name = (TextView) convertView.findViewById(R.id.addcomp_att_name);                    holder.Attitude_Value = (EditText) convertView.findViewById(R.id.addcomp_att_value);                    convertView.setTag(holder);                } else {                    holder = (ViewHolder) convertView.getTag();                }                holder.Attitude_Name.setText(attitude_names[position]);                holder.Attitude_Value.setHint(attitude_names[position]);                attitude_values[position] = holder.Attitude_Value.getText().toString();                return convertView;            }            class ViewHolder {                TextView Attitude_Name;                EditText Attitude_Value;             }            @Override            public int getCount() {                return attitude_names.length;            }        }    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setListAdapter(new EfficientAdapter(this));        setContentView(R.layout.addcomp);    }}</code></pre>","528407","","2345913","","2013-09-05 07:01:30","2013-09-05 07:01:30","EditText in a list aren't working the way they should","<java><android><list><android-edittext>","3","8","","",""
"4358481","1","4358649","","2010-12-05 11:09:53","1","1460","<p>In my project I have three tabs. I want to know, each time that I click a tab onCreate function runs or it runs just one time when it creates.</p><p>Actually, in one tab I want to show a picture. for the first time, default picture is shown. However, if user creates his picture (in other tabs), when he clicks this tab the new picture should be shown.</p><p>My problem is, only default picture is shown and it doesn't show new picture. I think onCreate method don't run each time that I click the tab. Am I right?</p>","513413","","","","","2011-07-15 15:11:52","Android: Does onCreate method run in tabView when we click on each tab?","<android><image><tableview>","2","0","","",""
"4358517","1","","","2010-12-05 11:19:28","0","10639","<p>i have a listview in which i have 2 textviews, one of these textview contains zero text by default, but can be changed by the user. the problem is that i need to do so when the textview is empty the visibility of it is set to GONE. i have 2 ideas of how this might work, either defining it in xml or defining it in the database somehow.</p><pre><code>public long createDate(String date) {    ContentValues initialValues1 = new ContentValues();    initialValues1.put(KEY_DATE, date);    initialValues1.put(KEY_TIMESTAMP, ""00:00"");    if(text==""""){       initialValues1.put(KEY_DICTTAG,View.GONE); //this does NOT work    }else{       initialValues1.put(KEY_DICTTAG,text);    }    initialValues1.put(KEY_DICTALARMTIME, ""0"");    initialValues1.put(KEY_DICTLISTIMAGE, R.drawable.list_icon);    return mdiktationsDb.insert(DATABASE_TABLE, null, initialValues1);}</code></pre><p>i know the textview wont be seen by the user when there is no text, but i need it to not be seen by the system so to speak. this is because i need the timestamp textview to be centerd in the relative layout when there is no text in the dicttag textview. i could not post the xml layout because i do not have any room</p>","525726","","525726","","2010-12-05 11:41:36","2014-04-02 13:31:11","setting textview visibility to GONE when there is no text to show","<android><listview><textview><visibility>","2","2","","",""
"4358605","1","4380944","","2010-12-05 11:41:58","3","1847","<p>I have a custom view being dynamically inserted and the <code>onDraw</code> is not being called.  I initially made the custom view without the dynamic insertion and it worked fine, however when moving it to my working code base, I cannot get <code>onDraw</code> to get called ever, even though the view constructor gets called and the <code>onMeasure</code> also gets called.  I've tried putting <code>invalidate()</code> and <code>postInvalidate()</code> calls around the place, but they don't seem to force the view to draw.  The view hierarchy looks the same for both version and I'm lost.  </p><p>Can anyone help?  </p><p>EDIT:  A bit more testing has shown that <code>onDraw</code> is getting called on the emulator, but not the handset.  Also <code>onSizeChanged</code> on the handset has the correct values coming through, but on the emulator the values are all 0. </p><p>EDIT:  I've been playing about with it and still can't get anywhere, so have put a bounty on it.  If you need more code / xml / info then please let me know.</p>","264276","","802724","","2011-07-24 19:50:16","2011-07-24 19:50:16","Android - onDraw not being called in dynamically inserted custom view","<android><custom-view><ondraw>","2","0","","",""
"4358626","1","4367564","","2010-12-05 11:48:08","2","263","<p>I have an application that needs to create a remote account if the user pays for an application using the Android Market. </p><p>How might I do this from the application itself in a secure way, ie. I don't want anyone to be able to submit data to a url and create an account, I want this to happen in a verified way. I thought of including an authentication key in the application itself, but that does not stop someone from decompiling the application and taking out the authorisation key. </p><p>Is there a way to query the Android Market payments using PHP?</p>","248521","","","","","2011-06-30 10:01:06","Verifying the Android Licensing API remotely","<android>","3","0","","",""
"4358691","1","4358712","","2010-12-05 12:09:09","4","3836","<p>OK, I'm at the end of my wits. </p><p>I have no idea how to <a href=""http://developer.android.com/reference/android/widget/ZoomButtonsController.html"" rel=""nofollow"">use android.widget.ZoomButtonsController</a>. All I want is to have a zoom controls which I [show|hide|[enable|disable] zoom [in|out] buttons] for my View. I can't add it to my layout xml, and when I instantiate it in my onCreate, I can't see it on the screen.</p><pre><code>View viewer = ...ZoomButtonsController controller = new ZoomButtonsController(viewer);controller.setVisible(true); </code></pre>","72746","","","","","2011-01-28 22:34:04","How do I use Android ZoomButtonsController?","<android><zoom>","1","0","","",""
"4358777","1","4358862","","2010-12-05 12:29:20","0","954","<p>I'm trying to implement returning from an Activity without needing to refresh the screen. As far as I see, there are 4 possible states to handle:</p><ol><li>Both ""Use wireless networks"" and ""Use GPS satellites"" are disabled (user is directed to My Location preferences and not allowed to continue if either are are disabled)</li><li>One of these two are enabled (1 of 2 possibilities)3, Both are enabled</li></ol><p>My problem is that after returning from other Activities in my app, setupWebView() is called every time causing a screen refresh delay.</p><p>The refresh is somewhat necessary returning from the preferences (e.g. GPS after enabling gets a fix), but certainly not after returning from an Activity as the time delay in re-painting the screen is distracting and slows down the workflow of my app.</p><p>Could someone please advise how to handle this within my onResume() so to avoid all the setupWebview calls.</p><p>Here is the code from my onResume() within my main Activity:</p><pre><code>    @Overrideprotected void onResume() {    if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)            &amp;&amp; !locationManager                    .isProviderEnabled(LocationManager.NETWORK_PROVIDER))        createMyLocationDisabledAlert();    if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {        locationManager.requestLocationUpdates(                LocationManager.GPS_PROVIDER, 500, 0, this);        mostRecentLocation = locationManager                .getLastKnownLocation(LocationManager.GPS_PROVIDER);        if (mostRecentLocation != null)            setupWebView();        else {            mostRecentLocation = locationManager                    .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);            setupWebView();        }    }    else if (locationManager            .isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {        locationManager.requestLocationUpdates(                LocationManager.NETWORK_PROVIDER, 500, 0, this);        mostRecentLocation = locationManager                .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);        if (mostRecentLocation != null)            setupWebView();        else {            mostRecentLocation = locationManager                    .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);            setupWebView();        }    }    // locationManager.requestLocationUpdates(provider, 500, 0, this);    // mostRecentLocation = locationManager.getLastKnownLocation(provider);    // } else    // mostRecentLocation = locationManager    // .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);    super.onResume();}</code></pre>","496625","","","","","2010-12-05 12:50:27","onResume() without calling setupWebView() after retuning from Activity","<android><gps><webview><onresume><locationlistener>","1","0","","",""
"4358896","1","","","2010-12-05 12:59:48","0","910","<p>I'm trying to catch onKey events from a soft keyboard. however, only few keys fire the onKey event (Delete, back, etc.). not regular characters. anyone know why?</p>","258429","","","","","2010-12-05 13:59:11","Android onKey is not fired for soft keyboard on a nexus one","<android><onkeyup><android-softkeyboard><nexus-one><onkeydown>","1","3","","",""
"4359197","1","4359263","","2010-12-05 14:15:10","3","2865","<p>I have in my application 2 views:</p><p>a. res/layout/main.xml - a standard view with 1 button</p><p>b. res/layout/web_view.xml </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;         &lt;WebView android:id=""@+id/webview""            android:layout_height=""fill_parent""            android:layout_width=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>When I click the button on the first view(a), it loads the webview(b) and loads an url:</p><pre><code>// click on the ""Browser"" button in view apublic void goToWebView(View view) {        setContentView(R.layout.web_view);        WebView mWebView = (WebView) findViewById(R.id.webview);        mWebView.getSettings().setJavaScriptEnabled(true);        mWebView.loadUrl(""http://www.google.com"");    }</code></pre><p>All that is working fine, the url load well but the browser <b>is instantiated into its own view</b> (a third one, not b itself) and my goal is to use the Webview to show some HTML code into my application, not outside of it, in a separate browser.</p><p>Anyboyd any idea?</p><p>This is done using API level8/Android 2.2.</p><p>Thanks for your help.Paul</p>","289901","","21234","","2010-12-05 14:16:58","2010-12-05 14:34:34","Embedding a webview into another view","<android><android-webview>","1","0","1","",""
"4359239","1","4359308","","2010-12-05 14:28:16","2","4955","<p>In android SDK, when I editing an android layout xml file, it can do validation and auto-complete. How does this work?</p><p>How can I make eclipse validate and auto-complete with my own defined xml format?</p>","277422","","277422","","2010-12-05 14:34:11","2012-02-18 11:15:22","XML validation and auto-complete in Eclipse","<android><xml><eclipse>","5","0","1","",""
"4359290","1","","","2010-12-05 14:39:53","0","108","<p>Hi AllReal beginner here on Android. I am writing an app that displays a full screen jpg that has a file that is read that has touch areas defined on a granularity of 20 x 20 pixels. These touch areas are decoded to videos to play. The jpg and touch area decode work just fine, until I un comment out play_video(), then the emulator just displays a blank screen and hangs. The possible video numbers are 0 through 7 with 8 being used to indicate a non valid touch.</p><p>I am pulling what remains of my hair out over this.</p><p>Here is the java code</p><pre><code>package org.example.video_4;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.media.MediaPlayer;import android.os.Bundle;import android.view.MotionEvent;import android.widget.ImageView;public class video_4 extends Activity {    byte[] videos_to_play = new byte[960];    boolean video_playing = false;    int video_to_play = 8;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // now display the adBook background screen this is a full screen        // due to the declaration in manifest.xml under activity        // android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""        setContentView(R.layout.main);        ImageView jpgView = (ImageView) findViewById(R.id.jpgview);        String myJpgPath = ""/sdcard/AdBook.JPG""; //UPDATE WITH YOUR OWN JPG FILE        BitmapFactory.Options options = new BitmapFactory.Options();        options.inSampleSize = 1;        Bitmap bm = BitmapFactory.decodeFile(myJpgPath, options);        jpgView.setImageBitmap(bm);        // now we have to wait for a touch and then fire of the video play        // we also return here when the video is complete so as we wait for        // touch demand for a video to play        set_touch_areas();        /*******************************************************         Problem area all works fine until I uncomment this code         ********************************************************/        /* play_video();*/    }    @Override    public boolean onTouchEvent(MotionEvent event) {        int xpos, ypos;        if (event.getAction() != MotionEvent.ACTION_DOWN) {            return super.onTouchEvent(event);        }        xpos = (int) event.getX() / 20;        ypos = (int) event.getY() / 20;        if (xpos &lt; 0 || xpos &gt; 39 || ypos &lt; 0 || ypos &gt; 23) {            video_to_play = 8;            return true;        }        video_to_play = videos_to_play[(ypos * 40) + xpos];        return true;    }    public void set_touch_areas() {        // read in the touch file        File file = new File(""/sdcard/adbook.tch"");        FileInputStream is;        int c, v, x;        try {            is = new FileInputStream(file);            // Get the size of the file            long length = file.length();            if (length != 960) {                finish();            }            // Read in the bytes            int offset = 0;            int numRead = 0;            while (offset &lt; videos_to_play.length &amp;&amp; (numRead = is.read(videos_to_play, offset, videos_to_play.length - offset)) &gt;= 0) {                offset += numRead;            }            // Ensure all the bytes have been read in            if (offset &lt; videos_to_play.length) {                finish();            }        } catch (FileNotFoundException e1) {            // just bomb if anything is bad with the file read            finish();        } catch (IOException e) {            // just bomb if anything is bad with the file read            finish();        }        // we have read the adbook.tch file so now decode the entries based        // on my algorithm of invert, valid &amp; video_num / random data        for (c = 0; c &lt; 960; c++) {            v = (videos_to_play[c] &amp; 0xc0) &gt;&gt; 6; // mask and align the bits for checking            if (v == 0x02) { // inverted and video valid                x = videos_to_play[c]; // java can only invert integer                x = ~x; // so invert an integer, what a pain!!                videos_to_play[c] = (byte)(x &amp; 0x07); // mask to the valid number            } else if (v == 0x01) { // non inverted and video valid                videos_to_play[c] &amp;= (byte) 0x07; // so just isolate the video number            } else { // non valid entry who cares,  I do                videos_to_play[c] = (byte) 0x08; // it's not valid so store the fact            }        }    }    public void play_video() {        String myMp4Path = ""/sdcard/v1.mp4"";        video_to_play = 8;        while (true) {            if ((video_to_play &lt; 8) &amp;&amp; (video_playing == false)) {                switch (video_to_play) {                case 0:                    myMp4Path = ""/sdcard/v0.mp4"";                    break;                case 1:                    myMp4Path = ""/sdcard/v1.mp4"";                    break;                case 2:                    myMp4Path = ""/sdcard/v2.mp4"";                    break;                case 3:                    myMp4Path = ""/sdcard/v3.mp4"";                    break;                case 4:                    myMp4Path = ""/sdcard/v4.mp4"";                    break;                case 5:                    myMp4Path = ""/sdcard/v5.mp4"";                    break;                case 6:                    myMp4Path = ""/sdcard/v6.mp4"";                    break;                case 7:                    myMp4Path = ""/sdcard/v7.mp4"";                    break;                default:                    myMp4Path = ""/sdcard/v4.mp4"";                    break;                }                video_playing = true;                MediaPlayer mp = new MediaPlayer();                try {                    mp.setDataSource(myMp4Path);                } 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();                }                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();                while (mp.isPlaying());                video_playing = false;                video_to_play = 8;            }        }    }}</code></pre>","531241","","21399","","2010-12-05 14:56:35","2010-12-06 23:07:05","Video doesn't launch and JPEG no longer displays when code added","<java><android>","2","3","","",""
"4359313","1","","","2010-12-05 14:47:15","1","749","<p>I am pretty new to android; I would like to access google booksfrom my android app. Can anyone provide any pointers, sample code, or advice onhow to get going here?</p><p>Thanks!</p>","244005","","","","","2011-01-06 14:51:49","want to access google books from android app","<android><google-api-java-client><google-books>","1","0","","",""
"4359349","1","","","2010-12-05 14:56:35","1","323","<p>I have a custom digital clock widget, where I would like to use a custom font. I have gotten hold of a pice of code that helps me along, but I need help on how to use it. Here is the method:</p><pre><code>    public static RemoteViews buildUpdate(Context context){        RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.main);        Bitmap myBitmap = Bitmap.createBitmap(100, 50, Bitmap.Config.ARGB_4444);        Canvas myCanvas = new Canvas(myBitmap);        Paint paint = new Paint();        Typeface clock = Typeface.createFromAsset(context.getAssets(),""Clockopia.ttf"");        paint.setAntiAlias(true);        paint.setSubpixelText(true);        paint.setTypeface(clock);        paint.setStyle(Paint.Style.FILL);        paint.setColor(Color.WHITE);        paint.setTextSize(15);        myCanvas.drawText(""Test"", 0, 0, paint);        views.setImageViewBitmap(R.id.TimeView, myBitmap);        return views;</code></pre><p>}</p><p>And here is my updateservice:</p><pre><code>    private void update() {    mCalendar.setTimeInMillis(System.currentTimeMillis());    final CharSequence time = DateFormat.format(mTimeFormat, mCalendar);    final CharSequence date = DateFormat.format(mDateFormat, mCalendar);    final CharSequence day = DateFormat.format(mDayFormat, mCalendar);    RemoteViews views = new RemoteViews(getPackageName(), R.layout.main);    views.setTextViewText(R.id.Day, day);    views.setTextViewText(R.id.Date, date);    buildUpdate(this);    ComponentName widget = new ComponentName(this, DigiClock.class);    AppWidgetManager manager = AppWidgetManager.getInstance(this);    manager.updateAppWidget(widget, views);}</code></pre><p>How will I get it to show the time using the buildUpdate method?</p>","525720","","","","","2010-12-05 14:56:35","int to image to imageview","<android><fonts><widget><clock>","0","1","","",""
"4359356","1","4359398","","2010-12-05 14:57:48","6","449","<p>Under ""How Android Draws Views"" topic, there is such a sentence :</p><blockquote>  <p>Drawing begins with the root node of  the layout. It is requested to measure  and draw the layout tree. Drawing is  handled by walking the tree and  rendering each View that intersects  the <strong>invalid region</strong>.</p></blockquote><p>And I didn't quite understand the term ""invalid region"".</p><p>Here is the <a href=""http://developer.android.com/guide/topics/ui/how-android-draws.html"" rel=""nofollow"">source article of the quotation</a>.</p><p>Can someone elaborate it?</p><p>Thanks.</p>","44852","","497356","","2011-09-11 03:56:56","2011-09-11 03:56:56","What is invalid region in Android?","<java><android>","1","0","","",""
"4359390","1","","","2010-12-05 15:04:02","24","27676","<p>I did some digging in Android code, and saw the use of  in the indeterminate progress bar. after trying to create my own drawable with this tag:</p><pre><code>&lt;animated-rotate xmlns:android=""http://schemas.android.com/apk/res/android""    android:drawable=""@drawable/spinner_pia""    android:pivotX=""50%""    android:pivotY=""50%""    android:framesCount=""12""    android:frameDuration=""100"" /&gt;</code></pre><p>I get an error:""No resource identifier found for attribute 'frameDuration' in package 'android'"" - which means that frameDuration is a private attribute. Is there a way to use this ""animate-rotate"" feature?</p><p>My task is to replace the system's default indeterminate progress bar. I'd like to do it with as little code as possible (just change few attributes if possible).Using the ProgressBar view, setting:</p><pre><code>android:indeterminateOnly=""true""android:indeterminateBehavior=""cycle""android:indeterminateDuration=""3500""android:indeterminateDrawable=""@drawable/pia_sivuvator""</code></pre><p>and point ""@drawable/pia_sivuvator"" to that  object would've make my task as elegant as they come but I'm stuck on those private attributes.</p><p>help?</p>","258429","","54501","","2010-12-19 11:04:49","2014-03-28 20:46:52","Android Animate Rotate","<android><animation><progress-bar><customization>","4","1","9","",""
"4359394","1","","","2010-12-05 15:04:35","1","320","<p>I am developing an Android application which is initially freely downloadable but users need to pay to obtain a special feature. In the absence of an in application purchase, I have come up with another paid application which the users will be prompted pay and download. This paid application does acts like a license key and uses the Android Market Licensing to verify purchase. On successful installation of this application and a positive license check, the special feature on the free application gets enabled.</p><p>Now to my question. The price of the paid application (special feature) is expected to change. I need to display this price in my free application. Is there any way that I can query the Android market place to get this price information? I basic idea is to avoid hard coding the price in my free application.</p><p>Thanks in advance</p>","531248","","","","","2010-12-05 15:56:34","Query an application price from the android marketplace","<android>","1","0","1","",""
"4359397","1","7483808","","2010-12-05 15:04:49","1","182","<p>I have a set of activities starting from my home screen through a few list activities to my final screen.When i have an exception for whatever reason i get the ""Sorry....yada yada yada, must be closed"" dialog and the activity along with the process get shut down, i would expect it to stay that way however the process itself get's relaunched with the same activity stack up to the activity before the one that crashed.It's a very useful feature however since i don't have Bundle savings yet to save my data in onDestroy one activity crash and relaunch will cause an avalanche...Is there a way to disable that feature ? change the launch mode should help here ?</p>","312288","","387076","","2012-10-02 21:08:14","2012-10-02 21:08:14","death of an activity re-launches the process","<android><activity><process><crash><relaunch>","1","1","","",""
"4359403","1","4359421","","2010-12-05 15:05:21","0","1001","<p>I have List of items. i`am using custom adapter(Android 1.5)Everything work perfectly, until i reached the point when I add item's ClickListener to each Item.</p><p>when I do that, I loss the ""focus effect"", when the user touch at any item.</p><p>the mechanism works fine, but <strong>visually</strong> I cant see the red background which surrounding the item when the user clicks on it.</p><p>any idea why?</p><p>Some code:</p><p>my arrayAdapter:</p><pre><code>  public class OrderAdapter extends ArrayAdapter&lt;Order&gt;  {private ArrayList&lt;Order&gt; items;private Context context;public OrderAdapter(Context mContext, int textViewResourceId,        ArrayList&lt;Order&gt; items){    super(mContext, textViewResourceId, items);    this.items = items;    this.context = mContext;}@Overridepublic View getView(int position, View convertView, ViewGroup parent){    View v = convertView;    if (v == null)    {        LayoutInflater vi = (LayoutInflater) context                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);        v = vi.inflate(R.layout.row, null);    }    Order o = items.get(position);    v.setOnClickListener((new OnItemClickListener(position, o)));    if (o != null)    {        TextView tt = (TextView) v.findViewById(R.id.TxtType);        TextView bt = (TextView) v.findViewById(R.id.txtTimeCreated);        if (tt != null)        {            tt.setText(""??? ????? ????: "" + o.getIdType());        }        if (bt != null)        {            bt.setText(""??? ????? ??????: "" + o.getCreateDate());        }    }    return v;}private class OnItemClickListener implements OnClickListener{    private int mPosition;    private Order item;    OnItemClickListener(int position, Order mItem)    {        mPosition = position;        item = mItem;        // mItem.setmChecked(false);    }    @Override    public void onClick(View v)    {        int x=mPosition;        int z=0;    }}</code></pre><p>}</p><hr><p>this is the row.xml :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p><pre><code>android:layout_width=""fill_parent"" android:layout_height=""100sp""android:padding=""6dip""&gt;&lt;ImageView android:layout_width=""wrap_content""    android:layout_height=""fill_parent"" android:src=""@drawable/certificate""    android:id=""@drawable/certificate"" android:layout_marginLeft=""6dip""    android:clickable=""false""&gt;&lt;/ImageView&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""    android:orientation=""vertical"" android:layout_width=""1sp""    android:layout_height=""fill_parent"" android:layout_weight=""1""    android:gravity=""right"" android:focusableInTouchMode=""true"" android:focusable=""true"" android:clickable=""true""&gt;    &lt;TextView android:layout_height=""wrap_content""        android:layout_width=""wrap_content"" android:clickable=""false""        android:id=""@+id/TxtType"" android:text=""??? ????? ????""&gt;    &lt;/TextView&gt;    &lt;TextView android:singleLine=""true""        android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:layout_marginBottom=""3dip"" android:id=""@+id/txtTimeCreated"" android:text=""??? ????? ??????""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>Any ideas will be welcome,</p><p>thanks,</p><p>ray.</p>","260511","","260511","","2010-12-05 15:45:52","2010-12-05 15:45:52","Item's ClickListener disable HighLight on Item touch","<android>","1","0","1","",""
"4359513","1","","","2010-12-05 15:30:19","0","323","<p>In a shared project, we have an Adapter class (extends BaseAdapter, implements ListAdapter).  In its constructor, this class fetches an RSS feed from the internet and parses the returned XML document to obtain the data it will 'adapt'; the data is kept in a private class variable.</p><p>This is seen as the ""Android way"" of doing things by the author and is supported by the project lead.<br>Can this be considered a ""Best Practice""?<br>Can it be justified on the grounds that it (may?) increase performance?<br>Doesn't it violate the general Object Oriented Design (OOD) principle that a class should have only a ""Single Responsiblity""?<br>Are best practices for OOD or Java to be set aside in Android development?</p>","512578","","","","","2011-02-13 22:19:14","Adapter fetches and parses RSS feed to get its data - best practice?","<android>","1","2","","",""
"4359562","1","","","2010-12-05 15:39:39","1","1647","<p>I'll be creating an application which has some amount of Image Processing as its core feature.I'll be wanting to do following things with it-</p><ul><li>Be able to save the downloaded or created Images in the phone memory/ SDCard that may be available in Gallery too.</li><li>Apply some effects to images like Resizing, Cropping, Rotating</li><li>Will be having design templates which will be in the form of transparent PNGs, They can be layered over each another to create an effect or a new design (Like a fancy photo frame or so) and at a point of time, they will be required to be flattened and saved as PNGs at some point of time.</li></ul><p>I am looking for some way to perform these things nicely.</p><p>I have seen that Android helps the developers implement the Business Logic quite easily without letting them bother about the API or widget level details.</p><p>Is there anything available for my requirements?</p><p>Please let me know.Thanks!</p>","243709","","243709","","2010-12-06 06:33:21","2010-12-07 17:53:54","Image Processing in an Android App","<android><android-sdk-2.1>","1","0","1","",""
"4359564","1","","","2010-12-05 15:40:37","0","1808","<p>I am trying to get the contact's display name from the sms uri. I should get the person's contact id if that person is in my contact list. But every time I got a Null as a respond which means the person is not in my contact list. But actually the person is in my contact list and shown in the message. So is there a way to get the person's display name from sms uri?btw, I am using 2.2 emulator. </p>","449110","","","","","2011-05-25 18:32:47","How to get the contact's display name in sms uri?","<android>","1","0","","",""
"4359619","1","","","2010-12-05 15:54:02","2","4763","<p>Recently, I've been working on an iphone app, and I would now like to port it to Android, for a broader distribution.Could anybody suggest me some way to ""port"" (to keep those functionalities in an Android-friendly interface, perhaps) the iPhone App Navigation Bar and Toolbars?</p>","531279","","73488","","2011-05-24 12:25:21","2012-03-13 15:35:56","iPhone NavigationBar / ToolBar on Android","<android>","4","0","","",""
"4359640","1","4359793","","2010-12-05 15:57:27","1","540","<p>I'm trying to check the value of the EditText inside my AlertDialog.Builder so that I can prevent the user from entering nothing in the EditText.</p><p>For some reason when I use the code below it never gets into the <code>if (mEditText.getText() == null || test == """")</code> statement, it always executes the else statement instead.</p><p>Any ideas?  Thanks folks.</p><pre><code>    @Override    protected Dialog onCreateDialog(int id) {        LayoutInflater factory = LayoutInflater.from(mContext);        final View textEntryView = factory.inflate(R.layout.file_save_dialog, null);        mEditText = (EditText) textEntryView.findViewById(R.id.file_name_edit);        final Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);         return new AlertDialog.Builder(mContext)            .setIcon(android.R.drawable.ic_menu_save)            .setTitle(R.string.file_name_title)            .setView(textEntryView)            .setPositiveButton(R.string.dialog_ok, new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int whichButton) {                    String test = mEditText.getText().toString();                    //This if never works...it always hits the else statement                    if (mEditText.getText() == null || test == """") {                        mEditText.startAnimation(shake);                    }                    else {                        finish();                    }                }            })            .setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int whichButton) {                    finish();                }            })            .create();    }</code></pre>","432209","","","","","2012-10-23 07:57:24","Can't check the value of an EditText in an AlertDialog.Builder","<java><android><edittext><alertdialog>","3","0","","",""
"4359696","1","4360264","","2010-12-05 16:08:03","1","2750","<p>I am trying to start a date picker from an alert dialog. but for some reason the showDialog(DATE_DIALOG_ID) doesn't open up at all. Could some please tell me what is wrong. </p><pre><code>final AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);        alt_bld.setIcon(R.drawable.icon);        alt_bld.setTitle(""Categories"");        alt_bld.setSingleChoiceItems(categoryType, -1, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int item) {                System.out.println(""Category selected= ""+categoryType[item]);                Toast.makeText(getApplicationContext(), ""Category selected= ""+categoryType[item], Toast.LENGTH_SHORT).show();                category=categoryType[item];                if(category.equalsIgnoreCase(""Time"")){                    showDialog(DATE_DIALOG_ID);                    System.out.println(""selected date here:""+selectedDate);                    Intent intent = new Intent(MainActivity.this, ListViewActivity.class);                    bundle.putString(""category"", category);                    bundle.putString(""attribute"", selectedDate);                    intent.putExtras(bundle);                    startActivity(intent);                }</code></pre><p>other datepicker related code</p><pre><code>static final int DATE_DIALOG_ID = 0;@Override    protected Dialog onCreateDialog(int id) {        switch (id) {        case DATE_DIALOG_ID:            return new DatePickerDialog(this,                        mDateSetListener,                        mYear, mMonth, mDay);        }        return null;    }       private DatePickerDialog.OnDateSetListener mDateSetListener =        new DatePickerDialog.OnDateSetListener() {        public void onDateSet(DatePicker view, int year,                              int monthOfYear, int dayOfMonth) {            mYear = year;            mMonth = monthOfYear;            mDay = dayOfMonth;            selectedDate = Integer.toString(mMonth)+""-""+Integer.toString(mDay)+""-""+Integer.toString(mYear);            System.out.println(""selected date is:""+selectedDate);        }    };public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.homescreen);        final Calendar cal = Calendar.getInstance();        mYear = cal.get(Calendar.YEAR);        mMonth = cal.get(Calendar.MONTH);        mDay = cal.get(Calendar.DAY_OF_MONTH);</code></pre>","377337","","","","","2010-12-05 17:56:14","android date picker from alert dialog","<android><datepicker><android-datepicker>","1","0","","",""
"4359699","1","","","2010-12-05 16:08:47","2","1495","<p>As far as OpenGL is concerned on android, it looks like the matrix operations like glTranslate, glScale and glRotate only take their parameters as discrete entries.  Is there 3d vector in android that takes care of the common arithmetic operations?  Is there a way to array of floats or some sort of vector object to these functions instead of having to write out the individually every time?</p>","122229","","44729","","2010-12-06 00:46:59","2010-12-06 00:46:59","Is there a 3d vector class for android?","<android><vector><opengl-es>","1","0","","",""
"4359720","1","4365306","","2010-12-05 16:12:28","1","6445","<p>I need to use some native c/c++ in my project, so I need to use the NDK. Is there an easy way to set it up in eclipse? </p><p>Thanks.</p>","171911","","","","","2012-05-07 13:56:50","How to use NDK in android project?","<c++><android><c><jni><android-ndk>","2","0","8","",""
"4359856","1","4359955","","2010-12-05 16:38:23","1","1677","<p>In my XML file I have:</p><pre><code>&lt;ListView  android:id=""android:id/list"" android:layout_height=""fill_parent""  android:layout_width=""fill_parent"" android:visibility=""visible""   android:scrollbarAlwaysDrawVerticalTrack=""true"" android:fadingEdge=""none""&gt;&lt;/ListView&gt;</code></pre><p>My Java code:</p><pre><code>public OnClickListener teamlisten = new OnClickListener() {     public void onClick(View v) {       // do something when the button is clicked     View list = (View)findViewById(R.id.myviewId);      list.setVisibility(View.INVISIBLE);     } };</code></pre><p>As you can see I'm trying to set my listview to invisible, the problem is I can't get it to appear in my R.java so I can't seem to make it invisible. I only want the listview to turn invisible when a button is pressed.</p><p>Any help on this one would be appreciated.</p>","531315","","366904","","2010-12-05 16:43:06","2010-12-05 16:55:09","How do I hide ListView on click?","<java><android><listview><hide>","1","0","","",""
"4359871","1","4416899","","2010-12-05 16:41:30","1","753","<p>I have an AlertDialog.Builder with an OK button, a Cancel button, and an EditText.  I want to prevent the user from hitting ""OK"" and dismissing the dialog until they actually type something in the EditText.</p><p>The dialog seems to automatically dismiss itself when either button is pressed.  Is there a way I can grey/disable the OK button until I meet a condition?</p><p>I'm thinking I will have to implement a custom dialog to accomplish this.  Anyone have any ideas?  Thanks!</p>","432209","","432209","","2010-12-05 16:50:32","2011-09-28 19:29:03","Prevent dismissing an AlertDialog.Builder until a condition is satisfied","<java><android><dialog><alertdialog>","3","0","1","",""
"4359901","1","4535669","","2010-12-05 16:46:57","0","365","<p>After I put my ExpandableListView component in a ViewFlipper element, I got this:</p><p><img src=""http://i.stack.imgur.com/qa3ro.png"" alt=""alt text""></p><p>My layout file is this:</p><pre><code>&lt;LinearLayout android:id=""@+id/LinearLayout01""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""&gt;&lt;LinearLayout android:id=""@+id/LinearLayout02""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;ViewFlipper android:id=""@+id/ViewFlipper01""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;!--adding views to ViewFlipper--&gt;        &lt;ExpandableListView android:id=""@+id/List01""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:text=""Flipper Content 0""&gt;&lt;/ExpandableListView&gt;        &lt;TextView android:id=""@+id/TextView01"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""Flipper Content 1""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/TextView02"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""Flipper Content 2""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/TextView03"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""Flipper Content 3""&gt;&lt;/TextView&gt;    &lt;/ViewFlipper&gt;&lt;/LinearLayout&gt;....&lt;/LinearLayout&gt;</code></pre><p>Does anybody have an idea why the item rows are just partially in orange?</p><p>Thanks!</p>","481828","","","","","2010-12-26 22:26:13","ExpandableListView in ViewFlipper display problem?","<android><expandablelistview><viewflipper>","1","0","","",""
"4360031","1","","","2010-12-05 17:09:17","1","419","<p>my app has a ListActivity to let the user choose a file from a list generated by listFiles().</p><pre><code> File f=null; File[] files = null; f= new File(BOOKPATH);    files = f.listFiles();    item = new ArrayList&lt;String&gt;();    for(int i=files.length-1; i &gt;= 0; i--){      File file = files[i];      item.add(file.getName());    }</code></pre><p>It works well, and when the user clicks on an entry, an activity is launched, then the user can edit the file.When the user quits the editing Activity, the edited content is saved in a new file with a new name, and the first selected file is deleted.</p><p>Then the same code to get the new list of files is called again, on the onResume() of the first Activity.</p><p>The code is well executed, but the function listFiles() return the ancient list, like if a buffer were not refreshed.</p><p>A strange thing is that the correct list of files is returned when I change orientation on the android device, and onResume() is called again.</p><p>I also tried to restart the activity by different ways to obtain the same behaviour, with no succes.</p><p>Thanks in advance for helping.</p>","531334","","","","","2012-01-26 15:56:02","Android listfiles not refreshed when files changes","<android><sd-card>","1","0","","",""
"4360074","1","4360217","","2010-12-05 17:17:33","2","4100","<p>I'm creating my first android app and I need to use a service. The UI will have a checkbox (CheckBoxPreference) that will be used to turn the service on/off and the service will only be accessed by my app (there's no need to share it).</p><p>So far the UI for this functionality is ready and I know how to respond to the event, what I dunno is how to create a service nor how to connect to it whatsoever.</p><p>The idea is that the service continues to listen for events and responding to them on the background and that the application is only to used to turn it on/off or to change some settings.</p><p>I've looked for tutorials on the web but I don't seem to get the process.</p>","304461","","304461","","2010-12-06 01:33:57","2012-10-14 10:53:04","Creating a Service in Android","<android><android-service>","1","0","1","",""
"4360100","1","","","2010-12-05 17:22:29","8","1270","<p>The application's default package is ""example.app"".</p><p>and the target activity's package is ""example.app.abc"".</p><p>Calling startActivity() for ""example.app.abc.TheActivity"" in java code just works, </p><p>but specifying it on preference.xml doesn't work:</p><pre><code>&lt;PreferenceScreen android:key=""key""    android:title=""@string/title""&gt;    &lt;intent android:action=""android.intent.action.MAIN""        android:targetPackage=""example.app.abc""        android:targetClass=""TheActivity""/&gt;&lt;/PreferenceScreen&gt;</code></pre><p>I tried android:targetClass=""example.app.abc.TheActivity"" but it doesn't work too.</p><p>Is it impossible to start an activity of non-default package, in preference?</p>","2556909","","","","","2014-01-20 11:18:51","ActivityNotFoundException when different package's targetClass in PreferenceScreen","<android><package><preference>","2","7","1","",""
"4360113","1","4360154","","2010-12-05 17:24:13","0","381","<p>Thanks to some help from a user here I was able to hide my ListView when a button is pressed. What I want to happen is once I've pressed the button and it's hidden my ListView then the button outside the ListView tags to replace the space where the listview was.</p><p>Code below: </p><pre><code>&lt;ListView android:id=""@android:id/list"" android:layout_height=""fill_parent""            android:layout_width=""fill_parent""             android:scrollbarAlwaysDrawVerticalTrack=""true"" android:fadingEdge=""none""&gt;    &lt;/ListView&gt;    &lt;Button android:text=""Arsenal"" android:id=""@+id/arsenal"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt; &lt;/Button&gt;</code></pre><p>Any help, once again is very much appreciated.</p>","531315","","244296","","2010-12-05 17:25:52","2010-12-05 17:33:31","Getting button appear after ListView has been set to invisible","<android><listview><button>","1","0","","",""
"4360146","1","","","2010-12-05 17:31:56","0","660","<p>Hey guys, Im nuew to anddroid but struggling with databases.</p><p>How would i retrieve data from my database and put it into a table or textview</p>","505655","","","","","2010-12-05 17:48:33","Display database data into a table layout or into textviews","<sql><android><database><textview>","2","2","","",""
"4360200","1","","","2010-12-05 17:41:46","1","132","<p>I am using eclipse and would like to launch a debug session for my android executable (apk) from the command line.</p><p>Said another way - instead of pushing the debug button in the eclipse interface, I'd like to startup the debug session via the command line.</p>","512759","","321731","","2014-03-04 19:35:17","2014-03-04 19:35:17","how do I initiate a debug session for android application from the command line?","<android><debugging><command-line>","1","1","1","",""
"4360211","1","4405980","","2010-12-05 17:43:41","5","3646","<p>I have a Android app that works with GPS module and a SQLite database. Everything sounds so nice in the beginning, but the horror comes when I need to work with Date() and timezones.</p><p><strong>A little background</strong></p><p>The GPS module has the possibility to get date from the satellite. This is a great thing and I need it in my application to assure valid data. The date returned from it is GMT time.This Date is inserted in a field in local database as StartTime. The StartTime is stored encrypted with AES. When I decrypt the StartTime, I need to convert it as a Date and keep the format as GMT.</p><p><strong>What I do</strong> Get the data from the GPS in LocationListener:</p><pre><code>gpsDate = new Date(location.getTime());</code></pre><p>by having new Date() by default the GPS date is converted in the current time zone of the Device. So instead of having a nice <strong>Sun Dec 05 14:00:00 GMT 2010</strong> time, I get <strong>Sun Dec 05 16:00:00 GMT+2 2010</strong>. Why does it do that ? I just wanted a new Date out of the getTime().</p><p>I insert the data in database:</p><pre><code>SimpleDateFormat outputFormat = new SimpleDateFormat(""yyyy-MM-dd HH:mm:ss"");outputFormat.setTimeZone(TimeZone.getTimeZone(""GMT"")); String date = outputFormat.format(gpsDate);</code></pre><p>I retrieve the Date when I need it:</p><pre><code>SimpleDateFormat outputFormat = new SimpleDateFormat(""yyyy-MM-dd HH:mm:ss"");outputFormat.setTimeZone(TimeZone.getTimeZone(""GMT""));String myStored = {decrypy from the database}Date myStartDate = outputFormat.parse(myStoredDate);</code></pre><p>myStored shows: <strong>2010-12-05 14:00</strong></p><p>myStartDate shows: <strong>Sun Dec 05 16:00:00 GMT+2 2010</strong></p><p>There is something I am missing in here. I need to be able to get the Date in GMT format, insert it, convert it, compare it, calculate differences. I need the Date in users Timezone only when I need to show it to him.</p><p>Please illuminate me.</p>","379865","","365188","","2012-07-20 07:08:19","2012-07-20 07:08:19","Android Date Timezones driving me nuts","<java><android><date><timezone>","1","3","2","",""
"4360236","1","5012953","","2010-12-05 17:49:12","3","5436","<p>I am trying to set smaller height of EditText but still have not managed it. Here is my source:</p><pre><code>&lt;EditText android:layout_width=""150dp"" android:layout_height=""20dp""      android:singleLine=""true"" android:textSize=""10dp"" /&gt;</code></pre><p>This code cuts out text and a white rectangular shape appears around EditText control. I have also tried maxHeight/minHeight properties, but did not worked either. If anybody have solved this issue, please help.</p><p>Or is this is the bug in the android? I can not even resize Spinner, same happens as with EditText.</p><p>Thanks</p><p>Irfan</p>","531346","","","","","2011-02-16 05:49:42","EditText Height Issue","<android><height><edittext><spinner>","1","1","2","",""
"4360487","1","","","2010-12-05 18:41:42","1","398","<p>In an android application I am trying to do a exponential modulus operation and want to calculate the time taken for that process. So i have created 2 timestamps,one just before the operation and the other just after the operation</p><pre><code>Calendar calendar0 = Calendar.getInstance();java.util.Date now0 = calendar0.getTime();java.sql.Timestamp currentTimestamp0 = new java.sql.Timestamp(now0.getTime());BigInteger en = big.modPow(e, n);Calendar calendar1 = Calendar.getInstance();java.util.Date now1 = calendar1.getTime();java.sql.Timestamp currentTimestamp1 = new java.sql.Timestamp(now1.getTime());</code></pre><p>The difference in time reported by these 2 timestamps is varying over a large range for the same inputs when i am running application multiple times. It gives time in range of [200ns-6ns]</p><p>Can someone point out the reason for such result/something that i am doing wrong?</p>","482419","","","","","2010-12-05 20:24:36","Big difference in timestamps when running same application multiple times on an emulator","<java><android><android-emulator>","4","1","","",""
"4360511","1","4362043","","2010-12-05 18:46:15","1","997","<p>I'm trying to add fog to my scene, but instead of the scene becoming more foggy further away from the camera, the fog seems to be entirely dependent on height. Below is a screenshot demonstrating the problem:</p><p><img src=""http://gyazo.com/ab60dfd1d85a3a5533153f09ef6a059e.png"" width=""350"" height=""200""></p><p>I initialize the fog using the following code:</p><pre><code>gl.glFogx( GL10.GL_FOG_MODE, GL10.GL_LINEAR );gl.glFogfv( GL10.GL_FOG_COLOR, new float[] { 1.0f, 1.0f, 1.0f, 1.0f }, 0 );gl.glFogf( GL10.GL_FOG_DENSITY, 0.35f );gl.glHint( GL10.GL_FOG_HINT, GL10.GL_DONT_CARE );gl.glFogf( GL10.GL_FOG_START, 10.0f );gl.glFogf( GL10.GL_FOG_END, 15.0f );gl.glEnable( GL10.GL_FOG );</code></pre><p>And this is how my projection is set up:</p><pre><code>gl.glMatrixMode( GL10.GL_PROJECTION );gl.glLoadIdentity();GLU.gluPerspective( gl, 90.0f, _w / _h, 0.1f, 15.0f );GLU.gluLookAt( gl, _player.position.x, _player.position.y, _player.position.z, centerX, centerY, centerZ, 0.0f, 0.0f, 1.0f );</code></pre><p>Any idea what's wrong?</p>","238180","","44729","","2010-12-06 00:46:38","2010-12-06 00:46:38","OpenGL fog is based on Z-axis instead of depth","<java><android><opengl-es>","2","5","","",""
"4360531","1","","","2010-12-05 18:51:58","2","257","<p>Is there any way to apply an XSL stylesheet to the layout XML files in res/layout/ at build time so the resource compiler sees only the transformed output instead of the actual files on the hard drive?</p><p>Why: layout_width and layout_height have no default, everything requires them, and manually specifying them for every. single. widget. is. slowly. driving. me. insane.</p><p>So... the idea I came up with was to use XSLT to automatically and transparently add layout_width and layout_height attributes having a value of ""wrap_content"" to any tag that lacks them at build time. I'd be happy, and ADT will never know the difference. :-)</p>","388603","","388603","","2010-12-05 18:59:42","2010-12-05 19:10:30","Apply XSL to layout XML at build time?","<android><android-widget><android-layout>","2","1","3","",""
"4360548","1","","","2010-12-05 18:57:34","1","1026","<p>I have a very basic question about Sensors:</p><p>Do magnetic sensors return readings w.r.t the phone's initial orientation or w.r.t the world coordinates? </p><p>What about accelerometers? Do they return values w.r.t their previous readings or is each value an independent acceleration relative to the world coordinate system?</p><p>I know that gyros return readings relative to the phone's initial orientation. So, how do I convert the yaw, pitch and roll readings from a gyro into the azimuth, pitch and roll readings from a magnetic sensor of a smartphone (I'm using HTC hero)</p><p>Thanks!</p>","526223","","","","","2012-06-03 11:57:55","Android Sensors","<android><sensor><wiimote>","2","5","1","",""
"4360612","1","","","2010-12-05 19:09:05","1","5390","<p>I created an Android App in Eclipse that I'd like to test on my Samsung Intercept phone.</p><p>I downloaded the Windows ADB USB driver from Google and added the following lines to the android_winusb.inf based on the values found in Device Manager for my Samsung Intercept phone (based on other posts in this forum):</p><pre><code>;SAMSUNG_Android  %SingleAdbInterface%        = USB_Install, USB\VID_04E8&amp;PID_681C  %CompositeAdbInterface%     = USB_Install, USB\VID_04E8&amp;PID_681C&amp;MI_01;</code></pre><p>(FYI the Device Manager Ids are:  </p><pre><code>USB\VID_04E8&amp;PID_681C&amp;REV_0224  USB\VID_04E8&amp;PID_681C)</code></pre><p>After putting the Samsung phone in USB Debug mode, the drivers installed 'fine'... I'm seeing a new entry (""Android ADB Interface"") in Device Manager under ""Android Phone"".</p><p>However, when I run <code>&lt;sdk&gt;/tools/adb devices</code>, the phone is not showing up as an available device (the list is empty).</p><p>I tried ending the adb process in Task Manager, but this was not successful.</p><p>Is there anything else that I'm missing?</p><p>I'm running Windows 7 64 bit, installed Eclipse and Android SDK in the program files X86 folder.</p>","531402","","496830","","2011-11-23 14:14:47","2012-06-26 16:34:53","USB device for Samsung Intercept not recognized from <sdk>/tools/adb devices","<android><usb><adb>","2","3","","",""
"4360625","1","4360649","","2010-12-05 19:11:21","1","1339","<p>I need to get a value from my cursor.  The value needs to be in this format:</p><pre><code>        List&lt;double[]&gt; values = new ArrayList&lt;double[]&gt;();</code></pre><p>The problem is when I do the "".add"" it errors wanting me to change it to ""length"".  I have to have it in the List for the app to work at all.  Here is my code, is there a way to do that?  What am I doing wrong? </p><pre><code>    cursor = managedQuery(Provider.CONTENT_URI,            proj,            null,            null,            null);            while (cursor.moveToNext()) {         double value;         column_value = cursor.getColumnIndex(CsvProvider.VALUE);        value = cursor.getDouble(column_value);        values.add(value); //this did not work        values.add(new double[] {value}); //this did work    } ;</code></pre><p>Thanks Mike!</p>","447560","","447560","","2010-12-05 22:50:31","2010-12-05 22:50:31","Android problem getting Arraylist<double[]> from cursor","<android><cursor><arraylist>","1","0","","",""
"4360752","1","4360803","","2010-12-05 19:41:08","0","197","<p>I am trying to create a layout that extends to the whole screen if there is space.</p><p>Actually, I want to display information next to its title.</p><p>I found something that works, but I feel it is more a hack than a real solution.</p><pre><code>&lt;TableLayout android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:id=""@+id/resort_infos""    android:stretchColumns=""0""&gt;    &lt;TableRow android:background=""#0b66ad"" android:padding=""3dip""&gt;        &lt;TextView android:id=""@+id/openSlopesKmTitle""            android:text=""@string/slopes_km"" android:textColor=""#EEE"" /&gt;        &lt;TextView android:id=""@+id/slopes"" android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:gravity=""right""            android:textColor=""#EEE"" android:paddingRight=""15dip"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>This allows me to extend the first column and let enough space for the second one. Is it the right way to do it?</p>","183665","","244296","","2010-12-06 23:48:52","2010-12-06 23:48:52","Is there an easy to use extensible layout?","<android><android-layout>","1","0","","",""
"4360868","1","4361094","","2010-12-05 20:05:21","18","15950","<p>I've done some research on building layouts that work for multiple screen sizes and I'm looking for some clarification.</p><p>Is it common practice to just make a separate layout file for each of the three screen sizes (small, medium, large) or can you accomplish this with an easier method?</p><p>I've been testing my projects on a large screen device, and even though I  use DIPs (density independent pixels) for padding, margins, etc, it still scrunches stuff up when I view it on smaller screens.  Should I be designing my projects for medium-sized screens and then just allow Android to scale it appropriately?</p><p>I'm not sure if this is a good question or not, but I am looking for what the common practice is for designing for multiple screen sizes.  What do you do?</p><p>Edit:  In addition to this, for example, let's say I have a button that is 40dip above the bottom of the screen, should I literally write 40dip, or should I be using some sort of pixel math like 40 * screenWidth / blahblah or something so that it scales depending on the screen size the user has?  I have limited experience with UIs...</p>","487840","","487840","","2010-12-05 20:10:52","2010-12-05 20:50:53","How do you make layouts for several Android screen sizes?","<android><layout><dip>","3","1","8","",""
"4360894","1","4361184","","2010-12-05 20:12:54","24","19634","<p>Currently I have Android SDK 2.1 (+ tools revision 4). I'd like to upgrade to Android SDK 2.2. When I try to do it I'm informed I need to upgrade Android SDK Tools to revision 7 first. So I agree, the process starts and then I get an error:</p><blockquote>  <p>-= warning! =- A folder failed to be renamed or moved. On Windows this  typically means that a program Is  using that Folder (for example Windows  Explorer or your anti-virus software.)  Please momentarily deactivate your  anti-virus software. Please also close  any running programs that may be  accessing the directory  'D:\Install\Programming\android-sdk-working-dir\android-sdk_r04-windows\android-sdk-windows\too!s'.  When ready, press YES to try again.</p>    <p>Downloading Android SDK Tools,  revision 7 Installing Android SDK  Tools, revision 7 </p>    <p>Failed to rename  directory  D:\Install\Programming\android-sdk-working-dir\android-sdk_r04-windows\android-sdk-windows\tools to  D:\Install\Programming\android-sdk-working-dir\android-sdk_r04-windows\android-sdk-windows\temp\ToolPackage.old01.</p></blockquote><p>I am aware of http/https and antivirus issues. So I disactivated my AV. I also closed any application that might hold a handle to the folder. Eclipse is also closed (I start the manager via command line). However I still get the same error.</p><p>Looks like the only app that can hold a handle to the folder is the manager itself, because its starting directory is the one the error complains about ('\tools').</p><p>I am on Win XP Pro + SP3. I run as admin.</p><p>Does anyone have an idea?</p>","247013","","247013","","2012-02-17 17:46:35","2013-11-10 16:05:14","Android: trouble updating to Android SDK Tools, revision 7","<android><sdk><windows-xp><upgrade>","19","0","10","",""
"4360963","1","4361426","","2010-12-05 20:27:48","0","182","<p>I was trying to style my list items in list view. I thought it would be great if I could create links like HTML links but instead of opening a browser it should open a new intent. I could not find any tutorial with my first search on google so dropping my question here. Please suggest me what to look for.</p><p>Regards,Lalith</p>","297119","","","","","2010-12-05 21:47:19","Creating a new activity after clicking a link in android?","<android><coding-style>","1","0","","",""
"4361005","1","4361329","","2010-12-05 20:35:56","2","699","<p>I write my own SyncAdapter based on example in SDK. It should add contacts from external source, and it works perfect in device emulator. But when I run it on HTC Desire after all I can't see my Account in Contacts->Display options</p><p>Also I tried google's example on Desire and couldn't see them in this list too. Does anyone know any solution?</p>","418891","","418891","","2010-12-05 21:16:00","2013-07-11 12:12:18","Account doesn't appear in contacts app settings on device from HTC","<android><contacts><htc>","2","0","3","",""
"4361016","1","4361252","","2010-12-05 20:37:43","2","707","<p>Is the Nexus One the only Android phone having 2 microphones?</p><p>I know that the 2nd microphone is intended for helping noise cancellation and I need this feature for my software development project.</p><p>I am wondering whether the Nexus One is the only such Android phone. That is, if I need to program for this feature, must I purchase a Nexus One only?</p>","418055","","418055","","2010-12-06 00:16:06","2010-12-06 00:46:22","2-Microphone Android Phones for ASR purposes?","<android><nexus-one><adp><noise-reduction>","1","1","1","2010-12-06 11:10:12",""
"4361023","1","4371643","","2010-12-05 20:40:15","5","5128","<p>I have particles that I want to be able to change the color of in code, so any color can be used.  So I have only one texture that basically has luminance.</p><p>I've been using <code>glColor4f(1f, 0f, 0f, 1f);</code> to apply the color.</p><p>Every blendfunc I've tried that has come close to working ends up like the last picture below. I still want to preserve luminance, like in the middle picture. (This is like the Overlay or Soft Light filters in Photoshop, if the color layer was on top of the texture layer.)</p><p>Any ideas for how to do this without programmable shaders?  Also, since these are particles, I don't want a black box behind it, I want it to add onto the scene.</p><p><img src=""http://i.stack.imgur.com/XIXk0.jpg"" alt=""alt text""></p>","506796","","","","","2011-03-20 18:24:45","OpenGL ES 1.1: How to change texture color without losing luminance?","<iphone><android><opengl-es>","2","1","9","",""
"4361272","1","4361331","","2010-12-05 21:21:13","1","1272","<p>I have a simple Activity that uses a <code>android:theme=""@android:style/Theme.Dialog""</code> in the manifest.</p><p>My activity consists of an EditText, 2 Buttons, and a TextView.  It is nothing more than a box for the user to enter in a name and press OK/Cancel.</p><p>I just want to focus the EditText and have the soft keyboard automatically show when the Activity is started.  I've read countless posts about this but I just can't seem to get it to work.  When the activity starts the blinking cursor appears in the EditText, but the keyboard won't show until I click inside it.</p><p>Here is my Activity:</p><pre><code>public class Finalize extends Activity {    private EditText mEditName;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.finalize_dialog);        mEditName = (EditText) findViewById(R.id.file_name_edit);        mEditName.setFocusable(true);        mEditName.requestFocus();        mEditName.setOnFocusChangeListener(new View.OnFocusChangeListener() {                       @Override            public void onFocusChange(View v, boolean hasFocus) {                getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);            }        });    }}</code></pre><p>I've also tried this in onCreate:</p><pre><code>    InputMethodManager mgr = (InputMethodManager) getSystemService(this.INPUT_METHOD_SERVICE);    mgr.showSoftInput(mEditName, 0);</code></pre><p>Edit:  My manifest for reference</p><pre><code>    &lt;activity class="".Finalize""        android:name="".Finalize""        android:label=""@string/file_name_title""        android:theme=""@android:style/Theme.Dialog""        android:screenOrientation=""portrait""                android:windowSoftInputMode=""stateAlwaysVisible""&gt;    &lt;/activity&gt;</code></pre>","432209","","432209","","2010-12-05 21:38:39","2013-07-18 10:20:41","Display soft keyboard automatically on a dialog activity","<java><android><keyboard><dialog><activity>","2","0","","",""
"4361309","1","4361499","","2010-12-05 21:27:02","7","5653","<p>i have bunch of buttons within linear layout. But there is spaces buttons. I set padding as 0 but there no change.There is someone who already had the same problem at <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg51104.html"">http://www.mail-archive.com/android-developers@googlegroups.com/msg51104.html</a> but no answer at there.Can you plese help me.</p>","455158","","","","","2010-12-05 22:22:34","Remove space between buttons","<java><android>","2","0","1","",""
"4361434","1","4362552","","2010-12-05 21:49:09","1","1677","<p>I am trying to have an application that runs as a service on android, other apps will be distributed that need to communicate with it.</p><p>It has been implemented as a Service and running client apps work fine when they are packaged within the same app.</p><p>However following <a href=""http://developer.android.com/guide/developing/tools/aidl.html"" rel=""nofollow"">http://developer.android.com/guide/developing/tools/aidl.html</a> I am having problems making this work for client applications, in particular the line</p><p>""In your implementation of ServiceConnection.onServiceConnected(), you will receive an IBinder instance (called service). Call YourInterfaceName.Stub.asInterface((IBinder)service) to cast the returned parameter to YourInterface type.""</p><p>Since the applications are distributed separately I dont have access to YourInterfaceName and copying it across to the client app definitely feels like ""the wrong way"" </p><p>If anyone could provide a pointer to documentation / a book / source code that would be very helpful, thanks</p><p>(and forgive the irony in my name, was a bit of an in joke)</p>","144799","","","","","2010-12-06 02:27:32","How to communicate between applications on android","<java><android><service><aidl>","3","0","","",""
"4361455","1","4361546","","2010-12-05 21:53:18","2","37","<p>I am starting an activity that is themed as Theme.Dialog. </p><p>I was wondering if it is possible to display the activity and still be able to click everything behind it. I know this is possible in android but i don't know how to do it.An example of that is the volume pop up that shows up when you try to increase or decrease the volume settings on android 2.0. If you try to click on it all clicks are registered on whatever activity is running behind it.</p><p>Any help will be greatly appreciated.</p>","513267","","","","","2010-12-05 22:12:07","Activity that does not obstruct clicks","<android>","1","0","","",""
"4361481","1","","","2010-12-05 21:57:57","1","10291","<p>hey guys i can currently fetch data from database into a table but im stuck with listview. my code is this to fetch all data:</p><pre><code>public ArrayList&lt;Object&gt; getRowAsArray(long rowID){    // create an array list to store data from the database row.    // I would recommend creating a JavaBean compliant object     // to store this data instead.  That way you can ensure    // data types are correct.    ArrayList&lt;Object&gt; rowArray = new ArrayList&lt;Object&gt;();    Cursor cursor;    try    {        // this is a database call that creates a ""cursor"" object.        // the cursor object store the information collected from the        // database and is used to iterate through the data.        cursor = db.query        (                TABLE_NAME,                new String[] { TABLE_ROW_ID, TABLE_ROW_ONE, TABLE_ROW_TWO, TABLE_ROW_THREE, TABLE_ROW_FOUR, TABLE_ROW_FIVE, TABLE_ROW_SIX, TABLE_ROW_SEVEN },                TABLE_ROW_ID + ""="" + rowID,                null, null, null, null, null        );        // move the pointer to position zero in the cursor.        cursor.moveToFirst();        // if there is data available after the cursor's pointer, add        // it to the ArrayList that will be returned by the method.        if (!cursor.isAfterLast())        {            do            {                rowArray.add(cursor.getLong(0));                rowArray.add(cursor.getString(1));                rowArray.add(cursor.getString(2));                rowArray.add(cursor.getString(3));                rowArray.add(cursor.getString(4));                rowArray.add(cursor.getString(5));                rowArray.add(cursor.getString(6));                rowArray.add(cursor.getString(7));            }            while (cursor.moveToNext());        }        // let java know that you are through with the cursor.        cursor.close();    }    catch (SQLException e)     {        Log.e(""DB ERROR"", e.toString());        e.printStackTrace();    }    // return the ArrayList containing the given row from the database.    return rowArray;}</code></pre><p>how would i populate this into a listview please. any help appreciated</p>","505655","","","","","2010-12-05 21:59:41","Populate listview from database","<android><database><listview><arraylist>","1","0","1","",""
"4361514","1","4361536","","2010-12-05 22:04:39","0","550","<p>Am learning android and have followed a tutorial to develop a tip calculator, it's been a really good tutorial, however have completed it and nothing's happening when I run it in the emulator suddenly, just get either a force close or a blank screen (it's fairly unpredictable).</p><p>The only clue I can get when I debug is the following message:[2010-12-05 22:02:01 - Tip Calculator] ActivityManager: Warning: Activity not started, its current task has been brought to the front</p><p>My code's below, any helpers or pointers on how I can start debugging/fixing this would be most appreciated!</p><pre><code>package com.tipcalc;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.os.Bundle;import android.view.KeyEvent;import android.view.View;import android.view.View.OnClickListener;import android.view.View.OnKeyListener;import android.widget.Button;import android.widget.EditText;import android.widget.RadioGroup;import android.widget.TextView;import android.widget.RadioGroup.OnCheckedChangeListener;public class tipCalc extends Activity {// Widgets in the Applicationprivate EditText txtAmount;private EditText txtPeople;private EditText txtTipOther;private RadioGroup rdoGroupTips;private Button btnCalculate;private Button btnReset;private TextView txtTipAmount;private TextView txtTotalToPay;private TextView txtTipPerPerson;// For the id of radio button selectedprivate int radioCheckedId = -1; /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // Access the various widgets by their id in R.java    txtAmount = (EditText) findViewById(R.id.txtAmount);    // On app load, the cursor should be in the amount field    txtAmount.requestFocus();    txtPeople = (EditText) findViewById(R.id.txtPeople);    txtTipOther = (EditText) findViewById(R.id.txtTipOther);    rdoGroupTips = (RadioGroup) findViewById(R.id.rdoGroupTips);    btnCalculate = (Button) findViewById(R.id.btnCalculate);    // On app load the calculate button is disabled    btnCalculate.setEnabled(false);   /*    * Attach an OnCheckedChangeListener to the radio    * Group to monitor the radio buttons selected by user    *     */    rdoGroupTips.setOnCheckedChangeListener(new OnCheckedChangeListener(){    @Override    public void onCheckedChanged(RadioGroup group, int checkedId){     // Enable/Disable Other Percentage tip field     if (checkedId == R.id.Radio15 || checkedId == R.id.Radio20){      txtTipOther.setEnabled(false);      // Also enable the calculate button if Total Amount and no of people fields      // have valid values.      btnCalculate.setEnabled(txtAmount.getText().length() &gt; 0             &amp;&amp; txtPeople.getText().length() &gt; 0            );     }     if (checkedId == R.id.RadioOther){      // enable the other % tip field      txtTipOther.setEnabled(true);      // set the focus to this field      txtTipOther.requestFocus();      /*       * Enable the calc button if total amount and no of people       * fields have valid values. Also ensure that the user has       * entered an Other Tip % Value before enabling the calc button       */      btnCalculate.setEnabled(        txtAmount.getText().length() &gt; 0       &amp;&amp; txtPeople.getText().length() &gt; 0       &amp;&amp; txtTipOther.getText().length() &gt; 0      );      // work out the % rate chosen by the user      radioCheckedId = checkedId;     }     }});/* * Create a KeyListener to the tip amount, no of people and other tip % fields *  */txtAmount.setOnKeyListener(mKeyListener);txtPeople.setOnKeyListener(mKeyListener);txtTipOther.setOnKeyListener(mKeyListener);// Attach listener to the Calc and Reset ButtonsbtnCalculate.setOnClickListener(mClickListener);btnReset.setOnClickListener(mClickListener);  }/**  OnKeyListener Special Routine*/private OnKeyListener mKeyListener = new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) {  switch (v.getId()) {  case R.id.txtAmount:  case R.id.txtPeople:   btnCalculate.setEnabled(txtAmount.getText().length() &gt; 0      &amp;&amp; txtPeople.getText().length() &gt; 0);   break;  case R.id.txtTipOther:   btnCalculate.setEnabled(txtAmount.getText().length() &gt; 0     &amp;&amp; txtPeople.getText().length() &gt; 0     &amp;&amp; txtTipOther.getText().length() &gt; 0);   break;  }  return false;   } }; // ClickListener for the calc and reset buttons private OnClickListener mClickListener = new OnClickListener(){  @Override  public void onClick(View v){   if(v.getId() == R.id.btnCalculate){    calculate();   } else {    reset();   }  } };  // Resets the results text views at the bottom of the screen as well as resets the text fields and radio buttons  private void reset() {  txtTipAmount.setText("""");  txtTotalToPay.setText("""");  txtTipPerPerson.setText("""");  txtAmount.setText("""");  txtPeople.setText("""");  txtTipOther.setText("""");  rdoGroupTips.clearCheck();  rdoGroupTips.check(R.id.Radio15);  // set focus on the first field  txtAmount.requestFocus(); }  // Calculate the tip as per data entered by the user  private void calculate() {  Double billAmount = Double.parseDouble(    txtAmount.getText().toString());  Double totalPeople = Double.parseDouble(    txtPeople.getText().toString());  Double percentage = null;  boolean isError = false;  if (billAmount &lt; 1.0) {   showErrorAlert(""Enter a vlaid Total Amount."",     txtAmount.getId());   isError = true;  }  if (totalPeople &lt; 1.0) {   showErrorAlert(""Enter a valid value for No. of people."",     txtPeople.getId());   isError = true;  }  // If user never changes radio, then verify 15% is correct  if (radioCheckedId == -1) {   radioCheckedId = rdoGroupTips.getCheckedRadioButtonId();  }  if (radioCheckedId == R.id.Radio15) {   percentage = 15.00;  } else if (radioCheckedId == R.id.Radio20) {   percentage = 20.00;  } else if (radioCheckedId == R.id.RadioOther) {   percentage = Double.parseDouble(    txtTipOther.getText().toString());   if (percentage &lt; 1.0) {    showErrorAlert(""Enter a valid Tip percentage"",      txtTipOther.getId());    isError = true;   }  }  // If all fields are valid, then calc the tips  if(!isError) {  Double tipAmount = ((billAmount * percentage) / 100);  Double totalToPay = billAmount + tipAmount;  Double perPersonPays = totalToPay / totalPeople;  txtTipAmount.setText(tipAmount.toString());  txtTotalToPay.setText(totalToPay.toString());  txtTipPerPerson.setText(perPersonPays.toString());  };}  // Show the alerts dialogs  //  @param errorMessage - String the Error message to show  //  @param fieldId - id of the field which caused the error   private void showErrorAlert(String errorMessage,    final int fieldId) {  new AlertDialog.Builder(this).setTitle(""Error"")  .setMessage(errorMessage).setNeutralButton(""Close"",    new DialogInterface.OnClickListener() {     @Override     public void onClick(DialogInterface dialog,       int which) {      findViewById(fieldId).requestFocus();     }  }).show(); }; }</code></pre>","528013","","","","","2010-12-06 05:04:39","How can I fix this android code bug that's hidden?","<android><debugging>","3","0","","",""
"4361520","1","4361939","","2010-12-05 22:06:14","0","595","<p>The Preference class allows for an Intent to be set, to have a preference activate another activity when clicked, but I'm unable to find a way to handle the result from an activity using this method. There's also the DialogPreference where I can provide a custom view, but I don't have direct access to the view I want to use, only an activity.</p><p>Digging a bit further, it looks like the RingtonePreference uses a few package internal methods on PreferenceManager to receive results from a started sub-activity, but as these are package internal I am unable to do the same.</p><p>Is there any other way of handling a custom preference with an activity that returns a result (where the result is to be saved as the value of the preference)?</p>","190480","","346112","","2010-12-05 22:11:27","2010-12-05 23:21:40","How do I create a custom preference that uses an existing activity that returns a result?","<java><android><activity><android-preferences>","1","0","","",""
"4361562","1","","","2010-12-05 22:15:02","1","782","<p>I'm parsing an OBJ-file in Android and my goal is to render &amp; display the object. Everything works fine (vertices, textures etc) except the correct color mapping.</p><p>OpenGL expects a colorbuffer with rgb-values (+alpha) per vertex into glColorPointer, but the MTL offers three different color-values per material (diffuse,specular,ambient).</p><p>Question: How do I compute the expected rgb value for my vertex from these three types of color (diffuse,specular,ambient)? Right now I'm passing the diffusecolor when populating the colorbuffer (this is just a kind of playing around, because of not knowing the solution), the outcome is following:</p><p><a href=""http://i56.tinypic.com/24oc6qe.png"" rel=""nofollow"">link text</a></p>","470517","","44729","","2010-12-06 00:45:02","2010-12-06 12:51:40","OpenGL & OBJ: How to fill glcolorpointer with colors from MTL","<android><opengl-es>","1","0","","",""
"4361586","1","","","2010-12-05 22:17:48","0","852","<p>Help!</p><p>I’m having problems with my Sudoku application. I plugged in all the code to have my application remember the current position. Now when I run the application and I try to either start a new game or continue my Sudoku application says:</p><p>Sorry the application Sudoku (process org.example.sudoku) has stopped unexpectedly. Please try again.</p><p>It hasn’t done this in the past yet and I’m confused on where to go from here. I took a look at the logcat but I’m not sure what I should look for and how to fix it. Here is the logcat below</p><pre><code>12-05 14:47:32.376: DEBUG/AndroidRuntime(289): &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;12-05 14:47:32.376: DEBUG/AndroidRuntime(289): CheckJNI is ON12-05 14:47:32.796: DEBUG/AndroidRuntime(289): —registering native functions --12-05 14:47:34.306: DEBUG/AndroidRuntime(289): Shutting down VM12-05 14:47:34.325: DEBUG/dalvikvm(289): Debugger has detached; object registry had 1 entries12-05 14:47:34.345: INFO/AndroidRuntime(289): NOTE: attach of thread ‘Binder Thread #3’ failed12-05 14:47:35.246: DEBUG/AndroidRuntime(297): &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;12-05 14:47:35.246: DEBUG/AndroidRuntime(297): CheckJNI is ON12-05 14:47:35.625: DEBUG/AndroidRuntime(297): —registering native functions --12-05 14:47:36.985: INFO/ActivityManager(60): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0×10000000 cmp=org.example.sudoku/.Sudoku }12-05 14:47:37.126: DEBUG/AndroidRuntime(297): Shutting down VM12-05 14:47:37.146: DEBUG/dalvikvm(297): Debugger has detached; object registry had 1 entries12-05 14:47:37.186: INFO/AndroidRuntime(297): NOTE: attach of thread ‘Binder Thread #3’ failed12-05 14:47:37.359: INFO/ActivityManager(60): Start proc org.example.sudoku for activity org.example.sudoku/.Sudoku: pid=304 uid=10037 gids={}12-05 14:47:39.327: INFO/ActivityManager(60): Displayed activity org.example.sudoku/.Sudoku: 2047 ms (total 333042 ms)12-05 14:47:44.516: DEBUG/dalvikvm(128): GC_EXPLICIT freed 205 objects / 9864 bytes in 134ms12-05 14:48:14.936: DEBUG/Sudoku(304): clicked on 012-05 14:48:14.957: INFO/ActivityManager(60): Starting activity: Intent { cmp=org.example.sudoku/.Game (has extras) }12-05 14:48:15.146: DEBUG/AndroidRuntime(304): Shutting down VM12-05 14:48:15.146: WARN/dalvikvm(304): threadid=1: thread exiting with uncaught exception (group=0×4001d800)12-05 14:48:15.295: ERROR/AndroidRuntime(304): FATAL EXCEPTION: main12-05 14:48:15.295: ERROR/AndroidRuntime(304): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.example.sudoku/org.example.sudoku.Game}: java.lang.NullPointerException12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread.access$2300(ActivityThread.java:125)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.os.Handler.dispatchMessage(Handler.java:99)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.os.Looper.loop(Looper.java:123)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread.main(ActivityThread.java:4627)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at java.lang.reflect.Method.invokeNative(Native Method)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at java.lang.reflect.Method.invoke(Method.java:521)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at dalvik.system.NativeStart.main(Native Method)12-05 14:48:15.295: ERROR/AndroidRuntime(304): Caused by: java.lang.NullPointerException12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.content.ContextWrapper.getPackageName(ContextWrapper.java:120)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.Activity.getLocalClassName(Activity.java:3478)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.Activity.getPreferences(Activity.java:3512)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at org.example.sudoku.Game.&lt;init&gt;(Game.java:104)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at java.lang.Class.newInstanceImpl(Native Method)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at java.lang.Class.newInstance(Class.java:1429)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)12-05 14:48:15.295: ERROR/AndroidRuntime(304): ... 11 more12-05 14:48:15.376: WARN/ActivityManager(60): Force finishing activity org.example.sudoku/.Game12-05 14:48:15.455: WARN/ActivityManager(60): Force finishing activity org.example.sudoku/.Sudoku12-05 14:48:15.927: WARN/ActivityManager(60): Activity pause timeout for HistoryRecord{44049308 org.example.sudoku/.Game}12-05 14:48:27.095: WARN/ActivityManager(60): Activity destroy timeout for HistoryRecord{43f562c0 org.example.sudoku/.Sudoku}12-05 14:48:27.202: WARN/ActivityManager(60): Activity destroy timeout for HistoryRecord{44049308 org.example.sudoku/.Game}12-05 14:49:20.407: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre><p>Any help would be greatly appreciated. Thank you</p><p>-James</p>","514189","","54200","","2010-12-05 23:19:50","2010-12-05 23:22:05","Sorry the application Sudoku has stopped unexpectly. Please try again","<android>","2","0","","",""
"4361601","1","4361637","","2010-12-05 22:19:39","2","9395","<p>I'm using this code to post a request to a http server:</p><pre><code>HttpClient client = new DefaultHttpClient();HttpPost post = new HttpPost( ""http://192.168.0.1/test.php"" );HttpResponse response = null;try {    List&lt; NameValuePair &gt; nameValuePairs = new ArrayList&lt; NameValuePair &gt;( 1 );    nameValuePairs.add( new BasicNameValuePair( ""num"", ""2"" ) );    post.setEntity( new UrlEncodedFormEntity( nameValuePairs ) );    response = client.execute( post );}catch( ClientProtocolException e ) {    ...}catch( IOException e ) {    ...}</code></pre><p>The response is nothing more than a simple <code>String</code>.  How can I read this response as a <code>String</code>?  It doesn't seem like HttpResponse have a method for doing this directly.</p>","324943","","2302854","","2013-08-14 13:53:42","2013-08-14 13:53:42","Reading HttpPost response","<java><android><http>","2","0","1","",""
"4361604","1","6661762","","2010-12-05 22:20:18","14","22089","<p>I'm having an issue with the Droid X phones where users say that the font color turns out to be white in the spinner, making it invisible unless the users highlight the items.  No other phones seem to have this problem.  I was going to try to force the font to be black to see if that helps.  How can I do that?  </p><p>Here's how I'm currently populating the spinner.  It seems like the <code>simple_spinner_item</code> is broken on Droid X's.</p><pre><code>String spin_arry[] = new String[str_vec.size()];str_vec.copyInto(spin_arry);ArrayAdapter adapter =    new ArrayAdapter(this,android.R.layout.simple_spinner_item, spin_arry);</code></pre>","48784","","418183","","2011-06-27 19:44:45","2013-09-01 11:33:46","How to change the Spinner font color?","<android><spinner>","6","0","8","",""
"4361628","1","4362276","","2010-12-05 22:23:54","1","549","<p>This question is relevant for both Android and iOS developers:</p><p>Is it possible to play two sounds (files/streams) simultaneously in an application, where one of those is played through the speakers of the phone, whilst the other is streamed via Bluetooth to an external headset (or other bluetooth capable device)? </p>","531527","","209867","","2012-12-29 21:04:21","2012-12-29 21:04:21","Playing two sounds simultaneously, one of these sent over Bluetooth - iOS and Android","<iphone><android><streaming><audio><bluetooth>","2","0","1","",""
"4361665","1","","","2010-12-05 22:27:56","1","922","<p>I've made an Android home screen widget which displays some text and has 2 click listeners which I have working under normal operation, no problems. That is until HTC sense/launcher decides to reload, which it does most days. After the reload one of the click listeners stops working and can cause the widget to Force Close.</p><p>onClickListener 1 = starts an activity and passes it some text strings</p><p>onClickListener 2 = Triggers FORCE_WIDGET_UPDATE</p><p>After a launcher reload, the activity still trigures fine, but the widget update fails.</p><p>Here is the essence of the update code.</p><pre><code>public static String updateString = ""org.software.appname.FORCE_WIDGET_UPDATE"";public void onReceive(Context ctx, Intent intent){        showIntent=intent.getAction();        Log.d(TAG, showIntent);        if (updateString.equals(intent.getAction())){            Log.d(TAG, ""onReceive, Force"");        AppName.updateViews = new RemoteViews( ctx.getPackageName(),R.layout.main );            &lt;Code to update text, update widget view and load new intents&gt;        ComponentName me = new ComponentName( ctx, AppName.class );            AppWidgetManager.getInstance( ctx ).updateAppWidget( me, updateViews );        } else super.onReceive(ctx, intent);</code></pre><p>I've tried moving the onRecieve call to the super class inside the if statement, but this causes the app to force close as soon you the widget is dropped onto the home screen.</p><p>I don't see anything in logcat when clicking the button, when I normally would, sometimes it force closes sometimes it doesn't. I can re-create the problem in the desktop simulator by force closing the stock launcher in application setting.</p><p>Thanks in advance for your help! :-)</p><p>Edit:I've tried changing things around by passing appWidgetIds[] in the intent and then triggering the onUpdate within onReceive, but this doesn't seem to do anything. I get the message in logcat to say it's registering the click, but it doens't seem to be triggering onUpdate.</p><pre><code>public void onReceive(Context ctx, Intent intent){        AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(ctx);        int[] appWidgetIds = intent.getIntArrayExtra(""appWidgetIds"");        onUpdate(ctx, appWidgetManager, appWidgetIds);        Log.d(TAG, ""onReceive log"");}</code></pre>","531508","","531508","","2010-12-06 22:08:51","2010-12-06 22:08:51","Android - widget breaks after launcher reload/crash","<android><android-widget><android-intent>","0","3","","",""
"4361726","1","4375694","","2010-12-05 22:41:02","0","477","<p>I'd like to display a custom Dialog and then display some results for the user - that's not a problem. But I'd also like to draw a visual representation of the data over the text.</p><pre><code>    Dialog dialog = new Dialog(this);    dialog.setContentView(R.layout.progress_overview);    dialog.setTitle(getString(R.string.progress_overview));    TextView text = (TextView) dialog.findViewById(R.id.text);    text.setText(""results..."");</code></pre><p>progress_overview.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/layout_root""          android:orientation=""vertical""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:padding=""10dp""          &gt;&lt;com.name1.name2.ProgressDrawableView android:id=""@+id/progress_image""           android:layout_width=""fill_parent""           android:layout_height=""fill_parent""           android:layout_margin=""10dp""           /&gt;&lt;TextView android:id=""@+id/text""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:textColor=""#FFF""          /&gt;&lt;/LinearLayout&gt;</code></pre><p>The problem is, if I do it like this, I am unable to access the methods of my ProgressDrawableView View that is displayed (using findViewById returns null pointer).</p><p>Could you please suggest a solution or a different way if my approach is all wrong, please? (I'm new to android dev) Thanks</p>","523100","","","","","2010-12-07 10:35:05","Drawing in Dialog","<android><dialog>","1","2","","",""
"4361737","1","4361947","","2010-12-05 22:42:55","0","597","<p>Hello I am trying to start the android browser from a service using this code: </p><pre><code>protected void showBrowser(){    String url = ""http://www.google.com"";    Intent i = new Intent(Intent.ACTION_VIEW);    i.setData(Uri.parse(url));    this.startActivity(i);}</code></pre><p>but this doesn't seem to work! the browser is never started and using log the execution stops when the startActivity is called.</p>","234898","","759866","","2014-02-07 18:47:07","2014-02-07 18:47:07","cant start browser from service in android","<android>","2","0","1","",""
"4361760","1","","","2010-12-05 22:48:00","3","2306","<p>I am trying to capture Signal Strength and Ec/Io from my Android app on a phone that's on at&amp;t network. When a phone is being served on WCDMA / HSDPA network, the pertinent RF measurements are RSCP and Ec/Io. How do I obtain the current RSCP and Ec/Io? The GSM Signal Strength and GSM Bit Error Rate are not applicable when the phone is camping on 3G (UMTS/HSDPA/HSPA/HSUPA) network.</p><p>Thanks.Dillon</p>","531542","","","","","2012-10-29 04:04:54","Getting Signal Strength RSCP and Ec/Io from a phone served by a HSPA network","<android><signals><gsm><signal-strength>","1","0","0","",""
"4361848","1","","","2010-12-05 23:02:56","3","670","<p>I have an ImageView that initially has a Bitmap Image:</p><pre><code>    &lt;ImageView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt; </code></pre><p>By default that imageview scales the bitmap to fill the width that is what I want.</p><p>But the problem is that when I change the source of the ImageView to an AnimationDrawable, that is build by several images of the same size of the original, then animation isn't scaled at all and returns to the original.</p><p>How can I do that scale the animation drawable in the same way that is scaled the bitmap?</p>","269454","","","","","2012-04-14 19:22:31","Android AnimationDrawable scaling","<android>","1","0","","",""
"4361942","1","4362507","","2010-12-05 23:21:54","10","2284","<p>This cannot be impossible: We have four developers on an android app that uses the google maps api. We have generated a maps key that works for the one who generated it. All the others, however, see a tiled MapView without the actual map. Since my debug.keystore was used to generate, I was suspecting that the others need the same keystore. So I moved it into the repository so that everyone has a copy of it now. Then, everyone pointed eclipse towards that keystore using the custom keystore setting in Android->Build. This still does not work. What do we have to do? Surely we don't have to each use our own key and keep replacing it after every pull?</p><p>This site (and the web in general) contains tons of information on Google Maps API keys, but none answered my question unfortunately.</p>","312098","","881229","","2013-12-30 07:34:15","2013-12-30 07:34:15","One Google Maps Key for multiple developers (Android)? Eclipse custom keystore?","<android><google-maps><api-key>","2","3","3","",""
"4361967","1","4362448","","2010-12-05 23:27:10","3","164","<p>For those who write applications for mobile phones, what kind of <strong>bugs/problems have you fixed</strong> in order to improve energy efficiency, and how much the fix improves?</p><p>A follow-up question: is energy efficiency considered as important as features and avoiding functionality bugs when you write mobile apps?</p>","313294","","313294","","2010-12-06 03:29:49","2010-12-06 03:29:49","What kind of bugs have you fixed due to energy inefficiency issues when you develop mobile apps","<iphone><android><mobile><energy><energysmart>","5","0","1","",""
"4361990","1","","","2010-12-05 23:31:54","1","2158","<p>I have two classes and I want to be able to add button to be able to change stroke color, stroke width, background color and etc...  I have the buttons and the layout designed in my main.xml but I just can't figure out how to make them function...</p><p>---Draw---class----import android.app.Activity;import android.os.Bundle;import android.view.Window;import android.view.WindowManager;</p><p>public class Draw extends Activity {    DrawView drawView;</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Set full screen view    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,     WindowManager.LayoutParams.FLAG_FULLSCREEN);    requestWindowFeature(Window.FEATURE_NO_TITLE);    drawView = new DrawView(this);    setContentView(drawView);    drawView.requestFocus();}</code></pre><p>}</p><p>---DrawView---class---import java.util.ArrayList;import java.util.List;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;</p><p>public class DrawView extends View implements OnTouchListener {</p><pre><code>List&lt;Point&gt; points = new ArrayList&lt;Point&gt;();Paint paint = new Paint();public DrawView(Context context) {    super(context);    setFocusable(true);    setFocusableInTouchMode(true);    setBackgroundColor (Color.WHITE);    this.setOnTouchListener(this);    paint.setColor(Color.BLACK);    paint.setAntiAlias(true);}@Overridepublic void onDraw(Canvas canvas) {    for (Point point : points) {        canvas.drawCircle(point.x, point.y, 5, paint);    }}public boolean onTouch(View view, MotionEvent event) {    Point point = new Point();    point.x = event.getX();    point.y = event.getY();    points.add(point);    invalidate();    return true;}</code></pre><p>}</p><p>class Point {    float x, y;</p><pre><code>@Overridepublic String toString() {    return x + "", "" + y;}</code></pre><p>}</p>","531572","","","","","2011-02-26 13:31:17","Add buttons in canvas in DrawView class with Android","<android>","0","1","","",""
"4362011","1","","","2010-12-05 23:36:37","0","1663","<p>I'm using ViewAnimator to switch between views...</p><p>my layout file is like this:</p><pre><code>        &lt;ViewAnimator android:id=""@+id/ViewFlipper01""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;!--adding views to ViewFlipper--&gt;        &lt;ExpandableListView android:id=""@+id/List01""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""            android:text=""Flipper Content 0""&gt;&lt;/ExpandableListView&gt;        &lt;ExpandableListView android:id=""@+id/List02""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""            android:text=""Flipper Content 0""&gt;&lt;/ExpandableListView&gt;        &lt;TextView android:id=""@+id/TextView02"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""Flipper Content 2""&gt;        &lt;/TextView&gt;    &lt;/ViewAnimator&gt;</code></pre><p>When I click on some of the children from the first expandable list I want to go directly to the third child. </p><pre><code>    @Overridepublic boolean onChildClick(ExpandableListView parent, View v,        int groupPosition, int childPosition, long id) {    viewAnimator.setDisplayedChild(2);    viewAnimator.showNext();    return true;}</code></pre><p>Nothing happens when I click...</p><p>If I use only  <code>viewAnimator.showNext();</code> I get to the second element...</p><p>I cannot find out why it is not working for me.</p><p>Can someone give me a clue?</p><p>Thanks!</p>","481828","","","","","2011-05-23 21:36:44","ViewAnimator setting next view problem?","<android><view>","1","0","0","",""
"4362213","1","","","2010-12-06 00:23:44","1","1140","<p>I have a fairly simple question which somehow I can't figure out. I'm using a FrameLayout with an own view (onDrawn is overriden) and another transparent view which extends LinearLayout. I want to add scrolling for the transparent view, but if I use ScrollView in the XML a Classcast exception is thrown.</p><p>My alternative was to implement scrolling on my own (e.g. with scrollTo in LinearLayout, where I can't find any example using that method), but the OnGestureListener doesn't trigger onScroll, while onShowPress and onLongPress are triggered. I then tried to use onTouchEvent in the LinearLayout, but it only recognises ACTION_DOWN, not ACTION_MOVE. In my own view all that works perfectly.</p><p>Here the XML:</p><pre><code>&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""         android:id=""@+id/home_container""           android:layout_width=""fill_parent""         android:layout_height=""fill_parent""&gt;&lt;com.unimelb.pt2.ui.WaterfallView        android:id=""@+id/waterfall_view""         android:layout_width=""fill_parent""        android:layout_height=""fill_parent""         android:apiKey=""0DUEIIn35xtmfWC2DXprK5kqNF-aEaNgRJ4ONxw""/&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:gravity=""bottom""                android:paddingLeft=""0px""                android:paddingTop=""0px""                android:paddingRight=""0px""&gt;    &lt;com.unimelb.pt2.ui.TransparentPanel            android:id=""@+id/workbench""             android:layout_width=""fill_parent""            android:layout_height=""10px""            android:paddingTop=""0px""            android:paddingLeft=""0px""            android:paddingBottom=""0px""            android:paddingRight=""0px""&gt;    &lt;/com.unimelb.pt2.ui.TransparentPanel&gt;&lt;/LinearLayout&gt;&lt;LinearLayout   xmlns:android=""http://schemas.android.com/apk/res/android""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:orientation=""horizontal""                android:gravity=""right""                android:paddingLeft=""0px""                android:paddingTop=""0px""                android:paddingRight=""0px""&gt;    &lt;com.unimelb.pt2.ui.TransparentPanel                android:id=""@+id/tagarea""                 android:layout_width=""50px""                android:layout_height=""fill_parent""                android:paddingTop=""0px""                android:paddingLeft=""0px""                android:paddingBottom=""0px""                android:paddingRight=""0px""&gt;    &lt;/com.unimelb.pt2.ui.TransparentPanel&gt;  &lt;/LinearLayout&gt;&lt;/FrameLayout&gt;</code></pre><p>Here the basic construct of the WaterfallView:</p><pre><code>public class WaterfallView extends View {private GestureDetector gestureScanner;private Vector&lt;PictureEntry&gt; allPictures = new Vector&lt;PictureEntry&gt;();        public WaterfallView(Context context) {    super(context);    this.initialize(context);}public void initialize(Context context) {    this.setFocusable(true);    this.setClickable(true);    this.context = context;    allPictures.add(new PictureEntry(context, R.drawable.sample_0));    allPictures.add(new PictureEntry(context, R.drawable.sample_1));    allPictures.add(new PictureEntry(context, R.drawable.sample_2));    allPictures.add(new PictureEntry(context, R.drawable.sample_3));    allPictures.add(new PictureEntry(context, R.drawable.sample_4));    allPictures.add(new PictureEntry(context, R.drawable.sample_5));    allPictures.add(new PictureEntry(context, R.drawable.sample_6));    allPictures.add(new PictureEntry(context, R.drawable.sample_7));}public void setGestureDetector(GlassPane gp) {    gestureScanner = new GestureDetector(context, gp);}@Overrideprotected void onDraw(Canvas canvas) {    Iterator&lt;PictureEntry&gt; iter = allPictures.iterator();    int i = 0;    while (iter.hasNext()) {        PictureEntry pic = iter.next();        pic.draw(canvas)    }    invalidate();}@Overridepublic boolean onTouchEvent(MotionEvent event) {    if (gestureScanner.onTouchEvent(event)) {        return Prototype.glass.pictureTouch(event);    } else return false;}}</code></pre><p>Here the basic construct of the GlassPane:</p><pre><code>public class GlassPane implements OnGestureListener {public GlassPane(WaterfallView waterfall) {    super();    waterfall.setGestureDetector(this);}public boolean pictureTouch(MotionEvent event) {    // Handles drag and drop and zoom pinch}public boolean onDown(MotionEvent e)    {    Log.i(""Test"", ""DOWN"");    return false;}public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,        float velocityY)    {    Log.i(""Test"", ""FLING"");    return false;}@Overridepublic void onLongPress(MotionEvent e)  {    Log.i(""Test"", ""LONG PRESS"");}@Overridepublic boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,        float distanceY)    {    Log.i(""Test"", ""SCROLL"");    return true;}@Overridepublic void onShowPress(MotionEvent e) {    Log.i(""Test"", ""SHOW PRESS"");}}</code></pre><p>And here the construct of the TransparentPanel:</p><pre><code>public class TransparentPanel extends LinearLayout {private Paint innerPaint, borderPaint;private int width, height, scrollOffset;private Context mContext;public TransparentPanel(Context context, AttributeSet attrs) {    super(context, attrs);    mContext = context;    init();}public TransparentPanel(Context context) {    super(context);    init();}private void init() {    innerPaint = new Paint();    innerPaint.setARGB(225, 75, 75, 75); // gray    innerPaint.setAntiAlias(true);}public void setDimension(int w, int h) {    width = w; height = h;    this.setLayoutParams(new LayoutParams(width, height));    this.invalidate();}@Overrideprotected void dispatchDraw(Canvas canvas) {    RectF drawRect = new RectF();    drawRect.set(0, 0, width, height);    canvas.drawRect(drawRect, innerPaint);    super.dispatchDraw(canvas);}private void measure() {    if(this.getOrientation()==LinearLayout.VERTICAL) {        int h = 0;        for(int i=0; i&lt;this.getChildCount(); i++) {            View v = this.getChildAt(i);            h += v.getMeasuredHeight();        }        height = (h &lt; height) ? height : h;        Log.d(Prototype.TAG, ""mW:""+width+"", mH:""+height);    }    this.setMeasuredDimension(width, height); }}</code></pre>","531605","","161161","","2010-12-06 01:10:59","2010-12-11 13:13:53","Problems with Scrolling in LinearLayout","<android><scrollview><gestures>","1","0","1","",""
"4362367","1","4362401","","2010-12-06 01:01:35","3","254","<p>I am struggling to figure out how to handle a situation in Android where code continues to execute when I really don't want it to. In the onCreate() of an activity I have some stuff that I need to do in order and I can't have the code continue to execute until certain things happen first. I understand that this is how Android and Java behave and I am struggling to figure out another way to accomplish what I need. </p><p>ShowEula is a class that I created to show a simple dialog with my EULA. I really need to wait until the user agrees or disagrees with the EULA before calling DBGetOnlineVersionNumber(). Maybe I'm just not going this the correct way. Anyway here's a snippet of my code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);            setContentView(R.layout.main);    String version;    ShowEula();         version = DBGetOnlineVersionNumber();    ....</code></pre>","485438","","","","","2011-08-10 05:03:10","I need help with Android and Java","<java><android>","4","0","","",""
"4362384","1","4362537","","2010-12-06 01:06:30","5","3376","<p>I was wondering if it was possible to make GameKit broadcast data so that an Android device can get the information. I plan on sending XML data, (a Plist, nothing complex) if this is possible. I don't need any confirmation on the iOS device, I just want to send the information.</p><p>In theory, Android should be able to receive the raw encoded bytes (or bits) and then the decoding them on Android, becomes my problem, but I can't imaging GameKit broadcasting information until it has a ""peer"" to send to. </p><p>Is it possible to send information from an iOS device to an Android device through bluetooth?</p>","224988","","224988","","2010-12-06 15:29:51","2012-10-10 20:26:15","Is it possible to send Bluetooth data to Android from iOS?","<iphone><android><bluetooth><gamekit>","2","1","3","",""
"4362561","1","4412728","","2010-12-06 01:51:20","0","2051","<p>I'm writing an Android application that is connecting to a website and retrieving search results in the form of JSON. This function is happening in an AsyncTask, which is set up as a separate stream from the UI. I need to handle the case where the connection is interrupted/non-existent/too latent. I need to handle this case in order to display an AlertDialog to the user letting them know the connection is bad. I've seen posts suggest setting a timeout parameter for URLConnection, but I'm not using URLConnection right now. </p><p>Right now, The function performs flawlessly when I have a data connection, but not so when there is no connection. When I run the emulator and disable my PC's internet connection, running the function brings up a ""Force Close"" message and produces an UnknownHostException. I'm catching this exception, but my application still crashes.</p><p>I also need to handle a case where no thumbnail can be found, which produces a FileNotFoundException. </p><p>Please advise me on what I should do. Thanks.</p><pre><code>@Overrideprotected HashMap&lt;String, String&gt; doInBackground(Object... params) {    InputStream imageInput = null;    FileOutputStream imageOutput = null;    try {           URL url = new URL(""http://www.samplewebsite.com/"" + mProductID);        BufferedReader reader =                 new BufferedReader(new InputStreamReader(url.openStream()));        String jsonOutput = """";        String temp = """";        while ((temp = reader.readLine()) != null) {            jsonOutput += temp;        }        JSONObject json = new JSONObject(jsonOutput);        // ... Do some JSON parsing and save values to HashMap        String filename = mProductID + ""-thumbnail.jpg"";        URL thumbnailURL = new URL(""http://www.samplewebsite.com/img/"" + mProductID + "".jpg"");        imageInput = thumbnailURL.openConnection().getInputStream();        imageOutput = mContext.openFileOutput(outputName, Context.MODE_PRIVATE);        int read;        byte[] data = new byte[1024];        while ((read = imageInput.read(data)) != -1) {            imageOutput.write(data, 0, read);        }        reader.close();    } catch (MalformedURLException e) {        e.printStackTrace();    } catch (FileNotFoundException e) {        e.printStackTrace();    } catch (UnknownHostException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    } catch (JSONException e) {        e.printStackTrace();    }    finally {        try {            imageOutput.close();            imageInput.close();        } catch (IOException e) {            e.printStackTrace();        }    }return mProductInfoHashMap;}</code></pre>","453354","","453354","","2010-12-08 02:52:10","2010-12-10 19:52:16","Why is catching UnknownHostException when using BufferedReader to open URL stream crashing my app?","<java><android><exception-handling><try-catch><bufferedreader>","1","1","","",""
"4362615","1","","","2010-12-06 02:10:28","1","2514","<p>Im trying to save a highscore, in my game. My class extends SurfaceView and implements SurfaceHolder.Callback. So the scoring system works perfect but I really want to make a highscore system (you know first see if score is your highest, if it is set it as highscore). </p>","531655","","","","","2010-12-06 02:58:03","How to save a score/highscore (int) in a surfaceview class?","<android><save><int><surfaceview>","1","0","0","",""
"4362675","1","4362810","","2010-12-06 02:26:28","1","441","<p>Problem: I have multitouch unintentionally generating a single strokegesture.</p><p>I'm using a GestureOverlayView over the entire screen and not attempting to use multitouch at all. I'm using <code>android:gestureStrokeType=""single""</code>. One of my gestures is a horizontal left to right, like a swipe. It works just fine. The problem is that if I touch and hold the left side of my screen, then at the same time touch the right side and hold, then let go of theleft, then let go of the right, my <code>OnGesturePerformedListener</code> gets called and it indicates that the horizontal gesture has occurred. Could this be related to some of the multitouch problems on the Nexus One? Is there any way for me to detect this as a bogus gesture?</p><p>I'm seeing this problem on my Nexus One (2.2.1) but my code has to remain 1.6 compatible for now.</p>","250124","","995926","","2012-05-22 08:04:14","2012-05-22 08:04:14","Issue with GestureOverlayView/Multitouch on Nexus One","<android><multi-touch><gestures><android-2.2-froyo><nexus-one>","1","0","1","",""
"4362698","1","","","2010-12-06 02:32:37","2","1692","<p>I have the following 2 lines of code:</p><pre><code>myButton.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);myButton.playSoundEffect(SoundEffectConstants.CLICK);</code></pre><p>When I press the button, haptic feedback works fine but no audio isheard.</p><p>Anybody had this problem when they started with Android?</p>","531663","","1815485","","2013-03-15 00:45:38","2013-09-14 20:08:27","Can't play sound on button click using playSoundEffect(SoundEffectConstants.CLICK)","<android>","2","0","1","",""
"4362729","1","","","2010-12-06 02:39:52","1","1021","<p>I use AsyncTask to download a file from the Internet, but when I call cancel to cancel the AsyncTask, the thread does not stop downloading. And when I do a test, I find when finishing the Activity, Android will not stop the thread in the Activity. So how can I stop downloading the file? Thanks!</p>","445611","","321697","","2010-12-06 03:17:50","2010-12-06 03:17:50","Using AsyncTask to download, how to cancel","<android><multithreading>","0","6","","",""
"4362760","1","4362842","","2010-12-06 02:46:53","0","3778","<p>I'm writing an application that uses Intent(MediaStore.ACTION_IMAGE_CAPTURE) to capture and image. On the process of capturing the image, I noted the output of the image's URI. Right after finishing the camera activity, I wish to display the image using this specific URI.</p><p>The method I used to capture images is:</p><pre><code>    private void saveFullImage() {  Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  File file = new File(Environment.getExternalStorageDirectory(),                        ""test.jpg"");  outputFileUri = Uri.fromFile(file);   intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);  startActivityForResult(intent, TAKE_PICTURE);}</code></pre><p>Which is a method taken from Reto Meier's book Professional  Android 2  Application Development.</p><p>The method works fine, and I assume that the URI of the picture I just took is stored in the outputFileUri variable. Then at this point of the code is where I want to display the picture:</p><pre><code>    @Overrideprotected void onActivityResult(int requestCode,                                 int resultCode, Intent data) {  if (requestCode == TAKE_PICTURE) {      //I want to display the picture I just took here      //using the URI  }}</code></pre><p>I'm not sure how to do it.</p><p>I tried creating a new layout object and a new ImageView object using the method setImageURI(outputFileUri). My main layout (xml) did not have a ImageView object. But even when I set the contentView to the new layout with the ImageView attached to it, it doesn't display anything. I tried creating a Bitmap object from the URI and set it to the ImageView, but I get an unexpected error and forced exit.</p><p>I have seen examples from here <a href=""http://stackoverflow.com/questions/2227209/how-to-get-the-images-from-device-in-android-java-application/2229154#2229154"">here</a> which creates a Bitmap from URI, but it's not displaying it?</p><p>My question is just how to display an image in the middle of a running activity? Do I need to get the File Path (like <a href=""http://stackoverflow.com/questions/3401579/android-get-filename-and-path-from-uri-from-mediastore"">this</a>) in order to display it? If I make a Bitmap out of the URI, how do I display the Bitmap?</p><p>I'm just probably missing something simple...so any help would be a greatly appreciated!</p><p>Also additional question for thought: If I were to take multiple pictures, would you recommend me to use the SimpleCursorAdapter instead?</p><p>Thanks!</p>","528896","","","","","2011-01-17 20:49:21","Displaying an Image in an activity using URI","<java><android>","3","0","1","",""
"4362816","1","","","2010-12-06 03:01:35","1","424","<p>I have a custom control in android that has a text view, some images, etc.</p><p>i want to make the entire control clickable.</p><p>i declared the layout with:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:clickable=""true"" android:layout_width=""fill_parent"" android:layout_height=""50px"" android:layout_gravity=""center_vertical""&gt;</code></pre><p>even though it has that android:clickable attribute set to true, the click event never fires.</p><p>am i doing something wrong?</p>","339448","","","","","2010-12-06 04:52:07","How do you make an entire control clickable in android?","<android>","1","0","1","",""
"4362924","1","","","2010-12-06 03:24:34","2","1087","<p>I know how to stop animation on starting an activity:    intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);</p><p>How do I do I stop animation while closing an activity? (and returning to the starting activity)</p>","380490","","","","","2010-12-06 08:49:20","Closing an activity animation","<android><animation>","0","1","","",""
"4362941","1","","","2010-12-06 03:28:25","2","7008","<p>I am trying to use a Handler to have some code execute in some amount of time.</p><p>This works well in 2 of my classes, but I'm running on an issue with this one:</p><p>One of my class extends Activity, and starts a Thread (that implements Runnable).</p><p>In my run() method, I have, as in my other classes: </p><pre><code>mHandler = new Handler();mHandler.removeCallbacks(StopRequest);mHandler.postDelayed(StopRequest, 30000);</code></pre><p>The program seems to complain:</p><pre><code>java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</code></pre><p>I don't understand why it is posting, could someone please help me?</p><p>EDIT: Adding parts of my code:</p><pre><code>            out = new PrintWriter(new BufferedWriter(                    new OutputStreamWriter(clientSocket.getOutputStream())), true);            out.println(""VOICE_CALL_REQUEST"");            // Wait for a response            // Set a timer (about 30 seconds)            mHandler = new Handler();            mHandler.removeCallbacks(StopRequest);            mHandler.postDelayed(StopRequest, 3000);            // Ready reply            InputStream stream = clientSocket.getInputStream();            BufferedReader data = new BufferedReader(new InputStreamReader(stream));            String line = data.readLine();            mHandler.removeCallbacks(StopRequest); // Timer is removed here</code></pre><p>And if the timer hits 30 seconds:</p><pre><code>    // Stop a call request after some amount of time    private Runnable StopRequest = new Runnable() {        public void run() {            // Send a message to cancel the voice call            out.println(""VOICE_CALL_CANCEL"");            // Close the port            try {                clientSocket.close();            }            catch (IOException e) { finish(); }        }    };</code></pre><p>Thanks a lot,</p><p>Jary</p>","530891","","530891","","2010-12-06 03:58:54","2010-12-06 05:00:19","Android: Issue using a handler and postDelayed()","<android><handler><looper>","2","0","","",""
"4362957","1","4362990","","2010-12-06 03:33:16","2","1539","<p>I am writing an Android app where I need to pass a string array between two classes. The string initializes fine and I can output the contents of the string fine in the one class but as I try to pass it to another class I get a Null Pointer Exception error. The following is the stripped down version of my code:</p><p>accelerometer.java:</p><pre><code>    public class accelerometer extends Service { public String movement[]; public void onCreate() {  movement = new String[1000000]; } public void updatearray() {  movement[arraypos]=getCurrentTimeString();  //Toast.makeText(this, movement[arraypos] , Toast.LENGTH_SHORT).show(); //this correctly displays each position in the array every time it updates so I know the array is working correctly in this file  arraypos+=1; } public String[] getmovement(){  return movement; }    }</code></pre><p>wakeupalarm.java:</p><pre><code>    public class wakeupalarm extends Activity { private TextView herestext_; public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.wakeup);  herestext_ = (TextView) findViewById(R.id.TextView01);  accelerometer accelerometercall = new accelerometer();  String movearray[] = accelerometercall.getmovement();  herestext_.setText(movearray[2]);  }    }</code></pre><p>I have a feeling I'm missing something very simple but any help would be greatly appreciated!</p><p>Thanks,</p><p>Scott</p>","458452","","345717","","2010-12-06 03:36:50","2010-12-06 03:41:29","Passing a String Array Between Java Classes Android App","<java><android><arrays><string><parameter-passing>","2","0","1","",""
"4363015","1","4363063","","2010-12-06 03:45:34","1","338","<p>What I'm doing is working with a text document that I'm pulling numbers from a saved text document, each line has its own number, and it ignores any lines starting with a !, so, when using these codes, I am getting a NullPointerException and I'm not sure why, Its not filling the ArrayList because of this, how come?</p><pre><code>try{               File f = new File(extStorageDirectory+""/data.txt"");               FileInputStream fileIS = new FileInputStream(f);               BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS));               String readString = new String();               integers.clear();               char check;               while((readString = buf.readLine())!= null){                   check = readString.charAt(0);                  if(check == '!'){                  }                  else{                      //integers.add(0,Integer.parseInt(readString));                      if(check == 0){                          integers.add(0);                      } else {                          if(check == 1) {                              integers.add(1);                          } else {                              if(check == 2){                                  integers.add(2);                              }                          }                      }                  }               }            } catch (Exception e) {                Toast.makeText(getApplicationContext(),""Find Data: ""+e.toString(),Toast.LENGTH_LONG).show();            }</code></pre>","481082","","166339","","2010-12-06 04:01:49","2010-12-06 04:01:49","NullPointerException in Android","<java><android><nullpointerexception>","2","1","","",""
"4363046","1","","","2010-12-06 03:52:35","0","618","<p>I have system that send data in json format from ASP.NET MVC to android system.</p><p>I try sample from <a href=""http://www.instropy.com/2010/06/14/reading-a-json-login-response-with-android-sdk/"" rel=""nofollow"">this</a> site to achieve transfer data. When I try to call site to return result, there always return result without tag HTML in web browser but it work and display in web browser. In first time, I try in JQuery to display the result, but always say there no data. After that I test it Android system, but result always return ""{}"" that mean no data there. Then I found there problem, about result Json from ASP.NET. Because I'm curious about this problem, I try sample JSON from <a href=""http://rentopoly.com/ajax.php?query=Bo"" rel=""nofollow"">this</a> site, then it work in android.</p><p>My question why this could be happen and I could be resolve?</p><p>Sample Json work from <a href=""http://rentopoly.com/ajax.php?query=Bo"" rel=""nofollow"">site</a>:</p><pre><code>{""query"":""Bo"",""suggestions"":[""Bognor Regis"",""Bolton"",""Bournemouth"",""Camborne"",""Eastbourne"",""Loughborough"",""Peterborough"",""Scarborough"",""University of Bolton"",""Boston University"",""Bournemouth University"",""Camborne School of Mines"",""Loughborough University"",""Ravensbourne College of Design and Communication"",""University of Hull (Scarborough Campus)""]}</code></pre><p>Sample Json Doesn't Work retrieve from ASP.NET MVC using JsonResult:</p><pre><code>[{""Name"":""Saab"",""Color"":""Red""},{""Name"":""Volvo"",""Color"":""Blue""}]</code></pre>","473962","","","","","2010-12-06 07:30:53","Return result JSON include HTML tag in ASP.NET MVC","<android><asp.net-mvc><json>","1","0","","",""
"4363056","1","4363502","","2010-12-06 03:54:51","2","1591","<p>I have project where i'm developing an Android App using a lot of existing C++ code accessed through JNI which opens and closes sockets. </p><p>Even though this C++  properly handles the closeing of the sockets it opens, it seems either the Android OS or the JVM keeps around references to those sockets/ports being used until the next GC call. </p><p>What happens is if we stop the app and start it again before the next GC call, the app cannot create connections on that same socket/port. If we wait for GC to be called by the OS and <em>then</em> restart the app, it successfully creates the connections. </p><p>Is there a way to manually free up a socket from Android's/the JVM's perspective? Perhaps a socket class utility? A manual call to GC?</p>","351014","","","","","2013-11-05 21:29:15","How can i force Android to garbage collect old socket information?","<android><sockets><garbage-collection><android-ndk>","2","0","1","",""
"4363186","1","4363288","","2010-12-06 04:19:08","0","129","<p>When i create a new project i am getting the following error. But the R.java file had been created.</p><pre><code>[2010-12-06 09:38:18 - Hello] ERROR: Unable to open class file D:\Projects\Android\Training\Hello\gen\com\variable3\hello\R.java: No such file or directory</code></pre>","155196","","","","","2013-05-27 15:25:51","Android New Project Problem","<android>","3","0","","",""
"4363277","1","4363290","","2010-12-06 04:38:41","6","1043","<p>How to take screenshot using android emulator? </p>","450487","","","","","2012-10-24 00:34:34","Take screenshot","<android><android-emulator>","1","0","2","",""
"4363289","1","","","2010-12-06 04:42:11","0","352","<p>I use the standard Java file rename methods to rename a video file from my application. But I cannot figure out how to get the new name to show up immediately in my app. It only shows up after I remount the file system. </p><p>Do I need to tell the media scanner service something? Has anyone tried this?</p><p>Thanks,Bryan</p>","531757","","","","","2010-12-06 04:42:11","Need help renaming a video file","<android><file>","0","4","","",""
"4363353","1","","","2010-12-06 04:59:05","0","115","<p>my application contain some default intent and user defined ,i want my application to start always from the beaning when user resuming the application after pressing the home button</p>","487219","","","","","2010-12-06 08:17:04","Android mainfest file","<android>","2","2","","",""
"4363365","1","4363445","","2010-12-06 05:01:45","2","2040","<p>I have a list view with a check box in each row to select that row... And i have a select all check box above the listview to select all the rows at a click and vice versa...is it possible to do so...</p>","450487","","","","","2013-09-03 14:47:52","Select all rows and deselect all rows option in listview","<android><listview><selectall>","3","1","1","",""
"4363437","1","","","2010-12-06 05:20:15","0","114","<p>I developed an application for android. I am having problem with display of my application in my mobile. I am using HTC wildfire mobile having resolution 240 x 320. When i loaded my application in to mobile the images which i used in my application becoming small ( Shrinking) look and feel is so bad. It is showing somewhat good in emulater. </p><p>How can i get the actual images in my application (With out shrinking ).</p><p>Can anybody help me please?</p><p>Thanks and Regards,</p><p>Kiran.</p>","416143","","","","","2010-12-06 06:24:52","images are shrinking in my application","<android><android-manifest>","2","3","","",""
"4363457","1","","","2010-12-06 05:24:43","3","7580","<p>I'm using very standard code to send images from my app.  A user emailed me that their default messaging app doesn't show up in the chooser, and oddly enough the same happens on my phone.  I was playing around with the MIME type of the intent.  <code>""text/plain""</code> shows a set of options including my Messages app, and <code>""*/*""</code> shows a ton.  Would I be lazy to set the MIME type to <code>""*/*""</code> so that I don't get filtered by apps that should be an option for the user to send images?  Or is that pretty much the way to go?  </p><pre><code>        Intent intent = new Intent(Intent.ACTION_SEND);        intent.setType(""image/jpeg"");        Uri uri = Uri.fromFile(file);        intent.putExtra(Intent.EXTRA_STREAM, uri);        activity.startActivity(Intent.createChooser(intent, ""Custom Heading...""));</code></pre><p>One side effect of this that I don't like is that a few apps (Facebook, Handcent) have multiple intents registered to send various MIME types, so they show up in the list more than once when the MIME type is <code>""*/*""</code>.</p>","53501","","","","","2010-12-06 07:22:33","MIME types and ACTION_SEND intent chooser","<android><android-intent>","1","0","3","",""
"4363475","1","4363779","","2010-12-06 05:27:35","1","1934","<p>I am trying to build a custom adapter for my app, who's main screen is a <code>ListActivity</code> with a <code>ListView</code> in the center. I am absolutely clueless as to how I'd create the adapter, so I was wondering if anyone knew of any good tutorials to walk me through it.</p>","483790","","1228","","2013-08-13 19:53:27","2013-08-13 19:53:27","Where can I find a good tutorial for creating a custom ArrayAdapter?","<java><android><android-arrayadapter>","2","1","","2013-08-14 17:19:50",""
"4363486","1","4364015","","2010-12-06 05:29:03","0","621","<p>I have an Activity that holds a ServiceConnection to a Service. When the orientation changes the ServiceConnection appears to get lost and gets re created.</p><p>This is not desirable. I'd like to have it such that the ServiceConnection is maintained through the recreation of the Activity. I'm looking for a good pattern that solves this problem.</p>","42005","","","","","2012-01-24 16:45:42","Maintaining a ServiceConnection in Android through Orientation Changes","<android><activity><screen-orientation><serviceconnection>","3","0","","",""
"4363643","1","4363774","","2010-12-06 05:50:33","1","4903","<p>In my android i am using progress dialog for showing loading screen but is it possible to use gif images.Could any one please let me know how to use gif images for loading.</p><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2011-04-30 10:59:48","use gif images for loading screen in android","<android>","2","1","","",""
"4363709","1","4364449","","2010-12-06 05:59:24","0","340","<p>I am new to android. And we already have an project on android and I am supposed to develop an application that will do the API dependency checking on Android. I have to check whatever APIs we use will successfully run and are not deprecated in the newer Android version or Google APi version. So for this i have to write an Testing application. Do I need to write an Android test application or normal Java application can do this?I tried writing Java application and giving some basic calls from it but I get lots errors likeimport com.google.common. cannot be resolvedTYPE_MAP not supportedLists cannot be resolved</p><p>and basically the first error cannot be resolved. So do i need to create an android test application?</p><p>Thanks, </p>","521380","","","","","2010-12-06 08:24:01","Android Testing application","<android><testing>","1","0","","",""
"4363715","1","","","2010-12-06 06:00:29","1","2213","<p>I am new to Android application development.</p><p>I am developing an application which needs to call a .NET webservice and parse XML data. When I parse normal XML data it works with DOM Parser. But, when XML data is huge then it throws ""Out of memory error"".</p><p>Is there any other parser available in Android to parse huge XML data..</p><p>Please help me or suggest me..</p><p>I am really need this as soon as possible.</p>","525626","","","","","2011-01-28 10:07:14","How to parse huge xml data from webservice in Android application?","<android><xml-parsing>","2","0","1","",""
"4363832","1","","","2010-12-06 06:26:47","0","680","<p>(by saying receiver, i mean the part when you hear a phone call normally.)somebody gave following code piece, which does not work. any help please?</p><pre><code>  Object obj = new Object();  Method method;  try {   method = Class.forName(""android.media.AudioSystem"").getMethod(     ""setDeviceConnectionState"", new Class[] { Integer.TYPE,Integer.TYPE,                                               String.class });   method.invoke(obj, new Object[] {num,1,""""});  } catch (Exception e) {   e.printStackTrace();   Log.i(TAG, e.toString());  }  Intent intent = new Intent();  intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  intent.setAction(android.content.Intent.ACTION_VIEW);  String type = getMIMEType(f);  intent.setDataAndType(Uri.fromFile(f), type);  startActivity(intent);</code></pre>","521230","","521230","","2010-12-06 06:47:27","2012-08-17 12:03:10","How to let music be played from receiver instead of loud-speaker?","<android><audio><playback><speaker>","1","2","","",""
"4363895","1","4364012","","2010-12-06 06:40:56","1","923","<p>how to capture url opened in android mobile browser</p><p>my requirement capture opend urls and maintain in list view </p><p>Thanks in advance</p><p>aSwan</p>","1746300","","","","","2012-04-19 09:09:24","capture android browser urls","<android>","2","0","","2012-10-28 23:40:16",""
"4363901","1","4385836","","2010-12-06 06:42:34","1","465","<p>i am developing android apps ,in this apps i am update in android market.</p><p>any third party websites update in this new apps thanks in advance please forward some suggestion </p>","254790","","254790","","2010-12-06 07:38:28","2010-12-08 09:19:54","update new android apps in third party sites","<android>","1","4","4","",""
"4363909","1","4363928","","2010-12-06 06:44:04","1","234","<p>How we can know whether the check box is checked or unchecked using java code</p>","450487","","","","","2010-12-06 11:06:46","Checkbox status issue","<android><checkbox>","2","0","","",""
"4363920","1","","","2010-12-06 06:46:25","0","443","<p>I am New to Android. My Requirement is to check an item of list view and i want show the  selected items in next activity.</p><p>can anyone help me..</p><p>Thanks in advance </p>","530259","","","","","2011-05-30 19:14:36","how can i show checked items of listview in next activicity in android?","<android>","1","1","","",""
"4364055","1","4364130","","2010-12-06 07:12:46","1","609","<p>I am familiar with adb pull command. My question is, Is it possible to pull a file from android device/emulator and saving it in specified location in PC programmatically..?If possible how can we do that.</p><p>Thanks in andvance..</p>","399046","","","","","2011-09-12 10:18:41","Pull a file from android emulator/device programmatically","<android>","1","1","","",""
"4364076","1","5636872","","2010-12-06 07:16:39","1","637","<p>I am developing a soundboard application which extends ListActivity. I have a play button image and the text next to it. Now when the user clicks on a textview, I change the play image to pause image using the following code.</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);  try    {    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, Sounds));     final ListView lv = getListView();     lv.setTextFilterEnabled(true);     lv.setCacheColorHint(Color.WHITE);     lv.setSoundEffectsEnabled(false);     lv.setFastScrollEnabled(true);     lv.setFocusableInTouchMode(true);     lv.setBackgroundColor(Color.WHITE);  lv.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; parent, View view,           int position, long id) {          TextView tv1 = (TextView) view;           int u = (int)meMap.get(position+1); // meMap--&gt; HashMap which contains corresponding resids           playSample(u,tv1);       }     });    }private void playSample(int resid,TextView ttvv){final Resources res = getBaseContext().getResources();    final Drawable myImage = res.getDrawable(R.drawable.pause);  //  myImage.    final Drawable myImage1 = res.getDrawable(R.drawable.play);    MediaPlayer.OnCompletionListener listener = new MediaPlayer.OnCompletionListener(){  public void onCompletion(MediaPlayer mp) { // tv --&gt; (TextView) view; From onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id)     tv.setCompoundDrawablesWithIntrinsicBounds(myImage1, null, null, null);      }    };</code></pre><p>This code works, but with a small error which I noted. Suppose if I select third row in my list, the play image changes to pause image and if I scroll my list while it is playing, I can see that the third row of the second scroll page, the third row of the third scroll page and so on gets affected i.e they also change to pause image. Why is this happening? Am I doing something wrong? I hope you understand my question. Your help is appreciated. Thanks.</p>","527053","","527053","","2010-12-07 06:59:13","2011-04-12 14:29:21","Android: ListView Problem While changing the image next to text in TextView","<android><listview>","1","4","","",""
"4364078","1","4424409","","2010-12-06 07:17:10","2","500","<p>I have rendered a PNG with the iPhone system fount ""Helvetica Neue"" to use as OpenGL Texture in my iPhone App.</p><p>Now I want to port the App to the Android platform.</p><p>Do I need any type of license to use the same texture there as well?</p><p>Thanks, any help would be appreciated</p>","531840","","294884","","2011-04-17 10:44:05","2011-04-17 10:44:05","Can I use a texture with rendered ""Helvetica Neue"" characters without buying a license?","<iphone><android><licensing>","2","0","1","",""
"4364085","1","4369023","","2010-12-06 07:18:06","1","2374","<p>I want to update my ProgressBar simultaneously with the audio file on clicking the Button. I had also used the timer which runs according to the length of the audio file which is in seconds.</p><p>I have configured the Timer and it is nicely increasing according to the length of the audio file but my ProgressBar is not working. It gives me NumberFormatException.</p><p>My Code:     class MyCount extends CountDownTimer          {            private int mycount;</p><pre><code>        public MyCount(long millisInFuture, long countDownInterval)         {          super(millisInFuture, countDownInterval);        }        public void onFinish()         {          //timeDisplay.setText(""done!"");        }        public void onTick(long millsIncreasing)         {        mycount++;        mystring = formatTime(mycount*1000);        myText.setText(mystring);         pBar.setProgress(Integer.parseInt(mystring));  (*****)        pBar.setProgress(1000 * pBar.getProgress());        /*String myString1 = mystring.substring(0, mystring.lastIndexOf("":"")).trim();        String myString2 = mystring.substring(mystring.lastIndexOf("":"")+1, mystring.length()).trim();*/</code></pre><p>I am getting the Exception on the line where I have shown the Stars in the BRACKET.Can anybody please help me,Thanksdavid</p>","422859","","","","","2010-12-06 17:10:43","Synchronizing the Progress Bar with the Timer","<android><timer><progress-bar>","1","5","","",""
"4364143","1","4364841","","2010-12-06 07:31:27","0","1851","<p>I have used tabbar with activity group in my application. I have four tab like home, stock, citn, article. In my application first display home page from the home page user click in webview it will go to homepage1 activity. From home page1 activity user click stock tab it will go to stock activity. From the stock activity user click home tab it will go to homepage1 activity. I want to display home activity can any body tell how to do?</p><p>My question is switching between tab using activity group it will display last activity. I want to display first activity?</p><p>ok i will attach my code</p><pre><code>spec = tabHost.newTabSpec(""FirstGroup"").setIndicator(""FirstGroup"",                   getWallpaper()).setContent( new Intent(this,FirstGroup.class));        tabHost.addTab(spec);   </code></pre><blockquote>  <p>View view =  getLocalActivityManager().startActivity(""CitiesActivity"",  new  Intent(this,CitiesActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET  )).getDecorView();   </p><pre><code>          // Replace the view of this ActivityGroup         replaceView(view);      }   public void replaceView(View v) {               // Adds the old one to history       history.add(v);               // Changes this Groups View to the new View.       setContentView(v);</code></pre></blockquote><p>run this example <a href=""http://united-coders.com/nico-heid/use-android-activitygroup-within-tabhost-to-show-different-activity"" rel=""nofollow"">http://united-coders.com/nico-heid/use-android-activitygroup-within-tabhost-to-show-different-activity</a></p><p>switching between activity and tab </p><p>I have posted in pastebin, my link is <a href=""http://pastebin.com/1zG0HJgv"" rel=""nofollow"">http://pastebin.com/1zG0HJgv</a></p>","426344","","213269","","2010-12-06 13:59:44","2010-12-06 13:59:44","Activity group problem in tab bar","<android><tabbar><activitygroup>","1","0","","",""
"4364294","1","4364587","","2010-12-06 07:59:28","1","560","<p>when i press my login button there is a webservice call , at the time of web service call i have to display a progress dialog, and after receiving webservice return an intent to next page... but it always diplays a blank page when intent is called also progress dialog is not showing </p><pre><code>    if(Utility.isNetworkAvailable(currActivity)){                 //  Utility.showProgressDialog(currActivity);                               new Thread() {                                @Override                                public void run() {                                                                 currActivity.runOnUiThread(new Runnable() {                                        @Override                                        public void run() {                                             Intent intent = new Intent(Login.this, Listviewer.class);                                            startActivity(intent);                                            tempSplashTread = new Thread() { // Thread for showing wait cursor                                                @Override                                                public void run() {                                                    currActivity.runOnUiThread(new Runnable() {                                                        @Override                                                        public void run() {                                                             myProgressDialog = new ProgressDialog(InfraSignPdfList.this);                                                                   myProgressDialog.setMessage(""Loading...                  "");                                                            myProgressDialog.show();                                                        }                                                    });                                                }                                            };                                            tempSplashTread.start();                                            finish();                                        }                                    });                                }                            }.start();                        }else {                            Utility.noNetworkDialog(currActivity);                                                  }</code></pre>","450487","","473070","","2010-12-06 08:03:28","2010-12-06 08:47:00","Thread implementation","<android><multithreading>","2","1","2","",""
"4364540","1","","","2010-12-06 08:38:25","1","176","<p>I noticed that when my app is onscreen and the device goes into standby (black screen) and the device gets out of the standby the View (layout) will be moved a couple of centimeter downwards so that the last couple of centimeters of the View actually will ""fall offscreen""..The Activity itself is declared as being</p><pre><code>android:screenOrientation=""portrait""android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""</code></pre><p>After some more in-depth research, or actually just looking at it, I noticed that the amount of movement (the height of it) actually looks a lot like the height that the statusnoticebar should take.Anyone ever experienced this and/or anyone got a solution for it ?Also how should I force a redraw of the whole screen when it comes out of the standby mode ?I tried placing a MainLayout.ForceLayout() in the onResume() method but that didnt work at all :(</p>","162147","","","","","2011-02-16 14:21:22","View moves downwards after standby","<android><activity>","1","0","2","",""
"4364545","1","4365619","","2010-12-06 08:40:20","3","2708","<p>When my main activity starts after the splash screen it parses 4 big XML files. This takes a few seconds and I'm able to hide this in the time the splash screen shows at startup.</p><p>But when the screen orientation changes or when I go back to the main activity after a sub-activity it parses again and thus fore my app 'hangs' for a few seconds and it doesn't respond or anything in that time.</p><p>I understand this is normal behaviour in Android, but isn't there a way to avoid this?</p><p>I read something about savedinstancestate, but I can't seem to understand the docs..</p>","517460","","","","","2013-01-18 14:20:36","Activity reloads when orientation changes in Android","<java><android><multithreading>","3","0","1","",""
"4364569","1","4365047","","2010-12-06 08:43:38","0","603","<p>Ive been trying to look for the right answer, but couldn't find something clear.I have a List of items, using custom ArrayAdapter.Now each Item has click listener. I want to add another list, so when someone click on one of the times, another list will pop up.</p><p>Now how should I implement the second list? should I combine it somehow in the current ArrayAdapter and it's wrapping Activity? Should I create separate Custom adapter and activity for the second list?</p><p>I have also saw something about ViewSwitcher, is that the answer for this question?</p><p>Any ideas? </p><p>thanks,ray.</p>","260511","","","","","2010-12-06 09:46:01","Implementation List Inside List","<android>","1","0","1","",""
"4364613","1","","","2010-12-06 08:52:30","0","356","<p>I've added a SeekBar to my application to serve as a volume control.However, on Nexus One at least it does not seem to work too well.  I suspect the problem is that the SeekBar handle is too small and the touch area is not high enough.  The end result is that I keep trying to 'grab' the handle with my finger to change the volume, and I miss 2 times out of 3.</p><p>I first though I was doing something wrong, but since I've observed the same in all the apps that make use of the SeekBar that I've tried.</p><p>Is this a Nexus One specific issue, (running 2.2), or a general problem?  Are there free alternatives, or should I roll my own custom View?</p>","530459","","","","","2010-12-06 08:52:30","SeekBar not very usable, handle being too small, or...?","<android><usability><seekbar>","0","2","","",""
"4364833","1","4372420","","2010-12-06 09:20:12","1","1312","<p>I want to profiling an android app.I follow the instructions on Android's website here: <a href=""http://developer.android.com/guide/developing/tools/traceview.html"" rel=""nofollow"">http://developer.android.com/guide/developing/tools/traceview.html</a></p><p>The website told me to use Debug.startMethodTracing() and Debug.stopMethodTracing()Then finally I generate a trace file for my app and successfully view that file using traceview.</p><p>At the end of that web page it says there is a tool call dmtracedump can generate function call relation graph. I follow the instructions and also install Graphviz before using it.</p><p>But no matter how I try to use dmtracedump, the tool just stuck and nothing comes out.I used commond like</p><p>dmtracedump test1.trace</p><p>dmtracedump -g test1.png test1.trace</p><p>Is there anything I got worng when using this tool?Can any one show me how to generate a graph from dmtracedump?</p><p>Thanks a lot !</p>","532013","","","","","2011-08-24 14:15:55","dmtracedump doesn't work, HELP!","<android><profiling>","1","2","0","",""
"4365048","1","4365137","","2010-12-06 09:46:02","4","3534","<p>I am developing a soundboard application. In that, I use MediaPlayer to play sounds. I observe this warning in logcat which makes me worried.</p><pre><code>WARN/MediaPlayer(340): info/warning (1, 44)</code></pre><p>Everytime I play a file, am getting this warning in logcat. Do anyone know what this is about and how to solve it. I googled about this warning, but couldnt find any solution. Any help here is apppreciated. Thanks.</p>","527053","","","","","2010-12-06 09:55:12","Android: Media Player Warning (1,44)","<android><warnings><media-player>","1","0","1","",""
"4365056","1","","","2010-12-06 09:47:07","1","2073","<p>Android Can u anyone please show a sample for... (Android)1) How to get a data from a URL response using JSON?2) How to parse that response to append in another URL?</p>","532063","","","","","2011-09-28 19:29:58","JSON Array & Parse Response","<android><json><jsonp>","2","0","","",""
"4365123","1","","","2010-12-06 09:53:56","0","593","<p>I have a <code>Gallery</code> and a few images stored in it.</p><p>On selecting the images i want some URL s to get opened on the top of this gallery(As a web view only).For example If i click on a particular image i need a url to get opened.I tried using <code>ViewSwitcher</code> and since I am a begginner i couldn move further.</p><p>Can someone tell if this is possible or suggest me the ways?</p>","532072","","119895","","2010-12-11 03:09:59","2010-12-11 03:11:18","WebView and Gallery in android","<android>","1","0","","",""
"4365184","1","4365426","","2010-12-06 10:01:13","0","1725","<p>I need to use some classes (Vector, string8) provided in the <code>libUtils.so</code>, but this library did not come with the <code>ndk_linux_x86_r4</code>. In addition, I am having some problems to build this library from the source code. Does anyone have this library built or know where to download it?</p>","115722","","","","","2010-12-06 10:29:14","libutils for android ndk","<android><android-ndk>","1","2","","",""
"4365193","1","6245033","","2010-12-06 10:01:55","3","347","<p>I am recording sensor data (accelerometer, compass, wifi) in Android in 5Hz frequence. I don't scan Wifi that frequently. </p><p>I am using text file. When I have 1000 data records in memory, I append them into a text file.</p><p>However this method seems quite slow. Will using a SQLite database be faster than plain text file?</p><p>Thanks. </p>","183828","","","","","2011-06-05 18:47:02","Recording stream data efficiently in Android","<android><data><stream>","1","0","1","",""
"4365227","1","8630839","","2010-12-06 10:04:19","3","3203","<p>I'm developing an Android application that uses native code.</p><p>I need to add an external native library to my APK's lib folder on every build.</p><p>How can I do that?</p><p>Thanks.</p>","68571","","","","","2011-12-25 18:15:08","Add a native lib to an APK","<android><shared-libraries><native>","1","0","1","",""
"4365228","1","","","2010-12-06 10:04:22","0","1020","<p>This is my first post.I am very new to android platform. I am building an application that need to make video call using VOIP. I have already installed SipDroid which makes call using VOIP.</p><p>I want to call this application from my application on click of button.</p>","532085","","","","","2010-12-06 20:54:58","Calling SipDroid(third party) Application from my application","<android><third-party>","2","0","","",""
"4365254","1","","","2010-12-06 10:06:43","0","237","<p>Dear All,Please tell me how to update data from <strong>android.provider.Settings.Secure.</strong></p><p>Although I had read the description from android document: <em>""Secure system settings, containing system preferences that applications can read but are not allowed to write.""</em> </p><p>If There is exist any technique to solve this problem. please give me some keywords. </p><p>Thanks for All,Nguyen Dai Son</p>","434538","","","","","2010-12-06 12:30:47","Can I update data from android.provider.Settings","<android>","1","0","","",""
"4365261","1","4365300","","2010-12-06 10:07:30","0","430","<p>To give you a bit of history - I'm basically trying to send an unserializable object (Spanned) from the child thread to the main thread (via Message). I tried the obvious - turning it into an array of bytes and sending it that way, but that gives an error since it's not implementing serializable.</p><p>Is there any other way I can send it using a Bundle? Or something else? </p><p>Here is how I'm sending the message in the child thread</p><pre><code>// message and bundle for the questions explanationMessage qemsg = messageHandler.obtainMessage();Bundle qeb = new Bundle();qeb.putString(""questionExplanations"", questionExplanations);qemsg.setData(qeb);qemsg.arg1 = 0;messageHandler.sendMessage(qemsg);</code></pre><p>Here is the main thread handler (receives the messages sent from the child thread):</p><pre><code>private Handler messageHandler = new Handler() {  @Override  public void handleMessage(Message msg) {    CFAData cd = CFAData.getSingletonObject();    Bundle summaryBundle = msg.getData();    switch(msg.arg1) {      case 0:        // receives the bundle here and does what it needs on the UI thread        //testQuestionsExplanations.append(spannedExplanationsObj);        break;      default:        break;    }  }};</code></pre>","380579","","","","","2010-12-06 10:13:14","Passing an unserializable object to a Handler (from child thread)","<java><android><multithreading><serialization>","1","1","","",""
"4365275","1","","","2010-12-06 10:09:45","1","2324","<p>I'd need some help on this topic, so basically i've been reading a lot on the internet and have downloaded the sample from <a href=""https://github.com/facebook/facebook-android-sdk/"" rel=""nofollow"">https://github.com/facebook/facebook-android-sdk/</a> which when used their sample, it works but then after fiddling it for the pass few days, i'm lost again.</p><ol><li>so basically, what i need is to register my app on fb then; </li><li>design the app and create it on android;</li></ol><p>then comes the question, do i need still need the canvas on fb which will use php as well or is that a totally different thing?</p><p>my idea is to actually use the app that will retrieve or update my group's wall straight from the app. so basically what should i do, been lost but I'm willing to learn! just need someone to guide me :(</p>","532094","","251173","","2010-12-09 15:59:25","2010-12-09 15:59:25","Creating a FB App using java on android","<java><android><facebook><sdk>","1","0","","",""
"4365277","1","4493798","","2010-12-06 10:10:00","1","1302","<p>I am trying to implement following thing in android 2.x. </p><p><img src=""http://i.stack.imgur.com/Ekxoz.png"" alt=""alt text""></p><p>In my application i want to allow the user to create the custom live wallpaper kind of thing where user chooses few images and then those image will rotate in a typical fashion and after that user will be able to set it all the view as a live wallpaper within the application only.</p><p>i have successfully implemented the selection of images and its rotation now i don't know how to set live wallpaper within the application. i have tried implementing  Live Wallpaper chooser but it is used to access already installed live wallpaper. but what about the dynamically created live wallpaper?</p><p>Even i tried to call it using following line of code </p><pre><code>intent.setClassName(""com.android.wallpaper.livepicker"", ""com.android.wallpaper.livepicker.LiveWallpaperPreview"");</code></pre><p>But it is giving me an error </p><pre><code>java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview } from ProcessRecord{43f94a38 29784:com.vb.ui/10038} (pid=29784, uid=10038) requires null</code></pre><p><strong>There might be few ways but m not sure about it</strong> </p><p>is it possible to install live wallpaper apk programmatically  so that once the live wallpaper is created it is being installed by the application ?</p><p>if live wallpapers are stored in some place then we can store user created live wallpaper at that place so when live wallpaper chooser is being selected we can see the live wallpaper in the list</p>","405383","","19750","","2011-03-31 15:41:46","2011-03-31 15:41:46","call Live wallpaper within application","<android><live-wallpaper>","1","0","","",""
"4365312","1","","","2010-12-06 10:14:35","2","3167","<p>Is it possible to listen home button uniquely, if the application contain some default intent? I have checked life cycle method but it will execute when I am starting the default intent and home button.</p>","487219","","559850","","2011-08-09 14:46:29","2012-01-17 04:59:36","Android Listen Home button","<android>","3","0","","",""
"4365433","1","4365591","","2010-12-06 10:30:11","1","2020","<p>I'm sharing an image from my application by starting Intent.ACTION_SEND with image msg.setType(""image/png"") using startActivityForResult(). The call works perfectly and displays the desired activity chooser. </p><p>But when I get back to onActivityResult() the resultCode is always 0. To display my UI correctly I need to know if the user sent / shared the picture or cancelled the operation. Is there any way for me to know that?</p>","422863","","","","","2010-12-06 10:49:12","Starting Intent.ACTION_SEND always return resultCode 0","<android><activity><android-intent>","1","1","","",""
"4365444","1","","","2010-12-06 10:31:28","0","939","<p>I have an app where I want to access the magnotometer. I get results out of my application, but compared with orientation results from the compass app of g1 I get completely different results with my app than the compass app. e.g.: my app sais 250° and the compass app 90°!That just can't be, here is my code. Is there any difference to become better results?</p><pre><code>public class MySensorListener implements SensorListener{  int orientation;  public MySensorListener(){     orientation = 0;  }    public void onAccuracyChanged(int sensor, int accuracy) {  // TODO Auto-generated method stub }    public void onSensorChanged(int sensor, float[] values) {        orientation = (int)values[0];    }}</code></pre><p>I acess the Sensormanager like this:</p><pre><code>private MySensorListener doCompass(){ MySensorListener cl; SensorManager cm; compassListener = new MySensorListener();  cm = (SensorManager) getSystemService(Context.SENSOR_SERVICE);  cm.registerListener(   cl,    SensorManager.SENSOR_ORIENTATION,    SensorManager.SENSOR_DELAY_UI); //updateRate  return cl;}</code></pre><p>Can anyone help, pleeease?! :)</p><p>Thank you</p>","495918","","","","","2010-12-06 17:40:00","Android: Compass too imprecise?","<android><compass-geolocation>","1","0","","",""
"4365549","1","","","2010-12-06 10:45:05","0","2170","<p>How can I get phone number of sms sender from a sms thread id? I only know thread id.</p>","517558","","1048862","","2013-07-02 20:26:04","2013-07-02 20:26:04","get phone number of sms sender from sms thread id","<android><multithreading><sms>","1","0","","",""
"4365620","1","4365894","","2010-12-06 10:55:16","0","495","<p>I have configured the Progress Bar in my Application with the Audio File. All the audio files are in the Seconds, Now where am I stuck is the Progress Bar only shows the progress with the audio file upto the fixed value.</p><p>I mean if the duration of the file is supposedly ""5760""(in milliseconds) then the Progress Bar will show the progress upto only ""5000"" milliseconds and then the space will be seen empty for the rest ""760"" milliseconds.</p><p>I want the Progress Bar to get Synchronized fully and to show the Progress Bar complete according to the length of the Audio file.</p><p>Can anybody please help me in this particularly.</p><p>Thanks,david</p>","422859","","","","","2010-12-06 11:36:26","Rounding of the value of the Audio File duration with the ProgressBar","<android><time><progress-bar><duration>","2","0","","",""
"4365624","1","","","2010-12-06 10:55:36","0","287","<p>My task is, to detect android devices, when reaching the propximity of some BT-Scanners(My PC)</p><p>Instead of discovering all visible devices:</p><ul><li>all Device BT MAC-Adresses are stored at my PC</li><li>Can i look for special devices with the given MAC-adress without turning on discoverability on the android device? I don't want to turn on the discoverability all the time, so maybe I can check with the special MAC-adress for devices. Like the ""ping"" function in network technik?</li></ul><p>I hope you understand my problem and hope for solutions.</p>","501970","","","","","2010-12-07 15:18:44","Android Bluetooth without Discovering and discoverability!","<android><bluetooth><discovery>","1","0","","",""
"4365682","1","4365807","","2010-12-06 11:01:36","1","615","<p>I need to create a question wizard with the help of ViewFlipper so that users can navigate between the questions easily. I need to dynamically generate the views for each questions. Each of the view will contain a Textview(for questions) Radio Buttons(Options for answer) and Buttons('Next' and 'Previous' buttons to flip between each views). </p><p>Here is the model of wizard I want to create:</p><h2><img src=""http://i.stack.imgur.com/5B9Bi.jpg"" alt=""alt text""></h2><p>In Viewflipper, I see that the layout is already defined in the XML file. Can anyone help me how to generate it automatically and set the values correctly to the view. </p><p>regardsdj</p>","395959","","","","","2010-12-06 11:15:16","Using ViewFipper in android","<android><viewflipper>","1","0","6","",""
"4365730","1","","","2010-12-06 11:07:14","0","325","<p>In Android while trying to get/set the attributes of an Image I am getting Image attributes as zero which I guess is not a correct value. Please help me on this. here's the excerpt of the code:</p><p><strong>CODE</strong></p><pre><code>public class CumulativeGoalProgress extends Activity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.cumulative_goals);    showCumulativeGoalProgress();    }private void showCumulativeGoalProgress(){ImageView wellnessBarIndicator =     (ImageView)findViewById(R.id.iv_welness_bar_indicator);Log.e(""Ravi"", ""progBarImage getBaseline = "" + progBarImage.getBaseline());Log.e(""Ravi"", ""progBarImage getHeight = "" + progBarImage.getHeight());Log.e(""Ravi"", ""progBarImage getMeasuredHeight = "" + progBarImage.getMeasuredHeight());Log.e(""Ravi"", ""progBarImage getMeasuredWidth = "" + progBarImage.getMeasuredWidth());Log.e(""Ravi"", ""progBarImage getWidth = "" + progBarImage.getWidth());Log.e(""Ravi"", ""progBarImage getBottom = "" + progBarImage.getBottom());Log.e(""Ravi"", ""progBarImage getLeft = "" + progBarImage.getLeft());Log.e(""Ravi"", ""progBarImage getNextFocusLeftId = "" + progBarImage.getNextFocusLeftId());Log.e(""Ravi"", ""progBarImage getPaddingLeft = "" + progBarImage.getPaddingLeft());Log.e(""Ravi"", ""progBarImage getPaddingTop = "" + progBarImage.getPaddingTop());}}</code></pre><p><strong>The ImageView as defined in the XML</strong></p><pre><code>&lt;ImageView    android:id=""@+id/iv_welness_bar_indicator""    android:layout_marginTop=""119px""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:background=""@drawable/vis_wellness_bar_indicator""    /&gt;</code></pre><p><strong>vis_wellness_bar_indicator</strong> is the source Image file in PNG format.</p><p>What am I doing wrong?</p>","177086","","177086","","2010-12-06 11:18:06","2010-12-06 11:24:43","Android Native API (getWidth etc) for determining attributes of images return wrong value","<java><android>","1","0","","",""
"4365893","1","","","2010-12-06 11:27:30","6","34516","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4247385/how-to-change-color-of-listview-items-on-focus-and-on-click"">How to change color of ListView items on focus and on click</a>  </p></blockquote><p>friends,</p><p>i want to change color on android list item click any one guide me which attribute should i use to achieve this functionality?</p><p>actually when user clicks on list item he does not know if it was clicked or not?</p><p>here is my code.</p><pre><code>&lt;ListView android:id=""@+id/android:list"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:drawSelectorOnTop=""false""        android:layout_below=""@+id/Tablayoutdesign""        android:cacheColorHint=""#000000""        android:dividerHeight=""1dip""        android:layout_marginTop=""63dip""        android:layout_marginBottom=""40dip""        /&gt;</code></pre>","249991","","","","","2012-06-26 09:36:12","how to change color of android list item on click or selection?","<android>","1","2","7","2012-06-26 10:54:15",""
"4366002","1","","","2010-12-06 11:40:16","0","338","<p>i use local service named PollerService with one client (activity in the same app named PollerClient)but when i call      stopService(new Intent(PollerClient.this, PollerService.class)</p><p>it is noted that the code onDestroy() has not been executed though the service has only this client that started it by startService(new Intent(PollerClient.this, PollerService.class)) and stopped it as above by stopService()</p><p>can any one tell me why onDestroy()  has not been executed ?</p><pre><code>Thanks in advance   </code></pre>","526474","","","","","2011-03-15 20:09:37","stopService() with only one client but onDestroy() is not executed","<android><service>","1","1","","",""
"4366132","1","4367145","","2010-12-06 11:56:38","0","3125","<p>I am trying to delete Group when selected in my Expandable List, and having the list refreshed after the delete occurred.</p><p>I took the source code from google:</p><p><a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList1.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList1.html</a></p><p>I tried couple of ways to delete it, but no success, anyone achieved that already?</p><p>Thanks,ray.</p>","260511","","","","","2010-12-06 14:03:39","Delete group in Expandable List","<android>","2","0","3","",""
"4366148","1","4368041","","2010-12-06 11:58:24","2","3076","<p>I have been working on making our CMS export valid content for mobile devices. One of the problems we encountered was that newer devices, like the iphone4 have a higher resolution display so we needed to find a way to render the same page correctly on older devices and newer that use a 300dpi display. So far we used javascript and window.devicePixelRatio in order to get the dpi resolution, but it turns out this is not working in opera(?) and opera mobile.</p><p>Any suggestetions or maybe a defferent approach? I researched a bit but was unable to find somethig.</p><p>Thanks</p>","231120","","","","","2011-03-12 22:17:49","window.pixelRatio not working in Opera. Any alternative?","<javascript><android><opera><mobile-website>","3","0","2","",""
"4366161","1","","","2010-12-06 12:00:02","1","136","<p>Some features are broken down into subfeatures, such as the telephony feature:</p><pre><code>&lt;uses-feature android:name=""android.hardware.telephony"" android:required=""true"" /&gt;&lt;uses-feature android:name=""android.hardware.telephony.gsm"" android:required=""false"" /&gt;&lt;uses-feature android:name=""android.hardware.telephony.cdma"" android:required=""false"" /&gt;</code></pre><p>Now the question is: if setting all subfeatures to not be required, can it still make sense to require the parent feature, based on the assumption that there is functionality covered by the parent feature that goes beyond the sum of all subfeatures?</p>","127013","","","","","2010-12-06 12:00:02","uses-feature: is the sum of all subfeatures always identical to the parent feature?","<android><android-manifest><uses-feature>","0","2","2","",""
"4366223","1","","","2010-12-06 12:08:32","4","700","<p>We're currently revising our application manifest to explicitly use the <code>uses-feature</code> attribute to declare all its dependencies on hardware and software APIs.</p><p>Since we expect the user to have mobile Internet, we set <code>android.hardware.telephony</code> to <code>true</code>, but now the app fails to install on the emulator. The error message is:</p><pre><code>Failure [INSTALL_FAILED_MISSING_FEATURE]</code></pre><p>There is no additional information, not even in the device logs, but I could figure out by trial and error that the telephony feature was causing it.</p><p>Since the emulator has support for telephony functionality (you can even simulate dispatching a call), why does this break? And even if it correctly reports that it doesn't support telephony, shouldn't it be obvious that <code>uses-feature</code> was meant to target real devices, not the emulator?</p><p>I'm actually quite confused about this attribute now in general, since <a href=""http://developer.android.com/guide/topics/manifest/uses-feature-element.html"" rel=""nofollow"">its documentation</a> seems to imply that it only affects filtering rules for Android Market. I can't see where it mentions that <code>uses-feature</code> has a direct impact of the installability of an app, which seems to go way beyond the merely declarational/informational nature the docs attribute to it.</p><p>Maybe it's not a good idea to use it after all? Our build server doesn't execute anymore, since installation to the emulator now always fails...</p>","127013","","127013","","2010-12-06 13:54:23","2013-11-12 12:35:21","android.hardware.telephony breaks installation on the emulator","<android><android-emulator><android-manifest><uses-feature>","2","6","1","",""
"4366255","1","4366373","","2010-12-06 12:12:50","9","4569","<p>I'm trying to update the display brightness from a widget but i have some problems.</p><p>To change brightness level, i use:</p><pre><code>Settings.System.putInt(context.getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, 200);</code></pre><p>This modifies the display setting (in fact in Display->Brightness the level is correct) but the effective brightness of display is not changed. If i lock the screen and unlock, the brightness finally changes to the value i set.</p><p>I assume this is a Settings Update issue, so how can the display settings be immediatly updated after settings change?</p><p>I read that <code>WindowManager.LayoutParams lp = getWindow().getAttributes();</code> should be used but I am working in a App Widget so getWindow() cannot be called.</p>","527317","","114066","","2011-02-07 15:23:58","2011-02-07 15:23:58","Update Display Brightness on Android after changing it programmatically","<android><screen-brightness>","2","0","4","",""
"4366291","1","","","2010-12-06 12:16:32","2","1692","<p>I have some problems with using ListPreference, when i set the value with useing ListPreference.setEntries() and ListPreference.setEntryValues() , then  the value was  set ,but is was not checked  , i tried the ListPreference.setEnabled(true) and ListPreference.setSelectable(true), but it was about the ListPreference , not the values in ListPreference,  any method to make it checked with coding after i set the value?</p><p>thanks</p>","525280","","","","","2012-11-24 00:35:48","how can i set the value checked in ListPreference","<android><checked><listpreference>","1","0","","",""
"4366482","1","","","2010-12-06 12:41:09","0","147","<p>I am new to the development as well as the prg world. I want to learn android and want to make applications for it. So one possible way is to buy a new android phone to test it live and not on emulator. But I have two spare phones, Nokia N70 and Motorola MotoRokr E6. So I was willing to port the OS on those machines. As a result I wanted to know is that possible then what all do i need for that considering both Software and Hardware Aspects.ThankYou in Advance...</p>","532283","","","","","2010-12-06 15:16:42","Porting Android on various other mobiles","<android><motorola><motorola-droid>","2","0","","",""
"4366535","1","","","2010-12-06 12:48:30","0","365","<p>i have an app whick implements an AlarmManager. i was just about to relsease the app to the android market when i ba accident noticed that when setting an AlarmManager to fire of an intent in say 5 minutes and i before this time force close my app, the AlarmManager intent is never done.</p><p>i NEED a way to fix this asap, i thought the AlarmManager class put the intent in system and than fired that intent from system att specified time regardless of if the app was running or not. </p><p>here is my AlarmManager. </p><p>AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);        todaysDateAndTime();        long k = intAlarmTime - rightNow.getTimeInMillis();         alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + k , contentIntent);</p><p>Thanks in advance!P.S. not very experienced so keep that in mind when answering please, although im thankfull for anything!</p>","525726","","","","","2010-12-06 12:48:30","AlarmReminder intent is forgoten when app is force closed","<android><android-intent><alarmmanager>","0","4","1","",""
"4366746","1","4569206","","2010-12-06 13:15:40","5","6150","<p>I got most of the things working when querying contact data. I'm fighting with StructuredName and Organization. They do not work for me.</p><p>If you don't mind please have a look at the code. It's handcrafted and lot of error checking is removed to make it as small as possible to be posted here. Comments with ""not working"" are the parts that don't work for me.</p><p>The two leading if() are part of the onActivityResult where I receive the data at the end of the contact selection. Calling is done with:</p><pre><code>intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);startActivityForResult(intent, Main.DIALOG_PICKCONTACT);</code></pre><p>Many thanks in advanceHJW</p><pre><code>if (requestCode == Main.DIALOG_PICKCONTACT) { if (resultCode == RESULT_OK) {  int i;  String s;  Cursor cursorContacts = managedQuery(intent.getData(),      null,      null,      null,      null);  if (cursorContacts != null) {   if (cursorContacts.moveToNext()) {    ContentResolver contentResolver = getContentResolver();    String contactId = cursorContacts.getString(cursorContacts.getColumnIndex(ContactsContract.Contacts._ID));    i = cursorContacts.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);    // cursorContacts.getString(i); *** is DISPLAY_NAME    Cursor cursorEmail = contentResolver.query(        ContactsContract.CommonDataKinds.Email.CONTENT_URI,        null,        ContactsContract.CommonDataKinds.Email.CONTACT_ID + "" = ?"",        new String[] { contactId },        null);    if (cursorEmail != null) {     while (cursorEmail.moveToNext()) {      int type = cursorEmail.getInt(cursorEmail.getColumnIndex(ContactsContract.CommonDataKinds.Email.TYPE));      s = cursorEmail.getString(cursorEmail.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA));      switch (type) {       case ContactsContract.CommonDataKinds.Email.TYPE_HOME:        // s *** is private Email        break;       case ContactsContract.CommonDataKinds.Email.TYPE_WORK:        // s *** is business Email        break;      }     }     cursorEmail.close();    }    Cursor cursorOrganization = contentResolver.query(        ContactsContract.Data.CONTENT_URI,        null,        ContactsContract.CommonDataKinds.Organization.CONTACT_ID + "" = ?"",        new String[] { contactId },        null);    if (cursorOrganization != null) {     if (cursorOrganization.moveToNext()) {      s = cursorOrganization.getString(cursorOrganization.getColumnIndex(ContactsContract.CommonDataKinds.Organization.DATA));      // s *** Company name not working      s = cursorOrganization.getString(cursorOrganization.getColumnIndex(ContactsContract.CommonDataKinds.Organization.TITLE));      // s *** Function within company not working     }     cursorOrganization.close();    }    s = cursorContacts.getString(cursorContacts.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));    if (Integer.parseInt(s) &gt; 0) {     Cursor cursorPhone = contentResolver.query(         ContactsContract.CommonDataKinds.Phone.CONTENT_URI,         null,         ContactsContract.CommonDataKinds.Phone.CONTACT_ID + "" = ?"",         new String[] { contactId },         null);     if (cursorPhone != null) {      while (cursorPhone.moveToNext()) {       int type = cursorPhone.getInt(cursorPhone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));       s = cursorPhone.getString(cursorPhone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));       switch (type) {        case ContactsContract.CommonDataKinds.Phone.TYPE_FAX_HOME:         // s *** is private fax         break;        case ContactsContract.CommonDataKinds.Phone.TYPE_FAX_WORK:         // s *** is business fax         break;        case ContactsContract.CommonDataKinds.Phone.TYPE_HOME:         // s *** is private phone         break;        case ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE:         // s *** is mobile phone         break;        case ContactsContract.CommonDataKinds.Phone.TYPE_WORK:         // s *** is business phone         break;        case ContactsContract.CommonDataKinds.Phone.TYPE_WORK_MOBILE:         // s *** is business mobile         break;       }      }      cursorPhone.close();     }    }    Cursor cursorStructuredName = contentResolver.query(        ContactsContract.Data.CONTENT_URI,        null,        ContactsContract.CommonDataKinds.StructuredName.CONTACT_ID + "" = ?"",        new String[] { contactId },        null);    if (cursorStructuredName != null) {     if (cursorStructuredName.moveToNext()) {      i = cursorStructuredName.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME);      // cursorStructuredName.getString(i); *** given name not working      i = cursorStructuredName.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.MIDDLE_NAME);      // cursorStructuredName.getString(i); *** middle name not working      i = cursorStructuredName.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.PREFIX);      // cursorStructuredName.getString(i); *** prefix not working      i = cursorStructuredName.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.SUFFIX);      // cursorStructuredName.getString(i); *** suffix not working     }     cursorStructuredName.close();    }    Cursor cursorStructuredPostal = contentResolver.query(        ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_URI,        null,        ContactsContract.CommonDataKinds.StructuredPostal.CONTACT_ID + "" = ?"",        new String[] { contactId },        null);    if (cursorStructuredPostal != null) {     while (cursorStructuredPostal.moveToNext()) {      int type = cursorStructuredPostal.getInt(cursorStructuredPostal.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.TYPE));      s = cursorStructuredPostal.getString(cursorStructuredPostal.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.COUNTRY));      switch (type) {       case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_HOME:        //s *** is private country        break;       case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK:        // s *** is business country        break;      }      s = cursorStructuredPostal.getString(cursorStructuredPostal.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.CITY));      switch (type) {       case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_HOME:        // s *** is private city        break;       case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK:        // s *** is business city        break;      }      s = cursorStructuredPostal.getString(cursorStructuredPostal.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.POSTCODE));      switch (type) {       case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_HOME:        // s *** is private postcode        break;       case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK:        // s *** is business postcode        break;      }      s = cursorStructuredPostal.getString(cursorStructuredPostal.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.STREET));      switch (type) {       case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_HOME:        // s *** is private street        break;       case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK:        // s *** is business street        break;      }     }     cursorStructuredPostal.close();    }    Cursor cursorWebsite = contentResolver.query(        ContactsContract.Data.CONTENT_URI,        null,        ContactsContract.CommonDataKinds.Website.CONTACT_ID + "" = ?"",        new String[] { contactId },        null);    if (cursorWebsite != null) {     while (cursorWebsite.moveToNext()) {      i = cursorWebsite.getColumnIndex(ContactsContract.CommonDataKinds.Website.URL);      int type = cursorWebsite.getColumnIndex(ContactsContract.CommonDataKinds.Website.CONTENT_ITEM_TYPE);      s = cursorWebsite.getString(i);      switch (type) {       case ContactsContract.CommonDataKinds.Website.TYPE_HOME:        // s *** private url not working        break;       case ContactsContract.CommonDataKinds.Website.TYPE_WORK:        // s *** business url not working        break;      }     }     cursorWebsite.close();    }   }   cursorContacts.close();  } }}</code></pre>","471681","","","","","2014-03-14 09:38:36","Problems with ContactsContract.CommonDataKinds.StructuredName","<android><android-contacts>","3","0","3","",""
"4366893","1","","","2010-12-06 13:33:17","0","349","<p>I have a bunch of java objects that are made available to some javascript code in my Android application via the addJavascriptInterface in the WebView. </p><p>However, the problem with this is that when a method call from my java objects results in an exception, it crashes the whole WebView thread. Is there any way I can recieve exceptions arising from java method calls from within javascript code??</p><p>for example, is something like this possible in javascript from within Android? If not then is there a specific pattern already available to solve this problem?</p><pre><code>try{    javaObject.methodCall(); } catch(e) {  //do something here.}</code></pre><p>where <code>javaObject</code> is made available to javascript via <code>WebView.addJavascriptInterface()</code></p>","532340","","121493","","2010-12-06 13:37:53","2010-12-08 16:32:09","Android: catching java exceptions within javascript","<android>","2","0","","",""
"4367125","1","","","2010-12-06 14:01:50","1","778","<p>Hai friends,I implemented web view in one of my activity, when i am trying to go to previous activity(by clicking the back button)</p><p>whole application is terminating.</p><p>In the back button</p><p>I have written the following code to close the activity..</p><pre><code>Intent in=new Intent();        setResult(RESULT_OK, in);        finish();</code></pre><p>Thanks,Bhargav.</p>","524787","","24054","","2010-12-06 14:08:14","2011-05-03 00:08:05","Web view back button problem in android","<android><android-layout>","1","1","","",""
"4367166","1","4396024","","2010-12-06 14:05:26","1","2846","<p>I'm asking this question after searching the web for an answer for 2 days.</p><p>OK, here's the thing : </p><p>In the  server side i have a WCF webservice, defined like this:</p><pre><code>namespace HelloRest{[System.ServiceModel.ServiceContract]public interface IHelloRest  {    [OperationContract]    [WebInvoke(        Method = ""POST"",        UriTemplate = ""SaveVehicle"",        BodyStyle = WebMessageBodyStyle.WrappedRequest,        ResponseFormat = WebMessageFormat.Json,        RequestFormat = WebMessageFormat.Json)]    string SaveVehicle(clVehicles vehicles);  }}namespace HelloRest{  public class HelloRestService : IHelloRest{   public string SaveVehicle(clVehicles vehicles)    {    ...    }}}namespace WebApplication1{    [Serializable]    [DataContract]    public class clVehicles    {        [DataMember]        public List&lt;Vehicle&gt; Vehicles { get; set; }    }}namespace WebApplication1{    [Serializable]    [DataContract]    public class Vehicle    {        [DataMember(Name = ""year"")]        public int Year        {            get;            set;        }        [DataMember(Name = ""plate"")]        public string Plate        {            get;            set;        }        [DataMember(Name = ""make"")]        public string Make        {            get;            set;        }        [DataMember(Name = ""model"")]        public string Model        {            get;            set;        }    }    }</code></pre><p>And Im trying to consume this webservice with Android, this way:</p><pre><code>HttpPost request = new HttpPost(Consts.URL + ""/SaveVehicle"");request.setHeader(""Accept"", ""application/json"");request.setHeader(""Content-type"", ""application/json"");JSONStringer v = new JSONStringer();v.object();v.key(""Vehicles"");v.object();v.key(""plate"").value(plate);v.key(""make"").value(make);v.key(""model"").value(model);v.key(""year"").value(Integer.parseInt(year.toString()));v.endObject();v.endObject();JSONArray arr = new JSONArray();arr.put(v);JSONStringer vehicle = new JSONStringer();vehicle.object();vehicle.key(""vehicles"").value(arr);vehicle.endObject();StringEntity entity = new StringEntity(vehicle.toString());request.setEntity(entity);// Send request to WCF serviceDefaultHttpClient httpClient = new DefaultHttpClient();HttpResponse response = httpClient.execute(request);</code></pre><p>The problem :</p><p>When I'm launching the client, the request is forwarded to the server (I have a breakpoint inside the ""SaveVehicle"" function) properly.</p><p>The problem is with the function's parameter : ""vehicles"" - this object (suppose to) contains only one member - ""Vehicles"", which is of type : List.No matter what I'm sending from the client side, I'm getting null value for this inner container (""Vehicles"").</p><p>I've tried almost everything! I'm sure the problem is somewhere in the JSONStringer area...</p>","501560","","993246","","2013-03-26 08:19:42","2013-03-26 08:19:42","JSON request for WCF objects array parameter","<android><wcf><json>","1","0","","",""
"4367220","1","","","2010-12-06 14:10:34","3","1684","<p>How i can do that? is it possible? </p><p>:</p><p>tabhost.getTabWidget().getChildAt(i) . setTextColor or something else..?</p>","472537","","","","","2013-02-27 11:27:54","Android change tabview's text color not backgroundcolor","<android><tabview>","3","0","2","",""
"4367232","1","","","2010-12-06 14:11:42","0","1672","<p>I have a Timer synchronized in my application and I am able to start it. Now I want to Pause it and then again want it to get Resumed from the position it was Paused by clicking on the Same Pause Button.</p><p>For Timer I am extending the Class CountDownTimer and it has the start() method to start the counter of the Timer but no methods for Pause and Resume respectively.</p><p>I wonder how to do.</p><p>Can anybody please tell me how can I do this now?</p><p>Thanks,david,</p>","422859","","","","","2012-04-07 14:59:05","Pause and Resume the Timer","<android><timer><counter><resume>","0","2","","",""
"4367451","1","4367740","","2010-12-06 14:35:53","0","517","<p>Good Morning All,</p><p>I am currently buidling a media player for Android, and I am having trouble binding my player service to an Activity and pulling data from it.  Bear with me...a lot of code follows.</p><p>My code---</p><p>Interface:</p><pre><code>interface MyInterface{           void playFile( in String file);    void shuffle ();    String getPlayingData();}</code></pre><p>Service:</p><pre><code>public class MyService extends Service {public Context context;    public static String nowPlayingData = null;@Overridepublic IBinder onBind(Intent intent) {    return mBinder;}private final MyInterface.Stub mBinder = new MyInterface.Stub() {    public void playFile(String file) throws DeadObjectException {                 //Song playing method working great!    }    public void shuffle()throws DeadObjectException {               //This method picks a random song and passes it to nowPlayingData string                }    public String getPlayingData() throws RemoteException {        return nowPlayingData;    }};@Overridepublic void onCreate() {    //Toast.makeText(this, ""My Service Created"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onCreate"");    mp.setLooping(false); // Set looping    }@Overridepublic void onDestroy() {    //Toast.makeText(this, ""My Service Stopped"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onDestroy"");    mp.stop();}@Overridepublic void onStart(Intent intent, int startid) {    //Toast.makeText(this, ""My Service Started"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onStart"");}}</code></pre><p>Main Screen Activity, Shuffle Button:</p><p>Service is started in onCreate.  When I click on the shuffle button it uses a method in the service to play a random song, thus setting the nowPlayingData string.</p><pre><code>public class mainMenu extends Activity {private MyInterface mInterface;    private ServiceToken mToken;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Intent startedSvc = new Intent(mainMenu.this, MyService.class);    boolean success = this.bindService(            startedSvc, svcConn, Context.BIND_AUTO_CREATE);          this.startService(startedSvc);    findViewById(R.id.shuffle).setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {                try {        sInterface.shuffle();        } catch (RemoteException e) {        e.printStackTrace();        }        Intent play_screen = new Intent(MyPlayer.getContext(), NowPlaying.class);                               startActivity(play_screen);            }</code></pre><p>Player Activity:</p><p>I want to bind to the service, and pull nowPlayingData over using the interfaces getPlayingData method.</p><pre><code>public class NowPlaying extends Activity implements OnClickListener {public static String nowPlayingData = null;MyInterface mInterface;boolean isConnected = false;RemoteServiceConnection conn = null;@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.now_playing);    setVolumeControlStream(AudioManager.STREAM_MUSIC);    Log.i(""Log"", ""Player Loaded"");    bindService();    getData();    fillView();             }   public void fillView(){          //This method needs the nowPlayingData string to update the view                }class RemoteServiceConnection implements ServiceConnection {      public void onServiceConnected(ComponentName className,      IBinder boundService ) {mInterface = MyInterface.Stub.asInterface((IBinder)boundService);isConnected = true;            Log.d(""Now Playing"", ""Service Connected"" );                   }      public void onServiceDisconnected(ComponentName className) {            sInterface = null;       // updateServiceStatus();            isConnected = false;        Log.d( getClass().getSimpleName(), ""onServiceDisconnected"" );        getData();      }};private void bindService() {if(conn == null) {    conn = new RemoteServiceConnection();    Intent i = new Intent();    i.setClassName(""com.musicplayer.MyPlayer"", ""com.musicplayer.MyPlayer.MyService"");    bindService(i, conn, Context.BIND_AUTO_CREATE);    Log.d( getClass().getSimpleName(), ""bindService()"" ); } else {   Toast.makeText(NowPlaying.this, ""Cannot bind - service already bound"", Toast.LENGTH_SHORT).show(); }}private void getData() { if(conn == null) {     Log.i(""getData"", ""No Connection""); } else {    try {       String data = mInterface.getPlayingData();         Log.i(""Data Recieved"", data);       Log.d( getClass().getSimpleName(), ""invokeService()"" );    } catch (RemoteException re) {       Log.e( getClass().getSimpleName(), ""RemoteException"" );    }  } }   }</code></pre><p>I have been studying many examples online, and perhaps my mish-mash of attempts has caused this to not work.  My code works all the way through to binding the service, but OnServiceConnected is never called, and conn remains null.</p><p>Any help you guys can provide is greatly appreciated.</p><p>Thanks,Josh</p>","453305","","429063","","2010-12-06 15:59:29","2010-12-06 15:59:29","Binding to Service Trouble","<android><service>","1","0","","",""
"4367572","1","","","2010-12-06 14:48:34","0","365","<p>I'm making a UI designed as shown below. View 1 is an image, when showing different pictures, its size will be different. The sizes of view 2 and view 3 are depend on View 1. How to define the xml file to make this happen?</p><p>ps: The design came from client so I can't change it.</p><p><img src=""http://i.stack.imgur.com/36haA.png"" alt=""alt text""></p>","423989","","423989","","2010-12-06 14:55:14","2010-12-07 11:49:53","How to make a view's size depend on another view's size?","<android><user-interface>","2","0","2","",""
"4367659","1","","","2010-12-06 14:57:44","0","143","<p>when motorola milestone will get android 2.2?</p>","105261","","","","","2010-12-06 15:00:38","when motorola milestone will get android 2.2?","<android>","1","1","","2010-12-06 15:29:02",""
"4367770","1","4368496","","2010-12-06 15:10:00","1","352","<p>I'm not talking about restoring application state (using Bundle or configuration change or even SharedPreferences) i'm talking about the fact that i have a certain task, that is a base activity: HomeScreenActivity and from there i can have a series of activities opened for the user's flow.I want in case of application's death or user killed his own session to restore the whole task, not just one activity, i mean to restore the whole activity stack i had before the application was killed. if the user was in my billing screen and left off my app i want to take him back to that screen, but i want that if he'll press back he'll go back to my search screen or filtering screen, whatever was there before he left off.</p><p>I have no problem saving the activity's order in sharedPreferences and know the order once i start my home screen, but i wonder if there's a way to tel landroid to start an activity, which sould only enter the task's stack and not call the activity's onCreate method unless i actually get to it(with back key).</p>","312288","","","","","2010-12-06 16:17:34","restoring the task to it's last state in android","<android><state><task><restore>","1","1","","",""
"4367855","1","4368448","","2010-12-06 15:18:56","8","5299","<p>Hi i'm new android. i'm working through the samples and have an error when running the HelloGridView app. Eclipse is giving the following error. Has anyone had the following error? Thanks.</p><p>[2010-12-06 14:38:16 - HelloGridView] trouble processing ""javax/net/ServerSocketFactory.class"":[2010-12-06 14:38:16 - HelloGridView] Attempt to include a core class (java.* or javax.*) in something otherthan a core library. It is likely that you have attempted to includein an application the core library (or a part thereof) from a desktopvirtual machine. This will most assuredly not work. At a minimum, itjeopardizes the compatibility of your app with future versions of theplatform. 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 machine distribution,as opposed to compiling an application -- then use the""--core-library"" option to suppress this error message.</p><p>If you go ahead and use ""--core-library"" but are in fact building anapplication, then be forewarned that your application will still failto build or run, at some point. Please be prepared for angry customerswho find, for example, that your application ceases to function oncethey upgrade their operating system. You will be to blame for thisproblem.</p><p>If you are legitimately using some code that happens to be in a corepackage, then the easiest safe alternative you have is to repackagethat code. That is, move the classes in question into your own packagenamespace. This means that they will never be in conflict with coresystem classes. If you find that you cannot do this, then that is anindication that the path you are on will ultimately lead to pain,suffering, grief, and lamentation.</p><p>[2010-12-06 14:38:16 - HelloGridView] 1 error; aborting[2010-12-06 14:38:16 - HelloGridView] Conversion to Dalvik format failed with error 1</p>","532462","","","","","2013-04-05 14:21:35","Attempt to include a core class (java.* or javax.*) in something other than a core library","<android>","7","2","1","",""
"4367923","1","4439555","","2010-12-06 15:26:58","5","3143","<p>When hitting the ""debug""-button in eclipse my App gets signed by a debug key form android which is stored in the file ""debug.keystore"".</p><p>Now I am implementing the <a href=""https://github.com/facebook/facebook-android-sdk"">Facebook SDK</a> which forces me to use a signed app for the Single SignOn feature. That way I need to generate the hash of my companies keystore and store the one in our facebook developer account. </p><p>I know how to sign an app through the wizard in Eclipse (over the AndroidManifest.xml). How to debug such a signed app?</p><p>Can I change the debug key somehow and set up our companies key as debug key? Or how should I go? Right now I can get FB working only by signing and installing my app on a device. I already tried to generate a hash of the debug key with no luck...</p>","433718","","","","","2013-03-21 23:18:28","Debug a self signed android app? (Need it for facebook integration)","<android><debugging><facebook><signing>","2","4","3","",""
"4367934","1","4368006","","2010-12-06 15:27:39","1","2152","<p>I have to do the drag navigation in Android. I have added a code for the drag screen navigation. Which is not as smooth as Android default. The following code gives the drag navigation from left to right and right to left but the problem is when you tap at right and then to left then too the screen navigates. What is the right way to achieve it. Do I need to work with same code with calculating the X values?<br>Below the code.</p><pre><code>// On Drag Navigationpublic boolean onTouch(View arg0, MotionEvent arg1) {    // Get the action that was done on this touch event    switch (arg1.getAction())    {        case MotionEvent.ACTION_DOWN:        {            // store the X value when the user's finger was pressed down            downXValue = arg1.getX();            break;        }        case MotionEvent.ACTION_UP:        {            // Get the X value when the user released his/her finger            float currentX = arg1.getX();                        // Going Backward: pushing stuff to the right            if (downXValue &lt; currentX)            {                Intent lIntent = new Intent(getApplicationContext(), previousScreen.class);                startActivity(lIntent);                finish();            }            // Going Forward: pushing stuff to the left            if (downXValue &gt; currentX)            {                Intent lIntent = new Intent(getApplicationContext(), nextScreen.class);                startActivity(lIntent);                finish();            }            break;        }    }}</code></pre><p>Please specify the right way of achieving it.</p><p>Thanks in advance</p>","28557","","436938","","2012-02-17 13:04:44","2012-02-17 13:04:44","Android - Drag screen navigation","<android><android-widget><android-layout><drag>","2","0","","",""
"4367936","1","4368197","","2010-12-06 15:27:43","1","950","<p>I have an app that goes out to a website to grab XML for processing.  This process is in a separate thread and works fine when I have 3G or WiFi available.  I also have code that checks signal before actually running the thread so it won't attempt with no connectivity.</p><p>During my testing I walked into a building that blocked all signal so the proces started while I was outside and had signal but when I went inside the signal dropped and my Progress dialog just kept runnnig, I had to manually shut the program down to get it to recover.</p><p>Is there a good way to deal with this without requiring the user to manually shut down the app if this situation happens?</p>","351112","","","","","2010-12-06 15:53:12","How can you stop a progress dialog running when network access drops?","<android>","1","0","","",""
"4367961","1","4368090","","2010-12-06 15:30:48","1","2522","<p>For a particular Image say on blue background,  I can get its Width and Height in android. I can display it on screen using ImageView. Even If I keep the background of Image as transparent I can display it on screen. But still if I try to find out the width or height of image programmatically , I still get the same as in previous step. What I wanted to achieve Is there any way through which I can get the exact height or width of image minus transparent background.</p><p>I want to do this because I 'm trying to implement a drag/move gesture. But now the Image size is more due to transparent background I can only move it to few portion only. </p><p>Probably I 'm new to whole game that's why not getting right words to express me. But hope someone will understand. </p><p>Thanks      </p>","218665","","","","","2010-12-06 15:44:57","Size of Image in Android","<android><sdk><android-layout>","1","0","","",""
"4367987","1","4368850","","2010-12-06 15:33:39","4","405","<p>I just published my first application to Google Marketplace and received the information, that the app crashed - I got two stacktraces, one of them for example:</p><pre><code>android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@45681318 is not valid; is your activity running?   at android.view.ViewRoot.setView(ViewRoot.java:468)   at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)   at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)   at android.view.Window$LocalWindowManager.addView(Window.java:424)   at android.app.Dialog.show(Dialog.java:239)   at abc.de.f.MyTask.onPreExecute(MyTask.java:52)</code></pre><p>There's only one possibility to get to method onPreExecute() in MyTask - and it's not crashing in the emulator or on my physical device. But it seems to crash sometimes ""out in the wild"".</p><p>What would your first steps be to get to the reason?</p><p>Thanks A LOT,</p><p>Stefan </p><p>EDIT:</p><pre><code>@Overrideprotected void onPreExecute() {  this.dialog.setMessage(((Activity) listener).getString(R.string.daten_werden_geladen));  this.dialog.show();}</code></pre><p>this.dialog.setMessage works, but show() doesn't... :(</p>","27404","","27404","","2010-12-07 10:21:51","2012-03-01 10:36:54","Android: two error only sometimes/on some devices","<android><crash>","4","0","","",""
"4368047","1","","","2010-12-06 15:40:05","25","24111","<p>My server application exposes a RESTful web service using JAX-RS (Jersey Implementation). What is the best way to invoke this service (other than using Apache HttpClient)? I was wondering whether the REST Client APIs from Jersey, Restlet, RESTeasy and other frameworks work on Android.</p><p>Thanks,Theo</p>","461769","","","","","2012-10-11 13:31:05","Java REST client API for Android","<java><android><web-services><rest>","5","4","16","2012-04-18 13:57:53",""
"4368127","1","4368202","","2010-12-06 15:47:58","0","1179","<p>It'd be nice to have the ""Swiss Army knife"" of BusyBox on my emulator.  It would also be nice to have full root access.  Does anyone have any experience doing this?  I'm not familiar with qemu; is this even possible?</p><p><strong>Update:</strong> The emulator has root by default (accessed via the <code>adb shell</code> command).  Does anyone know where I can easily obtain a pre-built busybox binary?</p>","213525","","213525","","2010-12-06 16:49:53","2012-03-28 16:02:26","Is it possible to gain root and/or install BusyBox on the Android Emulator?","<android><android-emulator><root><qemu><busybox>","1","0","1","",""
"4368238","1","","","2010-12-06 15:55:57","-2","114","<pre><code>package com.android.example.spinner.test;import com.android.example.spinner.SpinnerActivity;import android.test.ActivityInstrumentationTestCase2;public class SpinnerActivityTest extends  ActivityInstrumentationTestCase2&lt;SpinnerActivity&gt; {}</code></pre>","176608","","227267","","2010-12-06 15:57:40","2010-12-06 16:00:26","Why are superclass The superclass is parameterized in JAVA","<android><unit-testing>","1","1","","2010-12-08 02:12:21",""
"4368367","1","","","2010-12-06 16:07:44","0","592","<p>Is there a way it can be controlled to update the display settings?</p><p>There's an event, <code>android.intent.action.SCREEN_ON</code>, that triggers the status of the display, but this is a protected Intent that can only be sent by the system.</p><p>Help please!</p>","527317","","","","","2010-12-06 16:07:44","Update display settings in Android","<android><settings>","0","2","","",""
"4368393","1","4368530","","2010-12-06 16:10:00","0","115","<p>I need to know how could I find if there are any access points available.</p>","304866","","265570","","2011-07-02 07:25:38","2011-07-02 07:25:38","Check Access points","<android>","2","0","1","",""
"4368564","1","","","2010-12-06 16:24:42","4","5057","<p>For the Android API version 2.1 and higher, we can use context:</p><pre><code>getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_AUTOFOCUS)</code></pre><p>But before version 2.1, how can we perform the same operation? Is there anything like this that does not involve invoking <code>Camera.open</code> and then <code>getParameters</code>?</p>","441316","","121493","","2010-12-06 16:31:30","2011-02-24 10:13:12","Android: Check whether camera supports auto-focus?","<android><camera><autofocus>","2","0","3","",""
"4368662","1","4368769","","2010-12-06 16:33:04","0","521","<p>In my android application there is a number of operations that the user can do (~50). For each of these operations, I will write a small amount of text explaining how they work ('help'). The majority of these operations are self explanatory, so the user will rarely have to read the 'help'.</p><p>There are two methods that I could think of for displaying the help:</p><ul><li>When the help is needed, display the help for all of the operations and have the view automatically scroll to the location of the help required</li><li>Just display the help for the operation required</li></ul><p>Is there a normal way of doing this?</p><p>I am already storing a list of the operations in a SQLite database. Should I add the 'help' in a new column or should I store it in a flat text file?</p>","406813","","","","","2010-12-06 16:42:14","Android flat file vs SQLite for storing help","<android><sqlite><flat-file>","1","0","","",""
"4368864","1","4369511","","2010-12-06 16:53:48","0","2007","<p>I'm using SQLite DB in my Android Application.</p><p>There are numbers and strings in a column. Something like:</p><p>3, 1, 2, 6 / 6A, X, 3A, 10, 12, XY, 44, ZW</p><p>If I select values of this column and sort them, I get:</p><p>1, 10, 12, 2, 3, 3A, 44, 6 / 6A, X, XY, ZW</p><p>Is there any possibility in <strong>SQLite</strong> to sort these values so, that I would get:</p><p>1, 2, 3, 3A, 6 / 6A, 10, 12, 44, X, XY, ZW</p><p>Thank you,</p><p>Mur</p>","408780","","","","","2010-12-06 18:27:15","SQLite sorting question","<android><sqlite><sorting>","2","0","","",""
"4369012","1","","","2010-12-06 17:09:39","3","2316","<p>I try to write an Activity as an alternative to google maps.It works perfect when calling it by an google-maps url:</p><pre><code>&lt;activity android:name=""DataActivity"" android:label=""@string/app_name""&gt;  &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;action android:name=""android.intent.action.VIEW"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;    &lt;data android:scheme=""http"" android:host=""maps.google.com"" /&gt;  &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>But for some reason it does not shown up when starting an Intent with a ""geo""-URI.</p><p>My Activity:</p><pre><code>&lt;activity android:name=""DataActivity"" android:label=""@string/app_name""&gt;  &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;action android:name=""android.intent.action.VIEW"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;    &lt;data android:scheme=""geo"" android:host=""*"" /&gt;  &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>The Caller (This starts Google Maps without the option to start my App):</p><pre><code>final String uri = ""geo:"" + lat + "","" + lng;startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri)));</code></pre>","502955","","","","","2010-12-08 22:12:22","Android Intent-filter for GEO-URI","<android><intentfilter>","1","0","2","",""
"4369218","1","4369240","","2010-12-06 17:35:47","2","1174","<p>I have a CSV file in the <strong>assets</strong> folder with more than 10000 lines of data. I want to insert this data into a SQLite database when the database is created. I cannot include a database because it is a very generic application and the model demands a CSV file instead. I don't want to read all 10000 lines of data and insert it from the memory in one stretch. How do I accomplish the task effectively and efficiently?</p>","421372","","","","","2010-12-06 17:45:51","Android reading a large file","<java><android><database><csv>","3","0","1","",""
"4369261","1","","","2010-12-06 17:41:17","0","548","<p>I'm using the Android 2.2 SDK emulator to test out the Scripting Layer for Android and have one annoyance. When you launch a Python interpreter and start to type code it appears that the parentheses key isn't mapped properly. When I hit the ( key on the PC keyboard I get ^[[20~ instead. What am I missing?</p>","532656","","","","","2010-12-25 21:27:24","Android Emulator Keyboard","<python><android><sl4a>","1","2","","",""
"4369325","1","4369787","","2010-12-06 17:49:12","1","1018","<p>I'm working on a MP3 application in which I'd like to index the files on my SDCard. What is the best way to do it?</p><p><strong>My Idea</strong>. Search for files when the application is started for the first time and register a broadcast receiver for the SDCard state change intents and search for the files whenever the intent is broadcasted.</p><p>But in this case the ANR would show up if my broadcast receiver doesn't return within 10 seconds.</p><p>Looking for better and failsafe ideas. Thanks.</p>","421372","","","","","2010-12-06 18:42:36","Android finding files on the SDCard","<java><android><file-search>","2","0","","",""
"4369349","1","","","2010-12-06 17:52:40","0","467","<p>I have a Layout with a <code>TextView</code>. The <code>TextView</code> has </p><pre><code>android:autoLink=""all"" </code></pre><p>How can I achieve the following:</p><ul><li>if user clicks a link, an action associated with that link is executed (i.e., click on phone number invokes dialer, etc.)</li><li>if user clicks anywhere else within Layout boundaries, Layout's onClick is called.</li></ul><p>Thanks.</p>","367677","","","","","2010-12-08 20:29:59","passing click event to underlying view","<android><gui><textview><android-layout>","1","0","0","",""
"4369437","1","","","2010-12-06 18:00:45","0","866","<p>I followed the instructions in the following post to make active links in a textview:</p><p><a href=""http://stackoverflow.com/questions/2734270/how-do-i-make-links-in-a-textview-clickable"">How do I make links in a TextView clickable?</a></p><p>What I'd like to figure it out is if there's a way to alter the ""a href"" in the string resource to link to another screen in my app, rather than a website. I have a number of links in a single block of text, and each one should link to a different screen in the app. I can't find this information anywhere.</p><p>Thanks.</p>","503185","","","","","2010-12-10 14:16:35","How to navigate to another screen using a TextView link - Android","<java><android>","1","1","","",""
"4369513","1","4369532","","2010-12-06 18:09:56","3","1669","<p>I would like to perform some action on phone start up. Is there simply an intent that I can use a Receiver with? or is there more to it? </p><p>Thanks, Jason</p>","407133","","","","","2011-05-28 01:33:26","How do I make my app start on phone startup?","<android>","1","0","1","",""
"4369537","1","","","2010-12-06 18:13:03","24","51046","<p>I want to update my UI from a Thread which updates a Progressbar. Unfortunately, when updating the progressbar's drawable from the ""runnable"" the progressbar disappears! Changing the progressbars's drawable in <code>onCreate()</code> on the otherside works!</p><p>Any Suggestions?</p><pre><code>public void onCreate(Bundle savedInstanceState) {    res = getResources();    super.onCreate(savedInstanceState);    setContentView(R.layout.gameone);    pB.setProgressDrawable(getResources().getDrawable(R.drawable.green)); //**Works**/    handler.postDelayed(runnable, 1);       }private Runnable runnable = new Runnable() {    public void run() {          runOnUiThread(new Runnable() {             public void run()             {                 //* The Complete ProgressBar does not appear**/                                         pB.setProgressDrawable(getResources().getDrawable(R.drawable.green));             }         });     }}</code></pre>","496675","","404469","","2012-01-26 12:20:39","2013-10-01 12:41:23","Update UI from Thread","<android><multithreading><user-interface>","7","0","9","",""
"4369613","1","4369834","","2010-12-06 18:21:52","2","474","<p>In my application I need to delete file with sensitive information. For that I'm writing to file some garbage generated by random bytes and then deleting using File.delete() method, like here:</p><pre><code>long size=file.length();Random r=new SecureRandom();OutputStream os=new BufferedOutputStream(new FileOutputStream(file));while(size &gt; 0){    os.write(r.nextInt());    size--;}os.close();file.delete();</code></pre><p>So the question is: does this method guarantee that if someone will undelete file one will find only garbage instead of real content? I'm not completely sure that writing to file would guarantee that the same sectors in underline Linux filesystem will be overwritten... Please give a hint - what to do - to be sure that file content is destroyed.</p>","472270","","","","","2013-01-24 11:53:36","Deleting file (including content cleaning)","<android><linux><file><file-io><filesystems>","2","0","1","",""
"4369674","1","4369729","","2010-12-06 18:30:08","6","1394","<p>Just looking through the newly released <a href=""http://developer.android.com/sdk/android-2.3.html"" rel=""nofollow"">Gingerbread documents</a> and I see they've added some support for Near Field Communication (as expected).</p><p>However, it looks to me like its receive only (you can receive NFC communications and messages but you can't send them). Is that everyone's interpretation? Haven't had a chance to do a deep dive here, but that's what it looked like to me. Just 3 classes added and I don't see a send() method anywhere.</p><p>So receive only is Ok, but then that would leave us with cell,wi-fi,bluetooth if we need to communicate back. Am I missing something here?</p>","483163","","","","","2011-06-28 13:50:45","Android Gingerbread: NFC support - Receive Only?","<android><nfc>","4","0","","",""
"4369794","1","4370680","","2010-12-06 18:42:58","3","3151","<p>When I nest a TabActivity inside another TabActivity, startActivityForResult fails when called from the inner tabactivity. The new activity starts, but I get an error message:</p><pre><code>startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent </code></pre><p>and onActivityResult is never called when the activity returns.</p><p>Code to reproduce found below. Four classes, MyActivity is the main class with two tabs, NestedTab has three tabs, all tabs containt SimpleActivity with a button that calls SimpleDialog:</p><pre><code>public class MyActivity extends TabActivity {/** * Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // Populate a couple of tabs    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, SimpleActivity.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""simple"").setIndicator(""Simple"")                  .setContent(intent);    tabHost.addTab(spec);    // Repeat    intent = new Intent().setClass(this, NestedTab.class);    spec = tabHost.newTabSpec(""nested"").setIndicator(""Nested tabs"")                  .setContent(intent);    tabHost.addTab(spec); }}public class NestedTab extends TabActivity {/** * Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    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(this, SimpleActivity.class);    String tabs[]= {""One"", ""Two"", ""Three""};    for (String s : tabs)    {        intent.putExtra(""name"", s);        spec = tabHost.newTabSpec(s).setIndicator(s).setContent(intent);        tabHost.addTab(spec);    }}public class SimpleActivity extends Activity {Button mBtn;Context mCtx;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.simple);    mCtx = this;    mBtn = (Button) findViewById(R.id.btn);     mBtn.setOnClickListener(new View.OnClickListener() {         public void onClick(View view) {             //To change body of implemented methods use File | Settings | File Templates.             startActivityForResult(new Intent(mCtx, SimpleDisplay.class), 1);         }     });}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    //To change body of overridden methods use File | Settings | File Templates.    Toast.makeText(this, ""Activity finished"", Toast.LENGTH_LONG).show();}}public class SimpleDisplay extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TextView text = new TextView(this);    text.setText(""Just hit back button"");    setContentView(text);}}</code></pre><p>Not able to paste the xml files but main is identical to step 4: <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a></p><p>and simple is just a textview and a button.</p><p>Any help appreciated.</p>","247222","","","","","2010-12-07 03:35:01","Android: Nested tabactivities doesn't work with startActivityForResult","<android><tabs><nested>","1","2","1","",""
"4369848","1","4370111","","2010-12-06 18:49:37","3","1608","<p>I have a question with a general design implementation. Hope anyone more skilled than me helps me.</p><p>I want to do an application based on an android client and a java server. Local wifi transmission, no 3G.</p><p>Basically, the client must connect to the server and request a file to download using a code.</p><p>How can I do that?</p><p>Things I know:</p><ul><li>I must create a background thread in the client to create a file in the SD card and update a progress bar using a Handler to communicate with the UI thread.<br/><br/></li><li>The server must be multithread and non-blocking.<br/><br/></li><li>The file is a binary file like a mp3 audio. So the server has to:<br/><br/><ol><li>Send information about the file: name and total length.</li><li>Open the file, read and send bytes while it does not reach the end.<br/><br/></li></ol></li><li>The client has to:<br/><br/><ol><li>Receive the information about the file and create an empty file.</li><li>Read bytes and dump them into the empty file. Update progress bar.</li><li>When all bytes are recieved close the file.</li></ol></li></ul><p>I have knowledge implementing a client and server in C (very awful) but I am beginning with a real client-server application done in java.</p><p>Questions:</p><ul><li><strong>How can I download a binary file like an mp3 from a server to a client?</strong><br/><br/></li><li><strong>Where I have to put my server application? I supose that I must create a jar, save it on a folder and execute it at PC start-up, right?</strong></li></ul><p>Thanks!</p>","458093","","","","","2010-12-06 19:23:27","How to download a file from a server","<java><android><multithreading>","1","0","1","",""
"4369869","1","","","2010-12-06 18:52:09","0","700","<p>I'm having an issue with building my android project. It gives me the error ""Error generating final archive: Failed to add /Users/r2q2/Dropbox/workspace/redtxt/src</p>","531339","","","","","2010-12-06 18:52:09","How to fix error""Error generating final archive: Failed to add folder""","<android>","0","2","","",""
"4370048","1","4370092","","2010-12-06 19:15:55","0","1425","<p>I am trying to write a simple android application to help interpret some lab results.</p><pre>package org.android.bloodgas;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.TextView;import android.widget.Button;public class pinit extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button interpretButton = (Button) findViewById(R.id.Interpret);        //interpretButton.setOnClickListener(this);        View.OnClickListener myhandler = new View.OnClickListener() {            @Override            public void onClick(View v) {                    float inpPH, inpPO2, inpPCO2, inpHCO3, inpBE;                    inpPH = Float.valueOf(findViewById(R.id.InpPH).toString()).floatValue();                    inpPO2 = Float.valueOf(findViewById(R.id.InpO2).toString()).floatValue();                    inpPCO2 = Float.valueOf(findViewById(R.id.InpCO2).toString()).floatValue();                    inpHCO3 = Float.valueOf(findViewById(R.id.InpHCO3).toString()).floatValue();                    inpBE = Float.valueOf(findViewById(R.id.InpBE).toString()).floatValue();                    TextView interpretation;                    interpretation = (TextView) findViewById(R.id.Interpretation);                    String sResult = null;                    if (inpPH &lt; 7.35) {                        // Acidosis                        sResult.concat(""Acidosis. "");                    } else {                        if (inpPH &gt; 7.45) {                            // Alkalosis                            sResult.concat(""Alkalosis. "");                        } else {                            // Normal acidity, 7.35-7.45                            sResult.concat(""Normal pH. "");                        }                    }                    interpretation.setText(sResult);            }        };        interpretButton.setOnClickListener(myhandler);    }}</pre><p>It does compile and run but when I press on the ""interpret"" button it simply says The application ... has stopped unexpectedly. Please try again. (Force Close).</p><p>I am totally new to android programming... So I guess this would be some very stupid mistake I have made but please help. Thanks.</p><p>update: changed the code to this (minus the logic portion while i will complete later)but still hangs when press on the button.</p><pre>package org.android.bloodgas;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.EditText;import android.widget.Button;public class Pinit extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button interpretButton = (Button) findViewById(R.id.Interpret);        View.OnClickListener myhandler = new View.OnClickListener() {            @Override            public void onClick(View v) {                    float inpPH, inpPO2, inpPCO2, inpHCO3, inpBE;                    inpPH = Float.valueOf(((EditText) Pinit.this.findViewById(R.id.InpPH)).toString()).floatValue();                    inpPO2 = Float.valueOf(((EditText) Pinit.this.findViewById(R.id.InpO2)).toString()).floatValue();                    inpPCO2 = Float.valueOf(((EditText) Pinit.this.findViewById(R.id.InpCO2)).toString()).floatValue();                    inpHCO3 = Float.valueOf(((EditText) Pinit.this.findViewById(R.id.InpHCO3)).toString()).floatValue();                    inpBE = Float.valueOf(((EditText) Pinit.this.findViewById(R.id.InpBE)).toString()).floatValue();                    // ...            }        };        interpretButton.setOnClickListener(myhandler);    }}</pre><p>logcat:</p><pre>12-07 03:37:02.231: WARN/dalvikvm(1074): threadid=1: thread exiting with uncaught exception (group=0x4001d800)12-07 03:37:02.332: ERROR/AndroidRuntime(1074): FATAL EXCEPTION: main12-07 03:37:02.332: ERROR/AndroidRuntime(1074): java.lang.NumberFormatException: android.widget.EditText@44f47e6012-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at org.apache.harmony.luni.util.FloatingPointParser.initialParse(FloatingPointParser.java:130)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(FloatingPointParser.java:319)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at java.lang.Float.parseFloat(Float.java:291)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at java.lang.Float.valueOf(Float.java:330)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at org.android.bloodgas.Pinit$1.onClick(Pinit.java:22)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at android.view.View.performClick(View.java:2408)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at android.view.View$PerformClick.run(View.java:8816)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at android.os.Handler.handleCallback(Handler.java:587)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at android.os.Handler.dispatchMessage(Handler.java:92)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at android.os.Looper.loop(Looper.java:123)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at java.lang.reflect.Method.invokeNative(Native Method)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at java.lang.reflect.Method.invoke(Method.java:521)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-07 03:37:02.332: ERROR/AndroidRuntime(1074):     at dalvik.system.NativeStart.main(Native Method)12-07 03:37:02.382: WARN/ActivityManager(68):   Force finishing activity org.android.bloodgas/.Pinit12-07 03:37:02.952: WARN/ActivityManager(68): Activity pause timeout for HistoryRecord{44fbfc90 org.android.bloodgas/.Pinit}12-07 03:37:07.761: INFO/Process(1074): Sending signal. PID: 1074 SIG: 912-07 03:37:09.852: INFO/ActivityManager(68): Process org.android.bloodgas (pid 1074) has died.12-07 03:37:09.862: INFO/WindowManager(68): WIN DEATH: Window{44fa71e0 org.android.bloodgas/org.android.bloodgas.Pinit paused=false}12-07 03:37:15.931: WARN/ActivityManager(68): Activity destroy timeout for HistoryRecord{44fbfc90 org.android.bloodgas/.Pinit}</pre>","360285","","360285","","2010-12-06 19:39:18","2010-12-06 20:14:34","How to handle onClickListener in android?","<android><nullpointerexception>","2","2","","",""
"4370205","1","","","2010-12-06 19:35:49","0","1054","<p>My fault for being impatient but I've just installed Gingerbread SDK and the new ADT plugin for Eclipse on Eclipse 3.5Now when I run an existing Google maps project which has worked fine on 2.2, I see no map displayed when running in Eclipse, just like as if I had the wrong debug maps API key. (I just get the grey screen and the Google logo bottom left.)</p><p>I have the build path using the old Google APIs [Android 2.1 update1] just like it was before and the target AVD is Google API level 7 as before. (I also created a new Google API level 7 and that doesn't work either).</p><p>It seems that something in the backward compatibility is broken somewhere. The only thing in logcat which <strong><em>may</em></strong> be of significance is:</p><pre><code>12-06 19:10:31.095: ERROR/ActivityThread(231): Failed to find provider info for com.google.settings</code></pre><p>where 231 is the PID of my application.</p><p>All suggestions will be gratefully received</p><p>(I have checked with Google that my debug API key is still OK)</p><p>(I tried to add a Gingerbread tag to this question, but don't have enough rep. Perhaps someone would like to add one?)</p><p>For Octavian:</p><p>part of manifest.xml </p><pre><code>&lt;uses-sdk android:minSdkVersion=""4"" /&gt;</code></pre><p>default.properties</p><pre><code># This file is automatically generated by Android Tools.# Do not modify this file -- YOUR CHANGES WILL BE ERASED!# # This file must be checked in Version Control Systems.# # To customize properties used by the Ant build system use,# ""build.properties"", and override values to adapt the script to your# project structure.# Indicates whether an apk should be generated for each density.split.density=false# Project target.target=Google Inc.:Google APIs:7apk-configurations=</code></pre><p>I imported the sample MapsDemo project from the addon, pasted my API key in the xml and see this:</p><pre><code>12-06 21:55:16.722: ERROR/MapActivity(492): Couldn't get connection factory client</code></pre><p>in the logcat (492 is the PID of the sample app, I still get just the grey screen - no map)I wonder if it's relevant?</p><p><strong>UPDATE</strong></p><p>It's not just the maps application. <strong>Every single application that requires network connectivity on every AVD (newly created or pre-existing) fails to connect.</strong> The built in browser can't find google. The build in app called ""maps"" comes up with ""loading"", then ""Network failure - This application requires a working data connection"".</p><p>What have I done? Please suggest how can I fix it?</p>","440010","","19750","","2010-12-07 05:28:53","2010-12-07 05:28:53","Upgraded to SDK2.3, now maps won't display","<android><android-sdk-2.3>","1","7","1","",""
"4370371","1","","","2010-12-06 19:54:44","1","979","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/919153/what-is-androids-icicle-parameter"">What is android&#39;s icicle parameter?</a>  </p></blockquote><p>I've seen the term ""frozen icicle"" used in several places in the Android API documentation, but nowhere have I ever seen it <i>explained</i>. What is a frozen icicle? I had at first thought that it meant the triangles used when selecting text, but now I wonder if it has something to do with saved instance state.</p>","337456","","","","","2010-12-06 19:56:39","What is a frozen icicle?","<android>","1","0","","2010-12-06 19:59:16",""
"4370430","1","","","2010-12-06 20:02:41","-2","1017","<p>I want to add item in the context menu of Power options, appear after long key press of Power.I have tried to capture event onkeyLongpress but its not working.</p>","532774","","","","","2012-11-29 21:39:09","Android Emulator Power Key Long Press Event","<android><keyevent>","2","1","","",""
"4370549","1","","","2010-12-06 20:17:46","1","347","<p>I'm trying to create a layout in android with program guide data represented by clickable custom shapes/buttons. Here is the project I'm extending on: <a href=""http://remotepotatoforums.fatattitude.com/viewtopic.php?f=14&amp;t=51"" rel=""nofollow"">http://remotepotatoforums.fatattitude.com/viewtopic.php?f=14&amp;t=51</a> (second image).I'm fetching the guide data at runttime with a http request. I'm not sure what's the best way to go about this. Any help will be greatly appreciated.</p>","532794","","21234","","2010-12-11 11:18:57","2010-12-11 11:18:57","Android: Custom layout question","<android><view><android-layout>","0","2","","",""
"4370612","1","","","2010-12-06 20:24:06","2","5372","<p>How do you update an <code>ArrayAdapter</code> without losing the scrolling position?</p><p>This is how I currently do it. I create an update method in the <code>ArrayAdapter</code> subclass which does the following:</p><pre><code>public void update(List&lt;MyEntity&gt; entities) {    for (MyEntity entity : entities) {        int position = this.getPosition(entity);        if (position &gt;= 0) {            final MyEntity outdateEntity = this.getItem(position);            this.insert(entity, position);            this.remove(outdateEntity);        } else {            this.insert(entity, 0);                 }    }}public int getPosition(MyEntity updatedEntity) {    for (int i = 0; i &lt; this.getCount(); i++) {        if (this.getItem(i).getId() == updatedEntity.getId()) {            return i;        }    }    return -1;}</code></pre><p>However, this seems awfully inefficient and error-prone. Is there a better way?</p>","143378","","","","","2011-01-29 11:02:11","Update ArrayAdapter in Android","<android><android-arrayadapter>","1","0","","",""
"4370668","1","4370695","","2010-12-06 20:32:17","5","2344","<p>I am using EGit in eclipse to provide Git support for an Android project I am working on. The problem is that after committing my project to the local repository I realized that the ""gen"" folder was not getting committed. As a result of this when I try to open the project on another machine after getting the latest source from the Git repository I keep getting the following error:</p><blockquote>  <p>ERROR: Unable to open class file D:\CodeRep\POCs\Java\Android\Sudoku\gen\org\blah\example\R.java: No such file or directory</p></blockquote><p>Why can't I commit the ""gen"" folder to Git from Eclipse ? Everything gets committed just fine so I can push it to the remote repository.</p>","313197","","","","","2010-12-06 20:36:41","Cannot commit android ""gen"" folder to Git","<android><eclipse><git>","3","2","","",""
"4370703","1","4371034","","2010-12-06 20:37:06","0","1164","<p>I am writing my first application, and I am also trying to incorporate a database, and I am really struggling with it. What I am trying to do is have multiple spinners, and those spinners get their data from a database. Each spinner will do a different query.</p><p>So far this is what I have: DBUtility</p><pre><code>import android.content.Context;</code></pre><p>import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteDatabase.CursorFactory;import android.widget.SimpleCursorAdapter;</p><p>public class DbUtility {</p><pre><code>static final String DB_NAME=""food"";static final String BEEF_TABLE=""beef"";static final String CHICKEN_TABLE=""chicken"";SQLiteDatabase db=null; Context context;public static class DatabaseHelper extends SQLiteOpenHelper{    public DatabaseHelper(Context context, String name, CursorFactory factory, int version)     {        super(context, name, factory, version);        // TODO Auto-generated constructor stub    }    @Override    public void onCreate(SQLiteDatabase db)     {                   db.execSQL(""CREATE TABLE IF NOT EXISTS ""+BEEF_TABLE+"" (_id INT PRIMARY KEY, cookTime INT PRIMARY KEY ,name VARCHAR);"");        db.execSQL(""INSERT INTO ""+BEEF_TABLE+"" values(5000,'Skirt Steak');"");        db.execSQL(""INSERT INTO ""+BEEF_TABLE+"" values(10000,'Flank Steak');"");        db.execSQL(""INSERT INTO ""+BEEF_TABLE+"" values(15000,'Filet Mignon');"");        db.execSQL(""CREATE TABLE IF NOT EXISTS ""+CHICKEN_TABLE+"" (_id INT PRIMARY KEY, cookTime INT PRIMARY KEY ,name VARCHAR);"");        db.execSQL(""INSERT INTO ""+CHICKEN_TABLE+"" values(5000,'Breast');"");        db.execSQL(""INSERT INTO ""+CHICKEN_TABLE+"" values(10000,'Wings');"");        db.execSQL(""INSERT INTO ""+CHICKEN_TABLE+"" values(15000,'Burger');"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {      }   }public DbUtility(Context context) {    this.context=context;}public SimpleCursorAdapter getBeefAdapter(){    DatabaseHelper dbhelper=new DatabaseHelper(this.context, DB_NAME, null, 1);    db=dbhelper.getWritableDatabase();    Cursor beefCursor=db.rawQuery(""SELECT * FROM ""+BEEF_TABLE, null);    while(!beefCursor.isLast())    beefCursor.moveToNext(); //I don't understand why but it's necessary (alternative call c.getCount() )    String[] from=new String[1];    from[0]=""name"";    int[] to=new int[1];    to[0]=android.R.id.text1;    SimpleCursorAdapter beefAdapter=new SimpleCursorAdapter(this.context, android.R.layout.simple_spinner_item, beefCursor, from, to);    beefAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    db.close();    return beefAdapter; }   public SimpleCursorAdapter getChickenAdapter(){    DatabaseHelper dbhelper=new DatabaseHelper(this.context, DB_NAME, null, 1);    db=dbhelper.getWritableDatabase();    Cursor chickenCursor=db.rawQuery(""SELECT * FROM ""+CHICKEN_TABLE, null);//If I change this to BEEF_TABLE it doesn't force close...    while(!chickenCursor.isLast())    chickenCursor.moveToNext(); //I don't understand why but it's necessary (alternative call c.getCount() )    String[] from=new String[1];    from[0]=""name"";    int[] to=new int[1];    to[0]=android.R.id.text1;    SimpleCursorAdapter chickenAdapter=new SimpleCursorAdapter(this.context, android.R.layout.simple_spinner_item, chickenCursor, from, to);    chickenAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    db.close();    return chickenAdapter;  }   </code></pre><p>}</p><p>and I also have my chickenActivity, this is where my spinners are:</p><p>package com.tsilo.grillbuddy;</p><p>import android.app.Activity;import android.os.Bundle;import android.widget.SimpleCursorAdapter;import android.widget.Spinner;</p><p>public class ChickenActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.spinner);</p><pre><code>    DbUtility db=new DbUtility(this);    SimpleCursorAdapter beefAdapter=db.getBeefAdapter();    Spinner beefSpinner=(Spinner)this.findViewById(R.id.spinner);    beefSpinner.setAdapter(beefAdapter);    SimpleCursorAdapter chickenAdapter=db.getChickenAdapter();    Spinner chickenSpinner=(Spinner)this.findViewById(R.id.spinner2);    chickenSpinner.setAdapter(chickenAdapter);            }</code></pre><p>}</p><p>This is what I have noticed:<br>If I change my getChickenAdapter() so it queries BEEF_TABLE, it works, it is only when I switch it to CHICKEN_TABLE, that it force closes.</p><hr><p>My DDMS Error: </p><p>12-06 16:03:12.473: INFO/Database(11856): sqlite returned: error code = 1, msg = no such table: chicken12-06 16:03:12.473: DEBUG/AndroidRuntime(11856): Shutting down VM12-06 16:03:12.473: WARN/dalvikvm(11856): threadid=1: thread exiting with uncaught exception (group=0x4001d7f0)12-06 16:03:12.483: ERROR/AndroidRuntime(11856): FATAL EXCEPTION: main12-06 16:03:12.483: ERROR/AndroidRuntime(11856): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tsilo.grillbuddy/com.tsilo.grillbuddy.ChickenActivity}: android.database.sqlite.SQLiteException: no such table: chicken: , while compiling: SELECT * FROM chicken</p>","484707","","484707","","2010-12-06 21:06:34","2010-12-06 21:27:36","SQlite Query Problems, causing Force Close","<android><sqlite><spinner>","1","2","","",""
"4370899","1","4374056","","2010-12-06 20:59:45","38","8496","<p>I upgraded to Android SDK Tools r8 today and I can't seem to run the draw9patch tool.  I'm getting the following error:</p><pre><code>Exception in thread ""AWT-EventQueue-0"" java.lang.NoClassDefFoundError: org/jdesktop/swingworker/SwingWorkerat com.android.draw9patch.Application$1.run(Application.java:48)at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)Caused by: java.lang.ClassNotFoundException: org.jdesktop.swingworker.SwingWorkerat java.net.URLClassLoader$1.run(URLClassLoader.java:202)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:190)at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)at java.lang.ClassLoader.loadClass(ClassLoader.java:307)at java.lang.ClassLoader.loadClass(ClassLoader.java:248)... 9 more</code></pre><p>I'm running snow leopard and have jre (or jdk?) 1.6.</p><p>Any ideas how to get this working?  Thanks!</p>","443839","","418183","","2010-12-06 21:41:20","2011-02-09 15:12:00","Android draw9patch throws NoClassDefFoundError","<android>","1","4","13","",""
"4370951","1","4371166","","2010-12-06 21:05:34","1","283","<p>I have 3 drawable folders in my res folder.  drawable-ldpi, drawable-mdpi, and drawable-hdpi.  I have low, medium, and high res images for these respective folders.</p><p>I've been testing my application on a Samsung Moment, which is an mdpi screen.  Today, I went to test my application on a Samsung Epic (480x800), which is a hdpi screen.  Unfortunately, the images my application is using are incorrectly pulled from the drawable-mdpi screen and not the drawable-hdpi.</p><p>Does anyone know why?</p><p>The images in both folders are named the same.  Also, in my manifest, I have the following tag:</p><pre><code>&lt;supports-screens        android:largeScreens=""true""        android:normalScreens=""true""        android:smallScreens=""true""        android:anyDensity=""true""        /&gt;</code></pre><p>I'm not quite sure why it wouldn't be pulling the images from the drawable-hdpi folder.</p>","406790","","","","","2010-12-06 21:32:37","Problem pulling images from high res folder","<android><drawable>","1","2","1","",""
"4371058","1","4371183","","2010-12-06 21:18:35","2","1687","<p>I want to put some Help Text in an Activity when a MenuItem Help in my Android App is clicked. Currently I have the MenuItem Help working so that when it is click it opens up a new Activity.</p><p>What would be the best way to put formatted text in that Help Activity's contentview layout? I think I will need the ability to Scroll in this view. Should I use a TextView? What is the recommended way of doing this?</p><p>Thanks in advance.</p>","447886","","","","","2010-12-06 22:01:24","Help Activity in Android App","<android>","2","0","1","",""
"4371105","1","","","2010-12-06 21:24:18","5","3861","<p>I'm new to ANDROID platform.  I'm using the following to animate a set of 16 ""frames"" using AminationDrawable in my app:</p><p><strong>In the XML file I have:</strong></p><pre><code>&lt;animation-list xmlns:android=""http://schemas.android.com/apk/res/android""  android:oneshot=""false""&gt;&lt;item android:drawable=""@drawable/image_1"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/image_1_25"" android:duration=""200"" /&gt; &lt;item android:drawable=""@drawable/image_1_5"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/image_1_75"" android:duration=""200"" /&gt; &lt;item android:drawable=""@drawable/image_2"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/image_2_25"" android:duration=""200"" /&gt; &lt;item android:drawable=""@drawable/image_2_5"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/image_2_75"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/image_3"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/image_3_25"" android:duration=""200"" /&gt; &lt;item android:drawable=""@drawable/image_3_5"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/image_3_75"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/image_4"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/image_4_25"" android:duration=""200"" /&gt; &lt;item android:drawable=""@drawable/image_4_5"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/image_4_75"" android:duration=""200"" /&gt; &lt;/animation-list&gt;</code></pre><p><strong>In the Java code I have the following</strong></p><p>first I'm declaring the class and adding an onCreate() method where I set up the animation.</p><pre><code>public class MyNewActivity extends Activity {    // member variables (accessible from within class methods below).    AnimationDrawable mainAnimation;    long mSpeed = 50;    @Override    protected void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.my_widget);        // set up image        ImageView mainImage = (ImageView) findViewById(R.id.image_widget);        mainImage.setBackgroundResource(R.drawable.animated_image);        mainAnimation = (AnimationDrawable) mainImage.getBackground();    };&lt;...snip...&gt;</code></pre><p>...then later on I start my drawing when the user presses a button I call the following to start the animation moving:</p><pre><code>private void start(){    // start the image rotating.    if (mainAnimation.isRunning())        mainAnimation.stop();    int numFrames = mainAnimation.getNumberOfFrames();    for (int ii = 0; ii &lt; numFrames; ii++ )    {        // change the animation speed.        Drawable d = mainAnimation.getFrame(ii);        mainAnimation.scheduleDrawable(d, mainAnimation, mSpeed);    }}</code></pre><p>&lt;...snip...></p><p>So elsewhere in the code I have a place to adjust the member variable ""mSpeed"".  If I do this and then call ""start()"", the animation will start, however the speed is always the same (essentially what was defined in the XML above.  My question is, how can I modify the ""duration"" of the frames to move this animation faster/slower based on user input?  I see no way to modify a ""duration"" state, and was under the assumption the ""ScheduleDrawable()"" call above would change the drawing's frames duration.</p><p>Thanks for the helpMark.</p>","532859","","","","","2013-05-08 20:07:12","How can I change the duration for an Android AnimationDrawable animation on-the-fly?","<android>","1","1","7","",""
"4371225","1","4377700","","2010-12-06 21:42:01","6","8717","<p>I am experimenting with PhoneGap and Android.</p><p>Does anyone have an example that shows how to store JSON data from an external site on a html5 WEBSQL database in an html file?</p>","472335","","","","","2011-10-18 15:33:29","PhoneGap - JSON Data storing locally on the device","<android><html5><phonegap>","2","0","3","",""
"4371273","1","4371883","","2010-12-06 21:47:56","48","8953","<p>With the release of Gingerbread, I have been experimenting with some of the new API's, one of them being <a href=""http://developer.android.com/reference/android/os/StrictMode.html"">StrictMode</a>.</p><p>I noticed that one of the warnings is for <code>getSharedPreferences()</code>.</p><p>This is the warning:</p><pre><code>StrictMode policy violation; ~duration=1949 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2</code></pre><p>and it's being given for a <code>getSharedPreferences()</code> call being made on the UI thread.</p><p>Should <code>SharedPreferences</code> access and changes really be made off the UI thread?</p>","445348","","1300995","","2012-09-26 20:04:16","2012-09-26 20:04:16","Should accessing SharedPreferences be done off the UI Thread?","<android><sharedpreferences><strictmode>","2","1","34","",""
"4371330","1","","","2010-12-06 21:54:50","3","8930","<p>I am a bit of a novice at writing applications and I'm working on a school project. I've just about finished the program, just debugging now. I'm having a major issue that can't seem to get around involving calling a method on the click of a button. The program is intended to download a file after the user types in a search term. </p><p>Originally, my logcat was telling me the method could not be found in the HelloTabWidget class. I originally had the findSong method in the SearchActivity class, so I moved pretty much all of the code from SearchActivity into HelloTabWidget, since that seemed like an easy way to see everything anyway. Now, I've tried the tip on here of changing the path in the xml fro onClick but that didn't fix it either. Rather, I got the past error from before: ""could not find method com.android.iPirate.HelloTabWidget.findSong in activity HelloTabWidget..."" I'm beginning to think it has something to do with the added exception in the method. But I'm virtually clueless as to what can be done to fix this. Any help would be appreciated. </p><p>Here's HelloTabWidget:</p><pre><code>package com.android.iPirate;import java.io.BufferedReader;import java.io.File;import java.io.FileOutputStream;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream;import java.net.URL;import java.net.URLConnection;import java.util.HashSet;import java.util.Scanner;import java.util.Set;&gt;import android.app.Activity;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.TabHost;import android.widget.TextView;public class HelloTabWidget 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;  // Reusable 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, SearchActivity.class);        // Initialize a TabSpec for each tab and add it to the TabHost        // Do the same for the other tabs        intent = new Intent().setClass(this, SongsActivity.class);        spec = tabHost.newTabSpec(""songs"").setIndicator(""Songs"",                          res.getDrawable(R.drawable.ic_tab_artists))                      .setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, SettingsActivity.class);        spec = tabHost.newTabSpec(""settings"").setIndicator(""Instructions"",                          res.getDrawable(R.drawable.ic_tab_settings))                      .setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(2); }    public String searchTerm;    public String quotes = """";    public String title;    public EditText edittext;    public String youTubeURL;    public Set&lt;String&gt; names = new HashSet&lt;String&gt;();        public void findSong(View view) throws Exception {            edittext = (EditText) findViewById(R.id.edittext);             searchTerm = edittext.getText().toString();            String address;            address = getURL(searchTerm);            UrlDownload.fileUrl(address, title + "".mp3"", ""/"");        }        public void findPlaylist(View view) throws Exception{            findSong(view);            String[] pageNames = getLinks(youTubeURL);            for(String name : pageNames)                if (!names.contains(name))                    UrlDownload.fileUrl(getURL(name), title + "".mp3"", ""/"");        }        public static String[] getLinks(String link) throws Exception {            URL url = new URL(link);            BufferedReader in = new BufferedReader(                    new InputStreamReader(                    url.openStream()));            Scanner input = new Scanner(in);            String[] songs = new String[15];            for(int i = 0; i &lt; 15; i++)                songs[i] = nextTitle(input);            return songs;        }        public static String nextTitle(Scanner input){            while (input.hasNextLine()){                String inputLine = input.nextLine();                if (inputLine.contains(""&lt;span dir=\""ltr\"" class=\""title\"" title=\"""")){                    return inputLine.substring                    (inputLine.indexOf(""&lt;span dir=\""ltr\"" class=\""title\"" title=\"""") + 37, inputLine.indexOf(""&gt;"")-1);                }            }            return null;        }        public String getURL(String searchString) throws Exception {            String searchQuery = searchString.replace(' ','+');            String siteURL = new String(""http://www.youtube.com/results?search_query=""+searchQuery+ ""&amp;aq=f\"""");            URL url;            url = new URL(siteURL);            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));            Scanner input = new Scanner(in);            String videoLink = """";            String fLink = null;            while(input.hasNextLine()){                String line = input.nextLine();                if(line.contains(""&lt;!-- start search results --&gt;"")){                    for(int i = 0; i &lt;= 44; i++){                        line = input.nextLine();                    }                    youTubeURL = ""www.youtube.com/""+line.substring(line.indexOf(""&lt;a href="")+8, line.indexOf(""class"")-2);                    videoLink = ""http://www.video2mp3.net/index.php?url="" + youTubeURL;                    title = line.substring(line.indexOf(""title=""+6),line.indexOf(quotes,line.indexOf(""title"")+7)-1);                    names.add(title);                    break;                }            }            URL vurl = null;            vurl = new URL(videoLink);            BufferedReader in2;            in2 = new BufferedReader(new InputStreamReader(vurl.openStream()));            Scanner input2 = new Scanner(in2);            while(input2.hasNextLine()){                String line = input.nextLine();                if(line.contains(""Conversion successfully completed!"")){                    line = input.nextLine();                    line = input.nextLine();                    fLink = line.substring(line.indexOf(""http""),line.indexOf(""/'""));                    break;                }            }            URL furl;            furl = new URL(fLink);            BufferedReader in3 = new BufferedReader(new InputStreamReader(furl.openStream()));            Scanner input3 = new Scanner(in3);            while(input3.hasNextLine()){                String line = input.nextLine();                if(line.contains(""Wait 20 seconds or click here"")){                    line = input.nextLine();                    String line2 = input.nextLine();                    String line3 = input.nextLine();                    String line4 = input.nextLine();                    if(line2.contains("".mp3""))                        return line.substring(line.indexOf(""tt""+3)) + line2.substring(0,line2.indexOf("".mp3"")+4);                    else if(line3.contains("".mp3""))                        return line.substring(line.indexOf(""tt""+3)) + line2 + line3.substring(0,line3.indexOf("".mp3"")+4);                    else if(line4.contains("".mp3"")){                        return line.substring(line.indexOf(""tt""+3)) + line2 + line3 + line4.substring(0,line4.indexOf("".mp3"")+4);                    }                }            }               return """";        }        public void savemp3(String s) throws Exception{            URLConnection conn = new URL(s).openConnection();            InputStream is = conn.getInputStream();            OutputStream outstream = new FileOutputStream(new File(title + "".mp3""));            byte[] buffer = new byte[4096];            int len;            while ((len = is.read(buffer)) &gt; 0) {                outstream.write(buffer, 0, len);            }            outstream.close();        }    }</code></pre><p>Now the XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    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;EditText        android:id=""@+id/edittext""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""/&gt;        &lt;Button        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:text=""Find Song""        android:onClick=""findSong"" /&gt;        &lt;Button        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:text=""Find Playlist""        android:onClick=""findPlaylist"" /&gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp""/&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><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=""com.android.iPirate""     android:versionCode=""1""     android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".HelloTabWidget""                 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="".SettingsActivity""                 android:label=""@string/app_name""                 android:theme=""@android:style/Theme.NoTitleBar""&gt;        &lt;/activity&gt;  &lt;activity android:name="".SearchActivity""                 android:label=""@string/app_name""                 android:theme=""@android:style/Theme.NoTitleBar""&gt;        &lt;/activity&gt;          &lt;activity android:name="".SongsActivity""                 android:label=""@string/app_name""                 android:theme=""@android:style/Theme.NoTitleBar""&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt;</code></pre><p>and Logcat:</p><pre><code>12-06 14:35:33.603: ERROR/AndroidRuntime(4157): FATAL EXCEPTION: main12-06 14:35:33.603: ERROR/AndroidRuntime(4157): java.lang.IllegalStateException: Could not execute method of the activity12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at android.view.View$1.onClick(View.java:2072)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at android.view.View.performClick(View.java:2408)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at android.view.View$PerformClick.run(View.java:8816)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at android.os.Handler.handleCallback(Handler.java:587)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at android.os.Handler.dispatchMessage(Handler.java:92)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at android.os.Looper.loop(Looper.java:123)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at java.lang.reflect.Method.invokeNative(Native Method)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at java.lang.reflect.Method.invoke(Method.java:521)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at dalvik.system.NativeStart.main(Native Method)12-06 14:35:33.603: ERROR/AndroidRuntime(4157): Caused by: java.lang.reflect.InvocationTargetException12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at com.android.iPirate.HelloTabWidget.findSong(HelloTabWidget.java:71)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at java.lang.reflect.Method.invokeNative(Native Method)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at java.lang.reflect.Method.invoke(Method.java:521)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at android.view.View$1.onClick(View.java:2067)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     ... 11 more12-06 14:35:33.603: ERROR/AndroidRuntime(4157): Caused by: java.net.SocketException: Permission denied12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocketImpl(Native Method)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocket(OSNetworkSystem.java:186)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:265)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at java.net.Socket.checkClosedAndCreate(Socket.java:873)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at java.net.Socket.connect(Socket.java:1020)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:62)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1152)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at java.net.URL.openStream(URL.java:653)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     at com.android.iPirate.HelloTabWidget.getURL(HelloTabWidget.java:111)12-06 14:35:33.603: ERROR/AndroidRuntime(4157):     ... 15 more</code></pre><p>Thanks for any help.</p><p>New logcat:</p><pre><code>&gt;12-06 16:34:30.585: ERROR/AndroidRuntime(4870): FATAL EXCEPTION: main12-06 16:34:30.585: ERROR/AndroidRuntime(4870): java.lang.IllegalStateException: Could not execute method of the activity12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at android.view.View$1.onClick(View.java:2072)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at android.view.View.performClick(View.java:2408)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at android.view.View$PerformClick.run(View.java:8816)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at android.os.Handler.handleCallback(Handler.java:587)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at android.os.Handler.dispatchMessage(Handler.java:92)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at android.os.Looper.loop(Looper.java:123)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at java.lang.reflect.Method.invokeNative(Native Method)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at java.lang.reflect.Method.invoke(Method.java:521)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at dalvik.system.NativeStart.main(Native Method)12-06 16:34:30.585: ERROR/AndroidRuntime(4870): Caused by: java.lang.reflect.InvocationTargetException12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at com.android.iPirate.HelloTabWidget.findSong(HelloTabWidget.java:71)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at java.lang.reflect.Method.invokeNative(Native Method)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at java.lang.reflect.Method.invoke(Method.java:521)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at android.view.View$1.onClick(View.java:2067)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     ... 11 more12-06 16:34:30.585: ERROR/AndroidRuntime(4870): Caused by: java.net.MalformedURLException: Protocol not found: 12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at java.net.URL.&lt;init&gt;(URL.java:275)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at java.net.URL.&lt;init&gt;(URL.java:159)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     at com.android.iPirate.HelloTabWidget.getURL(HelloTabWidget.java:129)12-06 16:34:30.585: ERROR/AndroidRuntime(4870):     ... 15 more</code></pre><p>And thanks to the people helping me with the quotes. Can't figure them out! :D</p>","532909","","345717","","2010-12-07 00:25:19","2012-10-21 16:33:29","Android: Fatal exception issue: attempting to call method on click of a button","<android><exception><button><methods><logcat>","6","2","","",""
"4371443","1","4371480","","2010-12-06 22:09:25","6","6653","<p>How to deal with raw queries in Android DB that contain a lot of arguments? For example <code>SELECT * FROM table WHERE table.column IN (15, 14, 17, 19)</code>. Can I use precompiled SQL with <code>?</code> selections, or is there no other choice than to format each query individually with concatenation?</p><p>I'm doing</p><pre>SQLiteDatabase.rawQuery(""... WHERE table.column IN (?)"", selectionArgs);</pre><p>where <code>selectionArgs</code> is <code>String</code> of joined IDs, but the query won't execute.</p>","414545","","","","","2010-12-06 22:15:11","Dealing with WHERE IN(?) in Android SQLite raw query","<android><sqlite>","1","0","1","",""
"4371492","1","4371702","","2010-12-06 22:17:20","1","1529","<p>I have a Motorola flipout with Android 2.1. and the USB my driver is the following:<a href=""http://developer.motorola.com/docstools/USB_Drivers/Handset_USB_Driver_64/"" rel=""nofollow"">http://developer.motorola.com/docstools/USB_Drivers/Handset_USB_Driver_64/</a></p><p>Whenever I connect the USB cord to the cellphone I can access the SD card from the computer and I no longer can access it from the cellphone. That means that any software on the phone that needs to access the SD card can't do so, therefore I can't debug anything that needs file access. Is there any way to connect the USB cord yet at the same time <em>not</em> mount the SD card file system onto the computer filesystem?</p>","480894","","24380","","2010-12-06 22:36:33","2010-12-06 22:44:39","Motorola flipout cannot access SD card while USB connected","<android><android-sdcard>","2","3","","",""
"4371515","1","4372149","","2010-12-06 22:19:36","0","99","<p>I've noticed that google calendar doesn't allow me to put html into the body of a new event.  Is there any workaround to prevent the html from getting stripped out when putting into a google calendar event?  I'm using the google calendar java api for an android application.  Thanks</p>","532933","","532933","","2010-12-06 22:45:31","2010-12-06 23:50:11","google calendar html","<java><android>","1","0","","",""
"4371631","1","4616491","","2010-12-06 22:35:24","13","5584","<p>I would like to create an Android app (for a tablet) that should be only displayed in landscape orientation, e.g. the app should ignore rotations by 90°, but support rotations by 180°.</p><p>Adding android:screenOrientation=""landscape"" in the manifest causes the app to ignore all rotations, (even the 180° rotations), i.e. rotating the device by 180° shows the application upside down.</p><p>Without the android:screenOrientation attribute my app is displayed ""correctly"" in all four positions. Rotation the device by 180° flips the UI vertically resp. horizontally.</p><p>When rotation the device the following log messages are created (maybe this helps?):</p><pre><code>[...]: INFO/WindowManager(1290): Setting rotation to 1, animFlags=0Rotation is a value between 0 and 3 representing the current orientation.</code></pre><p>Summarized: Is it possible to enable an app to support both landscape orientations?</p>","516472","","345717","","2010-12-06 23:03:07","2011-01-26 05:13:56","Android: Disable rotations by 90°, but enable rotations by 180°","<android><orientation><screen-orientation>","1","6","6","",""
"4371708","1","","","2010-12-06 22:45:27","2","2459","<p>I am working on an Android application which requires a google synced calendar as part of it. I cannot use an Intent to show up the Android Calendar Activity. It has to be a part of the application. The calendar takes up only half of the screen, and rest of the area should be filled with the application content.</p><ol><li>Can someone tell me how to go about this? </li><li>I would have to create a new custom calendar as a View? Or its not possible at all? </li><li>Is there any custom calendar view available already so that I can plug it and use?</li></ol><p>Thanks guys. </p>","532929","","","","","2011-01-07 16:29:51","How to create/use a Calendar inside an Android Application (not as an Intent)","<android><calendar><google-calendar><custom-component>","2","0","","",""
"4371842","1","4372296","","2010-12-06 23:02:08","1","4939","<p><strong>Solution:</strong></p><p>Okay,I've found the solution from your answers since your answers are not completely working</p><p>First we need to use <code>Handler</code> to post a <code>Runnable</code> to main/UI thread to run <code>UpdateDisplay()</code> and but define <code>ProgressDialog</code> under UIThread not other threads which was also crucial.</p><p>Here is the final code :</p><pre><code>public final String RSSFEEDOFCHOICE = ""http://www.deals2buy.com/rssgen/tech.xml"";public final String tag = ""RSSReader"";private RSSFeed feed = null;private Handler handler = new Handler();private ProgressDialog dialog;/** Called when the activity is first created. */public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    dialog = ProgressDialog.show(RSSReader.this, ""Loading"",            ""Loading, please wait.."");    Thread t = new Thread() {        public void run() {            feed = getFeed(RSSFEEDOFCHOICE);            handler.post(new Runnable() {                public void run() {                    dialog.dismiss();                    UpdateDisplay();                };            });        }    };    t.start();}</code></pre><p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p><p><strong>Problem :</strong></p><p>When Android application first load, this is what happens :</p><ol><li>Retrieving RSS content from Url and parse it into <code>RSSFeed feed</code> instance variable via <code>getFeed(String url)</code>.</li><li>Showing these feeds to users in ListView via <code>UpdateDisplay()</code> method.</li></ol><p>When these are happening, I wanted to show a ProgressDialog to users to notify them about system are retriving content like ""Loading, please wait..."" Once <code>getFeed(String Url):RSSFeed</code> is done, ProgressDialog will be dismissed and <code>UpdateDisplay():void</code> will be invoked.</p><p><strong>So this is my first attempt :</strong></p><pre><code>public final String RSSFEEDOFCHOICE = ""somewhere.xml""; //coming from httppublic final String tag = ""RSSReader"";private RSSFeed feed = null;/** Called when the activity is first created. */public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    ProgressDialog dialog = ProgressDialog.show(RSSReader.this, ""Loading..."", ""Loading, please wait"");    feed = getFeed(RSSFEEDOFCHOICE);    dialog.dismiss();    UpdateDisplay();}</code></pre><p>And it doesn't show the <code>ProgressDialog</code> so it didn't work the way I want. Since I belived it is because ProgressDialog is continues progress, it should be handled by another <code>Thread</code>.</p><p><strong>Here is my second attempt :</strong></p><pre><code>public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    Thread t = new Thread()    {        public void run()        {            ProgressDialog dialog = ProgressDialog.show(RSSReader.this, ""Loading..."", ""Loading, please wait"");            feed = getFeed(RSSFEEDOFCHOICE);            dialog.dismiss();        }       };    UpdateDisplay();}</code></pre><p>It was okay till <code>UpdateDisplay()</code> since this method was handled by main thread and it wasn't waiting anything so I thought maybe I should have put it under <code>t</code> Thread after <code>dialog.dismiss()</code>.</p><p><strong>So I did this :</strong></p><pre><code>public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    Thread t = new Thread()    {        public void run()        {            ProgressDialog dialog = ProgressDialog.show(RSSReader.this, ""Loading..."", ""Loading, please wait"");            feed = getFeed(RSSFEEDOFCHOICE);            dialog.dismiss();                    UpdateDisplay();        }       };}</code></pre><p>But then debugger said at run-time : <em>only the main thread which handles <code>onCreate():void</code> can reach and use View objects because it creates them.</em></p><p>Now, I am so messed up and feel like quitting programming.</p><p>Some one can help me :/</p><p>Thanks in advance.</p>","44852","","21234","","2011-03-07 21:44:43","2011-03-07 21:44:43","ProgressDialog problem during Activiy onCreate():void in Android","<java><android><multithreading>","4","0","3","",""
"4372011","1","4372522","","2010-12-06 23:25:03","2","595","<p>i have a simple opengl app that displays arbitrary 3D models. i'd like to implement zoom. what i have now uses glScale, and works to some degree. however, i'm having two issues.</p><ol><li><p>any sort of zoom (+) quickly gets to the point where the edges of the object are inside the near clipping plane. right now, my zNear is something like 0.1, so it makes sense that increasing the scale of the object will cause clipping. i am wondering if there are any other approaches for achieving a better effect.</p></li><li><p>as i zoom in, the object gets dimmer. zoom out and it gets brighter. i have a light position at around 0, 0, 100. i have very simple lighting positioned at 0,0,100 and using only diffuse. </p><pre><code>gl.glEnable(GL10.GL_LIGHTING);gl.glEnable(GL10.GL_LIGHT0);gl.glEnable(GL10.GL_COLOR_MATERIAL);float[] lights;lights = new float[] { 0f, 0f, 0f, 1f };gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lights, 0);lights = new float[] { 1f, 1f, 1f, 1f };gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lights, 0);lights = new float[] { 0f, 0f, 0f, 1f };gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_SPECULAR, lights, 0);float matAmbient[] = { 0f, 0f, 0f, 1f };float matDiffuse[] = { 1f, 1f, 1f, 1f };float matSpecular[] = { 0f, 0f, 0f, 1f };gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT, matAmbient, 0);gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_DIFFUSE, matDiffuse, 0);gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_SPECULAR, matSpecular, 0);float lightPosition[] = { mesh.mid.vertex[X], mesh.mid.vertex[Y], 100f,        1f };gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPosition, 0);</code></pre></li></ol><p>i do not have attenuation settings, which i believe needs to be enabled to cause the light to be affected by distance. regardless, i'm not changing the distance of the object, just scaling it. sure the position of the faces are changing but not significantly. anyway, i'd thinking zooming in would cause it to get brighter, not dimmer.</p><p>this happens to be using opengl-es 1.0 on the android platform, if that is relevant.</p><p>any help is appreciated. </p>","337455","","44729","","2010-12-07 03:39:56","2010-12-07 10:15:50","opengl ""zoom"": object clipping and brightness","<java><android><opengl-es>","2","0","","",""
"4372108","1","4372371","","2010-12-06 23:43:59","0","1533","<p>Ok. So I've been doing a bit of looking at gestures and such and am trying to find out how to set up my code so that when something like a left swipe happens I can open a new screen and same with a right swipe. Something like the calendar, where you can swipe through the days. I already have the gestures built. Thanks for the help. </p>","288437","","","","","2010-12-07 01:01:54","Starting new activity with a gesture","<android><activity><gesture><gestures>","2","0","1","",""
"4372122","1","","","2010-12-06 23:45:44","3","5922","<p>I'm talking about the search icon used in many apps, such as Twitter (top right), Evernote (top right), Books (top right).</p><p>Here is the icon:  <a href=""http://developer.android.com/images/icon_design/ic_menu_search.png"" rel=""nofollow"">http://developer.android.com/images/icon_design/ic_menu_search.png</a></p><p>Where can I get this in white? Thank you.</p>","522605","","","","","2010-12-06 23:47:45","Where can I get a white search icon?","<android><design><icons>","1","7","","2010-12-07 00:22:11",""
"4372311","1","","","2010-12-07 00:27:18","0","3645","<p>I am new in the Android development area ( i bought my Samsung Galaxy S 2 days ago, mainly to test the apps I create directly on the device ) and today I started gathering information about how to create Android Apps ( I`m interested in creating games ) .</p><p>I have installed the SDK Tools and Eclipse , updated everything , and already started on my first app .</p><p>The problem is that I try to convert my Flash games I previously made , I try to convert them into Android games .Is there an easy way to do this ? I'm a fast learner , but complete beginner to Android apps/games .</p><p>Can someone give me some tips / link to tutorials they found useful / hints / help / code snippets ?Maybe someone can help me by telling me how they started , or how they start the games now ?</p><p>I'm asking here because all the tutorials I've read were for Apps , none for games .</p><p>Thank you in advance .Chris</p>","533033","","1228","","2013-07-18 13:50:53","2013-12-06 16:05:33","Beginner guide / Flash to Android converter","<android>","2","0","","",""
"4372322","1","4372336","","2010-12-07 00:29:04","0","287","<p>I work for a company which is making device using the Android platform.</p><p>A UI designer asked me if it is possible to modify not just apps UI but whole Android's basic UI for example, status bar color, setting menu's font and so on.</p><p>I found a way to do this (editing <code>services.jar</code>... right?) but I wonder if it is okay to do it (release a device with modified Android framework code... does Google allow this or not).</p><p>Does anybody know about this issue?</p>","59597","","1034755","","2011-11-09 21:05:10","2011-11-09 21:05:10","Is it okay to modify Android's system files? (for device company)","<android>","2","0","","",""
"4372437","1","","","2010-12-07 00:51:06","-1","292","<p>Hey everyone, I didn't want to make separate topics so I decided to put all my questions into 1 topic. It's okay if you can't answer them all at once but it would be helpful if you could answer even one of them.</p><p>1.) In my table layout I have 3 buttons horizontally next to each other. Only half of the 3rd button shows. Shouldn't eclipse automatically re-size all three to make them fit whatever screen is viewing the app? Is there a way to automatically re-size them to fit each screen?--The ScrollView, TableLayout, and Buttons all have height and width set to wrap_content</p><p>2.) Is there a way to make links change color when you click them? Sort of like 'A:visited' or 'A:hover' in CSS. Because right now, I have [code]android:autoLink=""web""[/code] in one of my XML files. The link is blue, but it is rather annoying not knowing if you clicked it or not until a popup appears. I'm sure there is some javascript that I can use however I would like for it to return back to a normal color once the user hits the back button... that way if they want to click it again it will still change colors.</p><p>3.) How do you embed a link inside an ImageView?</p><p>4.) If I use a LinearLayout and orientation set to Vertical with a background image, there is a black space on the right side and the very bottom of the screen. The image doesn't fill that part up. How can I get it to fill up?</p>","533049","","","","","2013-04-03 08:32:00","A few random android development questions","<android><scrollview><android-linearlayout>","2","1","","",""
"4372510","1","6265666","","2010-12-07 01:05:52","0","1776","<p>I have an ExpandableListView with lots of children. Some of the children consist of a title and description, while some lack a description. I use a SimpleExpandableListAdapter, and the layout for the children consists of two TextView items in a LinearLayout. </p><p>The problem I'm having is that empty descriptions still take up space, creating too much spacing between items that do not have descriptions. </p><p>Is there a way to hide the second TextView on the fly in the adapter, or to set up the layout so that the empty TextView doesn't take up any space?</p><p>Thanks.</p>","434035","","434035","","2010-12-07 01:19:58","2012-03-26 20:17:25","How do I stop empty TextView Elements from taking up too much space in a list?","<android><textview><expandablelistview>","3","0","1","",""
"4372574","1","4372665","","2010-12-07 01:21:43","43","34663","<p>Today I upgraded to Android SDK 2.3 and I also upgraded the Eclipse Plugin Androi Developer Tools 8.0 (from 0.9.9). I also upgraded my Java Development Kit to 1.6_22.</p><p>Now in Eclipse I get <strong>many errors</strong> in all my Android projects.</p><p>The error messages are like:</p><blockquote>  <p>The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files.</p></blockquote><p>How can I fix this so I can use my Android projects again?</p><p>In the Build Path for these projects, I don't have any references to an <code>android.jar</code> but a message:</p><blockquote>  <p>Unable to get system library for project</p></blockquote>","213269","","213269","","2010-12-08 12:20:31","2014-03-21 10:36:58","""Unable to get system library for project"" after I upgraded to Android SDK 2.3 and ADT 8.0","<android><eclipse><adt><android-sdk-2.3>","23","0","5","",""
"4372632","1","","","2010-12-07 01:31:35","3","1314","<p>I am displaying a series of Flash animations in a WebView.  The screen goes black each time I load a new animation—this is visually distracting and I would like it to leave the screen white.  I have tried changing the WebView background color, embedding the Flash animation in HTML and specifying the background color, and making the WebView “Invisible” until the page has finished loading but nothing seems to have the desired effect.  The Flash animation does not display the black background when run on a PC.</p><p>I am completely stumped.  Has anyone else encountered this problem?</p>","533074","","","","","2012-01-02 07:07:21","Black background when WebView is loading Flash animation","<android><flash><webview>","1","1","","",""
"4372744","1","","","2010-12-07 01:59:19","1","350","<p>I have a set of jpg's stored in my app's drawable folder. I'd like to be able to let users press a button that allows them to send one of these jpg's. I've figured out that I can use an ACTION_SEND intent, but I am having trouble getting the jpg in my drawable folder attached to the intent. I've read a few other forum posts and it sounds like the way to go is to get my jpg saved onto the user's external sd card and then refer to it there. How do I copy the jpg from my app's drawable folder onto the user's external sd card?</p>","533087","","","","","2010-12-07 09:50:27","Android: Send a local image using MMS","<android>","1","1","","",""
"4372763","1","","","2010-12-07 02:05:05","0","392","<p>I have a tab layout set up and I would like to temporarily replace the whole screen with an image view and then go back when the image view is held.  How could I go about this?</p>","445342","","122607","","2012-04-06 18:14:04","2012-04-06 18:14:04","Switch to full image view in Android","<android><tabs><imageview>","1","0","","",""
"4372833","1","","","2010-12-07 02:21:37","0","2143","<p>I am trying to write unit tests for my Android application. The particular test I'm having trouble with is just to make sure that when the user taps somewhere on my MapView, the application drops a marker where the user tapped. But everything I try leaves me with some kind of error message. Does anybody know how to write something like this?</p><p>Here's what I've tried so far:</p><pre><code>public class MyMapActivityTest extends ActivityInstrumentationTestCase2&lt;MyMapActivity&gt; {public MyMapActivityTest() {    super(""com.example.blah"", MyMapActivity.class);}public void testPreconditions() {    assertNotNull(getActivity().findViewById(com.example.blah.R.id.mapview));}// This method gives me the following error message: java.lang.SecurityException: Injecting to another application requires INJECT_EVENT permissionpublic void testTap1() {    final MyMapActivity m = getActivity();    final MapView mapView = (MapView) m.findViewById(com.example.blah.R.id.mapview);    getInstrumentation().waitForIdleSync();    getInstrumentation().sendPointerSync(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, 1, 0, 0));    assertTrue(true);    // this doesn't execute}// junit.framework.AssertionFailedError: Click can not be completed! Something is in the way e.g. the keyboardpublic void testTap2() {    final MyMapActivity m = getActivity();    final MapView mapView = (MapView) m.findViewById(com.example.blah.R.id.mapview);    // Robotium    Solo solo = new Solo(getInstrumentation(), m);    solo.clickOnScreen(1,1);    assertTrue(true);    // this doesn't execute}// This method gives me the following error message: java.lang.SecurityException: Injecting to another application requires INJECT_EVENT permissionpublic void testTap3() {    final MyMapActivity m = getActivity();    final MapView mapView = (MapView) m.findViewById(com.example.blah.R.id.mapview);    TouchUtils.tapView(this, mapView);    assertTrue(true);    // this doesn't execute}</code></pre><p>}</p>","459550","","","","","2013-11-08 14:09:13","How to debug Android activity/view events","<android><unit-testing>","2","0","1","",""
"4372897","1","4373864","","2010-12-07 02:35:51","0","482","<p>What is the correct pattern to broadcast data changes within an Android application?  I have a global data class that will refresh its data based on a user action or a timer.  Each time it refreshes its data, it needs to notify any open Activities that depend on the data.  Basically I have two Activities that need to subscribe to changes.</p>","533104","","","","","2010-12-07 06:07:48","Android: Broadcast data to multiple Activities within an application","<android>","1","2","","",""
"4372899","1","4998770","","2010-12-07 02:36:01","6","7526","<p>The <a href=""http://developer.android.com/sdk/ndk/index.html"">Android NDK</a> has just been significantly expanded to include support for writing android applications entirely in native C/C++ code. One can now capture input events on the keyboard and touch screen using native code, and also implement the application lifecycle in C/C++ using the new NativeActivity class. </p><p>Given all the expanded native capabilities, would it be worthwhile to completely bypass Java and write Android application in native code? </p>","134397","","","","","2011-02-15 00:07:50","Android NativeActivity","<android><android-ndk><native-code>","4","0","2","",""
"4372914","1","4728236","","2010-12-07 02:39:22","2","2607","<p>How would I filter the returned contacts by the <code>groupName</code>?</p><pre><code>@Overridepublic void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos,        long id) {    String groupName = parent.getItemAtPosition(pos).toString();    Log.i(this.toString(), String.format(""Show Group: %s"", groupName));    Cursor cur = this.getContentResolver().query(            ContactsContract.Contacts.CONTENT_URI, null, null, null, null);    if (cur.getCount() &gt; 0) {        while (cur.moveToNext()) {            String name = cur                    .getString(cur                            .getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));            if (name != null) {                Log.i(this.toString(), String.format(""Show: %s"", name));            }        }        cur.close();    }}</code></pre>","398012","","","","","2012-10-16 00:07:24","Using the ContactsContract cursor to get the contacts by group","<android>","4","0","0","",""
"4372936","1","","","2010-12-07 02:44:41","9","1632","<p>I'm having an orientation issue with a Live Wallpaper that I wrote.  Basically the canvas will rotate depending on the application opened above it.  I tested this and realized that the onSurfaceChanged() method is firing when I return to the home screen from a previously opened application who's orientation was changed.</p><p>I suppose a better question would be, <strong>why does my Live Wallpaper Surface Change when an application is opened and it's orientation changed?</strong>  Is there a way to prevent my Live Wallpaper orientation from ever changing? Thanks, hope that makes sense?</p>","518116","","19750","","2011-08-31 14:26:58","2013-01-13 11:38:08","Prevent Live Wallpaper orientation change when an application is opened and orientation is changed?","<android><orientation><screen-orientation><live-wallpaper><wallpaper>","1","3","1","",""
"4372961","1","4373102","","2010-12-07 02:50:37","1","163","<p>SUPER FINAL LAST EDIT: i got it to work exactly how i wanted it to... and i think i learned something very valuable. First, i had to change the ID of the TextView (my old code said  r.id.usebuttonid. That is wrong. that referenced the button's text characteristic. i simply changed that and fixed a small problem with the string name for the TextView's ID String and it worked like a charm! Thank you all! i appreciate your input. The final code is below)</p><p>Final Code:</p><pre><code>package com.jwright.test;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.TextView;public class testerproject extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final TextView joke = (TextView) findViewById(R.string.UseButtonID);}public void UseButtonOnClick(View view){    final TextView joke = (TextView) findViewById(R.string.TextViewID);    joke.setText(""changed!"");    return;}</code></pre><p>}</p><hr><p>Hello StackOverflow. I am new to android programming, but not new to java (i have to program in java for a class i take at my school) and am trying to learn the basics. I have looked through the ""tutorials"" on the developer site but cannot find them of any decent help.</p><p>I am simply trying to start small and work my way up. I want to slightly modify the basic program so that when i press a button, it changes the text to Changed!</p><p>i used the following code:</p><pre><code>package com.jwright.test;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.TextView;public class testerproject extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final TextView joke = (TextView) findViewById(R.string.UseButtonID);}public void UseButtonOnClick(View view){    final TextView joke = (TextView) findViewById(R.string.UseButtonID);    joke.setText(""changed!"");    return;}`}`</code></pre><p>to create the button and try to change the text. Eclipse says it all checks out fine (no red marks, only some yellow ones) but when i run it on my phone (HTC EVO) and click the button (NOTE: it does work if i dont click the button... only once i click the button) it tells me that the application has stopped unexpectedly. please try again.</p><p>if anyone could explain to me what i need to do to help you guys or if you can help me figure out my error, that would be great.!</p><p>Even better, if somebody knows of a free resource i could use that is much clearer and easier to understand than the developer tutorials, that would be great!</p><p>thank you very much in advance!</p><p>James</p><p>EDITED EDIT:I figured out part of my error. I called the method the name of the string that i set the button's onclick value to, not the value of that string. problem 1: SOLVED.</p><p>HOWEVER! when the button was clicked... it changed the text on the button itself, not the textview's text. any ideas? The code above is changed to reflect the current working code.</p>","533108","","533108","","2010-12-07 03:30:45","2010-12-07 03:30:45","Basic Android Help?","<android>","2","3","","",""
"4372992","1","4409273","","2010-12-07 02:58:44","5","803","<p>Okay, so this is somewhat related to my previous question on the ColorMatrixColorFilter, but I feel it's a significantly different question. I'm wondering if there's a way - or rather, how to extend the ColorFilter class to create my own custom color filter. For what I'm needing to accomplish, I need to write a custom filter that will query each pixel, convert its RGB value to HSL or LAB, modify the hue, convert it back to RGB, and set that pixel to the new value. </p><p>I'm thinking I could simply write a class that does this, taking in a Drawable and an amount of hue shift to perform, but it would have to be called manually for each and every Drawable, and every state of every Drawable, whereas the ColorFilter seems to handle this nicely. Given the existence of the LightingColorFilter and ColorMatrixColorFilter, it seems like it can be subclassed, but so far my efforts to find any sort of documentation have been futile. I can't seem to find the source code for any of the three (Lighting, ColorMatrix, ColorFilter); I'm thinking they're probably done in native code? </p><p>My question is this: How can I properly subclass ColorFilter? If I can't find a good answer for that, if anyone is able to find the source (I've searched Android's git) and post a link to that, that would be helpful as well. </p><p>Thanks!</p>","321697","","","","","2010-12-10 13:28:18","Creating a Custom Subclass of ColorFilter?","<android><subclass><extend><colorfilter>","1","1","","",""
"4373025","1","","","2010-12-07 03:04:40","0","96","<p>Here's my code.  I have tried this in a TableLayout as well.  Everything lines to the left, regardless of what I do.  Wish this (what seems to be a normal use-case) was detailed better.</p><pre><code>    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/actionbar""    android:orientation=""horizontal""    android:background=""@layout/lightblue_gradient""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;ImageView        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_margin=""3dip""        android:gravity=""left""        android:src=""@drawable/logo"" /&gt;    &lt;ImageView        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:gravity=""right""        android:src=""@drawable/ic_menu_search"" /&gt;&lt;/LinearLayout&gt;</code></pre>","522605","","","","","2010-12-07 03:09:37","Best way to have a left and right aligned View in the same parent?","<android><design><android-linearlayout>","1","0","","",""
"4373074","1","","","2010-12-07 03:16:57","11","16836","<p>I want to open up the Calendar application from an android application. When i searched online, all i got is to create new events using intent. I could find Intents to open Contacts and Gallery etc.</p><p>Is it possible to launch the Calendar to a specific week or day? If possible, could someone please help me with it.</p><p>Thanks in advance.</p>","532929","","","","","2013-01-28 20:32:50","How to launch Android Calendar application using Intent (Froyo)","<android><calendar><android-intent>","5","1","11","",""
"4373101","1","4373132","","2010-12-07 03:22:09","1","2143","<p>I know it is used to get the containing c string ,similar to <code>std::string.c_str().</code> But how should I use the operator? </p><pre><code>//android/frameworks/base/include/utils/String8.h458 inline String8::operator const char*() const459 {  460     return mString;461 }  </code></pre>","115722","","115722","","2010-12-07 03:27:37","2010-12-07 07:53:51","what is the operator be overloading here : String8::operator const char*() const","<c++><android>","2","0","","",""
"4373106","1","4373823","","2010-12-07 03:23:06","3","4666","<p>By calling <code>BackButton.override();</code> and then hooking on to the <code>backKeyDown</code> event, I am able to get the back button press to register.</p><p>But there doesn't appear to be a <code>MenuButton.override();</code> Also, hooking on the <code>menuKeyDown</code> doesn't register a button press.</p><p>Here's my (non-functional) code. What am I missing?</p><pre><code>&lt;script type=""text/javascript"" charset=""utf-8"" src=""phonegap.js""&gt;&lt;/script&gt;        &lt;script type=""text/javascript"" charset=""utf-8""&gt;        document.addEventListener(""deviceready"", function() {            alert('initialized');    }, false);    document.addEventListener(""menuKeyDown"", function() {            alert('menu_pressed'); // Never happens    }, false);  &lt;/script&gt;</code></pre>","164980","","102112","","2011-06-01 13:49:27","2011-06-01 13:49:27","How do I Capture native (Menu) button presses in PhoneGap?","<javascript><android><phonegap>","1","0","2","",""
"4373147","1","","","2010-12-07 03:33:10","0","139","<p>I found htc g7 can't support the symbol 'a' of SimpleDateFormat. So I can't parse date expediently.  For example: the code:    *</p><pre><code>    SimpleDateFormat sdf2 = new SimpleDateFormat(""MM/dd/yy hh:mm a"");    String d2 = ""12/15/10 6:30 PM"";      try{        sdf2.parse(d2);    } catch (ParseException e) {        // TODO Auto-generated catch block        e.printStackTrace();}*</code></pre><p>Test in simulator, that's ok. But run on my phone, It will occur the ParseException. </p><p>My phone HTC  G7 os2.2</p>","517055","","","","","2010-12-07 04:01:15","htc g7 os2.2 can't support the symbol 'a' of SimpleDateFormat","<android><simpledateformat>","1","0","","",""
"4373156","1","4373175","","2010-12-07 03:34:30","1","756","<p>has anyone ever read/skimmed through this book? it is valuable/very helpful to people such as myself, who are complete noobs to android programming? I am thinking of purchasing one on amazon for $20 but dont know if its going to be a really helpful book. </p><p>Also, when i skim through the book on the amazon wesite, it seems to be missing alot of stuff. is that just amazon's preview method or is the book really that simple?</p>","533108","","","","","2011-08-25 10:01:44","Android app development for dummies book?","<android>","1","2","","",""
"4373242","1","","","2010-12-07 03:53:59","0","1684","<p>I have a service that will be started every once in a while via an AlarmManager.</p><p>When it starts I want to be able to check if the device is currently being used or if it is idle.</p><p>I could simply check if the screen is on, but it is possible that if the device was charging, or on a dock, that the screen could be on but not being used.  So that is is not a perfect method.</p><p>Is there a solid way determine that the device is idle?</p><p>If not, I figure if the device is plugged in, then in my case I could just carry on as if the device was idle.  However, I haven't been able to find a way to check if the phone is plugged in beyond capturing a Broadcast Intent.  Is there a way to just check without having to capture the broadcast intents continually?</p>","445348","","","","","2010-12-07 05:10:38","How to determine if the device is idle or if device is plugged in?","<android><python-idle>","1","6","","",""
"4373254","1","","","2010-12-07 03:57:12","4","8447","<p>I want to use the onPreviewFrame to post-process the image before displaying it to the user (i.e. apply a color tint, sepia, etc).  As I understand, the byte[] data returned to the callback is encoded in YUV420sp.  Have people been decoding this to RGB in Java or using NDK (native code)?  Does anyone have an example of a function that decodes this to RGB and how the RGB values are used afterwards?</p><p>Thanks.</p>","533158","","752878","","2012-08-20 22:54:39","2013-04-02 09:19:32","Image processing with Android Camera","<android><image><image-processing><camera><rgb>","2","0","7","",""
"4373263","1","","","2010-12-07 03:59:31","1","16416","<p>My SQLite query returning only one record, However, the table has multiple rows</p><pre><code>cursor=mydb.rawQuery(""Select category from items;"", null);</code></pre><p>I have even tried <code>GROUP BY</code> but still wont work.</p><p>I am new to SQLite, would appreciate any help. Thanks.</p>","492458","","717341","","2011-08-28 22:04:39","2013-08-05 09:53:59","Android SQLite rawquery returns only first record","<android><sqlite>","5","1","","",""
"4373266","1","4374828","","2010-12-07 04:00:15","0","4822","<p>I am building a web application that needs to be working seamless when being online or off line. For this need to be able to <strong>check my connection with the server</strong>. </p><p>The main devices that are to be supported are iphone3+4, ipad, a netbook with chrome and android 2.1+. </p><p>The <code>navigator.onLine</code> is not exactly what I am looking for. This is unreliable and only checks if you have connectivity, not if you are connected to a specific server.</p><p>I tried <code>jQuery.getJSON</code> to connect to a ping web-service on my server. This works fine in chrome on the netbook but the native android browser returns null. Ipod touch doesn't do anything at all.</p><p>I could use some help with this..</p>","533161","","","","","2012-10-20 03:56:51","How to check for connectivity with server using javaScript from native Android 2.1 browser?","<jquery><android><web-services><connection><getjson>","3","0","","",""
"4373334","1","4373397","","2010-12-07 04:17:21","3","9374","<p>i have a problem that i want to set the position of text as to from particular location. for example: i have this text in my textview: ""abcdefghijklmnopqrstuvwxyz""Now i want this text to show from location ""efgh"" rather than ""abcd""How can i perform this operation in textview. I want to change position of text and not the position of textview.Thanks</p>","493193","","493193","","2010-12-07 04:45:04","2010-12-07 05:09:35","How can i set the position of text?","<android>","2","10","","",""
"4373343","1","4374481","","2010-12-07 04:19:02","-1","971","<p>I'm developing an android app of a library ,divide books into categories containing books,implemented categories as sqlite tables and books as records ,i need to make _id of a book unique through whole library ,i tried thiscategory 1 _id 1 to 1000<br>category 2 _id 1001 to 2000<br>category 3 _id 2001 to 3000<br>but this limits each category to 1000 itemany solutions???</p>","533111","","","","","2010-12-07 08:03:09","impleminting unique _id through whole sqlite DB","<android><sqlite>","2","1","","",""
"4373392","1","4373869","","2010-12-07 04:28:42","0","268","<p>In my project I read a bitmap picture from assets directory and I want to change the quality of this picture and save it again. I am using this code:</p><pre><code>FileOutputStream fos = new FileOutputStream(path);image.compress(Bitmap.CompressFormat.PNG, 10, fos);</code></pre><p>The problem is in second line whether I put 10 or 100, result is the same in terms of pixels of width, height and size of the picture. How can I resize or change a quality?</p><p>Thanks</p>","513413","","","","","2010-12-07 06:09:31","android: problem in changing quality of picture","<android><image>","1","0","","",""
"4373395","1","4374338","","2010-12-07 04:29:08","2","915","<p>I picked up the new 2.3 version of the SDK platform and tools, and when I build, I get eight instances of the error below.  Then errors about missing resources.  Presumably my resources have failed to build.</p><pre><code>W/ResourceType( 8168): Bad XML block: header size 146 or total size 3145924 is larger than data size 0</code></pre><p>Googling indicates that perhaps a Clean would fix, but it does not.</p><p>Googling also indicates that this error would be caused by a poorly formatted XML document, but I have not changed any resources since the upgrade (or for that matter any code), and the code was building and working fine pre-upgrade.</p><p>Any idea what's up, or suggestions to troubleshoot?</p>","457317","","345717","","2010-12-07 04:31:53","2011-01-21 22:25:15","Problem building following upgrade to Android 2.3","<android>","3","1","","",""
"4373468","1","4401706","","2010-12-07 04:43:35","1","1798","<p>I have been facing a problem since 40days . i didn't get a solution . Here am describing  my problem  </p><p>In a single list i need different types of lists  . for example three list with types List A , ListB , List C. i mean in a same list view i  have three different types of views.List A contain textView and Button . List B and List C are diffenrt types . My problem ,</p><ol><li>How to display a list with below criteria .</li><li>when ever i click  on button(RowA) i need to update list of List B.</li></ol><p>In a ListView(ListView 1)</p><ol><li>List item  A</li><li>List item A</li><li>List item A</li></ol><p>(ListView 2) 4.  <strong>Header</strong> 5. List item B 6. List item B 7. List item B 8. <strong>Header</strong> 9. List item C 10. List item C 11. List item C</p><p>Can any one sort out this problem ? Gimme a solution .</p><p>Thanking you,Srinivas</p>","414777","","414777","","2010-12-07 05:09:05","2010-12-09 18:23:07","How to add multiple listViews to a single listView?","<android><listview>","2","3","1","",""
"4373485","1","9340202","","2010-12-07 04:45:06","34","16302","<p>Does anyone have a simple example of a ListActivity displaying Textviews in a column and when you swipe left to right you see that row in a new view?  This would be to say edit the data for that row or show more detailed info on that row.  Please do not reference code shogun or other sites as I have googled and have not seen this answered.</p>","346309","","","","","2013-04-02 00:59:00","Android Swipe on List","<android><list><textview><listactivity><swipe>","3","2","55","",""
"4373489","1","4373501","","2010-12-07 04:45:56","2","547","<p>I have an Android app that's been on the market since v1 of the OS.  I haven't touched it since and thus forgot all that there was to forget about developing for Android.</p><p>With the new Android 2.3 SDK, can I compile my app so that users of previous OS releases can also use it (say 1.6 or 2.1)?</p>","9382","","","","","2010-12-08 04:05:28","Can Android 2.3 SDK cross compile to earlier versions?","<android><cross-compiling><backwards-compatibility>","2","0","","",""
"4373549","1","4373589","","2010-12-07 05:00:12","0","1469","<p>// Activity1.java</p><pre><code>setContentView(R.layout.activity1);</code></pre><p>// AndroidManifest.xml</p><pre><code>    &lt;activity android:name="".Activity3""          android:label=""@string/page2""&gt;    &lt;/activity&gt;</code></pre><p>These are the lines that show an error.</p><p>I am trying to use Intent and move from page 1->2->3</p><p>this the button code</p><pre><code>Button b = (Button) findViewById(R.id.button1);b.setOnClickListener(new View.OnClickListener() {    public void onClick(View arg0) {    Intent i = new Intent(Activity1.this,Activity2.class);    startActivity(i);    } });</code></pre>","155196","","","","","2010-12-07 05:33:11","R.java Error when adding new layouts","<android><android-manifest>","2","2","1","",""
"4373617","1","","","2010-12-07 05:13:46","3","1570","<p>I am trying to add few views to the incoming call screen with required functionality.Is it possible to do overide the exis android OS call screen? Is there any way to achieve this as stand alone application.?</p><p>Thanks in advance.</p>","524907","","","","","2010-12-07 05:29:02","Customised Incoming call screen","<android>","1","1","2","",""
"4373801","1","","","2010-12-07 05:55:18","0","536","<p>I created video player list with video thumbnail. but scorll display time is very slow..how can I display fast video thumnail? The list of video is  8 lines.. and source -></p><pre><code>ImageView imageView = null;Bitmap bm = null;bindView(View view, int iViewType, Context context,Cursor cursor, boolean bExpand) {bm= MediaStore.Video.Thumbnails.getThumbnail(vmcontext.getContentResolver(),index, MediaStore.Video.Thumbnails.MINI_KIND, null);imageView.setImageBitmap(bm);}</code></pre><p>I can display video thumbnail. but list display or scroll display is very slow.</p>","533247","","331473","","2011-11-22 22:30:02","2011-11-22 22:30:02","Android: Is it possible to display very fast video thumbnails?","<android>","1","0","2","",""
"4373888","1","4374101","","2010-12-07 06:13:25","16","32551","<p>I have set a hint for an <code>EditText</code>, currently the hint visibility is gone. When a user starts typing, I want to remove the hint text, when the cursor is visible in the <code>EditText</code>, not at the time when a user starts to type. How can I do that?</p><pre><code>&lt;EditText android:paddingLeft=""10dp""android:background=""@drawable/edittextbg""android:layout_marginLeft=""4dp""android:layout_marginTop=""7dp""android:gravity=""left""android:id=""@+id/Photo_Comments"" android:layout_width=""150dip"" android:maxLines=""1""android:hint=""Write Caption""android:maxLength=""50""android:singleLine=""true""android:maxWidth=""100dip""android:layout_height=""wrap_content""/&gt;</code></pre>","487219","","2390083","","2013-11-04 18:32:43","2014-02-07 11:48:24","Android EditText Hint","<android>","3","0","3","",""
"4373952","1","4373965","","2010-12-07 06:24:36","2","565","<p>I am new to android.I need to know the Basic Animation in Android for View's and View Group's.Can anyone give some Guide lines to learn it !!! Thanks in advance...</p>","512192","","","","","2013-10-07 01:45:02","animation in android?","<android>","2","0","","",""
"4374004","1","","","2010-12-07 06:35:20","0","1070","<p>I am trying to connect the android device with other hardware through Bluetooth. The application is connecting to other phone but it is not connecting to hardware. Please help me</p>","533281","","1108213","","2012-03-14 12:42:19","2012-03-14 12:42:19","How to connect android phone with other hardware through bluetooth?","<android>","1","0","","",""
"4374034","1","4374085","","2010-12-07 06:42:26","1","4250","<p>Is it possible in Android create virtual (in memory) SD card? </p>","472270","","","","","2013-04-22 12:11:33","How to create virtual (in memory) SD card?","<android><memory>","1","2","","2013-04-22 14:42:05",""
"4374041","1","","","2010-12-07 06:44:42","0","270","<p>Hi i have using a autocomplete textview,how can i specify the direction of pop up list?</p>","487219","","","","","2011-09-05 20:15:22","Android AutoComplete TextView","<android>","1","0","1","",""
"4374100","1","4976618","","2010-12-07 06:56:39","7","3425","<p>I have a task to show 458 markers to show in Android maps. And to avoid performance related issues I update the data on map using an <code>AsyncTask</code> instance. </p><p>Here is a short scenario of what I do. </p><ol><li>I fetch the latitude/longitude of 458 locations around UK.</li><li>I run the loop and as per Android Blog tutorial I add them in <code>ItemizedOverlay</code> class</li><li>After every 50th iteration I call <code>publishProgress</code> method to place 50 markers in map.</li></ol><p>After the 50th iteration the flow goes into <code>onProgressUpdate</code> via <code>publishProgress</code> and here is my code of <code>onProgressUpdate</code> method</p><pre><code>// MapOverLays = mapView.getOverlays(); //This line was called in asyc task's constructor   // Hello Overlay is an instance of ItemizedOverlay.mapOverlays.add(helloOverLay);//MapView.getController - Also called in Constructorcontroller.setZoom(12);controller.animateTo(centerPoint);controller.setCenter(centerPoint);</code></pre><p>This code throws <code>ArrayIndexOutOfBoundException</code> and the logcat doesn't show any of the class from my module. Here is the logcat dump if it elaborates my problem.</p><pre><code>12-07 11:34:48.644: ERROR/AndroidRuntime(508): java.lang.ArrayIndexOutOfBoundsException12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.google.android.maps.ItemizedOverlay.getIndexToDraw(ItemizedOverlay.java:211)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.google.android.maps.ItemizedOverlay.draw(ItemizedOverlay.java:240)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.google.android.maps.Overlay.draw(Overlay.java:179)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.google.android.maps.MapView.onDraw(MapView.java:476)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.View.draw(View.java:6535)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.View.draw(View.java:6538)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.widget.FrameLayout.draw(FrameLayout.java:352)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.View.draw(View.java:6538)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.widget.FrameLayout.draw(FrameLayout.java:352)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewRoot.draw(ViewRoot.java:1349)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1114)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.os.Handler.dispatchMessage(Handler.java:99)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.os.Looper.loop(Looper.java:123)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.app.ActivityThread.main(ActivityThread.java:4363)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at java.lang.reflect.Method.invokeNative(Native Method)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at java.lang.reflect.Method.invoke(Method.java:521)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>P.S. I have tested the application with relatively smaller (10) and relatively larger (150) iterations instead of 50. But the application throws same Error.</p>","246942","","331508","","2011-11-24 06:25:55","2012-05-13 00:43:24","android maps :  array index out of bound exception","<android><google-maps><android-maps>","5","1","2","",""
"4374129","1","","","2010-12-07 07:00:49","0","3790","<p>in my application i m showing List in side the Tabview , in one tab when ever i m trying to start a new activity on onclick a list view touch event . i want to start a new activity in web view .</p><pre><code>showNewsListView.setAdapter(listAdapter); showNewsListView.setOnItemClickListener(new OnItemClickListener(){  public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position,        long arg3) {            Log.v(""status "",""tab on   position""+position);           Intent myIntent = new Intent(BizTab.this, MainView.class);           startActivity(myIntent);          }          }); getUrlData(baseUrl); }</code></pre><p>if i run this much code app is crashing so i just find its solution that i should start a new activity in asyncrouniously so now i m doing this </p><pre><code>    showNewsListView.setAdapter(listAdapter);     showNewsListView.setOnItemClickListener(new OnItemClickListener(){     public void onItemClick(AdapterView arg0, View arg1, int position, long arg3) { Log.v(""status "",""tab on position""+position);         new ShowFullNews().execute();      }      }); getUrlData(baseUrl); }``showNewsListView.setAdapter(listAdapter); showNewsListView.setOnItemClickListener(new OnItemClickListener(){  public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position,        long arg3) {            Log.v(""status "",""tab on   position""+position);         new ShowFullNews().execute();      }      }); getUrlData(baseUrl); }`</code></pre><p>then also my code is crashing and not giving error just giving this two warning</p><p>and if i starting a new activity in both places onTouch and post execute then my code is woking but here it first show screen and then its went automatically and refresh that screen , that is not looking good. so how to avoid it . Pls help me and plese ignore grammer error my working code is</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position,        long arg3) {            Log.v(""status "",""tab on   position""+position);            //set bundle to send data into other activity            b.putInt(""total"", 10);            b.putInt(""position"",position);            b.putStringArray(""allurls"", allsNewsUrls);            b.putString(""returnname"", ""BizTab"");            b.putString(""footertext"",""Biz"");            b.putInt(""tabid"", 3);           Intent myIntent = new Intent(BizTab.this, MainView.class);            myIntent.putExtras(b);            startActivity(myIntent);            new ShowFullNews().execute();      }      }); protected void onPostExecute(Long result) { try {    Intent myIntent2 = new Intent(BizTab.this, MainView.class); startActivity(myIntent2);} catch (Exception e) { Log.v(""error"",""error in starting new activity""); e.printStackTrace();}  }`</code></pre><p>The Log generating are and  my app is closing automatically.</p><pre><code>12-07 11:55:18.684: WARN/InputManagerService(72): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4406738812-07 11:55:20.792: VERBOSE/status(419): tab on   position012-07 11:55:20.814: INFO/ActivityManager(72): Starting activity: Intent { cmp=org.nuvus/.MainView (has extras) }12-07 11:55:20.872: DEBUG/PhoneWindow(419): couldn't save which view has focus because the focused view com.android.internal.policy.impl.PhoneWindow$DecorView@43ea45d8 has no id.12-07 11:55:21.023: VERBOSE/status(419): mainView oncreate called12-07 11:55:21.452: VERBOSE/status(419): onStartcalled12-07 11:55:21.962: INFO/ActivityManager(72): Displayed activity org.nuvus/.MainView: 1072 ms (total 1072 ms)12-07 11:55:22.082: INFO/AndroidRuntime(419): AndroidRuntime onExit calling exit(0)12-07 11:55:22.173: INFO/ActivityManager(72): Process org.nuvus (pid 419) has died.12-07 11:55:22.183: INFO/WindowManager(72): WIN DEATH: Window{43fe6f30 org.nuvus/org.nuvus.Main paused=true}12-07 11:55:22.202: INFO/WindowManager(72): WIN DEATH: Window{440f9620 org.nuvus/org.nuvus.MainView paused=false}12-07 11:55:22.283: INFO/UsageStats(72): Unexpected resume of com.android.launcher while already resumed in org.nuvus12-07 11:55:22.303: WARN/InputManagerService(72): Got RemoteException sending setActive(false) notification to pid 419 uid 10032</code></pre><p>please help me...</p>","533299","","533299","","2010-12-07 07:07:38","2010-12-07 14:26:00","Error in starting new Activity","<android>","1","1","","",""
"4374141","1","","","2010-12-07 07:04:29","4","7607","<p>I find that DrawBitMap is taking 50-60 ms for drawing just three bitmaps one is a rectangle occupying the full screen, one is a circle and another one is a Path. My bitmaps are created by using Canvas.drawPath, drawRect and drawCircle on a blank bitmap with the Bitmap.Config as ARGB_8888.I am using ARGB_8888 to make the background visible to get a layering effect.I was shocked to find the time taken as around 50ms as I thought drawBitmap would be a very simple operation. Can someone guide as to is there any fundamental mistake that I am making. Following is my code</p><p><strong>Creating the Blank Bitmaps</strong></p><pre><code>Rectangle = Bitmap.createBitmap(320,480,Bitmap.Config.ARGB_8888);Circle = Bitmap.createBitmap(70,70,Bitmap.Config.ARGB_8888);Leaf1 = Bitmap.createBitmap(20,30,Bitmap.Config.ARGB_8888);</code></pre><p><strong>Drawing the Shapes on the appropriate BitMap</strong></p><pre><code>Canvas c = new  Canvas(Rectangle);Paint p = new Paint();p.setAntiAlias(true);p.setColor(0xff6e8b3e);c.drawRect(0,0,320,480,p);Canvas c = new Canvas(Circle);Paint p = new Paint();CirclePath = new Path();p.setAntiAlias(true);p.setColor(0xffcd661d);System.out.println(""x = ""+x+"" y = ""+y);CirclePath.addCircle(50,50,10,Path.Direction.CW);c.drawPath(CirclePath,p);Canvas c = new  Canvas(Leaf1);Paint paint = new Paint();Path path = new Path();paint.setAntiAlias(true);path.moveTo((float)184.37,(float)219.15);path.cubicTo((float)188.32,(float)219.15,(float)192.88,(float)220.44,(float)195.62,(float)223.54);path.cubicTo((float)197.84,(float)226.05,(float)203.2,(float)229.84,(float)198.18,(float)245.98);</code></pre><p><strong>Drawing the BitMap in OnDraw</strong></p><pre><code>canvas.drawBitmap(Rectangle,0,0,p);canvas.translate(x,y); // For animation effectcanvas.drawBitmap(Circle,0,0,p);canvas.drawBitmap(Leaf1,0,0,p);</code></pre><p>Now when I record the time taken for this three drawBitMap I find it is taking around 50msIs there something big time mistake in the code. Changing the Bitmap.Config to RGB_565 brings the time down to around 8ms but then the background is not visible and I am getting a black box around the path</p>","533303","","345717","","2010-12-07 07:12:33","2011-12-24 17:45:52","Android DrawBitMap very slow when using ARGB_8888","<android>","3","0","2","",""
"4374180","1","","","2010-12-07 07:12:11","-1","1643","<p>helloi am updating contacts name and number , the code for the above is </p><pre><code>Uri workUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, id);ContentValues values = new ContentValues();values.clear();values.put(ContactsContract.Contacts.DISPLAY_NAME,""""+editname);values.put(ContactsContract.CommonDataKinds.Phone.NUMBER,""""+editno);getContentResolver().update(workUri, values, null, null);</code></pre><p>But it is not working.Can anyone suggest me where i m wrong.Thanks in advance</p>","152867","","152867","","2010-12-07 09:53:19","2012-12-01 11:43:06","how to update android contacts","<android>","3","2","","",""
"4374226","1","","","2010-12-07 07:21:02","-1","317","<p>I want to create a UI like <a href=""http://www.ndtv.com/static/images/iphone/motorola_droid.jpg"" rel=""nofollow"">http://www.ndtv.com/static/images/iphone/motorola_droid.jpg</a>, where extra links are below the tabs. How can we achieve this?</p><p>I already made tabs but not understanding how to add this text view with this.</p>","450601","","63550","","2010-12-08 17:47:28","2010-12-08 17:59:25","How to create GUI with text links and tabs","<android><android-layout>","1","1","","",""
"4374281","1","4374465","","2010-12-07 07:32:03","0","1166","<p>Say I'd like to make a memory/pairs game. I have currently made a draft that works on a Canvas, and cards are drawn into a grid. </p><p>This works for my current basic version, but I'd like show do an animation (when the card is turned, it will flip around and scale to higher size; or when the match is found, the cards would rotate around and then go back. I can't imagine doing this on Canvas, I'd have to make a lot of timers and do the animation by hand, it seems overly complex for this simple task.</p><p>I think I could could subclass View for a control that would display a card, and then react to touch events for that control. It would also make drawing scaling of the images done by Android itself, and, most importantly, I could use <a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html"" rel=""nofollow"">Tween Animation</a> for some effects.</p><p>My question is - would it be OK to use a View for each card in the game (I could have 5x6 or 4x5 cards), and arrange them in a <a href=""http://developer.android.com/reference/android/widget/GridView.html"" rel=""nofollow"">GridView</a>? Are there some pitfalls with this approach? Or should I continue with completely custom-drawn Canvas?</p>","72746","","72746","","2010-12-07 08:22:35","2010-12-07 08:22:35","GridView with images vs custom drawn Canvas for Android memory game","<android><gridview><canvas><tiles>","1","0","1","",""
"4374348","1","","","2010-12-07 07:44:09","0","306","<p>Whenever I click on textarea on the webview, it displays a keyboard which is showing me characters in English, but whenever I start typing, my typed characters get converted into some other language [chinese] and on rendering only that other language words are rendered instead of English.</p><p>I'm really confused and dont know how to resolve this issue.</p><p>Can anybody please help?</p><p>Thanx in advance.</p>","227943","","","","","2010-12-07 08:16:29","Set the language of the keyboard appearing on webview textarea click in Android","<android><keyboard><webview>","1","0","","",""
"4374400","1","4394006","","2010-12-07 07:51:55","2","2631","<p>Having noted this question has gone unanswered after a month, I hope I can meet with more success than this guy: -<a href=""http://stackoverflow.com/questions/4087026/help-about-googleadview-jar"">Help about GoogleAdView.jar</a></p><p>The instructions on <a href=""http://code.google.com/mobile/ads/docs/android/"" rel=""nofollow"">http://code.google.com/mobile/ads/docs/android/</a> states this: -</p><p>Integrating the Google Ads SDK with your Android-based app is a relatively straightforward process:Add GoogleAdView.jar to your project's /libs directory. If you are developing in Eclipse, you will also need to add this JAR to your project's build path.</p><p>But, I do not have the file ""GoogleAdView.jar"" in the SDK - nor on my hard-drive anywhere for that matter, nor can I find it on the android SDK downloads or updates.  I've searched for a couple of hours now for it with no luck.  I am stumped before I even got a chance to start!  I have an Adsense account, and am pretty sure I am doing everything right.</p><p>I live in Australia if that makes any difference.</p>","530047","","530047","","2010-12-07 08:00:02","2010-12-09 01:17:47","Help about GoogleAdView.jar","<android><adsense>","1","0","","",""
"4374439","1","4375161","","2010-12-07 07:57:50","0","1127","<p>I want to run my application on HTC Comet. I have Android 2.2 installed and I use Eclipse. Based on what is given in <a href=""http://developer.android.com/sdk/win-usb.html"" rel=""nofollow"">http://developer.android.com/sdk/win-usb.html</a> - I found that I have "" USB Driver for Windows, Revision 3"" installed. So then I go to Perform a fresh installation for Windows XP.Even if point to the USB Driver package that has been installed, I get the message  that explains that the driver that I am pointing to is not a match for the device. Two USB drivers come with HTC Comet - one for ActiveSync and the other is ADB Driver. Please let em know if I ma missing something here - in the meantime I will install the ADB driver. Thank you</p>","446006","","","","","2011-02-24 16:12:13","Unable to use T-Mobile/HTC Comet for Android development","<android><usb><comet>","1","1","","",""
"4374522","1","4374815","","2010-12-07 08:08:55","0","1492","<p>Main Activity Code. BroadcastExample.java</p><pre><code>package com.example.broadcast;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class BroadcastExaple extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Log.d(""PHONE"", ""Main Activity...Called"");        setContentView(R.layout.main);        Log.d(""PHONE"", ""After Mainf Activity..."");    }}</code></pre><p>MyBroadCastReceiver.java</p><pre><code>package com.example.broadcast;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.telephony.PhoneStateListener;import android.telephony.TelephonyManager;import android.util.Log;public class MyBroadcastReceiver extends BroadcastReceiver { @Override /*public void onReceive(Context context, Intent intent) {  try{  Log.d(""Call BroadCAST"",""Calling Broad CAST"");  MyPhoneStateListener phoneListener = new MyPhoneStateListener();  TelephonyManager telephony = (TelephonyManager) context    .getSystemService(Context.TELEPHONY_SERVICE);  telephony.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE);  }  catch(Exception e)  {  } }*/  public void onReceive(Context context, Intent intent) {       Log.d(""Message"", ""Message Received"");    }}</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.example.broadcast"" android:versionCode=""1"" android:versionName=""1.0""&gt; &lt;uses-prmission android:name=""android.permission.READ_PHONE_STATE"" /&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="".BroadcastExaple"" android:label=""@string/app_name""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;   &lt;/intent-filter&gt;  &lt;/activity&gt;  &lt;receiver android:name="".MyBroadcastReceiver""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.PHONE_STATE"" /&gt;   &lt;/intent-filter&gt;   &lt;/receiver&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre><p>Program doesn't enter into the onReceive Mathod of MyBroadCastReceiver class.</p>","533863","","212275","","2010-12-12 20:58:22","2010-12-12 20:58:22","Broadcast Receiver doesn't work","<android>","1","1","","",""
"4374618","1","4374845","","2010-12-07 08:21:51","4","2271","<p>The release of Android NDK r5 (along with the SDK for Android 2.3) brings official access to packaged asset files from <strong>native</strong> code. (release notes <a href=""http://developer.android.com/sdk/ndk/index.html"" rel=""nofollow"">here</a>)</p><ol><li>How do you make that work? What is the API to use?</li><li>Will it work on all previous versions of the Android OS, or only on devices running v2.3?  </li></ol><p>Thanks</p>","229745","","","","","2010-12-07 08:49:36","How to access packaged assets from Android native code (NDK r5)","<android><android-ndk>","1","0","5","",""
"4374660","1","4375869","","2010-12-07 08:27:01","3","1077","<p>On the new android platform tools (v8) released with the 2.3 SDK, I get an error while running dex from the ant script</p><p>I typed the usual ""ant release"", and got an error in the dex stage</p><pre><code>-dex:    [echo] Converting compiled files and external libraries into C:\Documents and Settings\omri\My Documents\myapp\bin\classes.dex...   [apply] =C:\Documents was unexpected at this time.</code></pre><p>My guess is that it has something to do with the spaces in the path.anyone know what the issue is and how to fix it?</p>","406682","","406682","","2010-12-07 09:49:49","2011-02-12 01:30:37","Dex not working with spaces in path on the new android platform tools (V8)","<android><ant>","2","1","2","",""
"4374787","1","","","2010-12-07 08:42:47","2","10076","<p>After searching for a few hours, I was unable to find the exact answer to my situation. I'm currently using a RelativeLayout and all I have is a background image and a button. The problem I'm having is placing the button in the exact location I want it to be (a little offset from the center).</p><p>My first attempt was to modify the layout_margins of the button. While this worked for the current emulator I was working with (3.7in WVGA), the positioning of the button was slightly/way off for a different screen size (such as 3.2in HVGA). </p><p>I then attempted to modify the padding of the parent layout but got the same issue. My XML looks 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""                android:paddingLeft=""98dip"" android:paddingBottom=""68dip"" android:background=""@drawable/background""&gt;    &lt;Button android:id=""@+id/starttimer""             android:background=""@drawable/button""             android:layout_width=""wrap_content"" android:clickable=""true"" android:layout_height=""wrap_content"" android:layout_alignParentBottom=""true""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>Please let me know if I'm completely off with my approach. It seems like an extremely simple problem, and I'm bummed out that it's taken me so long to try to get it. Thanks for any help!</p>","533377","","795446","","2011-07-05 03:48:03","2011-07-05 03:48:03","How to set the absolute position of an image or button so that it is consistent across multiple screen sizes?","<android><android-layout>","2","2","1","",""
"4374788","1","4477267","","2010-12-07 08:42:55","4","563","<p>I've been doing all my builds using ant on the command line (Ubuntu 10.04). I loaded up the 2.3 SDK and made the necessary path changed (platform-tools). Now my builds don't include the jars in my libs directory. Any thoughts on what I need to change?</p>","533391","","533391","","2010-12-07 15:43:33","2010-12-18 08:16:38","Upgraded to 2.3, now ant builds don't include the jars in my libs directory","<android><android-sdk-2.3>","3","0","1","",""
"4374862","1","4374934","","2010-12-07 08:51:45","51","31450","<p><strong>How to programatically create and read <code>WEP/EAP WiFi configurations</code> in Android?</strong></p><p>I have seen a number of people struggling on this very question on various forums and all across the community. I know this is not that straight forward(especially EAP) to figure out because When I wanted to acheive the same I too struggled quite a lot.Well, all the hard work of code analysis and searching various implementations on the internet done with I was finally able to acheive the goal. All the credit goes to number of open source projects and their developers. </p><p>I would like to share this knowledge with all, Since SO <a href=""http://stackoverflow.com/faq"">encourages</a> this:  ""It's also perfectly fine to ask and answer your own question, as long as you pretend you're on Jeopardy: phrase it in the form of a question.""</p><p><a href=""http://stackoverflow.com/questions/4374862/how-to-programatically-create-and-read-wep-eap-wifi-configurations-in-android/4374934#4374934""><strong>Part 1:</strong> <em>Creating a WEP WiFi configuration programatically.</em></a> </p><p><a href=""http://stackoverflow.com/questions/4374862/how-to-programatically-create-and-read-wep-eap-wifi-configurations-in-android/4374934#4374934""><strong>Part 2:</strong> <em>Read a WEP WiFi configuration programatically.</em></a>  </p><p><a href=""http://stackoverflow.com/questions/4374862/how-to-programatically-create-and-read-wep-eap-wifi-configurations-in-android/4374934#4374934""><strong>Part 3:</strong> <em>Read a EAP WiFi Configuration programatically.</em></a>  </p><p><a href=""http://stackoverflow.com/questions/4374862/how-to-programatically-create-and-read-wep-eap-wifi-configurations-in-android/4375874#4375874""><strong>Part 4:</strong> <em>Save a EAP WiFi configuration programatically.</em></a></p>","452307","","452307","","2011-09-08 17:55:30","2014-01-27 22:10:02","How to programatically create and read WEP/EAP WiFi configurations in Android?","<android><wifi><android-wifi>","4","6","63","",""
"4375030","1","4375936","","2010-12-07 09:18:44","0","260","<p>I've tried to use threads for better performance in my Android App.In the <code>onCreate</code> Method i started two threads:</p><pre><code> @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.play);    ...    new Thread(new Runnable() {        public void run() {         makeList();        }    }).start();    new Thread(new Runnable() {        public void run() {         setChronometer();        }    }).start();  }  </code></pre><p>In these Methods I change the some settings of my Views. (no heavy events)</p><p>First a Chronometer:</p><pre><code> private void setChronometer(){ time.post(new Runnable() {         public void run() {       time.setFormat(""Time: %s"");       time.setBase(SystemClock.elapsedRealtime());       time.start();         }       }); }</code></pre><p>Second a <code>ListView</code>:</p><pre><code>private void makeList(){  ...        final ArrayAdapter&lt;String&gt; listAdapter = new ArrayAdapter&lt;String&gt;(...);          list.post(new Runnable() {         public void run() {          list.setAdapter(listAdapter);           list.setOnItemClickListener(new OnItemClickListener() {     public void onItemClick(AdapterView&lt;?&gt; parent,  View view, int position, long id) {    ....         }       }); }</code></pre><p>The <code>Chronometer</code> works fine, but the operations in <code>makeList()</code> weren't done.. so my ListView isn't working!</p><p>I had the idea,that when the activity starts, defining the listView and Chronometer is less important, so i defer them in threads, with the aim, that the activity starts faster (is more performat)</p><p>First of all, was this a good Idea?</p><p>Secondly, why is my ListView not working? When i remove the <code>list.post(new Runnable() {</code>it works, but i thought that wasn't a good way in android. Cause now the Views are directy changed from a thread.</p><p>Thirdly, when should i use Threads <code>vs.View.post</code>?</p><p>Any help would be great, Thanks!</p><p>GreetingsFireDragon</p>","533429","","418183","","2010-12-07 11:10:18","2011-01-22 18:41:21","Android-Threading: refer to Views from Threads","<android><multithreading><performance><gui><listview>","2","1","0","",""
"4375057","1","4376996","","2010-12-07 09:22:34","0","1763","<p>I have a ListView and I have my own customized ListItem I am applying action listener on them but they are not responding to event.</p><pre><code>private class CustomAdapter extends ArrayAdapter&lt;FriendInfo&gt; {        public CustomAdapter (Context context, int textViewResourceId,                ArrayList&lt;FriendInfo&gt; friendList) {            super(context, textViewResourceId, friendList);        }        public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;                       try {                if (v == null) {                    LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);                    v = vi.inflate(R.layout.friend_item, null);                }                                if(isViewInvitations){                    Button btn_AcceptFrndReq = (Button)v.findViewById(R.id.btnAcceptFrndReq);                    Button btn_DelFrnd = (Button)v.findViewById(R.id.btnDelFrnd);                    btn_DelFrnd.setClickable(true);                    btn_AcceptFrndReq.setVisibility(View.VISIBLE);                    btn_DelFrnd.setVisibility(View.VISIBLE);                    btn_AcceptFrndReq.setOnClickListener(new OnClickListener() {                        public void onClick(View arg0) {                                                Toast.makeText(getContext(), ""Accept"", Toast.LENGTH_LONG);                        }                    });                    btn_DelFrnd.setOnClickListener(new OnClickListener() {                        public void onClick(View arg0) {                                    //do delete call here in new thread                            Toast.makeText(context, ""Delete"", Toast.LENGTH_LONG);                        }                    });                }</code></pre>","185022","","21234","","2010-12-07 13:12:29","2010-12-07 13:23:51","setOnClickListener is not working inside CustomAdapter extends ArrayAdapter","<android><android-arrayadapter>","2","2","","",""
"4375175","1","4376156","","2010-12-07 09:36:09","38","70222","<p>I have upgraded my Android SDK to version 2.3 and Android Development Tools 8.0.0. Now in Eclipse, I get an error message:</p><blockquote>  <p>Could not find C:\Program Files (x86)\Android\android-sdk-windows\platform-tools\adb.exe!</p></blockquote><p>And I don't have that file. How can I fix this? Is it a bug in the Android SDK 2.3 or Android Development Tools 8.0.0?</p>","213269","","","","","2013-05-23 08:45:31","Could not find adb.exe - after upgrade to Android SDK 2.3","<android><eclipse><adt><android-sdk-2.3>","17","2","7","",""
"4375206","1","4375418","","2010-12-07 09:41:05","1","1555","<p>I wanted to take Numeric input from user from Numberpad displayed on screen, it should be in Activity view. please see attached image.</p><p>I don't know if there is some way to make similar UI or do i have make one my self in XML ? . need your help. <img src=""http://i.stack.imgur.com/pB3Mk.png"" alt=""alt text""></p>","236732","","","","","2010-12-07 10:06:08","Android on screen number pad","<android>","1","0","","",""
"4375278","1","","","2010-12-07 09:51:54","1","3797","<p>Is there a way to run adb commands like </p><blockquote>  <p>adb get-state </p></blockquote><p>in the code I write in eclipse</p><p>For e.g.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    testADB();}</code></pre><p>and in <code>testADB()</code> run some adb commands?</p>","533463","","418183","","2011-05-18 13:42:04","2011-05-18 13:42:04","ADB commands in code","<android><adb>","3","1","","",""
"4375299","1","4375427","","2010-12-07 09:53:21","0","504","<p>I have this method that get's the street names for Ambassy's out of a XML file and shows them on the map.</p><p>This is the method that I'm using:</p><pre><code>locatie = gc.getFromLocationName(gevondenland.getAdresamba(),5);</code></pre><p>and I open an MapActivity with the location (locatie) i get.</p><p>This does work, but only for some countries.</p><p>Here is a sample from the XML file:</p><pre><code>&lt;land&gt;   &lt;naam&gt;Angola&lt;/naam&gt;   &lt;code&gt;AO&lt;/code&gt;   &lt;politie&gt;110&lt;/politie&gt;   &lt;ambulance&gt;118&lt;/ambulance&gt;   &lt;brandweer&gt;118&lt;/brandweer&gt;   &lt;telamba&gt;00244222310686&lt;/telamba&gt;   &lt;adresamba&gt;Edificio Secil, Avenida 4 de Fevereiro 42-6? en 10?, Luanda&lt;/adresamba&gt;&lt;/land&gt;&lt;land&gt;   &lt;naam&gt;Antigua en Barbuda&lt;/naam&gt;   &lt;code&gt;AG&lt;/code&gt;   &lt;politie&gt;911&lt;/politie&gt;   &lt;ambulance&gt;911&lt;/ambulance&gt;   &lt;brandweer&gt;911&lt;/brandweer&gt;   &lt;telamba&gt;0012684811857&lt;/telamba&gt;   &lt;adresamba&gt;High Street, Sint John?s, Antigua&lt;/adresamba&gt;&lt;/land&gt;&lt;land&gt;   &lt;naam&gt;Argentini?&lt;/naam&gt;   &lt;code&gt;AR&lt;/code&gt;   &lt;politie&gt;101&lt;/politie&gt;   &lt;ambulance&gt;107&lt;/ambulance&gt;   &lt;brandweer&gt;100&lt;/brandweer&gt;   &lt;telamba&gt;00541143380050&lt;/telamba&gt;   &lt;adresamba&gt;Edificio Porte?o II, Olga Cossettini 831, piso 3, Buenos Aires&lt;/adresamba&gt;&lt;/land&gt;</code></pre><p>Antigua en Barbuda works, but Argentinia and Angola don't.</p><p>When I search the exact same address on Google Maps, it finds it.</p><p>What can be the reason it can't find the addresses in Android?</p>","517460","","","","","2010-12-07 10:07:23","getFromLocationName() can't find streets in Android","<java><android><geolocation><reverse-geocoding>","1","2","","",""
"4375375","1","4375505","","2010-12-07 10:01:46","41","48217","<p>I have HTC Comet connected to Eclipse with SDK 2.2. I do a debug build - the application does not run; though it does get installed on the device. On the device I get this message box on the Comet screen</p><p><strong>Waiting for Debugger<br>Application HunyDew (process com.airvine.hunydew) is waiting for the debugger to attach.<br>[Force Close]</strong></p><p>Whereas in the Eclipse console I get these set of messages  </p><pre><code>[2010-12-07 01:42:29 - hunydewprj] Android Launch!  [2010-12-07 01:42:29 - hunydewprj] adb is running normally.  [2010-12-07 01:42:29 - hunydewprj] Performing com.airvine.hunydew.HunyDewAAStartsHere activity launch  [2010-12-07 01:42:47 - hunydewprj] Application already deployed. No need to reinstall.  [2010-12-07 01:42:47 - hunydewprj] Starting activity com.airvine.hunydew.HunyDewAAStartsHere on device 308730C861BC  [2010-12-07 01:42:49 - hunydewprj] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.airvine.hunydew/.HunyDewAAStartsHere }  [2010-12-07 01:42:49 - hunydewprj] Attempting to connect debugger to 'com.airvine.hunydew' on port 8601  [2010-12-07 01:43:09 - hunydewprj] Launch error: Failed to connect to remote VM. Connection timed out.  </code></pre><p>The application runs fine in the Emulator - please help - what is it that I am missing here? Any hints/suggestions? Thanks</p>","446006","","418183","","2010-12-07 10:03:55","2014-04-07 07:40:54","How to resolve ""Waiting for Debugger"" message?","<android><eclipse><debugging><device><adb>","20","8","6","",""
"4375378","1","","","2010-12-07 10:02:25","2","2434","<p>i just wanted to ask about sending gzip for post requests using HttpClient in Android?</p><p>where to get that OutputStream to be passed in the GZIPOutputstream?</p><p>any snippets?</p>","279560","","142162","","2011-09-25 01:32:17","2013-01-21 08:43:44","GZIP in Android","<java><android>","2","1","3","",""
"4375410","1","4375470","","2010-12-07 10:05:18","8","3915","<p>Lets assume we have one million.</p><p>In english it should be formatted as 1,000,000 in german it should be 1.000.000.</p><p>Thanks</p>","360592","","360592","","2010-12-11 18:12:56","2010-12-11 18:12:56","Recommended way to format numbers in a locale aware way?","<java><android>","3","0","1","",""
"4375510","1","","","2010-12-07 10:16:24","4","4195","<p>I'm looking for a (possibly free...) Android library that dynamically draws graph and permits to click on an item to show a sub-item.Do you know any library with these features?</p>","339500","","339500","","2010-12-07 11:47:45","2012-04-05 07:42:44","Looking for an Android chart library with clickable items","<android><charts>","2","2","1","2012-04-05 11:11:18",""
"4375754","1","","","2010-12-07 10:41:50","1","408","<p>I want to align images one over another ie like collage. The images are from Gridview.The image should overlap one over other.plz any one help me to solve this.When clicking those images it should expand .. pls provide me some source code to solve this or provide some similar example</p><p>Thanks in advance...</p>","244540","","","","","2012-09-06 05:07:32","How to Align images one over another in android?","<android>","1","1","","",""
"4375811","1","","","2010-12-07 10:49:24","1","9016","<p>In my application i use the single Activity.</p><p>Here is my code</p><pre><code>import android.app.Activity;import android.graphics.Color;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.view.animation.Animation;import android.view.animation.TranslateAnimation;import android.widget.Button;import android.widget.LinearLayout;import android.widget.TextView;public class Animation2 extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Show1();}private void Show1() {    LinearLayout linLay = new LinearLayout(this);    linLay.setBackgroundColor(Color.RED);    TextView tv = new TextView(this);    tv.setText(""This is form 1"");    Button btn = new Button(this);    btn.setText(""Go to Form 2"");    btn.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            // TODO Auto-generated method stub            Show2();        }    });    linLay.addView(tv);    linLay.addView(btn);    Animation animation=new TranslateAnimation(0,0,Animation.ZORDER_NORMAL, 300);    animation.setDuration(1500);    linLay.setAnimation(animation);    setContentView(linLay);}protected void Show2() {    LinearLayout linLay = new LinearLayout(this);    linLay.setBackgroundColor(Color.GRAY);    TextView tv = new TextView(this);    tv.setText(""This is form 2"");    Button btn = new Button(this);    btn.setText(""Back to form 1"");    btn.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            // TODO Auto-generated method stub            Show1();        }    });    linLay.addView(tv);    linLay.addView(btn);    Animation animation=new TranslateAnimation(0,0,Animation.ZORDER_NORMAL, 300);    animation.setDuration(1500);    linLay.setAnimation(animation);    setContentView(linLay);}</code></pre><p>}</p><p>when i call the function Show1() and show2() i wish to show the animation like a intent action.How to do this? </p>","512192","","","","","2012-08-13 16:45:58","set animation in android?","<android>","1","1","1","",""
"4375904","1","","","2010-12-07 10:59:28","1","634","<p>We can merge layout using include tag in xml</p><p></p><pre><code> &lt;include android:id=""@+id/all_tab"" layout=""@layout/all_tab""/&gt;</code></pre><p></p><p>How to add include tag from code?? Because i want to change it in run time. Thanks.</p>","430926","","","","","2010-12-07 11:01:58","Android include tag","<android><android-linearlayout>","0","3","","",""
"4375913","1","4938445","","2010-12-07 11:00:50","3","6168","<p>I am trying to fetch Gps latitude and longitude, but i am having a query that whenever i try to fetch Lat &amp; Long without sim card, it is not providing any info where as soon i insert my sim card, it provides me all information in desired manner.</p><pre><code>LocationManager mlocManager =     (LocationManager) getSystemService(Context.LOCATION_SERVICE);LocationListener mlocListener = new MyLocationListener();mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,                                   0, 0, mlocListener);</code></pre><p>you can see though i m using GPS_PROVIDER, it is not giving me Lat &amp; Long without Network Operator help, can anybody tel me?</p><hr><p>Another thing is How to start and stop GPS from an application means i wanna start gps after particular time and than as soon i get beslocation, i can turn it off.</p>","457146","","213269","","2010-12-07 11:47:11","2012-09-01 20:44:08","Get Latitude and Longitude without inserting Sim Card and Start/Stop Gps from Application","<android><gps><locationmanager>","4","2","2","",""
"4375931","1","","","2010-12-07 11:03:08","5","10312","<p>im am having difficulties to update a ListActivity when the underlying data changes.</p><p>I am using a custom (list) adapter (CustomListAdapter) derived vom BaseAdapter to fill a ListActivity with custom list elements (CustomListElement).</p><p>The elements in question can have their underlying data changed over time, either by user interaction or by changes in an underlying database. In order to announce said changes, the CustomListElement and CustomListAdapter objects can register DataSetObserver objects.</p><p>This is in essence done like this (unfortunately posting the entire code would be overkill):</p><pre><code>public class CustomListElement extends DataSetObservable {    protected Object value;    public void setValue(Object newValue) {         this.value = newValue;         notifyChanged();    }}</code></pre><p>Hence a CustomListElement provides registerDataSetObserver by inheritance from DataSetObservable and announces changes by means of it's notifyChanged() method.</p><p>And for the CustomListAdapter:</p><pre><code>public class CustomListAdaper extends BaseAdapter {    protected List&lt;CustomListElement&gt; elementList;    @Override    public void registerDataSetObserver(DataSetObserver observer) {        super.registerDataSetObserver(observer);        for (CustomListElement element : elementList)            element.registerDataSetObserver(observer);    }}</code></pre><p>I.e. the observers are ""handed through"".</p><p>Now, when invoking</p><pre><code>setListAdapter(new CustomListAdapter(customElementList));</code></pre><p>within a ListActivity this should register an <a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/android/widget/AdapterView.java#AdapterView.AdapterDataSetObserver"">android.widget.AbsListView.AdapterDataSetObserver</a> within the setAdapter method of ListView (invoked from setListAdapter of ListActivity).</p><p>Upon notifying the registered DataSetObserver objects of any change the onChanged method of the AdapterDataSetObserver and therefor requestLayout of the ListView should be invoked. This should (to my understanding) refresh the ListView.</p><p>However, the ListView is not updated with the new data.</p><p>I realize it has been pointed out that notifyDataSetChanged and (maybe) notifyChanged should be run within a runOnUiThread environment, however that does not seem to fix the issue.</p><p>I also realize that similar questions came up, but not with this specific set of android classes, and with unsatisfying answers.</p><p>Am i missing anything? Any insight into why this breaks and how to fix it is greatly appreciated.</p>","533556","","229044","","2010-12-07 15:28:11","2013-11-16 14:36:59","ListView does not update when calling notifyDataSetChanged from a BaseAdapter","<android><android-widget>","3","1","0","",""
"4375982","1","","","2010-12-07 11:11:11","7","9533","<p>I am getting Timestamp value as 1291204449 from server so i extracted the value byimplementing handler.</p><p>Now i want to convert timestamp value  to date.(But the problem is in my activity i stored this value in a string variable because handler returning in string format).</p><p>please help me</p><p>Thanks in advance.</p>","523046","","","","","2013-01-07 11:53:40","Converting Timestamp as String to Date in android","<android>","2","0","","",""
"4376141","1","4383265","","2010-12-07 11:34:21","1","2272","<p>I've been using Netbeans 6.9 quite happily with Android for a few months but I completely wiped my SDK yesterday and now, after reinstalling it, I can't get Netbeans to create the Android platform. I can select the platform okay but once I press FINISH nothing ever appears in Netbeans. I've even re-installed Netbeans but no joy.</p><p>Could someone post the contents of their platform XML file for Android? I'm thinking I can just enter this file manually and have Netbeans pick it up.</p><p>Any other ideas greatly appreciated!</p>","472428","","","","","2011-11-08 10:26:46","Problem adding Android platform to NetBeans 6.9","<android><netbeans>","4","2","","",""
"4376376","1","","","2010-12-07 12:05:56","0","2332","<p>I found that use SQLiteDatabase.createDatabase can create database to external storage, but use SQLiteOpenHelper can not create database to sdcard.Why? </p>","238908","","418183","","2010-12-07 12:07:21","2012-02-06 23:55:37","SQLiteOpenHelper can not create database to sdcard","<android><database><sd-card>","1","3","1","",""
"4376481","1","","","2010-12-07 12:19:07","0","395","<p>I have a feeling that my synchorization may be a little coarse (juddering UI) and was wondering how do I find out when/if my synchronized java methods are blocking on each other.  My current project is on Android but I am interested in the more general Java case as well.</p><p>Thanks, </p>","468854","","","","","2010-12-07 12:30:08","How do I check on whether my synchronized methods are blocking (Android + Java)","<java><android>","2","0","","",""
"4376553","1","4399624","","2010-12-07 12:26:24","16","10421","<p>I've upgraded from 2.2 to 2.3. I originally thought that I  had just a problem with my own Google maps application not working and posted a question <a href=""http://stackoverflow.com/questions/4370205/upgraded-to-sdk2-3-now-maps-wont-display"">link text</a></p><p>I now realise that the problem is much wider, in that non of the built in applications present when a new AVD is created will work. For example the 'maps' application gives ""Network failure - This application requires a working data connection"". The browser won't connect to Google or anything else. This happens with the AVDs that existed before I upgraded and with those created from the command line after the upgrade, for all API levels. I have all the necessary components I think:<img src=""http://i.stack.imgur.com/lqBJA.jpg"" alt=""alt text""></p><p>I've tried to describe this problem in it's simplest terms by decoupling it from any reference to Eclipse and to applications that I have written. The logcat for a newly created AVD set to filter out all but errors is very long but I'm posting those that I <strong><em>think</em></strong> might be relevant:</p><pre><code>12-07 12:05:42.048: ERROR/System(61): Failure starting core service12-07 12:05:42.048: ERROR/System(61): java.lang.SecurityException12-07 12:05:42.048: ERROR/System(61):     at android.os.BinderProxy.transact(Native Method)12-07 12:05:42.048: ERROR/System(61):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)12-07 12:05:42.048: ERROR/System(61):     at android.os.ServiceManager.addService(ServiceManager.java:72)12-07 12:05:42.048: ERROR/System(61):     at com.android.server.ServerThread.run(SystemServer.java:206)12-07 12:07:22.553: ERROR/CheckinTask(382): Checkin failed: https://android.clients.google.com/checkin (request #0)12-07 12:07:22.553: ERROR/CheckinTask(382): java.net.UnknownHostException: android.clients.google.com12-07 12:07:22.553: ERROR/CheckinTask(382):     at java.net.InetAddress.lookupHostByName(InetAddress.java:506)12-07 12:07:22.553: ERROR/CheckinTask(382):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)12-07 12:07:22.553: ERROR/CheckinTask(382):     at java.net.InetAddress.getAllByName(InetAddress.java:256)12-07 12:07:22.553: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)12-07 12:07:22.553: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)12-07 12:07:22.553: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)12-07 12:07:22.553: ERROR/CheckinTask(382):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)12-07 12:07:22.553: ERROR/CheckinTask(382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)12-07 12:07:22.553: ERROR/CheckinTask(382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)12-07 12:07:22.553: ERROR/CheckinTask(382):     at android.net.http.AndroidHttpClient.execute(AndroidHttpClient.java:248)12-07 12:07:22.553: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.executeWithoutRewriting(GoogleHttpClient.java:203)12-07 12:07:22.553: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.execute(GoogleHttpClient.java:245)12-07 12:07:22.553: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.execute(GoogleHttpClient.java:313)12-07 12:07:22.553: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinTask.sendRequest(CheckinTask.java:254)12-07 12:07:22.553: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinTask.doInBackground(CheckinTask.java:150)12-07 12:07:22.553: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinService$1.doInBackground(CheckinService.java:221)12-07 12:07:22.553: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinService$1.doInBackground(CheckinService.java:214)12-07 12:07:22.553: ERROR/CheckinTask(382):     at android.os.AsyncTask$2.call(AsyncTask.java:185)12-07 12:07:22.553: ERROR/CheckinTask(382):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)12-07 12:07:22.553: ERROR/CheckinTask(382):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)12-07 12:07:22.553: ERROR/CheckinTask(382):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)12-07 12:07:22.553: ERROR/CheckinTask(382):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)12-07 12:07:22.553: ERROR/CheckinTask(382):     at java.lang.Thread.run(Thread.java:1019)12-07 12:08:43.802: ERROR/CheckinTask(382): Checkin failed: https://android.clients.google.com/checkin (request #0)12-07 12:08:43.802: ERROR/CheckinTask(382): java.net.UnknownHostException: android.clients.google.com12-07 12:08:43.802: ERROR/CheckinTask(382):     at java.net.InetAddress.lookupHostByName(InetAddress.java:506)12-07 12:08:43.802: ERROR/CheckinTask(382):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)12-07 12:08:43.802: ERROR/CheckinTask(382):     at java.net.InetAddress.getAllByName(InetAddress.java:256)12-07 12:08:43.802: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)12-07 12:08:43.802: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)12-07 12:08:43.802: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)12-07 12:08:43.802: ERROR/CheckinTask(382):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)12-07 12:08:43.802: ERROR/CheckinTask(382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)12-07 12:08:43.802: ERROR/CheckinTask(382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)12-07 12:08:43.802: ERROR/CheckinTask(382):     at android.net.http.AndroidHttpClient.execute(AndroidHttpClient.java:248)12-07 12:08:43.802: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.executeWithoutRewriting(GoogleHttpClient.java:203)12-07 12:08:43.802: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.execute(GoogleHttpClient.java:245)12-07 12:08:43.802: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.execute(GoogleHttpClient.java:313)12-07 12:08:43.802: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinTask.sendRequest(CheckinTask.java:254)12-07 12:08:43.802: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinTask.doInBackground(CheckinTask.java:150)12-07 12:08:43.802: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinService$1.doInBackground(CheckinService.java:221)12-07 12:08:43.802: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinService$1.doInBackground(CheckinService.java:214)12-07 12:08:43.802: ERROR/CheckinTask(382):     at android.os.AsyncTask$2.call(AsyncTask.java:185)12-07 12:08:43.802: ERROR/CheckinTask(382):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)12-07 12:08:43.802: ERROR/CheckinTask(382):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)12-07 12:08:43.802: ERROR/CheckinTask(382):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)12-07 12:08:43.802: ERROR/CheckinTask(382):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)12-07 12:08:43.802: ERROR/CheckinTask(382):     at java.lang.Thread.run(Thread.java:1019)12-07 12:10:10.643: ERROR/CheckinTask(382): Checkin failed: https://android.clients.google.com/checkin (request #0)12-07 12:10:10.643: ERROR/CheckinTask(382): java.net.UnknownHostException: android.clients.google.com12-07 12:10:10.643: ERROR/CheckinTask(382):     at java.net.InetAddress.lookupHostByName(InetAddress.java:506)12-07 12:10:10.643: ERROR/CheckinTask(382):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)12-07 12:10:10.643: ERROR/CheckinTask(382):     at java.net.InetAddress.getAllByName(InetAddress.java:256)12-07 12:10:10.643: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)12-07 12:10:10.643: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)12-07 12:10:10.643: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)12-07 12:10:10.643: ERROR/CheckinTask(382):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)12-07 12:10:10.643: ERROR/CheckinTask(382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)12-07 12:10:10.643: ERROR/CheckinTask(382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)12-07 12:10:10.643: ERROR/CheckinTask(382):     at android.net.http.AndroidHttpClient.execute(AndroidHttpClient.java:248)12-07 12:10:10.643: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.executeWithoutRewriting(GoogleHttpClient.java:203)12-07 12:10:10.643: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.execute(GoogleHttpClient.java:245)12-07 12:10:10.643: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.execute(GoogleHttpClient.java:313)12-07 12:10:10.643: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinTask.sendRequest(CheckinTask.java:254)12-07 12:10:10.643: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinTask.doInBackground(CheckinTask.java:150)12-07 12:10:10.643: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinService$1.doInBackground(CheckinService.java:221)12-07 12:10:10.643: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinService$1.doInBackground(CheckinService.java:214)12-07 12:10:10.643: ERROR/CheckinTask(382):     at android.os.AsyncTask$2.call(AsyncTask.java:185)12-07 12:10:10.643: ERROR/CheckinTask(382):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)12-07 12:10:10.643: ERROR/CheckinTask(382):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)12-07 12:10:10.643: ERROR/CheckinTask(382):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)12-07 12:10:10.643: ERROR/CheckinTask(382):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)12-07 12:10:10.643: ERROR/CheckinTask(382):     at java.lang.Thread.run(Thread.java:1019)12-07 12:11:41.652: ERROR/CheckinTask(382): Checkin failed: https://android.clients.google.com/checkin (request #0)12-07 12:11:41.652: ERROR/CheckinTask(382): java.net.UnknownHostException: android.clients.google.com12-07 12:11:41.652: ERROR/CheckinTask(382):     at java.net.InetAddress.lookupHostByName(InetAddress.java:506)12-07 12:11:41.652: ERROR/CheckinTask(382):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)12-07 12:11:41.652: ERROR/CheckinTask(382):     at java.net.InetAddress.getAllByName(InetAddress.java:256)12-07 12:11:41.652: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)12-07 12:11:41.652: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)12-07 12:11:41.652: ERROR/CheckinTask(382):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)12-07 12:11:41.652: ERROR/CheckinTask(382):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)12-07 12:11:41.652: ERROR/CheckinTask(382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)12-07 12:11:41.652: ERROR/CheckinTask(382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)12-07 12:11:41.652: ERROR/CheckinTask(382):     at android.net.http.AndroidHttpClient.execute(AndroidHttpClient.java:248)12-07 12:11:41.652: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.executeWithoutRewriting(GoogleHttpClient.java:203)12-07 12:11:41.652: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.execute(GoogleHttpClient.java:245)12-07 12:11:41.652: ERROR/CheckinTask(382):     at com.google.android.common.http.GoogleHttpClient.execute(GoogleHttpClient.java:313)12-07 12:11:41.652: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinTask.sendRequest(CheckinTask.java:254)12-07 12:11:41.652: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinTask.doInBackground(CheckinTask.java:150)12-07 12:11:41.652: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinService$1.doInBackground(CheckinService.java:221)12-07 12:11:41.652: ERROR/CheckinTask(382):     at com.google.android.gsf.checkin.CheckinService$1.doInBackground(CheckinService.java:214)12-07 12:11:41.652: ERROR/CheckinTask(382):     at android.os.AsyncTask$2.call(AsyncTask.java:185)12-07 12:11:41.652: ERROR/CheckinTask(382):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)12-07 12:11:41.652: ERROR/CheckinTask(382):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)12-07 12:11:41.652: ERROR/CheckinTask(382):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)12-07 12:11:41.652: ERROR/CheckinTask(382):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)12-07 12:11:41.652: ERROR/CheckinTask(382):     at java.lang.Thread.run(Thread.java:1019)</code></pre><p>I'm using Vista 64 bit, JDK and Eclipse are 32 bits (I have had no problems before following the SDK from 0.0 right up to 2.2). I noticed in another post that it's necessary to add ...platform-tools to the PATH. I couldn't find any reference to this in the release notes, but I did it anyway.</p><p>I'm totally stuck now. Please can anyone suggest what the problem might be?</p><p><strong>UPDATE 1540 GMT</strong></p><p>Turned off Norton Internet SecurityDeleted the sdk folder, installed the starter pack and all the API levels. </p><p>Deleted c:\users\nick.android (Got rid of all the AVDS)</p><p>Recreated one AVD (Level 9 with Google maps)from the SDK Manager and started it.</p><p>Net result - just the same errors, browser won't connect, nor will the built in maps application.</p><p><strong>UPDATE 1920 GMT</strong></p><p>I had an older SDK saved to a memory stick. I copied this to a temp directory</p><p><img src=""http://i.stack.imgur.com/E0aoS.jpg"" alt=""alt text""></p><p>I didn't change PATH, but clicked on the SDK Manager in this temp folder and started up an existing API level 7 AVD. The browser and the built in maps application both worked fine.</p><p>Filed bug report<a href=""http://code.google.com/p/android/issues/detail?id=13031&amp;sort=-id&amp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars"">link text</a></p><p><strong>UPDATE 9th December 1325 GMT</strong></p><p>I managed to roll back to SDK 2.1 and found an old ADT plugin (0.9.9). I've got Eclipse 3.5 set up to use SDK 2.1 and Eclipse 3.6 to use SDK 2.3. (I know 3.6 isn't recommended but it used to work OK with SDK 2.1 although code completion was slow). SDK 2.3 emulators are still failing to connect. </p><p>If you are thinking of investigating this problem, please backup your earlier SDK and plugin, else you might end up with a useless development environment. </p><p>A brand newly created AVD in 2.3 gives:</p><pre><code>12-09 13:09:08.823: ERROR/ActivityThread(213): Failed to find provider info for com.google.settings12-09 13:09:30.193: ERROR/browser(213): onReceivedError -2 http://www.google.com/m?client=ms-android-google&amp;source=android-home The URL could not be found.</code></pre><p>when you start the browser</p>","440010","","440010","","2010-12-09 13:20:58","2012-08-10 20:06:10","Upgraded to SDK 2.3 - now no emulators have connectivity","<android><android-sdk-2.3>","3","11","7","",""
"4376601","1","4384706","","2010-12-07 12:30:56","2","1951","<p>Today, i tried to update the Android tools i use on Eclipse to version 8.0 and the Android SDK to version 2.3. This caused a loss of adb from tools directory. I managed to retrieve it again and put it back. Then, i searched the forum and found <a href=""http://stackoverflow.com/questions/4375175/could-not-find-adb-exe-after-upgrade-to-android-sdk-2-3"">this</a>, that eventually helped me to solved it, by updating the Eclipse first. </p><p>So, why is there no warning of proceeding to Android tools update, without updating the Eclipse first, can cause this kind of troubles? </p><p>It could have saved some time...</p>","485328","","485328","","2010-12-08 19:38:55","2011-06-08 06:22:28","Trying to update to Android SDK 2.3 on Eclipse causes adb loss","<android><eclipse><adb><adt><android-sdk-2.3>","2","3","","",""
"4376723","1","","","2010-12-07 12:48:31","1","1356","<p>I want to rum my J2ME application over android device ( HTC Legend )</p><p>first i used file manager(astro) to install my jad/jar file but instead of installing the application file manager simply extracting my executable file .</p><p>then i tried <a href=""http://www.netmite.com/android/srv/1.6/getapk.php"" rel=""nofollow"">http://www.netmite.com/android/srv/1.6/getapk.php</a> to change my jad/jar into .apk , but this site is also not able to do it , and reason might be additional jar files i used  and quite large size of project ......So please let me know if somebody have precise and fruitful way to do so .</p>","533662","","488433","","2011-01-25 11:11:40","2011-03-18 14:52:46","how to run a j2me application on android","<android><java-me><jar><apk>","0","1","1","",""
"4376730","1","","","2010-12-07 12:49:42","-1","313","<p>I have created a tabhost project and in one of my tab i have a listview and i want to display next activity in the same tab on clicking on a listitem? Please help</p>","565184","","","","","2010-12-07 16:34:59","Tabhost Problem?","<android>","1","0","","",""
"4376734","1","4377278","","2010-12-07 12:49:55","1","875","<p>I can get the artist, title and track information from the MediaStore, but how do I get the path or uri of the media file I'm trying to play?</p>","421372","","","","","2010-12-07 13:47:23","How do I get the URI of a music from the MediaStore?","<android><media><android-contentprovider>","1","0","1","",""
"4376902","1","4376967","","2010-12-07 13:08:34","26","10746","<p>Keeping the screen awake can be accomplished by using a wakelock by</p><pre><code>mWakeLock = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK,                 getClass().getName());</code></pre><p>Or by adding the FLAG_KEEP_SCREEN_ON to the window,</p><pre><code>getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);</code></pre><p>What is the technical difference between the two and in terms of performance and battery life which is recommended?</p>","421372","","","","","2011-08-07 15:55:15","Difference between Wakelock and FLAG_KEEP_SCREEN_ON?","<android><screen>","1","0","4","",""
"4376905","1","4378036","","2010-12-07 13:09:05","0","1295","<p>I am using IntelliJ IDEA 10 preview and have updated the android SDK to look at 2.3 which appears to have broken IntelliJ's support of android (no devices in the target device dialogue).  <strong>I'm aware that ADB has changed location and have updated my path to include both the tools and platform-tools directories</strong>.  I know IDEA 10 is a preview and I'm aware of everything which that entails, but I'm wondering if there's anything I can do to get it working with the Android SDK?</p>","264276","","","","","2010-12-07 14:58:43","Intellij IDEA 10 with Android 2.3","<android><intellij-idea><android-sdk-2.3>","2","0","","",""
"4376918","1","4377497","","2010-12-07 13:10:06","1","1933","<p>i'm trying to make heavy use of the Location API. I have no problem whatsoever doing a simple Activity that refreshes a TextView with a LocationListener, that's fine.</p><p>The thing is, i must put all the Location stuff in something like a Manager class that gets called by the main Activity. So i must place everything inside that class and pass say the location to the Activity. This is the Activity:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);            setContentView(R.layout.main);    g = new GPSManager(getApplicationContext());    t = new Thread(g);    t.start();    updateWithNewLocation(g.getLocation());}    private void updateWithNewLocation(Location location) {    String latLongString;    TextView myLocationText;    myLocationText = (TextView)findViewById(R.id.loca);    if (location != null) {       double lat = location.getLatitude();       double lng = location.getLongitude();       latLongString = ""Lat:"" + lat + ""\nLong:"" + lng;    } else {       latLongString = ""No location found"";    }    myLocationText.setText(""Your Current Position is:\n"" +    latLongString); }    </code></pre><p>And this is the ""Manager"" class:</p><pre><code>public GPSManager(Context context) {    locationManager = (LocationManager)context.getSystemService(service);     String service = Context.LOCATION_SERVICE;    Criteria criteria = new Criteria();    criteria.setAccuracy(Criteria.ACCURACY_FINE);    criteria.setAltitudeRequired(false);    criteria.setBearingRequired(false);    criteria.setCostAllowed(true);    criteria.setPowerRequirement(Criteria.POWER_LOW);    provider = locationManager.getBestProvider(criteria, true); }public Location getLocation() {    return this.location;}private final LocationListener locationListener = new LocationListener() {    public void onLocationChanged(Location location) {        Manager.this.location=location;    }    public void onProviderDisabled(String provider){        locationManager.removeUpdates(this);    }    public void onProviderEnabled(String provider){ }    public void onStatusChanged(String provider, int status,        Bundle extras){ }    };@Overridepublic void run() {   Looper.prepare();   locationManager.requestLocationUpdates(provider, 0, 0,           locationListener);           location = locationManager.getLastKnownLocation(provider);   Looper.loop();   Looper.myLooper().quit();}private Handler handler = new Handler() {@Overridepublic void handleMessage(Message msg) {    locationManager.removeUpdates(locationListener);}</code></pre><p>The problem i have is that, well, it doesn't works at all! If i put this code in the activity, no thread involved, it works great. But this way, it just says ""no location found"". I need to make the Manager class always listening to changes, so when i ask for the current location is updated.</p>","495904","","","","","2011-10-13 06:16:08","Android Location and Threads","<java><android><multithreading><location>","2","0","2","",""
"4376962","1","","","2010-12-07 13:15:27","3","6942","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3912849/implement-page-curl-on-android"">Implement page curl on android?</a>  </p></blockquote><p>I am new to Android. I need a sample code for page flip/curl/turn effect in Android. </p>","533677","","313758","","2011-03-03 07:12:45","2012-05-20 23:30:30","Page curl/turn effect in Android","<android>","0","4","7","2012-05-20 23:30:40",""
"4376963","1","","","2010-12-07 13:15:28","2","424","<p>I am developing an IM application on android 2.2 and when somebody writes to me I want to see that he is typing to me, exactly like on yahoo messenger. How could I do this on Android 2.2? If you can give me an example I would be grateful. Thank you and I'm waiting your answers.</p>","477758","","21234","","2010-12-07 13:16:56","2010-12-07 13:35:56","Android 2.2 How to know when somebody is typing?","<android>","2","0","1","",""
"4376998","1","","","2010-12-07 13:18:50","2","363","<p>I am new to Android development. We are currently trying to port our existing framework on to Android. We have a core library (existing one) which exposes a singleton instance which provides us a set of flags based on which certain operations are performed. Now when i perform certain operations and flags of the single instance are modified. When i exit the application and restart it, my expectation was that these flags should have been reset to the default values, but it fails.. :-(. Ive read in several posts that the reference would still be active until the application is killed by the OS. Can someone suggest me how to overcome this issue. Any work around?</p>","533690","","244296","","2010-12-07 13:40:26","2010-12-07 13:40:26","Issue with Singleton","<android>","2","0","","",""
"4377217","1","","","2010-12-07 13:42:13","3","2163","<p>I want to find a way specific SMS that contains a specific word and answer back automatically.</p><p>I have found a way to answer the SMS but I still can't work on finding the SMS...</p>","533731","","213269","","2010-12-07 15:41:27","2012-10-18 13:15:30","Android SMS programming","<android><sms>","4","0","1","",""
"4377297","1","4377437","","2010-12-07 13:50:05","2","667","<p>I'm trying to transform an XML file to Android layout XML through XSLT. So far I got this working, it's returning valid XML. I want this output to be displayed via setContentView (or if this isn't possible, I would like to add Views to a ViewFlipper. So far I haven't been succesfull and I also cannot find any information on this topic.</p><p>This is my code:</p><pre><code>Source xmlSource = new StreamSource(projectFile); //a XML file on the SD cardSource xsltSource = new StreamSource(getResources().openRawResource(R.raw.session));TransformerFactory transFact = TransformerFactory.newInstance();Transformer trans = transFact.newTransformer(xsltSource);OutputStream output = new StringOutputStream();StreamResult result = new StreamResult(output);trans.transform(xmlSource, result);</code></pre><p>output.toString() returns the transformed XML in a String format, so far everything works! But how can I use this XML in my layout? I've tried the following approaches:</p><pre><code>setContentView(output);</code></pre><p>and:</p><pre><code>projectFlipper = (ViewFlipper)findViewById(R.id.projectFlipper);projectFlipper.addView(output);</code></pre><p>I've tried to cast the variable, but I've been stuck for quite a while now. What am I overlooking? Or is there no possible way to do this?</p><p>Thanks in advance!</p>","533719","","","user357812","2010-12-07 13:54:13","2010-12-07 14:15:36","Can I display XML from a variable in through setContentView?","<android><xml><layout>","3","0","","",""
"4377393","1","4377439","","2010-12-07 14:00:22","0","258","<p>I have a bitmap object. I want to overwrite a .png image under drawable folder with the bitmap object content. I need a sample code to do this.Thanks in advance</p>","525004","","","","","2010-12-07 14:05:32","Write image in drawable using android 2.1","<android>","1","0","","",""
"4377430","1","4435399","","2010-12-07 14:04:44","1","1388","<p>I would like to build an Android app showing a dashboard with many different graphical indicators. Have you already used a library containing these items?Can anyone help me in this?</p><p>Thanks in advance and greetingsc.</p>","339500","","339500","","2010-12-14 08:59:15","2010-12-14 13:24:27","Looking for Android dashboard-like widget library","<android><widget>","2","2","","",""
"4377459","1","","","2010-12-07 14:07:15","0","2393","<p>I have a one row database just for saving app data. My goal is to read one column (one value) from it.</p><p>This query returns all the columns in a Cursor:</p><pre><code>public Cursor readAll() {       return getReadableDatabase().query(tableName, null, null, null, null, null, null);    }</code></pre><p>It returns a Cursor with one row in it, just perfect. However, I don't want to read all columns at once, because it's slow as I have blob's in db too.Instead, I'd like to read just one column at a time, separately. For example, for a column called ""TEXT"" it would be this:</p><pre><code>public Cursor readText() {      String[] projection = new String[]{""TEXT""};      return getReadableDatabase().query(tableName, projection, null, null, null, null, null);    }</code></pre><p>However, this won't work, as I get back a Cursor with zero rows.</p><p>So, how to read a specific column from SQLiteBatabase in Android? </p>","54155","","","","","2010-12-07 14:18:29","Android SQLiteDatabase: Reading one column","<android><sqlite>","3","1","","",""
"4377482","1","","","2010-12-07 14:09:17","0","560","<p>I have an Android Project and a TestProject, and I've written some unit tests. I can run all Tests in eclipse.</p><p>No I try to run the tests via command-line, because I want to parse the output:adb shell am instrument -w -r  com.allg.test/android.test.InstrumentationTestRunner </p><p>Everything seems fine. But when I am editing a TestCase, and run the command again, the output will not change (although I changed a test). I have to run the tests in eclipse first, to refresh the command line test result. </p><p>How is this possible?</p>","468259","","","","","2010-12-07 14:09:17","android unit tests via command line","<java><android><eclipse><unit-testing><adb>","0","5","","",""
"4377496","1","","","2010-12-07 14:10:20","0","594","<p>I downloaded the source code from IBM for RSS reader implementation. </p><p><a href=""http://www.ibm.com/developerworks/opensource/library/x-android/index.html"" rel=""nofollow"">http://www.ibm.com/developerworks/opensource/library/x-android/index.html</a></p><p>But when I am running the application, it displays nothing. Please tell me the problem with this application or suggest me a good and simple tutorial for the same.</p><p>Thank You..</p>","523058","","","","","2012-11-23 04:48:31","RSS for Android","<android><rss>","1","0","","",""
"4377533","1","4377577","","2010-12-07 14:14:37","4","328","<p>My code is basically allocation free, however the GC runs every 30 seconds or so when at 60fps. Checking the app with DDMS for allocation shows there is ALOT of <code>SimpleListIterator</code> being allocated. There is also some stuff being allocated because i use <a href=""http://d.android.com/reference/java/util/concurrent/Exchanger.html"" rel=""nofollow""><code>Exchanger</code></a>. </p><p>The SimpleListIterator comes from for each loops <code>for (T obj : objs) {}</code>. I was under the impression that the compilator/translator would optimize those to not use iterators for types that support it (I basically only use ArrayList) but that seems to not be the case.</p><p>How can I avoid allocating all these <code>SimpleListIterators</code>? One solution would be to switch to regular for loops <code>for (int i = 0; i &lt; size; ++i) {}</code> but I like for each loops :(</p><p>Another way would be to extend ArrayList which returns an <code>Iterator</code> that is only allocated once.</p><p>A third way I hacked together is using a static helper function which returns a <code>Collection</code> which is reusing an <code>Iterator</code>. I hacked something like this together but the casting feels very hackish and unsafe. It should be thread safe though as I use <code>ThreadLocal</code>? See below:</p><pre><code>public class FastIterator {    private static ThreadLocal&lt;Holder&gt; holders = new ThreadLocal&lt;Holder&gt;();    public static &lt;T&gt; Iterable&lt;T&gt; get(ArrayList&lt;T&gt; list) {        Holder cont = holders.get();        if (cont == null) {            cont = new Holder();            cont.collection = new DummyCollection&lt;T&gt;();            cont.it = new Iterator&lt;T&gt;();            holders.set(cont);        }        Iterator&lt;T&gt; it = (Iterator&lt;T&gt;) cont.it;        DummyCollection&lt;T&gt; collection = (DummyCollection&lt;T&gt;) cont.collection;        it.setList(list);        collection.setIterator(it);        return collection;    }    private FastIterator() {}    private static class Holder {        public DummyCollection&lt;?&gt; collection;        public Iterator&lt;?&gt; it;    }    private static class DummyCollection&lt;T&gt; implements Iterable {        private Iterator&lt;?&gt; it;        @Override        public java.util.Iterator&lt;T&gt; iterator() {            return (java.util.Iterator&lt;T&gt;) it;        }        public void setIterator(Iterator&lt;?&gt; it) {            this.it = it;        }    }    private static class Iterator&lt;T&gt; implements java.util.Iterator&lt;T&gt; {        private ArrayList&lt;T&gt; list;        private int size;        private int i;        @Override        public boolean hasNext() {            return i &lt; size;        }        @Override        public T next() {            return list.get(i++);        }        @Override        public void remove() {        }        public void setList(ArrayList&lt;T&gt; list) {            this.list = list;            size = list.size();            i = 0;        }        private Iterator() {}    }}</code></pre>","253583","","","","","2010-12-07 19:54:32","Allocation free game","<java><android><opengl-es>","3","5","","",""
"4377668","1","4391404","","2010-12-07 14:26:18","1","1220","<p>I have a digital clock widget, and I want to use a custom font to display the time. I know that it can't be done in remoteviews, so I have obtained some code that renders the custom font to a bitmap and then pushes it across remoteviews to an imageview. However, I am unable to get it to work. This is my code so far:</p><pre><code>        public Bitmap buildUpdate(String time)    {            RemoteViews views = new RemoteViews(this.getPackageName(), R.layout.main);            Bitmap myBitmap = Bitmap.createBitmap(100, 50, Bitmap.Config.ARGB_4444);            Canvas myCanvas = new Canvas(myBitmap);            Paint paint = new Paint();            Typeface clock = Typeface.createFromAsset(this.getAssets(),""Clockopia.ttf"");            paint.setAntiAlias(true);            paint.setSubpixelText(true);            paint.setTypeface(clock);            paint.setStyle(Paint.Style.FILL);            paint.setColor(Color.WHITE);            paint.setTextSize(15);            myCanvas.drawText(time, 0, 20, paint);            views.setImageViewBitmap(R.id.TimeView, myBitmap);            return myBitmap;            }    private void update() {        mCalendar.setTimeInMillis(System.currentTimeMillis());        final CharSequence date = DateFormat.format(mDateFormat, mCalendar);        final CharSequence day = DateFormat.format(mDayFormat, mCalendar);//        final CharSequence time = DateFormat.format(mTimeFormat, mCalendar);        String time = (String) DateFormat.format(mTimeFormat, mCalendar);        RemoteViews views = new RemoteViews(getPackageName(), R.layout.main);        views.setTextViewText(R.id.Day, day);        views.setTextViewText(R.id.Date, date);//        views.setTextViewText(R.id.Time, time);        buildUpdate(time);        ComponentName widget = new ComponentName(this, DigiClock.class);        AppWidgetManager manager = AppWidgetManager.getInstance(this);        manager.updateAppWidget(widget, views);    }</code></pre><p>Any help is appreciated.</p>","525720","","","","","2011-06-15 17:17:39","Problem showing time using custom font","<android><widget><typeface>","1","1","2","",""
"4377762","1","","","2010-12-07 14:34:49","3","1088","<p>I am interested in Mobile Mesh network, so we choose it to be our graduation project which it's idea about building mobiles mesh network as a technology and internet connection sharing as the application of top of this technology for android, but we are now totally lost as we don't know the main component and couldn't find a good start. So kindly help us by supplying us with resources or tutorials that show how to make a design of mobile mesh network and generate an application on top of this technology or books to be read.</p>","533796","","918472","","2012-01-10 11:21:39","2012-01-10 11:21:39","Mobile Mesh network to share internet connection for android","<android><routing><network-protocols><mesh>","3","0","1","",""
"4377839","1","","","2010-12-07 14:41:54","0","2533","<p>I am using json parsing in one class file. How to store this class variable in sql lite. I have to include below my code.</p><pre><code>public class jsonreader {    ////////////////// Issues Parsing//////////////    public static ArrayList&lt;String&gt;issues_title=new ArrayList&lt;String&gt;();    public static ArrayList&lt;String&gt;issues_no=new ArrayList&lt;String&gt;();    public static ArrayList&lt;String&gt;last_date_open=new ArrayList&lt;String&gt;();    public static ArrayList&lt;String&gt;last_date_close=new ArrayList&lt;String&gt;();    public static ArrayList&lt;String&gt;issues_name=new ArrayList&lt;String&gt;();    public static ArrayList&lt;String&gt;issues_status=new ArrayList&lt;String&gt;();    public static ArrayList&lt;String&gt;issues_ball_court=new ArrayList&lt;String&gt;();    public static int dataval=0;    public static int res_code=0;    public static void json(String s)     {                            res_code=0;                        JSONArray Arr=obj.getJSONArray(""data"");                        System.out.println(""data""+Arr.length());                        dataval=0;                        int len=Arr.length();                        for(int i=0;i&lt;Arr.length();i++)                        {                            JSONObject pageobj=Arr.getJSONObject(i);                            String date_open=pageobj.getString(""date_opened"");                            if(date_open.equals(da))                            {                                last_date_open.add(""N/A"");                                  }                            else                            {                                last_date_open.add(date_open);                              }                            String issue_title=pageobj.getString(""issue_title"");                            if(issue_title.equals(da))                                  {                                issues_title.add(""N/A"");                            }                               else                            {                                issues_title.add(issue_title);                              }                            String issue_nu=pageobj.getString(""issue_number"");                            if(issue_nu.equals(da)){                                issues_no.add(""N/A"");                            }                            else                            {                                issues_no.add(issue_nu);                            }                            String date_closed=pageobj.getString(""date_closed"");                            if(date_closed.equals(da))                            {                                last_date_close.add(""N/A"");                            }                            else                            {                                last_date_close.add(date_closed);                            }                            String issue_name=pageobj.getString(""issue_name"");                            if(issue_name.equals(da))                            {                                issues_name.add(""N/A"");                             }                            else                            {                                issues_name.add(issue_name);                                }                            String status=pageobj.getString(""status"");                            if(status.equals(da))                            {                                issues_status.add(""N/A"");                            }                            else                            {                                issues_status.add(status);                            }                            String ball_in_court=pageobj.getString(""ball_in_court_ini"");                            if(ball_in_court.equals(da))                            {                                issues_ball_court.add(""N/A"");                            }                            else                            {                                issues_ball_court.add(ball_in_court);                            }                           }                }               }</code></pre>","533787","","236247","","2011-06-28 14:39:31","2011-06-28 14:39:31","How to store json values in SQLite database ","<android><json><sqlite>","0","1","","",""
"4377875","1","4377906","","2010-12-07 14:45:22","2","2085","<p>i'm currently trying to create a service that updates the current location of the person holding the handphone every 10 mins. The service will then send a http post to a server even there's no update to the location every 10 mins. I've tried using scheduleAtFixedRate but there's lots of problem. sometimes it's irresponsive and does not send according to the 10mins, not sure about the reason. Would be glad to have someone to point me the direction of which scheduler to use or any solution to solve my current scheduler which does not work well.</p>","492182","","","","","2010-12-07 14:47:10","How to set scheduler for android","<android><location><scheduler><schedule>","1","0","2","",""
"4377901","1","4377938","","2010-12-07 14:47:03","2","5222","<p>When clicking a file in any filebrowser the user usually gets to choose from a list wich app to open with.How can i add my program to this ""Complete action using""-list, so that the file can be opened in my app?</p><p>I know this has to be added to the manifest somehow, but i can't find what to add.</p><p>Anyone?</p><p>RESULT: </p><p>I followed the answeres i got here and made it work with this code:</p><pre><code>&lt;intent-filter android:label=""MyApp""&gt;&lt;action android:name=""android.intent.action.VIEW"" /&gt;&lt;action android:name=""com.MyApp.action.EDIT_NOTE"" /&gt;&lt;category android:name=""android.intent.category.DEFAULT"" /&gt;&lt;data android:mimeType=""text/plain"" /&gt;&lt;data android:pathPattern="".*txt"" /&gt;</code></pre><p>   </p>","484146","","484146","","2010-12-07 16:49:02","2010-12-07 16:49:02","Android: Add my program to ""Complete action using""-list, when clicking a file in filebrowser","<android><action><manifest><using><complete>","2","1","1","",""
"4377933","1","4378087","","2010-12-07 14:50:02","1","5795","<p>Hi i want to detect outgoing call in android application . Actually i have detect incoming call but it is also working for outgoing call and i don't want it. I need it to work only for outgoing. here is my code.... </p><pre><code>boolean ringing = false;boolean offhook = false;public void onCallStateChanged(int state, String incomingNumber) {   switch (state) {    case TelephonyManager.CALL_STATE_IDLE: if((!ringing)&amp;&amp; offhook){              ///incomming call         }          break;case TelephonyManager.CALL_STATE_RINGING:    callerPhoneNumber = incomingNumber; Log.d(TAG, ""RINGING""); ringing = true; offhook = false;      break;   case TelephonyManager.CALL_STATE_OFFHOOK: Log.d(TAG, ""OFFHOOK""); offhook = true; ringing = false; break;}</code></pre>","307585","","819367","","2011-11-29 18:22:36","2012-10-04 02:25:12","outgoing call detect in PhoneStateListener","<android><listener><telephonymanager>","1","0","1","",""
"4378051","1","","","2010-12-07 15:00:15","1","520","<p>I am implementing a map based Android application. In that I am trying to get display the pins at TopLeft and Bottom right. The following is my code that I tried. But I am not able to display it. Can you please suggest a way to get these cordinate.</p><pre><code>public GeoPoint topLeft(GeoPoint mapCenter, int latspan, int langspan) { int lat = (mapCenter.getLatitudeE6()) + (latspan/2); int lang = (mapCenter.getLongitudeE6()) - (langspan/2); return new GeoPoint(lat, lang);}public GeoPoint bottomRight(GeoPoint mapCenter, int latspan, int langspan) { int lat = (mapCenter.getLatitudeE6()) - (latspan/2); int lang = (mapCenter.getLongitudeE6()) + (langspan/2); return new GeoPoint(lat, lang);}</code></pre>","533835","","21234","","2010-12-07 15:03:34","2011-09-27 13:07:01","TopLeft & Bottom right longitude and lattitude value of MapView in Android SDK","<java><android>","1","2","1","",""
"4378155","1","4378210","","2010-12-07 15:09:52","2","1852","<p>I am working on a music player app and it runs as a remote service. When I press back button to exit, the service stops. Why is this happening?</p><p>It also shows the following logcat message</p><pre><code>android.app.ServiceConnectionLeaked</code></pre>","421372","","421372","","2010-12-07 15:18:39","2010-12-07 15:18:39","Service stops after I exit my application","<android><service>","1","0","1","",""
"4378159","1","","","2010-12-07 15:09:58","0","547","<p>I'm a bit puzzled here. </p><p>From all the resources I've read on how to get the device id (IMEI) in Android, it seems that there is no way to get it without having a reference to the Activity or the Activity Context.</p><p>Is that true?</p><p>Could there be another way? Some static system methods to help perform this easy task?</p><p>Where is the logic behind this decision?</p><p>is this the only option out there?</p><pre><code>TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);String imei = mTelephonyMgr.getDeviceId(); </code></pre><p>with the following permission </p><pre><code>&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""/&gt;</code></pre><p>Thanks,</p><p>Ita</p>","189319","","","","","2010-12-07 15:34:41","Is there a way to access the device IMEI without having reference to the Activity or Context?","<android><android-context>","1","2","","",""
"4378171","1","4378242","","2010-12-07 15:11:09","0","1966","<p>We're about to build an app for both iPhone and Android, and it would (of course) be glorious to only build one application that could work on both platforms. My question is, how easy is it to drop out of these cross-platforms into native code for certain views/activities?</p><p>In other words, if I find that Titanium is terrible for a particular task, can I just write that in Objective-C for iPhone and Java for Android or does that involve a bunch of hacks? I'm hoping we'll be able to build the basic stuff cross-platform, but I'd still like to be able to drop to native code if I start hitting snags or some hardware feature is poorly supported. We're leaning towards Titanium since we (as a shop) are unfamiliar with Ruby, but Rhodes is something we're definitely looking into as well.</p><p>From what I've read, the jury is out on these frameworks, so I'd like to have fallback options in case the app becomes buggy/unwieldy halfway through. I realize that a lot of this depends on exactly what you want to do with the app, but we're still trying to figure out what we CAN do cross-platform first...</p>","385830","","","","","2010-12-07 15:19:14","Mixing Appcelerator/Titanium or Rhodes with native code","<iphone><android><titanium><appcelerator><rhodes>","1","2","1","",""
"4378260","1","4502194","","2010-12-07 15:20:27","1","2529","<p>Here is My Whole Code.......</p><h2>BroadcastExample.java</h2><pre><code> package com.example.broadcast;&gt; import android.app.Activity; import&gt; android.content.Context; import&gt; android.os.Bundle; import&gt; android.telephony.*; import&gt; android.util.Log; import&gt; android.widget.TextView;public class BroadcastExaple extends Activity { TextView textOut; TelephonyManager telephonyManager; PhoneStateListener listener; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  try {   super.onCreate(savedInstanceState);   // Get the UI   textOut = new TextView(this);   textOut.setText(""DEmoBroadCast"");   setContentView(textOut);   // Get the telephony manager   telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);   // Register the listener wit the telephony manager   telephonyManager.listen(listener,PhoneStateListener.LISTEN_CALL_STATE);   // Create a new PhoneStateListener   listener = new PhoneStateListener() {    @Override    public void onCallStateChanged(int state, String incomingNumber) {     Log.d(""DEBUG"", ""Phone listener...."");     String stateString = ""N/A"";     switch (state) {     case TelephonyManager.CALL_STATE_IDLE:      stateString = ""Idle"";      break;     case TelephonyManager.CALL_STATE_OFFHOOK:      stateString = ""Off Hook"";      break;     case TelephonyManager.CALL_STATE_RINGING:      stateString = ""Ringing"";      break;     }     textOut.append(String.format(""\nonCallStateChanged: %s"",       stateString));    }   };  } catch (Exception e) {  } }}</code></pre><h2>AndroidManifest.xml</h2><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.broadcast"" android:versionCode=""1"" android:versionName=""1.0""&gt; -&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;  -&lt;activity android:name="".BroadcastExaple"" 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-prmission android:name=""android.permission.READ_PHONE_STATE"" /&gt; -&lt;uses-sdk android:minSdkVersion=""7"" /&gt;-&lt;/manifest&gt; </code></pre>","533863","","857361","","2012-07-26 10:12:58","2012-07-26 10:12:58","PhoneStateListener doesn't call","<android><android-emulator><phone-state-listener>","1","3","","",""
"4378280","1","","","2010-12-07 15:22:04","5","2768","<p>I'm trying to detect signal strength changes in a wifi connection. I'm confused of which method I should use in my BroadcastReceiver. What is the difference between using getConnectionInfo() and getScanResults() - from which then I can use relevant method to get the rssi value?</p><p>For example: if I use getConnectionInfo(), then later on I use getRssi(). Or I could use getScanResults() and the ""level"" property.</p><p>I display their values using Toast and it doesn't always show same values. When wifi conn is lost, the getConnectionInfo().getRssi() shows -200, while result.level still shows its previous value.</p><p>Any thoughts? Thanks!</p><pre><code>String netSSID = wifi.wifiMgr.getConnectionInfo().getSSID();int netRSSI = wifi.wifiMgr.getConnectionInfo().getRssi();List&lt;ScanResult&gt; results = wifi.wifiMgr.getScanResults();for (ScanResult result : results) {    if (result.SSID.equalsIgnoreCase(netSSID)) {        anothernetRSSI = result.level;    }}</code></pre>","404437","","404437","","2010-12-08 08:49:55","2012-06-02 05:39:33","difference between getConnectionInfo() and getScanResults() to detect signal strength changes","<android><wifi><rssi>","2","0","2","",""
"4378429","1","4379486","","2010-12-07 15:37:00","2","807","<p>I read that this exception means that I added a LinearLayout that had no children but I checked the suspected layout and it has 21 children.The exception doesn't seem to get raised until after the suspected layout (main) gets added to the screen so I guess it has a nested linearlayout has has no children, but there are alot of linearlayouts nested in there - so is there a quick way to find which one or to otherwise debug this?</p><p>Thanks</p><p>PS: seems when I step through this code I get frequent ""out of memory"" eclipse crashes too.</p><p>PPS:Here is the exception stack from the error log:</p><pre><code>com.sun.jdi.InternalException: Got invalid data:java.io.UTFDataFormatException: Second byte input does not match UTF Specificationat org.eclipse.jdi.internal.MirrorImpl.defaultIOExceptionHandler(MirrorImpl.java:269)at org.eclipse.jdi.internal.VirtualMachineImpl.allClasses(VirtualMachineImpl.java:370)at org.eclipse.jdi.internal.VirtualMachineImpl.allRefTypes(VirtualMachineImpl.java:382)at org.eclipse.jdi.internal.ReferenceTypeImpl.nestedTypes(ReferenceTypeImpl.java:1105)at org.eclipse.jdt.internal.debug.eval.ast.engine.BinaryBasedSourceGenerator.buildTypeDeclaration(BinaryBasedSourceGenerator.java:310)at org.eclipse.jdt.internal.debug.eval.ast.engine.BinaryBasedSourceGenerator.buildTypeDeclaration(BinaryBasedSourceGenerator.java:322)at org.eclipse.jdt.internal.debug.eval.ast.engine.BinaryBasedSourceGenerator.buildTypeDeclaration(BinaryBasedSourceGenerator.java:145)at org.eclipse.jdt.internal.debug.eval.ast.engine.BinaryBasedSourceGenerator.buildTypeDeclaration(BinaryBasedSourceGenerator.java:160)at org.eclipse.jdt.internal.debug.eval.ast.engine.BinaryBasedSourceGenerator.buildSource(BinaryBasedSourceGenerator.java:74)at org.eclipse.jdt.internal.debug.eval.ast.engine.EvaluationSourceGenerator.getInstanceSourceMapper(EvaluationSourceGenerator.java:204)at org.eclipse.jdt.internal.debug.eval.ast.engine.EvaluationSourceGenerator.getSource(EvaluationSourceGenerator.java:216)at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.getCompiledExpression(ASTEvaluationEngine.java:226)at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.evaluate(ASTEvaluationEngine.java:115)at org.eclipse.jdt.internal.debug.ui.JavaWatchExpressionDelegate$EvaluationRunnable.run(JavaWatchExpressionDelegate.java:144)at org.eclipse.jdt.internal.debug.core.model.JDIThread$ThreadJob.run(JDIThread.java:2751)at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)</code></pre>","491739","","321697","","2010-12-07 16:10:41","2011-12-12 14:19:41","strange exception -- java.lang.RuntimeException: mBaselineAlignedChildIndex of LinearLayout set to an index that is out of bounds","<android><exception><android-linearlayout>","2","2","","",""
"4378438","1","4378440","","2010-12-07 15:37:58","6","13129","<p>I upgraded to Gingerbreak 2.3 SDK today and started receiving this error when I try to run DDMS:</p><blockquote>  <p>Failed to get adb version: Cannot run program ""adb"": CreateProcess error=2, The system cannot find the file specified.</p></blockquote><p>How can I fix this?  Running Windows 7, 64bit.</p>","396","","213269","","2010-12-07 15:40:05","2013-01-24 14:22:55","DDMS throwing ADB error since SDK API 9 upgrade","<android><adb><ddms><android-sdk-2.3>","3","1","3","",""
"4378473","1","","","2010-12-07 15:40:42","0","1015","<p>I'm playing around with code for playing an MP3 stream, the code is as follows;</p><pre><code> try {   URL url = new URL(""streamURL"");   URLConnection con = url.openConnection();   con.connect();   con.getContent();   MediaPlayer mp = new MediaPlayer();   mp.setDataSource(con.getURL().toString());   mp.prepare();   mp.start(); } catch(Exception e) { }</code></pre><p>Crude, but I'm only playing around at the minute.  This code works fine in the emulator, but when running on my Galaxy S I find the error ""Command PLAYER_INIT completed with an error or info -105"", in the log file.</p><p>Has anyone come across this before, and is this something specific to the Galaxy ?</p><p>Many thanks in advance,</p><p>Neil.</p>","464850","","","","","2011-10-15 22:01:02","MediaPlayer error when playing MP3 stream","<android><media-player>","2","1","","",""
"4378528","1","4378843","","2010-12-07 15:44:41","-1","568","<p>I have implemented a Spinner in an activity which lists currencies to choose from. However, when any currency is selected, it returns the value as ""database.sqlite.sqlitecursor@"" something.</p><p>How do I get it to display the actual string instead of the current result?</p><p>This is the code:</p><pre><code>private void fillSpinnerData() {    String[] fields = new String[]  {   db.CURRENCY_CODE    };    int[] views = new int[] {   android.R.id.text1 /*R.id.text1, R.id.text2*/   };    c = db.getAllCurrencies();    startManagingCursor(c);    currencySpinner = (Spinner)findViewById(R.id.spnChangeCurrency);    SimpleCursorAdapter currencies = new SimpleCursorAdapter(            this,            android.R.layout.simple_spinner_item,            c, fields, views);    currencies.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    currencySpinner.setAdapter(currencies);    currencySpinner.setOnItemSelectedListener(new OnItemSelectedListener() {        public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id)        {            String index = currencySpinner.getSelectedItem().toString();            Toast.makeText(getBaseContext(),                ""You have selected item : "" + index + "" which is row "" + id,                Toast.LENGTH_LONG).show();        }        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {}    });}</code></pre><p>Thanks in advance.</p>","450534","","","","","2010-12-07 16:13:46","Android spinner issue","<android><spinner>","1","0","1","",""
"4378533","1","4378606","","2010-12-07 15:45:12","37","11987","<p>I am using handler.postdelayed to create a waiting period before the next stage of my app takes place.   During the wait period I am displaying a dialog with progress bar and 'cancel' button.   My problem is I cant find a way to cancel the postdelayed task before the time elapses.   Any suggestions?Ron </p>","479505","","","","","2010-12-07 15:59:14","cancelling a handler.postdelayed process","<android>","2","1","6","",""
"4378685","1","4379589","","2010-12-07 16:00:15","2","2073","<p>I have been following a tutorial to make Android App Widgets, and I was having a little trouble. The tutorial led me to create this code:</p><pre><code>public void onUpdate(Context context, AppWidgetManager appWidgetManager, int [] appWidgetIds) {    Timer timer = new Timer();    timer.scheduleAtFixedRate(new MyTime(context, appWidgetManager), 1, 1000);}private class MyTime extends TimerTask {    RemoteViews remoteViews;    AppWidgetManager appWidgetManager;    ComponentName thisWidget;    DateFormat format = SimpleDateFormat.getTimeInstance(SimpleDateFormat.MEDIUM, Locale.getDefault());    public MyTime(Context context, AppWidgetManager appWidgetManager) {        this.appWidgetManager = appWidgetManager;        remoteViews = new RemoteViews(context.getPackageName(), R.layout.main);        thisWidget = new ComponentName(context, FlipWidget.class);    }    @Override    public void run() {        remoteViews.setTextViewText(R.id.widget_text, ""Time: ""+format.format(new Date()));        appWidgetManager.updateAppWidget(thisWidget, remoteViews);    }}</code></pre><p>but it seems that the run method is never being called, as the TextView never changes. Thanks for your help, I'd love to get a handle on App Widgets.</p><p>Nick</p>","468498","","","","","2010-12-07 17:23:34","App Widget update TextView","<android><timer><textview><appwidget>","1","0","1","",""
"4378826","1","4379264","","2010-12-07 16:12:20","1","1901","<p>I'm pretty sure I've done this before, but I've forgotten how.</p><p>Here's the problem:I've got a button and a textview, and I want the textview to be centered, while the button is on the left side.</p><p>No problem? Just put them in a relativelayout, make the textview centerinparent, and the button alignparentleft. </p><p>But now I'm going to dynamically change the text, so it can potentially be written on top of the button! I'll just add toRightOf=""@id/button"" on the textview. No, now it's no longer centered.</p><p>I wish I could provide a screenshot, but it seems the computer is out of memory and can't do that.</p><p><strike>Here's some code: <a href=""http://pastebin.com/3N70Vjre"" rel=""nofollow"">http://pastebin.com/3N70Vjre</a> (Since I can't paste xml...?)</strike></p><pre><code>  &lt;RelativeLayout        android:id=""@+id/header""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""&gt;        &lt;Button                android:id=""@+id/leftbutton""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_alignParentLeft=""true""                android:layout_centerVertical=""true""                android:text=""text!""                /&gt;        &lt;TextView                android:id=""@+id/toptext""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@android:color/white""                android:layout_toRightOf=""@id/leftbutton""                android:layout_centerInParent=""true""                android:textSize=""16sp""                android:textStyle=""bold""                android:text=""Text!""                android:singleLine=""true""                /&gt;  &lt;/RelativeLayout&gt;</code></pre>","397060","","321697","","2010-12-07 16:18:26","2010-12-07 16:51:56","Centering a TextView while keeping it to the right of a button?","<android><android-layout><relativelayout>","3","2","","",""
"4378954","1","4379064","","2010-12-07 16:24:52","4","1994","<p>I have an Activity in my app that simply displays some results from a search.  This data is displayed using a ListView.  This works well.  I recently tried adding an Adview underneath it, but it simply doesn't display.  What's more, it pushes my List View up to the top of the screen so that it can only occupy the top 20% or so of the screen - with only blank underneath.</p><p>Here is the display XML:</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/uk.co.redfruit.android.whogotwhat""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:paddingTop=""10dp""    android:paddingBottom=""10dp""    &gt;    &lt;ListView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""         android:id=""@+id/scanResults""        android:paddingLeft=""5dp""         android:paddingRight=""5dp""         /&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><p>What am I missing here?</p>","398293","","1525300","","2012-07-24 08:37:00","2012-07-24 08:37:00","Can't seem to display both a ListView and an AdView at the same time","<android><listview><admob><adview>","2","0","3","",""
"4379113","1","","","2010-12-07 16:37:59","8","1250","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3953012/eclipse-android-sdk-slow-content-assist-performance"">Eclipse Android SDK slow Content Assist performance</a>  </p></blockquote><p>When I write a code like so:</p><pre><code>TextView tv = new TextView(context);tv.                                    // Here auto-complete window appears, and laaaaag,// and lag and lag, //and eclipse status of background working is ""Calculating Additional Info""</code></pre><p>On my Windows7 in ResourceMonitor i can see that eclipse.exe is waiting for TCP in-out.</p><p>Anybody can help me? Thanls in advance!!</p>","344053","","5821","","2011-02-15 13:45:43","2011-02-15 13:50:31","Android eclipse plugin lags on type (3.6 - Helios)","<android><eclipse><plugins><lag><content-assist>","4","6","4","2011-06-19 14:50:02",""
"4379261","1","4379748","","2010-12-07 16:51:46","1","2070","<p>Android 2.3 was recently released last night. So naturally I tried my app on it and found there was date formatting issue.  I have noticed the DateFormatter produces different formats. So do this in a simple Java program:</p><pre><code>((SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.LONG,     DateFormat.LONG)).format(new Date());</code></pre><p>Output is</p><blockquote>  <p>December 7, 2010 11:49:40 AM EST</p></blockquote><p>Do the same thing in an android emulator and you get </p><blockquote>  <p>December 7, 2010 11:42:50 AM GMT-05:00</p></blockquote><p>Notice the different time zone. Has anybody ran in to this issue? Is there another formatter I can use that doesn't depend on Java's implementation? </p><p><strong>EDIT:</strong>Ok so here is more detail to why I think this is broken:</p><p>Using this code:</p><pre><code>private final DateFormat format =     new SimpleDateFormat(""EEE, dd MMM yyyy HH:mm:ss z"");</code></pre><p>I tried to parse a date but the following error is thrown:</p><pre><code>12-07 12:55:49.556: ERROR/DateDeserializer(847): Error when parsing date    java.text.ParseException: Unparseable date: ""Mon, 06 Dec 2010 17:13:35 EST""    at java.text.DateFormat.parse(DateFormat.java:626)    at com.currency.mobile.client.DateDeserializer        .deserialize(DateDeserializer.java:31)    at com.currency.mobile.client.DateDeserializer        .deserialize(DateDeserializer.java:19)    at org.codehaus.jackson.map.deser.SettableBeanProperty        .deserialize(SettableBeanProperty.java:149)</code></pre>","419075","","213269","","2010-12-07 18:24:32","2011-01-01 00:18:43","TimeZone broken in SimpleDateFormat in android 2.3","<java><android><datetime><date-format><simpledateformat>","3","1","1","",""
"4379271","1","4379822","","2010-12-07 16:52:30","0","867","<p>I have an android service that uses a native library via NDK/JNI. The native library is statically loaded/initialized as suggested...</p><pre><code>static {    System.loadLibrary(""mylibrary"");    if (!nativeClassInit())        throw new RuntimeException(""native init failed"");}</code></pre><p>Everything works fine until the service is stopped (e.g., from a UI activity where the service may be started/stopped). The problem is when the service is stopped the task has not yet been killed by android and if the user restarts the service the native libraries are not reloaded and a call to a native function causes a crash in the native code?</p><p>I tried calling the nativeClassInit() method again after a restart but this doesn't help?Also, I seen in other posts that unloading the native library is not allowed in Android.</p>","420008","","","","","2010-12-07 17:46:17","Call to JNI crashes after android service is restarted?","<android>","1","2","","",""
"4379451","1","4380101","","2010-12-07 17:08:22","6","326","<p>The problem is that my map isn't showing. It's just the grid that shows when you (for example:) haven't got the INTERNET permission.</p><p>Here's my java class:</p><pre><code>public class MapClass extends MapActivity { public void onCreate(Bundle icicle) {  super.onCreate(icicle);  setContentView(R.layout.maplayout);  MapView mapView = (MapView) findViewById(R.id.mapView);  mapView.setBuiltInZoomControls(true);    } @Override protected boolean isRouteDisplayed() {  // TODO Auto-generated method stub  return false; }}</code></pre><p>Here's my XML Layout file (minus the Map Key):</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:enabled=""true"" android:layout_height=""fill_parent""  android:clickable=""true"" android:apiKey=""MY-API-KEY"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>And here's 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.android.mapexample"" android:versionCode=""1"" android:versionName=""1.0"" android:installLocation=""internalOnly""&gt; &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""  android:debuggable=""true""&gt;  &lt;uses-library android:name=""com.google.android.maps"" /&gt;  &lt;activity android:name="".MapClass"" 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;&gt;  &lt;/activity&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion=""1"" /&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.ACCESS_COARSE_LOCATION"" /&gt; &lt;uses-permission android:name=""android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"" /&gt;&lt;/manifest&gt;</code></pre>","348261","","1288","","2011-06-17 17:48:35","2011-06-17 17:48:35","Can anyone help me get this map app working?","<android><google-maps><maps>","1","8","1","",""
"4379478","1","4379516","","2010-12-07 17:12:21","3","1833","<p>I was creating a shape to use as a button background.  I'm making a strip of buttons, and the one on the left edge is going to have rounded corners on the left, and the last one on the right will have rounded corners on the right.  This is pretty simple, and the api docs show you just how to do it.  However, when I used <code>android:topLeftRadius</code> and <code>android:bottomLeftRadius</code>, the result in the UI was as if I put bottomRightRadius.  The same behavior was true of the other side.  It appears that whoever implemented this swapped bottomRight and bottomLeft.  I'll post a snippet of the code below.</p><p>Is there some logical reason for this that I might be missing?  Or, if this was a mistake on the part of the Android engineers, will it stay backward compatible once they fix it?  I imagine they'd have to make all new attributes to keep the old ones valid (leftTop instead of topLeft maybe?).</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"" &gt;        &lt;shape&gt;            &lt;solid android:color=""#99000000"" /&gt;            &lt;padding                android:top=""8dp""                android:left=""8dp""                android:right=""8dp""                android:bottom=""8dp"" /&gt;            &lt;corners                android:topLeftRadius=""8dp""                android:bottomRightRadius=""8dp"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;</code></pre>","53501","","","","","2012-09-13 12:35:36","Comical bug in Android xml shape declaration","<android><xml><user-interface>","3","1","","",""
"4379548","1","4379688","","2010-12-07 17:19:33","1","795","<p>I'm parsing some xml for tv guide data and ran into this 18 digit timestamp (633934980000869533). Looks like C#'s DateTime ticks. Does anyone know how to convert this to regular java Date/Time?</p>","532794","","","","","2010-12-07 17:31:46","Android: TimeStamp conversion question!","<java><android><datetime>","1","2","1","",""
"4379758","1","4380489","","2010-12-07 17:38:52","0","909","<p>Hello I have a question about android's alarm manager, I would like to schedule an alarm that would execute using an initial interval and be able to change by the user. my code is :</p><pre><code> long firstTime = SystemClock.elapsedRealtime(); mAlarmSender = PendingIntent.getService(mContext, 0, new Intent(mContext,AlarmService_Service.class), 0);this.setInterval(Integer.parseInt(Interval));configShared.edit().putInt(""interval"", this.getInterval()).commit();// Schedule the alarm!AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstTime,this.getInterval(), mAlarmSender); </code></pre><p>the this.getInterval() is a method to hold the interval and is used to check if user has changed the interval.</p><p>Reading the documentation I found under the parameters of alarmManagers setRepeating method that says: </p><p>triggerAtTime   Time the alarm should first go off, using the appropriate clock (depending on the alarm type)</p><p>What excactly is this? Is the alarm canceled when I change the interval? also there's a problem cause I like this code to be executed every 5 minutes and this will execute every 5 minutes+firstinterval correct?</p><p>thanks in advanced maxsap</p>","234898","","","","","2010-12-07 18:57:24","help about android's alarm manager","<android>","1","0","","",""
"4379788","1","4379834","","2010-12-07 17:42:49","1","200","<p>I need to stub out the GSM network on a test android device for testing some parts of an application. Is this possible?</p><p>Thanks</p>","21586","","","","","2010-12-07 17:47:31","Stub out network on android device","<android>","2","0","","",""
"4379866","1","4380029","","2010-12-07 17:51:17","1","243","<p>This is my first question relating to android development. I would like to know the best way to go about storing an array on an android phone so that even when the app/activity is ended the data remains, I thought about doing it using a SQLite db, but have not been able to find any information about how to keep this database even when the app has ended.</p><p>Any advice would be apprectiated, thanks.</p><p>Sam</p>","400406","","","","","2010-12-07 18:23:42","Quick question about storage on android","<java><android><sqlite>","1","0","","",""
"4379913","1","4379941","","2010-12-07 17:56:02","2","406","<p>What Android platform should I program to? If I develop an app for Android 1.5, will it run on Android 2.2 or 2.3? If not, what should I do to make my app run on any platform?</p>","399459","","23897","","2010-12-07 18:13:43","2011-05-15 17:05:56","What Android platform to program to?","<android>","2","0","","",""
"4379954","1","","","2010-12-07 18:00:42","3","1184","<p>I'm working on a little app, and one of things that has been bugging me is the design of a status bar icon that looks good on all phones</p><p>The problem is that if you follow the official design guidelines (<a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design.html#statusbarstructure"" rel=""nofollow"">http://developer.android.com/guide/practices/ui_guidelines/icon_design.html</a>) you get an icon which looks great on phones running ""standard Android"" (2.2 and lower), which have light grey status bars, but phones running a customised UI (or Android 2.3) generally have black or dark grey status bars, and the beautifully designed icon you've just created looks rather out of place and amateurish on such a phone</p><p>Does anyone have any good suggestions for design of such icons?</p>","498251","","","","","2010-12-07 21:56:53","Android status bar icon design","<android><icons><statusbar>","1","1","","",""
"4379994","1","4380173","","2010-12-07 18:05:21","2","2284","<p>I am trying to create a trial version of an app i wrote. I copied my main project, then pasted it as a new project with a new name. I then refactored (appended Trial) to my activities, then i fixed any errors that cropped up because of this. Once the project compiled, I tried running the app.</p><p>When I try to run the trial app on the emulator, my app cannot find any of its resources (drawables, styles, etc) if I programatically access 'R.*'. If my app starts an activity that hard coded a style, that works fine (except the drawables are missing).</p><p>Also, I am not sure how resources are mapped, but when I open my generated R.java for each project they are identical! The errors thrown from my trial app say ""Resource not found for xyz' and the id the exception shows me is different than the one in generated R.java.</p><p>Any one have any ideas how i can get this working?</p><p>Thanks.</p><p>*<strong><em>Addition</em>**</strong>So I forgot to mention that I am targeting version Android 1.5 (api version 3). I just updated the target version to 4 and things worked... I would like to target 1.5 ... Anyone experience this? Thanks.</p>","354607","","354607","","2010-12-07 18:31:53","2011-08-12 06:59:54","Android & Eclipse copy existing app to new project creates a funny R.*","<java><android>","2","5","","",""
"4380011","1","","","2010-12-07 18:07:17","1","3257","<p>I want to know how can I do to extract a substring from a text file in android: </p><p>the text file is as shown below : </p><pre><code>[start_delimeter]0|1|text10|1|text20|1|text30|1|text4[end_delimiter]</code></pre><p>I want to extract strings between start_delimeter and end_delimiter.</p><p>How can I do that in java language/ android ??</p>","358660","","228171","","2010-12-07 18:24:56","2010-12-07 18:29:03","How to extract a substring from a text file in android?","<java><android><string>","4","0","1","",""
"4380174","1","4380516","","2010-12-07 18:25:09","7","235","<p>I have just released my first app and would like to have a free version to it as well. I was wondering how should I manage my free version branch (in svn) so that it's easy to merge changes from full version? is it possible to just change package name in Manifest file? or do the package names have to be different in code? If so how could I Merge Changes easily?</p><p>Thanks, Jason</p>","407133","","","","","2010-12-07 22:54:01","how to Manage Free version?","<android><svn>","5","0","2","",""
"4380193","1","4380224","","2010-12-07 18:26:52","1","476","<p>How can I convert the below int to display the result of the sum as text in a textview?</p><p>Am getting 'cannot invoke toString() on primitive type int' - thought that was the point of toString!?!</p><pre><code>public void onClick(View v) {    // TODO Auto-generated method stub    txtAnswer = (TextView)findViewById(R.id.txtAnswer);    editStones = (EditText)findViewById(R.id.editStones);    int result = 10 + 10;    txtAnswer.setText(result.toString());}</code></pre>","528013","","","","","2010-12-07 18:30:52","Incredibly simple android java question","<java><android>","4","1","","",""
"4380201","1","4380277","","2010-12-07 18:27:19","3","801","<p>I am building an android application and want to know if there is a way to update this application automatically without requesting the user's permission for this...</p><p>This application will run as a stand alone app in a dedicated tablet running android and one of the desired features is to be able to update this app automatically from the server that the app connects to...</p><p>Is there any way to do this ???</p><p>Thanks a lot...</p>","522995","","","","","2011-10-21 00:23:54","Update Android application without asking the user","<android>","4","0","2","",""
"4380233","1","","","2010-12-07 18:30:21","2","658","<p>I have a lazy image loader, and would like to have a custom <code>ImageView</code> that shows progress while the image is loading. I'm just not sure how to achieve this. I know it must be a compound control, but I'm not sure how to do it. The behavior I want is to show an indeterminate progress in place of the image, until the image loads. Any help is appreciated.</p>","413414","","","","","2013-09-03 08:00:00","Android: How can I write a custom ImageView with Progress?","<android><imageview><progress>","0","0","","",""
"4380321","1","4380472","","2010-12-07 18:37:36","0","1670","<p>i'm trying to connect query a database and display the results in a Spinner.  below is what i have so far.  unfortunately <strong>the spinner only displays the last row that should have been returned from the query</strong>.  so from the example above, only ""Elvis Presley"" shows up in the list.  i've tried using ""Cursor.moveToFirst()"" (as you can see) but that doesn't do it.</p><p>i realized that i rebuild and update the database everytime i open it.  i'm doing this on purpose for now.</p><pre><code>package com.conceptualsystems.android4api.sms;import java.util.List;import java.util.ArrayList;import java.util.LinkedList;import android.app.Activity;import android.app.Dialog;import android.app.AlertDialog;import android.content.Context;import android.content.DialogInterface;import android.content.Intent;import android.content.ContentValues;import android.database.Cursor;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteDatabase;import android.util.Log;import android.view.Window;import android.view.View;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.ContextMenu;import android.view.ContextMenu.ContextMenuInfo;import android.view.LayoutInflater;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.Spinner;import android.widget.AdapterView;import android.widget.ListView;import android.widget.EditText;import android.widget.Toast;import android.widget.SimpleCursorAdapter;public class smsActivity extends Activity{    private static class smsDbOpenHelper extends SQLiteOpenHelper {        smsDbOpenHelper(Context context) {            super(context,smsDbSchema.DATABASE_NAME, null, smsDbSchema.DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db) {            db.execSQL(smsDbSchema.CustomerSchema.CREATE_TABLE);            db.execSQL(smsDbSchema.ProductSchema.CREATE_TABLE);        }        @Override        public void onOpen(SQLiteDatabase db) {            //open db            db.execSQL(""DROP TABLE IF EXISTS "" + smsDbSchema.CustomerSchema.TABLE_NAME);            db.execSQL(""DROP TABLE IF EXISTS "" + smsDbSchema.ProductSchema.TABLE_NAME);            this.onCreate(db);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            //upgrade db        }    }    private smsDbOpenHelper mDbHelper;    private SQLiteDatabase mDb;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        mDbHelper = new smsDbOpenHelper(getApplicationContext());        mDb = mDbHelper.getReadableDatabase();        //fill customer table with some fake data            ContentValues cv = new ContentValues();            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""Charles Keith Gilliam"");            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""Jarrod Martin"");            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""John Lennon"");            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""Sammy Hagar"");            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""David Lee Roth"");            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""Keith Richards"");            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""Steven Tyler"");            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""Brent Michaels"");            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""Eddie Veder"");            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""Kurt Cobain"");            cv.put(smsDbSchema.CustomerSchema.COLUMN_NAME, ""Elvis Presley"");            cv.put(smsDbSchema.CustomerSchema._ID, ""0298437598745"");            cv.put(smsDbSchema.CustomerSchema._ID, ""7585684317298"");            cv.put(smsDbSchema.CustomerSchema._ID, ""7585684317298"");            cv.put(smsDbSchema.CustomerSchema._ID, ""7585684317298"");            cv.put(smsDbSchema.CustomerSchema._ID, ""7585684317298"");            cv.put(smsDbSchema.CustomerSchema._ID, ""7585684317298"");            cv.put(smsDbSchema.CustomerSchema._ID, ""7585684317298"");            cv.put(smsDbSchema.CustomerSchema._ID, ""7585684317298"");            cv.put(smsDbSchema.CustomerSchema._ID, ""7585684317298"");            cv.put(smsDbSchema.CustomerSchema._ID, ""7585684317298"");            cv.put(smsDbSchema.CustomerSchema._ID, ""7585684317298"");            mDb.insert(smsDbSchema.CustomerSchema.TABLE_NAME, null, cv);            //cv.        setScreen(R.layout.inbound);        Spinner custSpn = (Spinner)findViewById(R.id.cust_spn);        Cursor custCur = null;        try {            custCur = mDb.query(smsDbSchema.CustomerSchema.TABLE_NAME, null, null, null, null, null, null);        } catch(Exception e) {            Log.e(""smsdb"", e.toString());        }        custCur.moveToFirst();        startManagingCursor(custCur);        SimpleCursorAdapter qc = new SimpleCursorAdapter(            this,            android.R.layout.simple_spinner_item,            custCur,            new String[] {smsDbSchema.CustomerSchema.COLUMN_NAME},            new int[] {android.R.id.text1}        );        qc.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        custSpn.setAdapter(qc);        Spinner prdSpn = (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);        mDb.close();    }    public void setScreen(int resource) {        setContentView(resource);        if(resource==R.layout.inbound) {            //setup main entry screen            final Button transmit = (Button)findViewById(R.id.transmit_btn);            final Button clear = (Button)findViewById(R.id.clear_btn);            transmit.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                    // transmit data ////////                    /////////////////////////                }            });            clear.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                    //clear fields                }            });        }    }}</code></pre>","329993","","","","","2010-12-07 18:56:56","SimpleCursorAdapter from SQLiteDatabase Cursor not displaying properly in Spinner adapter","<java><android><sqlite>","1","1","1","",""
"4380796","1","4380808","","2010-12-07 19:33:57","22","10125","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/7202616/java-abstract-interface"">Java abstract interface</a>  </p></blockquote><p>When I wondered the implementation of <code>MenuItem.setOnMenuItemClickListener()</code> method, I opened the implementation and this is what I see :</p><pre><code>// Compiled from MenuItem.java (version 1.5 : 49.0, no super bit)public abstract interface android.view.MenuItem {  // Method descriptor #7 ()I  public abstract int getItemId();  // Method descriptor #7 ()I  public abstract int getGroupId();  // Method descriptor #7 ()I  public abstract int getOrder(); //...goes like that}</code></pre><p>As you can see, <code>android.view.MenuItem</code> has two qualifier that I always know they have similiar meaning in programming and mostly for abstraction or force developer.</p><p>So what does it mean now?</p><p><strong>Difference between Abstract class and interface :</strong></p><blockquote>  <p>Unlike interfaces, abstract classes  can contain fields that are not static  and final, and they can contain  implemented methods. Such abstract  classes are similar to interfaces,  except that they provide a partial  implementation, leaving it to  subclasses to complete the  implementation. If an abstract class  contains only abstract method  declarations, it should be declared as  an interface instead.</p>    <p>Multiple interfaces can be implemented  by classes anywhere in the class  hierarchy, whether or not they are  related to one another in any way.  Think of Comparable or Cloneable, for  example.</p>    <p>By comparison, abstract classes are  most commonly subclassed to share  pieces of implementation. A single  abstract class is subclassed by  similar classes that have a lot in  common (the implemented parts of the  abstract class), but also have some  differences (the abstract methods).</p></blockquote><p>Source : <a href=""http://download.oracle.com/javase/tutorial/java/IandI/abstract.html"">http://download.oracle.com/javase/tutorial/java/IandI/abstract.html</a></p>","44852","","","","","2013-07-08 15:09:18","What is ""public abstract interface"" in Java?","<java><android>","4","0","1","2013-02-04 17:16:11",""
"4380860","1","4381413","","2010-12-07 19:41:47","1","287","<p>Is it possible for an Android Service to forcefully teardown the AIDL connections of existing clients? The only way I know to tear down such connections today is if the client has initiated it using Context.unbindService()</p>","440093","","","","","2010-12-07 20:47:19","Android: How to initiate an AIDL unbind from a Service?","<android>","1","0","","",""
"4380975","1","4529197","","2010-12-07 19:55:13","4","1633","<p><img src=""http://i.stack.imgur.com/yj8gz.png"" alt=""alt text""></p><p>Here is my layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""#FFFFFFFF""&gt;&lt;RadioGroup    android:id=""@+id/choices_group""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_margin=""5dp""    android:layout_centerInParent=""true""    android:orientation=""vertical""    android:background=""@drawable/rounded_bg"" &gt;    &lt;RadioButton        android:id=""@+id/choice_a""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:gravity=""center_vertical""        android:padding=""5dp""        android:text=""Choice A"" /&gt;    &lt;RadioButton        android:id=""@+id/choice_b""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:padding=""5dp""        android:text=""Choice B"" /&gt;    &lt;RadioButton        android:id=""@+id/choice_c""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:padding=""5dp""        android:text=""Choice C"" /&gt;    &lt;RadioButton        android:id=""@+id/choice_d""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:padding=""5dp""        android:text=""Choice D"" /&gt;&lt;/RadioGroup&gt;&lt;/RelativeLayout&gt;</code></pre><p>Why are the radio buttons superimposed over the text?</p>","421372","","","","","2010-12-25 03:28:57","Unexpected RadioButton behavior","<android><layout><radio-button>","3","1","","",""
"4381033","1","4381192","","2010-12-07 20:04:10","94","35335","<p>I'd like to create a shape that's like the following image:</p><p><img src=""http://i.stack.imgur.com/hM2v2.png"" alt=""alt text""></p><p>Notice the top half gradients from color 1 to color 2, but theres a bottom half that gradients from color 3 to color 4.  I know how to make a shape with a single gradient, but I'm not sure how to split a shape into two halves and make 1 shape with 2 different gradients.</p><p>Any ideas?</p>","406790","","","","","2013-08-30 20:54:41","Multi-gradient shapes","<android><gradient><shapes>","3","1","82","",""
"4381036","1","4381074","","2010-12-07 20:04:29","1","430","<p>Greetings.</p><p>I would like to have my application have a function so that when the user chooses, a web view will pop up they can look at it and then dismiss it by either pressing a button on the screen or the back button.  How would I do this?</p><p>Thanks.</p>","445342","","","","","2010-12-07 20:24:40","Temporary Webview Android","<android><webview><add><temporary>","2","0","","",""
"4381042","1","","","2010-12-07 20:05:22","4","20126","<p>I installed the android SDK from developer.android.com for Windows (installer_r08-windows.exe).  I installed to the default location, C:\Program Files\Android\android-sdk-windows.  When I try to run SDK Manager.exe, a console window briefly pops up, but disappears.. nothing else happens.  If I try to run this from the command line, nothing happens, either (and no output).</p><p>I have JDK 1.6.0_20 installed, and JAVA_HOME environment variable points to this folder (C:\Program Files\Java\jdk1.6.0_20)</p><p>Help?</p>","534173","","","","","2013-06-25 03:10:47","Android installation - sdk manager.exe does not work","<android>","4","1","1","",""
"4381221","1","4381288","","2010-12-07 20:26:14","5","7664","<p>Hey, I'm building just a basic app with text, urls, pictures, and some buttons. When you create a new project what build version do you usually choose? The highest, 2.2?And also what min SDK version do you choose? Also 2.2? or the lowest one possible?</p><p>I'm a little confused by what would be best for all customers</p><p>-Thanks!</p>","533049","","","","","2012-07-25 20:14:14","What build target and min SDK version should you choose?","<android><build-process>","3","1","0","",""
"4381296","1","4381971","","2010-12-07 20:33:55","12","25389","<p>I would like to implement a method that displays a dialog, waits until the dialog is dismissed, and then returns a result depending on the dialog contents.  Is this possible?</p><pre><code>public String getUserInput(){    //do something to show dialog    String input = //get input from dialog    return input;}</code></pre><p>I am actually trying to implement an interface which has method ""public String getUserInput()"", where the returned String must be retrieved via dialog.  This is easily done in java, seems impossible in android?</p><p>EDIT: Posting some sample code as requested in comment</p><p><code>getInput()</code> must be called from a background thread (I call it from an AsynchTask).  getInput() displays a dialog and calls wait.  When the ok button is pressed on the dialog, the dialog sets the user input in a member variable and calls notify.  When notify is called, getInput() continues and returns the member variable.</p><pre><code>String m_Input;public synchronized String getInput(){    runOnUiThread(new Runnable()     {        @Override        public void run()         {            AlertDialog.Builder alert = new AlertDialog.Builder(context);            //customize alert dialog to allow desired input            alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int whichButton)            {                          m_Input = alert.getCustomInput();                          notify();            }        });        alert.show();           }    });    try     {         wait();    }     catch (InterruptedException e)     {    }    return m_Input;}</code></pre>","426493","","281545","","2013-04-19 14:30:45","2013-04-19 14:30:45","Android: wait on user input from dialog?","<android><modal-dialog>","5","4","4","",""
"4381651","1","","","2010-12-07 21:13:52","2","279","<p>My application has a main Activity A and that does a StartActivity on Activity B.  If somebody uses a Task Killer (e.g., Advanced Task Killer), the application is killed but when they run the app again I see the Application object is being built (onCreate called) and then it goes right into Activity B not Activity A.  The Manifest has A being the Launcher Activity.</p><p>I also see the scenario if I run A, then Activity B, bring down notification list and run Task Killer to kill my app, and press the Back key, it creates the Application object and then Activity B object.</p><p>Any ideas on how to prevent this behavior?  Activity B assumes that Activity A has already run.  I am able to kludge this but have a boolean in the Application object which is set on Activity A.  In Activity B onCreate, if that global flag is not set, I do a finish().  Must be a better way to handle this since I have quite a few activities that would experience the same behavior.</p>","534224","","","","","2010-12-07 21:50:41","Task Killer not resetting stack","<android>","2","2","1","",""
"4381723","1","","","2010-12-07 21:21:45","6","3443","<p>In my android app I am using two activities and I want to make a smooth switch between these activities. I have seen many reference tutorials tells that ViewFlipper can make a smooth switch between views in one activity. So I would like to know if I can use ViewFlipper to switch between activities or Is there any other possible way to do this. At present I am just using button clicks that will start an activity but the switch doesn't look good.</p><p>I would be grateful for any suggestions.</p><p>Thank You,</p><p>Baluk</p>","496994","","","","","2010-12-07 21:32:06","How to Switch between activities with viewflipper","<android><activity><switch><viewflipper>","2","0","0","",""
"4381766","1","4381866","","2010-12-07 21:27:01","8","79404","<p>I'm trying to add a vCard from a web link to the user's contact list on Android 2.2.  When I direct the user to .vcf file, all I get is text output in the mobile browser.  I have confirmed that the files is being transferred with MIME type text/v-card.  This seems like it should be pretty simple to do.  Any ideas?</p>","534247","","","","","2014-04-18 17:32:50","How to get a vCard (.vcf file) into Android contacts from website","<android><vcard><vcf>","7","0","5","",""
"4381821","1","5278593","","2010-12-07 21:33:19","3","576","<p>There seems to be a breaking change in SDK 2.3 that causes applications compiled on it to fail to work on Android 2.0 devices. (Although Android 2.0 is officially gone, I'm unfortunately stuck with a bunch of Motorola Milestones that I got from Expansys which haven't gotten OTR updates yet). </p><p>It seems to be an issue with resources, exactly like <a href=""http://stackoverflow.com/questions/2923823/android-2-2-sdk-breaks-compatibility-with-older-phones"">the one mentioned here</a>, however on a 2.0 device instead of a 1.6 or earlier device. I can put all the resources in <code>/res/drawable/</code>, however I want the hdpi versions to appear instead of the mdpi versions (which I believe is the default for <code>/res/drawable/</code>). </p><p>I figured I could just use an older copy of the SDK (the 2.2 SDK was able to make apks that my Milestones were happy with), but I can't seem to find a download link for it anymore.</p><p>Are there any suggestions on how I can get my hdpi graphics on a 2.0 device?</p><p>(In parallel, I'm attempting to contact Motorola and get the devices upgraded via OTR. Unfortunately, many of them are deployed in the field and can't be updated via USB).</p><h1>Steps to reproduce</h1><ol><li>Install Android SDK 2.3</li><li>In Eclipse, create a new Android project. Set target to 1.6 or higher.</li><li>Modify the default <code>main.xml</code> to add: <code>&lt;ImageView android:src=""@drawable/icon"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt;</code> somewhere.</li><li>Build the example, then launch with an Android 2.0 VM. </li></ol><h2>expected results</h2><p>5: app will load. Icon may or may not appear depending on <code>main.xml</code>.</p><h2>actual results</h2><p>5: app crashes on start, see <a href=""http://stackoverflow.com/questions/2923823/android-2-2-sdk-breaks-compatibility-with-older-phones"">the aforementioned question</a> for the approximate stacktrace.</p>","90934","","90934","","2010-12-07 22:26:43","2011-03-11 21:31:16","Problem running applications on Android 2.0 compiled on Android SDK 2.3","<android><android-sdk-2.3><android-2.0-eclair>","3","5","","",""
"4381959","1","","","2010-12-07 21:49:08","1","195","<p>I have several android applications in the market. Some users are reporting force closes on certain devices. The only device I test on/have access to is a Nexus One. I also test my applications on many different permutations of the simulator.</p><p>Does anyone have any advice on how to ensure device compatibility? Or anything in general to avoid issues like this? Currently I am getting complaints from Samsung Moment and Motorla Cliq users, but I am not about to go out and buy these devices. I have looked up these devices and tested the apps on the simulator with the same version of android, but they work fine.</p>","80617","","","","","2010-12-07 22:00:27","Android Multiple Devices Best Practices","<android><mobile><android-emulator>","2","0","1","",""
"4381968","1","","","2010-12-07 21:50:06","1","5451","<p>I am attempting to create a program that saves an mp3 to the Android, which can be accessed by ASTRO. I am attempting to save the file to /sdcard/media/audio. Despite the app going through without a single error on Logcat/DDMS, the file is nowhere to be found. I added the WRITE_EXTERNAL_STORAGE permission (along with Internet, etc.) so it's not that. </p><p>Are there restrictions for apps saving files to the sdcard?</p><p>Method called:</p><pre><code>public void findSong(View view) throws Exception {    edittext = (EditText) findViewById(R.id.edittext);              searchTerm = edittext.getText().toString();    String address;             address = getMusic(searchTerm);             ImageManager img = new ImageManager(); //calls ImageManager (below)             img.DownloadFromUrl(address, title + "".mp3""); }</code></pre><p>The downloading method:</p><pre><code>private final String PATH = ""/data/data"";  //put the downloaded file herepublic void DownloadFromUrl(String imageURL, String fileName) {  //this is the downloader methodtry {    URL url = new URL(imageURL); //you can write here any link    File file = new File(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(50);    int current = 0;    while ((current = bis.read()) != -1) {        baf.append((byte) current);    }   /* Convert the Bytes read to a String. */   FileOutputStream fos = new FileOutputStream(PATH + file);   fos.write(baf.toByteArray());   fos.close();   Log.d(""ImageManager"", ""download ready in""       + ((System.currentTimeMillis() - startTime) / 1000)       + "" sec"");   } catch (IOException e) {       Log.d(""ImageManager"", ""Error: "" + e);   }}</code></pre><p>Any help appreciated.</p>","532909","","321697","","2010-12-07 22:02:08","2010-12-07 22:02:08","Android: save file to sdcard?","<android><file><permissions><download><sd-card>","1","2","1","",""
"4382021","1","4383147","","2010-12-07 21:54:20","1","744","<p>I'm making a game in Java. I need some solution for my current runtime allocation, caused by my <code>ArrayList</code>. Every single minute or 30 seconds the garbage collector starts to runs because of I am calling for draw and updates-method through this collection.</p><p><strong>How should I be able to do a non runtime allocation solution?</strong></p><p>Thanks in advance and if needed, my code is posted below from my Manager class which contains the <code>ArrayList</code> of objects.:</p><p>Some code:</p><pre><code>@Overridepublic void draw(GL10 gl) {  final int size = objects.size();  for(int x = 0; x &lt; size; x++) {    Object object = objects.get(x);    object.draw(gl);  }}public void add(Object parent) {  objects.add(parent);}     //Get collection, and later we call the draw function from these objectspublic ArrayList&lt;Object&gt; getObjects() {   return objects;}public int getNumberOfObjects() {   return objects.size();}</code></pre><p><strong>More explanation:</strong> The reason I mix with this is because (1) I see that the <code>ArrayList</code> implementation is slow and causing lags and (2) that I want to merge the objects/components together. When firing an update call from my Thread-class, it goes through my collection, send things down the tree/graph using the Manager's update function.</p><p><strong>When</strong> looking at an Open Source project, Replica Island, I found that he used an alternative class FixedSizeArray that he wrotes on his own. Since I'm not that good at Java, I wanted to make things easier and now I'm looking for another solution. And at last, he explained WHY he made the special class:</p><blockquote>  <p>FixedSizeArray is an alternative to a standard Java collection like ArrayList.  It is designed to provide a contiguous array of fixed length which can be accessed, sorted, and searched without <strong>requiring any runtime allocation</strong>.  This implementation makes a distinction between the ""capacity"" of an array (the maximum number of objects it can contain) and the ""count"" of an array (the current number of objects inserted into the array).  Operations such as set() and remove() can only operate on objects that have been explicitly add()-ed to the array; that is, indexes larger than getCount() but smaller than getCapacity() can't be used on their own.</p></blockquote>","386562","","13792","","2010-12-07 23:18:47","2012-04-09 21:48:28","Non runtime allocation solution - ArrayList","<java><android><allocation>","4","14","2","",""
"4382132","1","4853279","","2010-12-07 22:06:19","3","4131","<p>I've already discovered that you can't override the Home button on an Android phone.  It exits the application, it ALWAYS exits the application, and it DOESN'T bother with any sort of namby-pamby confirmation.  I suppose I understand Google's reasoning -- but I do think it's a bit short-sighted...</p><p>Anyway, (before I learned about the Home button), I set up my app so the user can exit the application through the Options Menu -- using onCreateOptionsMenu() and an XML file, I set up a simple pop-up menu that's displayed when the Menu button is pressed.  One of its choices is Exit, and it works fine.</p><p>However, it occurred to me that it might be good practice to add a confirmation dialog to the exit process (even if it could also be considered superfluous).  So, I created an AlertDialog with the title ""Do you want to Exit?"" and Yes and No buttons...</p><p>The click listeners for the buttons are simple and just set exitConfirm (a boolean) true or false.  The code that handles the Exit menu choice then cleans up after my application and executes finish() or not depending on the state of exitConfirm...</p><p>Unfortunately, it completely doesn't work...  All of the code in onOptionsItemSelected() for the exit case executes and THEN the Dialog is displayed!!  I suppose I should've seen that coming.  And I suppose if I keep pounding on it, I'll come up with a way accomplish this, but I thought I would ask the community for suggestions - so, does anybody have a suggestion for a way to smoothly exit an Android application in a manner that includes the step of getting confirmation from the user??</p><p>Thanks,R.</p>","453989","","1231943","","2012-06-09 20:44:21","2012-08-06 21:24:20","Trying to Implement an Exit Confirmation in my Android app","<android><user-interface>","3","1","","",""
"4382176","1","4382199","","2010-12-07 22:12:11","24","16438","<p>Can someone tell me what the <code>convertView</code> parameter is used for in the <code>getView()</code> method of the <code>Adapter</code> class?</p><p>Here is a sample code take from <a href=""http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/"">here</a>:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    View v = convertView;    if (v == null) {        LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);        v = vi.inflate(R.layout.row, null);    }    Order o = items.get(position);    if (o != null) {        TextView tt = (TextView) v.findViewById(R.id.toptext);        TextView bt = (TextView) v.findViewById(R.id.bottomtext);        if (tt != null) {            tt.setText(""Name: ""+o.getOrderName());                            }        if(bt != null){            bt.setText(""Status: ""+ o.getOrderStatus());        }    }    return v;}</code></pre><p>What should we pass via <code>convertView</code>? </p><p>What I've found, <a href=""http://developer.android.com/reference/android/widget/Adapter.html"">take from here</a>:</p><blockquote>  <p>Get a View that displays the data at the specified position in the  data set. You can either create a View manually or inflate it from an  XML layout file. When the View is inflated, the parent View (GridView,  ListView...) will apply default layout parameters unless you use  inflate(int, android.view.ViewGroup, boolean) to specify a root view  and to prevent attachment to the root.</p>    <p><strong>Parameters</strong></p>    <p><em>position</em> -- The position of the item within the adapter's data set of the item whose  view we want.</p>    <p><em>convertView</em> -- The old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before  using. If it is not possible to convert this view to display the  correct data, this method can create a new view.</p>    <p><em>parent</em> -- The parent that this view will eventually be attached to Returns</p>    <p><em>returns</em> -- A View corresponding to the data at the specified position.</p></blockquote>","44852","","1473751","","2013-11-19 19:05:31","2013-11-19 19:05:31","What is ""convertView"" parameter in ArrayAdapter getView() method","<java><android>","1","0","9","",""
"4382178","1","","","2010-12-07 22:12:14","722","251805","<p>I'm trying to install the Android SDK on my Windows 7 x64 System. <code>jdk-6u23-windows-x64.exe</code> is installed, but the Android SDK setup refuses to proceed, because it doesn't find the JDK installation.</p><p>Is this a known issue? And is there a solution?</p><p><img src=""http://i.stack.imgur.com/pZjuL.jpg"" alt=""SDK Error""></p>","534294","","881229","","2014-02-02 03:31:56","2014-02-02 03:31:56","Android SDK installation doesn't find JDK","<java><android><windows-7-x64>","35","7","82","","2012-11-12 21:30:59"
"4382332","1","4382588","","2010-12-07 22:33:50","2","4005","<p>I have a problem with layout which won't stretch within high resolution like 1024x600.</p><p>As root layout I use RelativeLayout with following style:</p><pre><code> &lt;style name=""DefaultLayout""&gt;        &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;        &lt;item name=""android:layout_height""&gt;fill_parent&lt;/item&gt; &lt;/style&gt;</code></pre><p>I want to stretch layout to any screen resolution but on emulator with high resolution it looks like this:</p><p><img src=""http://i.stack.imgur.com/2Fm7F.png"" alt=""alt text""></p><p>If it's important I didn't use images with fixed size, header and footer it's a 1px vertical line which duplicates horizontally and the list items implemented as shapes... so there is no point where it may took some fixed size... maybe I am checking this in a wrong way... Actually I didn't figured out what is the problem</p>","390323","","390323","","2010-12-07 22:54:02","2010-12-07 23:02:50","Android layout doesn't stretch on full screen","<java><android>","1","3","","",""
"4382334","1","4382392","","2010-12-07 22:33:58","0","2668","<p>Hey, I'm trying to implement two tabs. Each one calls a specifig activity. But when I try to run I have this error:</p><pre><code>12-07 20:26:22.164: ERROR/AndroidRuntime(363): FATAL EXCEPTION: main12-07 20:26:22.164: ERROR/AndroidRuntime(363): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.psyhclo/com.psyhclo.Main}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.psyhclo/com.psyhclo.RatedCalls}: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.CallLogProvider from ProcessRecord{405a8ac8 363:com.psyhclo/10030} (pid=363, uid=10030) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.os.Handler.dispatchMessage(Handler.java:99)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.os.Looper.loop(Looper.java:123)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread.main(ActivityThread.java:3647)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at java.lang.reflect.Method.invokeNative(Native Method)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at java.lang.reflect.Method.invoke(Method.java:507)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at dalvik.system.NativeStart.main(Native Method)12-07 20:26:22.164: ERROR/AndroidRuntime(363): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.psyhclo/com.psyhclo.RatedCalls}: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.CallLogProvider from ProcessRecord{405a8ac8 363:com.psyhclo/10030} (pid=363, uid=10030) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:1462)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:654)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.widget.TabHost.setCurrentTab(TabHost.java:326)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.widget.TabHost.addTab(TabHost.java:216)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at com.psyhclo.Main.onCreate(Main.java:17)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     ... 11 more12-07 20:26:22.164: ERROR/AndroidRuntime(363): Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.CallLogProvider from ProcessRecord{405a8ac8 363:com.psyhclo/10030} (pid=363, uid=10030) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.os.Parcel.readException(Parcel.java:1322)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.os.Parcel.readException(Parcel.java:1276)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:1882)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread.getProvider(ActivityThread.java:3311)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread.acquireProvider(ActivityThread.java:3336)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:1634)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.content.ContentResolver.acquireProvider(ContentResolver.java:748)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.content.ContentResolver.query(ContentResolver.java:256)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at com.psyhclo.RatedCalls.onCreate(RatedCalls.java:27)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)12-07 20:26:22.164: ERROR/AndroidRuntime(363):     ... 20 more</code></pre><p>Here is the <strong>Main.java</strong></p><pre><code>import android.app.TabActivity;import android.content.Intent;import android.os.Bundle;import android.widget.TabHost;public class Main extends TabActivity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    TabHost tabHost = getTabHost();    tabHost.addTab(tabHost.newTabSpec(""one"").setIndicator(""Rated Calls"")            .setContent(new Intent(this, RatedCalls.class)));    tabHost.addTab(tabHost.newTabSpec(""two"").setIndicator(""Rated Contacts"")            .setContent(new Intent(this, SMS.class)));    tabHost.setCurrentTab(2);}    }</code></pre><p>Here is the <strong>RatedCalls.java</strong> class</p><pre><code>import java.text.DateFormat;import java.util.ArrayList;import com.psyhclo.R;import android.app.Activity;import android.database.Cursor;import android.os.Bundle;import android.widget.TextView;import android.widget.Toast;public class RatedCalls extends Activity {private static TextView txtView;private CallDataHelper dh;StringBuilder sb = new StringBuilder();public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.ratedcalls);            //txtView = (TextView) findViewById(R.id.TextView01);    TextView txtView = new TextView(this);    Cursor cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null, null, null,            android.provider.CallLog.Calls.DATE + "" DESC "");    startManagingCursor(cursor);    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 dateId = cursor.getColumnIndex(android.provider.CallLog.Calls.DATE);    int numTypeId = cursor.getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE);    ArrayList&lt;String&gt; callList = new ArrayList&lt;String&gt;();    if (cursor.moveToFirst()) {        do {            String callerPhoneNumber = cursor.getString(numberColumnId);            String contactName = cursor.getString(contactNameId);            String duration = cursor.getString(durationId);            String callDate = DateFormat.getDateInstance().format(dateId);                  String numType = cursor.getString(numTypeId);            //this.dh.insert(1, contactName, callerPhoneNumber, numType, duration, callDate, ""01:20"");            Toast.makeText(getBaseContext(), ""Inserted!"", Toast.LENGTH_LONG);            callList.add(""\nNew Info: \nContact Number: ""                    + callerPhoneNumber + ""\nContact Name: "" + contactName                    + ""\nDuration: "" + duration + ""\nDate: "" + callDate);        } while (cursor.moveToNext());    }    txtView.setText(callList.toString());}    }</code></pre><p>And here is the <strong>ratedcalls.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5dp""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""5dp"" /&gt;&lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>And here is the <strong>main.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5dp""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""5dp"" /&gt;&lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre>","399459","","345717","","2010-12-07 22:39:53","2010-12-09 11:48:03","Error when running Android TabHost","<android><android-emulator><android-widget><android-layout><android-tabhost>","2","2","0","",""
"4382444","1","4382940","","2010-12-07 22:46:11","0","425","<p>Well, I've been looking around and can't find a specific way to actually DISPLAY the contacts list. I've found tutorials such as <a href=""http://www.higherpass.com/Android/Tutorials/Working-With-Android-Contacts/"" rel=""nofollow""> higher pass's </a> but it never actually discusses how to display them, just how to get them. I simply want to display the contacts list in a listView or something similar. I know it has to be a lot more simple than I'm making it out to be, because it seems to be a common thing. Specifically, all I want is the contact's name and phone numbers. I have my query set up, which I got the above mentioned tutorial, and I <em>think</em> it's right: </p><pre><code>        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));    if (Integer.parseInt(cur.getString(cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0) {        Cursor pCur = cr.query(                ContactsContract.CommonDataKinds.Phone.CONTENT_URI,                 null,                 ContactsContract.CommonDataKinds.Phone.CONTACT_ID +"" = ?"",                 new String[]{id}, null);                while (pCur.moveToNext()) {                }                 pCur.close();        }        }}</code></pre>","519436","","","","","2010-12-07 23:57:34","Getting AND Displaying Contacts","<android><listview><contacts>","1","0","","",""
"4382471","1","4382539","","2010-12-07 22:49:38","3","1499","<p>I have in my android application a database table with geo pointes (lat and lon are decimal degree values), about 1000 points. And I need to select 20 nearest point to some given geo point.</p><p>I've found at Stackoverflow the answer how to compute distance between two geo points and was very happy, till I tried to write my query. I've found out, that it's not possible to use trignometrical functions in built-in sqlite of android.</p><p>But then I've got an Idea. I don't really need to compute a distance. The near a point is to another one the smaller difference in their geo coordinates should be.</p><p>How could I use this fact? Would it be enough to order saved points by (lat_0 - lat_n)^2 + (lon0-lon_n)^2, where lat_0 and lon_0 are geo coordinates of a given point?</p><p>Thank you,</p><p>Mur</p><p><strong>UPD</strong></p><p>So, the best way to get an answer for my question was to test approach I describe above.</p><p>It works pretty well but not really exactly compared to exact distance.</p><p>So if you just need to compute a distance, this solution is ok, but in my case I also needed to order stations by distance and couldn't use this solution.</p><p>My thanks go on John at CashCommons and Philip. Thank you guys</p>","408780","","408780","","2011-01-20 09:59:37","2011-01-20 09:59:37","Get next N nearest Geo-Points","<android><sqlite><math>","3","0","4","",""
"4382728","1","4383172","","2010-12-07 23:24:45","0","723","<p>I have a ListView where each item represents a podcast. Selecting an item plays the podcast.  While playing, the view for that ListView item displays an elapsed time counter with a SeekBar next to it to show progress.</p><p>Where I'm having a problem is figuring out how to handle updating the elapsed time counter (a TextView) while the SeekBar is being repositioned by touch.  Calling <code>notifyDataSetChanged</code> during the <code>onProgressChanged</code> SeekBar event doesn't seem to work very well.</p>","460887","","","","","2010-12-08 00:39:13","Update ListView item outside of adapter","<android>","1","2","","",""
"4382730","1","","","2010-12-07 23:25:07","4","1010","<p>I'm trying to open a <code>File</code> with an <code>Intent</code>, but Android doesn't open the right application for the filetype.</p><p>Using the following code, every file - pdf, images, everything - is opened with the music app:</p><pre><code>Intent i = new Intent(Intent.ACTION_VIEW);i.setData(Uri.fromFile(file));startActivity(i);</code></pre><p>When I manually specify the mimeType, the right application is opened - in this case the pictureviewer.</p><pre><code>i.setDataAndType(Uri.fromFile(file), ""image/*"");</code></pre><p>Is there any way to get Android to open the right application, instead of manually setting the type judging from the file's extension?</p>","415304","","","","","2013-04-22 08:47:16","Right mimeType for opening file","<android><file><android-intent><mime-types>","2","0","","",""
"4382910","1","","","2010-12-07 23:51:46","5","856","<p>During testing I noticed that sometimes the finish() of my sub-activity doesn't execute onActivityResult. Most of the times it works okay, and I can't figure out, when and why this problem occurs.</p><p>Subactivity start:</p><pre><code>public void launchSubActivity(Class&lt;? extends Activity&gt; subActivityClass, Bundle data,        OnSubActivityResult callback) {    Intent i = new Intent(this, subActivityClass);    if(data!=null) i.putExtras(data);    Random rand = new Random();    int correlationId = rand.nextInt();    _callbackMap.put(correlationId, callback);    startActivityForResult(i, correlationId);}</code></pre><p>Subactivity finish:</p><pre><code>public void select() {    Bundle b = new Bundle();    b.putInt(""YEAR"", year_result);    b.putInt(""MONTH"", month_result);    b.putInt(""DAY"", day_result);    this.getIntent().putExtras(b);    this.setResult(RESULT_OK, this.getIntent());    this.finish();}</code></pre><p>onActivityResult (by <a href=""http://developerlife.com/tutorials/?p=302"" rel=""nofollow"">Nazmul Idris</a>):</p><pre><code>/** * this is the underlying implementation of the onActivityResult method that * handles auto generation of correlationIds and adding/removing callback * functors to handle the result */@Overrideprotected void onActivityResult(int correlationId, int resultCode,        Intent data) {    Log.d(Prototype.TAG, ""SimpleActivity Result ""+resultCode);    try {        OnSubActivityResult callback = _callbackMap.get(correlationId);        switch (resultCode) {        case Activity.RESULT_CANCELED:            callback.onResultCancel(data);            _callbackMap.remove(correlationId);            break;        case Activity.RESULT_OK:            callback.onResultOkay(data);            _callbackMap.remove(correlationId);            break;        default:            Log.e(Prototype.TAG,                    ""Couldn't find callback handler for correlationId"");        }    } catch (Exception e) {        Log                .e(Prototype.TAG,                        ""Problem processing result from sub-activity"", e);    }}</code></pre>","531605","","531605","","2010-12-08 03:12:36","2013-01-07 12:47:56","onActivityResult sometimes not called when Sub-Activity finishes","<android><subactivity>","2","3","2","",""
"4382925","1","","","2010-12-07 23:54:28","3","2226","<p>when I open android browser it opens in Google for mobile, and the page scrolls down so the address bar is not visible.. how can this be done to have more screen space with my webapp.</p><p>I have a webapp that loads a map, but to have more viewing field I will like to start the browser (via a shortcut) without the address bar or scroll up to hide.. </p><p>thanks.</p>","471817","","","","","2010-12-28 19:53:59","Scroll the browser to make my webapp fullscreen","<android><webkit>","1","1","","",""
"4382973","1","4433360","","2010-12-08 00:03:53","1","978","<p>i was trying to run the hello-jni example that comes bundled with the NDK samples.i keep getting the following error on the emulator and the phone everytime i try executing my app:</p><p>""The application JNIExample (process com.jniexample) has stopped unexpectedly. Please try again""</p><p>Here's the content of log cat:</p><p>12-07 15:52:23.199: ERROR/AndroidRuntime(353): FATAL EXCEPTION: main12-07 15:52:23.199: ERROR/AndroidRuntime(353): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.jniexample/com.jniexample.JNIExample}: java.lang.ClassNotFoundException: com.jniexample.JNIExample in loader dalvik.system.PathClassLoader[/data/app/com.jniexample-2.apk]12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at android.os.Handler.dispatchMessage(Handler.java:99)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at android.os.Looper.loop(Looper.java:123)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at java.lang.reflect.Method.invokeNative(Native Method)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at java.lang.reflect.Method.invoke(Method.java:521)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at dalvik.system.NativeStart.main(Native Method)12-07 15:52:23.199: ERROR/AndroidRuntime(353): Caused by: java.lang.ClassNotFoundException: com.jniexample.JNIExample in loader dalvik.system.PathClassLoader[/data/app/com.jniexample-2.apk]12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)12-07 15:52:23.199: ERROR/AndroidRuntime(353):     ... 11 more</p><p>can someone please help me out with this?</p>","495184","","","","","2010-12-13 20:49:15","issues running the hello-jni example on MotoDev studio","<android><jni><android-ndk>","2","0","","",""
"4383146","1","4383372","","2010-12-08 00:34:11","0","827","<p>I am writing a backup application and need to know which records in the contacts database have been updated, so that I can backup only those records. I have looked at the documentation and it seems that there is a ""DIRTY"" constant field in ContactsContract.RawContacts class, which is supposed to be set to ""1"", for the rows that are  updated. But it is not clear to me as to when will this field get cleared to ""0"". Can someone provide me example code on how to use this? Can this field be used to determine if a contact has been added or updated?If this is not the correct way to achieve what I am trying to do can anyone suggest me another way. I am also aware that I can use the RegisterContentObserver() call to identify whenever there is a change in the Contacts database but this will require my application to be running always in the background, which is way too expensive and I do not want to do that.If there is anyway to extract the timestamp when the various contacts have been added or updated that would be perfect too, but I cannot find how to do that.Any help is very much appreciated.</p>","887304","","","","","2010-12-08 01:25:31","How to determine which row in contacts database has been updated","<android>","1","1","2","",""
"4383185","1","","","2010-12-08 00:42:07","0","1138","<p>When phone device connects on 3G network, How can I determine How to determine whether android device's ip address is public or not?</p><pre><code>public static InetAddress getLocalIpAddress() {    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 address = enumIpAddr.nextElement();                return address;            }        }    } catch (SocketException ex) {        Log.e(DEBUG_TAG, ex.toString());    }    return null;}</code></pre>","489744","","1048862","","2013-07-02 20:27:16","2013-07-02 20:27:16","How to determine whether android device's IP address is public or not","<android><ip-address><3g>","1","5","","",""
"4383252","1","","","2010-12-08 00:57:50","1","1031","<p>model : zt180firmware : android 2.1-update1-20101030kernel : 2.6.32.9 usbandroid #1608build number zt180-eng 2.1-update1 20101030google maps : 4.5.1</p><p>Various crashes occur when embedding the google maps component into an android application. I'm connecting to a router via wi-fi for internet access. The stand-alone google maps app seems to work fine. To re-produce, start the maps app and begin scrolling around. </p><p>Will fail within a couple of minutes, occassionally on start-up (in setContentView). Most of the errors are when drawing tiles in google code. Sometimes just an Android SEGV.</p><p>NOTE : I've tested the same app on the Android developer phone 2 (os 1.6) and it works fine.</p><p>My android app is as follows:</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;com.google.android.maps.MapView  android:id=""@+id/mapView""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:enabled=""true""  android:clickable=""true""  android:apiKey=""043yBg1m9IiFNKXIhN5LsdeNndw2k7yrw4Ja3xQ""/&gt;&lt;/RelativeLayout&gt;import com.google.android.maps.MapActivity;import android.os.Bundle;public class Maps extends MapActivity {    public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);     }    protected boolean isRouteDisplayed() { return false; }   }  </code></pre><p>=========================</p><pre><code>W/MapActivity( 2745): Recycling dispatcher com.google.googlenav.datarequest.DataRequestDispatcher@45ebcd30V/MapActivity( 2745): Recycling map object.I/ActivityManager( 2010): Displayed activity com.brta.android.lite/.Maps: 720 ms (total 720 ms)I/MapActivity( 2745): Handling network change notification:CONNECTEDE/MapActivity( 2745): Couldn't get connection factory clientD/AndroidRuntime( 2745): Shutting down VMW/dalvikvm( 2745): threadid=3: thread exiting with uncaught exception (group=0x4001b168)E/AndroidRuntime( 2745): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 2745): java.lang.IncompatibleClassChangeError: interface not implementedE/AndroidRuntime( 2745): at com.google.googlenav.map.Map.checkPaintTimeExceeded(Unknown Source)E/AndroidRuntime( 2745): at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)E/AndroidRuntime( 2745): at com.google.googlenav.map.Map.drawMap(Unknown Source)E/AndroidRuntime( 2745): at com.google.android.maps.MapView.drawMap(MapView.java:1048)E/AndroidRuntime( 2745): at com.google.android.maps.MapView.onDraw(MapView.java:486)&lt;snip&gt;I/Process ( 2745): Sending signal. PID: 2745 SIG: 9I/ActivityManager( 2010): Process com.brta.android.lite (pid 2745) has died.I/WindowManager( 2010): WIN DEATH: Window{46112878 com.brta.android.lite/com.brta.android.lite.Maps paused=false}I/UsageStats( 2010): Unexpected resume of org.adw.launcher while already resumed in com.brta.android.lite`</code></pre><p>======================================================================</p><pre><code>I/MapActivity( 2863): Handling network change notification:CONNECTEDE/MapActivity( 2863): Couldn't get connection factory clientD/dalvikvm( 2863): GC freed 8114 objects / 577376 bytes in 86msD/dalvikvm( 2863): GC freed 685 objects / 444384 bytes in 85msD/dalvikvm( 2863): GC freed 3458 objects / 259456 bytes in 79msI/ActivityManager( 2010): Displayed activity com.brta.android.lite/.Maps: 4407 ms (total 4407 ms)D/AndroidRuntime( 2863): Shutting down VMW/dalvikvm( 2863): threadid=3: thread exiting with uncaught exception (group=0x4001b168)E/AndroidRuntime( 2863): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 2863): java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0E/AndroidRuntime( 2863): at java.util.Vector.elementAt(Vector.java:331)E/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawTile(Unknown Source)E/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)E/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawMap(Unknown Source)E/AndroidRuntime( 2863): at com.google.android.maps.MapView.drawMap(MapView.java:1048)E/AndroidRuntime( 2863): at com.google.android.maps.MapView.onDraw(MapView.java:486)E/AndroidRuntime( 2863): at android.view.View.draw(View.java:6535)E/AndroidRuntime( 2863): at android.view.ViewGroup.drawChild(ViewGroup.java:1531)E/AndroidRuntime( 2863): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)&lt;snip&gt;E/AndroidRuntime( 2863): at dalvik.system.NativeStart.main(Native Method)I/Process ( 2010): Sending signal. PID: 2863 SIG: 3I/dalvikvm( 2863): threadid=7: reacting to signal 3I/dalvikvm( 2863): Wrote stack trace to '/data/anr/traces.txt'I/Process ( 2863): Sending signal. PID: 2863 SIG: 9I/WindowManager( 2010): WIN DEATH: Window{460ac708 com.brta.android.lite/com.brta.android.lite.Maps paused=false}I/ActivityManager( 2010): Process com.brta.android.lite (pid 2863) has died.I/UsageStats( 2010): Unexpected resume of org.adw.launcher while already resumed in com.brta.android.liteW/InputManagerService( 2010): Got RemoteException sending setActive(false) notification to pid 2863 uid 10046</code></pre><p>Basically, lots of bad things start happening..</p>","534396","","","","","2010-12-08 02:17:10","Embedding Google MapView crashes android app","<android><google-maps>","1","0","1","",""
"4383355","1","4384167","","2010-12-08 01:21:21","0","2505","<p>I am working on a little test app to scrape some data (in this case, XKCD comics) from the web and display it on my phone.  This is my first foray into Android programming and I'm not too experienced with Java so I'm not being too ambitious.  I successfully wrote a program in Java that performs the same function I want to do on Android and it works wonderfully, but some of my code that works in Java causes a force close in Android.  Specifically this little code block:</p><pre><code>try {        home = Jsoup.connect(""http://www.xkcd.com"").get();        Log.i(""connect to home"",""completed"");    } catch (IOException e) {        Log.i(""connect to home"",""failed"");    }</code></pre><p>Every time that runs, I see the ""failed"" message in the log.  If I remove that section of my code, my app runs beautifully so I know the error must be there.  ""home"" is defined as a Document elsewhere in my code, if you are wondering.  In Java this runs fine, I also fond it strange that when in Eclipse developing for Android it forced me to surround that statement with a try-catch block but in Java I didn't need the try-catch.  Any ideas why this won't work?  If you need more information, or more of my code, I will provide it (although I tried to give the full story).</p><p>Thanks a lot for the help</p>","324977","","","","","2010-12-08 04:28:55","Having trouble with JSoup in Android (for parsing HTML)","<java><html><android><jsoup>","1","2","1","",""
"4383407","1","4383735","","2010-12-08 01:32:57","1","338","<p>Hey, I have a tab host, and I wanted that when I clicked on a tab shows a text. I've declared the text on the corresponding xml file that the class calls.</p><p>here is the xml file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5dp""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""5dp"" /&gt;    &lt;TextView        android:id=""@+id/txtView""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text="" ""    &gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>And I write a message like this on the class:</p><pre><code>txtView = (TextView) findViewById(R.id.txtView);        txtView.setText(""This is rated calls"");</code></pre><p>But it doesn't show anything. Why?</p>","399459","","","","","2010-12-08 02:45:21","How to show a text inside a <TabHost> tag? Android","<android><android-emulator><android-widget><android-layout><android-textview>","1","0","","",""
"4383440","1","4383523","","2010-12-08 01:41:15","0","2157","<p>Is it possible to access a SQLite database on an Android Emulator when the SDK &amp; Eclipse are closed?  (e.g. directly, via filesystem)</p><p>I don't mind pulling it through Eclipse, but the Emulator has to be open, and for some reason, likes to shutdown when trying to pull the database file. It would just be easier if I could access it directly without the emulator, and without eclipse...</p><p>Surely it's persisted as a SQLite database somewhere in the file system?</p>","462307","","462307","","2010-12-08 02:02:43","2011-09-12 10:22:27","Physical Location of Android Emulator Database","<android>","2","0","","",""
"4383557","1","","","2010-12-08 02:03:29","2","530","<p>How can an Android App be set on a timer to popup from the background?</p><p>Basically, a countdown is setup within the application, user then clicks HOME button, and then when the timer goes off, it returns the user back to the program.</p><p>I found a function moveToBack() but moveToFront or Foreground doesn't work.</p><p>This should be exactly like an alarm clock program, but I can't seem to find how to do it.</p><p>Thanks</p>","534450","","","","","2010-12-08 02:09:15","Android App Timed Pop Up from Background Service","<android>","1","2","1","",""
"4383641","1","4383666","","2010-12-08 02:20:42","2","1226","<p>Hey I'd like to change the icon from the TabWidget on Android by focusing and unfocusing the tab. I mean, when I select the Tab, the icon shows for example green, and when I select the oter tab, the icon changes to red.</p><p>I'm calling a unique icon this way:</p><pre><code>tabHost.addTab(tabHost.newTabSpec(""one"").setIndicator(""Rated Calls"", res.getDrawable(R.drawable.ratedcallicon))</code></pre><p>How to make it change the image of the icon when I select other tab?</p><p>Thanks!</p>","399459","","399459","","2011-02-07 19:34:10","2011-02-16 22:34:43","Change icon when focus and unfocus Android Tab widget","<android><android-emulator><android-widget><android-layout>","1","0","1","",""
"4383797","1","","","2010-12-08 02:59:44","1","96","<p>How can I create a custom view whose state spans multiple Activities?  Creating a custom view is not the hard part.</p><p>To be specific, I am using a sliding drawer, and I want this drawer to maintain it's state as it appears on more than 1 activity.  I haven't seen a coded example of doing this, hoping someone else has.  Thanks.</p>","522605","","143327","","2010-12-08 03:01:35","2010-12-08 03:02:48","Views whose state spans multiple Activities","<android><activity><slidingdrawer>","1","0","","",""
"4383902","1","4386003","","2010-12-08 03:29:54","2","1038","<p>I've finished writing the first version of my app and I'm trying to set the manifest correctly.</p><p>My app is a game that uses the touch </p><p>so I want to make sure that the phone handles touch </p><p>so I set the following:</p><pre><code>&lt;uses-configuration android:reqTouchScreen=""stylus""/&gt;&lt;uses-configuration android:reqTouchScreen=""finger""/&gt;</code></pre><p>Now what I'm wondering is do I need to put stylus ? would a game that works with touch work with stylus? </p><p>I don't have a stylus android phone handy so I would like to have some input if I should use this or not </p>","440336","","244296","","2010-12-08 03:32:04","2010-12-08 09:37:49","Android Manifest <uses-configuration>","<android><manifest><android-manifest>","2","0","","",""
"4383913","1","4384000","","2010-12-08 03:31:33","3","6153","<p>I am new to Android development. I am trying to populate a spinner by using the SimpleAdapter. But spinner's list is showing blank element. When I click any element, its text is shown properly in Toast. Please tell me what is the problem in my code below.</p><pre><code> public void onCreate(Bundle savedInstanceState) {  private List&lt;Map&lt;String, String&gt;&gt; data = new ArrayList&lt;Map&lt;String, String&gt;&gt;();  String[] from = new String[] { ""colorsData"" };  int[] to = new int[] { R.id.spinner };  String[] colors = getResources().getStringArray(R.array.colorsData);  for (int i = 0; i &lt; colors.length; i++) {   data.add(addData(colors[i]));  }  Spinner spinner = (Spinner) findViewById(R.id.spinner);  SimpleAdapter simpleAdapter = new SimpleAdapter(this, data, android.R.layout.simple_spinner_item, from, to);  simpleAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);  spinner.setAdapter(simpleAdapter);  spinner.setOnItemSelectedListener(new OnItemSelectedListener() {   @Override   public void onItemSelected(AdapterView&lt;?&gt; parent, View view,     int position, long id) {    Toast.makeText(      parent.getContext(),      ""Selected Color:-  ""        + parent.getItemAtPosition(position),      Toast.LENGTH_LONG).show();   }  }); } private Map&lt;String, String&gt; addData(String colorName) {  Map&lt;String, String&gt; mapList = new HashMap&lt;String, String&gt;();  mapList.put(""colorsData"", colorName);  return mapList; }</code></pre>","533635","","113141","","2010-12-08 03:35:45","2010-12-08 16:52:19","Using SimpleAdapter with Spinner","<android><spinner><simpleadapter>","1","2","1","",""
"4383973","1","4383991","","2010-12-08 03:45:24","0","1055","<p>Is it possible to force a link to open in the Google Maps app on Android using jQuery Mobile 1.0a2. The site in question is <a href=""http://www.cs.iupui.edu/~migivens/"" rel=""nofollow"">http://www.cs.iupui.edu/~migivens/</a>In my tests, the iPhone does this perfectly with the address simply enclosed in &lt; li > tags. Android fails to recognize the address unless I specifically use the anchor tag and prefix the address with http:// maps.google.com?q=This is not what I desire because android will only gives a list of available apps capable of opening this link(browser &amp; maps). I would like it to default to the maps app just as the iPhone does. Thanks in advance.</p>","441533","","441533","","2011-04-26 15:47:20","2011-04-26 15:47:20","Google Maps app on Android using jQuery Mobile 1.0a2","<jquery><android><mobile>","1","0","","",""
"4384071","1","4384336","","2010-12-08 04:05:01","1","1769","<p>I am trying to add a bunch of rows to an empty Table during execution. I have tried using some test code but for some reason the screen stays empty. If I had elements in the .XML They do show up, but not the table itself, unless I add some rows/elements inside the .XML file as well.</p><p>I would really appreciate some help.</p><p>My class extends Activity.</p><p>Here is the code to update the Table:</p><pre><code>public Runnable UpdateUserList = new Runnable() {    public void run() {        TableLayout userTable = (TableLayout) findViewById(R.id.listOfUsers);        for (String user : userNames) {            TableRow row = new TableRow(getBaseContext());            row.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));            TextView field = new TextView(getBaseContext());            field.setText(user);            field.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));            row.addView(field);            userTable.addView(row, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));        }    }};</code></pre><p>I call the code using a Handler this way, from a Thread:</p><pre><code>mHandler.post(UpdateUserList);  </code></pre><p>The code does get run and does not print any error.</p><p>This is the 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:background=""@drawable/main_bg""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_marginTop=""10px"" android:gravity=""center_horizontal""        android:layout_weight=""1"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;TextView android:text=""@string/userList""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:textSize=""25px"" /&gt;    &lt;/LinearLayout&gt;    &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:id=""@+id/listOfUsers""&gt;    &lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Any help would be very useful. I am very stuck right now.</p><p>EDIT: Using ListView</p><pre><code>private Runnable UpdateUserList = new Runnable() {    public void run() {        ListView userTable = (ListView) findViewById(R.id.listOfUsers);        userTable.setAdapter(new ArrayAdapter&lt;String&gt;(getBaseContext(),                R.layout.connectserver, userNames));    }};</code></pre><p>And the XML:</p><pre><code>&lt;ListView android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:id=""@+id/listOfUsers"" /&gt;</code></pre><p>Rather than the TableLayout.</p>","530891","","530891","","2010-12-08 05:32:41","2010-12-08 05:32:41","Android: Adding rows to an empty TableLayout during execution","<android><table><row><tablelayout>","1","2","","",""
"4384174","1","4384200","","2010-12-08 04:30:37","3","960","<p>i have this code to open the messaging. i wanna add body text into it</p><pre><code>            Intent i6 = new Intent(Intent.ACTION_VIEW, Uri                    .parse(""sms:9986377561""));            startActivity(i6);</code></pre><p>add body text</p><p>body: test text</p>","155196","","","","","2010-12-08 04:45:41","Launching Messaging application with a body text","<android><android-intent>","1","0","","",""
"4384312","1","4384338","","2010-12-08 04:56:44","1","400","<p>I have only ever programmed for the iphone and back then there was just one size and I did not have to worry about different screen resolutions and size.How in the world do I go about supporting multiple devices in android development?I have absolutely no clue and i've done some googling but it's not getting through to me.</p><p>Say I want a 15x25 grid of 32x32 tiles on my Nexus One.Well, how would I maintain the 15x25 oh a G1 or some other device?</p>","507007","","","","","2010-12-08 05:02:28","Android developing for multiple devices","<java><android>","3","2","","",""
"4384408","1","4385317","","2010-12-08 05:17:50","1","146","<p>Friends., I get some file from android device i want to save that file to my web server without reading that file(it may be mp3,mp4,mpeg format) I use Struts2(Java) in my web server how can i do that...?</p>","513162","","233792","","2010-12-08 08:03:07","2010-12-08 08:03:07","How to Copy file in Server page with out reading","<java><android>","1","0","","",""
"4384433","1","","","2010-12-08 05:22:17","11","47696","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4382178/android-sdk-installation-doesnt-find-jdk"">Android SDK installation doesn&#39;t find JDK</a>  </p></blockquote><p>I am unable to install the android SDK.  It requests that I have the JDK, which I do.  I re-downloaded and reinstalled the Java JDK.  I restarted my computer, I ran this install again for the android SDK... nothing... it won't let me get past this point.  Here is a screen shot of the screen I'm stuck on: </p><p><img src=""http://i.stack.imgur.com/JJOkB.jpg"" alt=""http://imgur.com/xAcw5.jpg""></p><p>I've googled my problem, I've spent 2 hours trying to find the answer... the closest I could get would be something about adding a ""Path"" to my ""Environment Variables.""  I found where the environment variables are in Windows 7, but I don't have the slightest clue what I am supposed to do.</p>","534578","","","user166390","2012-04-10 23:03:23","2012-04-18 19:13:25","Installing Android SDK on Windows 7 64-bit: ""JDK not found""?","<android><sdk>","7","2","1","2012-04-18 19:26:01",""
"4384490","1","4386133","","2010-12-08 05:34:47","3","1177","<p>in android 2.1 how can i read phone contact image,if no contact image is there i need to get the default one the os provide.</p>","487219","","","","","2011-09-27 11:39:17","Android 2.1 phone contact","<android>","1","0","3","",""
"4384492","1","4429288","","2010-12-08 05:34:56","2","1372","<p>(ubuntu8.0.4+eclipse3.6.1+ADT8.0.1)I update android from(1.5+1.6+2.1+2.2) to 2.3,but I got</p><p>1:/home/workaccount/Android/android-sdk-linux_86//tools/emulator: /lib/tls/i686/cmov/libc.so.6: version <code>GLIBC_2.8' not found (required by /home/workaccount/Android/android-sdk-linux_86//tools/emulator)2:/home/workaccount/Android/android-sdk-linux_86//tools/emulator: /lib/tls/i686/cmov/libc.so.6: version</code>GLIBC_2.11' not found (required by /home/workaccount/Android/android-sdk-linux_86//tools/emulator)</p><p>when I start an AVD.All versions can't work now.I delete everything expect eclipse,download adt, AndroidSDK, platform2.3/2.2 ,still error.Heeeelp!!!</p>","509138","","509138","","2010-12-08 06:54:47","2012-06-26 18:51:32","Android AVD error after update to 2.3","<android><linux><ubuntu>","3","2","0","",""
"4384819","1","4650981","","2010-12-08 06:39:06","0","2202","<p>i have written a code for answering automatic when somebody is calling...but this code doesn't reply...when call is coming.....</p><p>My code is ....here......</p><h2>ReceiveCall.java</h2><p>package com.devindia.receivecall;</p><p>import android.app.Activity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.telephony.*;import android.util.Log;import android.widget.TextView;</p><p>public class ReceiveCall extends Activity {</p><pre><code>TelephonyManager telephonyManager;MyPhoneStateListener listener;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Get the UI    try {        listener = new MyPhoneStateListener();        // Get the telephony manager        telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);        Log.d(""DEBUG"", ""telephonyManager....called"");        // Register the listener wit the telephony manager        telephonyManager.listen(listener,                PhoneStateListener.LISTEN_CALL_STATE);        Log.d(""DEBUG"", ""Listener REgister....."");    } catch (Exception e) {        e.printStackTrace();    }}class MyPhoneStateListener extends PhoneStateListener {    @Override    public void onCallStateChanged(int state, String incomingNumber) {        Log.d(""DEBUG"", ""Phone listener...."");        String stateString = ""N/A"";        switch (state) {        case TelephonyManager.CALL_STATE_IDLE:            stateString = ""Idle"";            break;        case TelephonyManager.CALL_STATE_OFFHOOK:            stateString = ""Off Hook"";            break;        case TelephonyManager.CALL_STATE_RINGING:            Log.d(""DEBUG"",""Before Answer..."");            stateString = ""Ringing""+ incomingNumber;            Intent myIntent = new Intent(Intent.ACTION_ANSWER);             myIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP //                   | Intent.FLAG_DEBUG_LOG_RESOLUTION //                   | Intent.FLAG_FROM_BACKGROUND //                   | Intent.FLAG_ACTIVITY_NEW_TASK).addCategory    (Intent.CATEGORY_DEFAULT);             startActivity(myIntent);             //startActivity((new Intent(Intent.ACTION_ANSWER)));            Log.d(""DEBUG"",""After Answer..."");                       break;        }    }}</code></pre><p>}</p><h2>AndroidManifest.xml</h2><p>                                                                            </p><pre><code>&lt;/application&gt;&lt;use-permission android:name=""android.permission.CALL_PHONE""/&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""&gt;&lt;/uses-permission&gt;&lt;uses-sdk android:minSdkVersion=""3"" /&gt;</code></pre><p> </p>","533863","","","","","2011-01-10 20:06:35","ACTION_ANSWER dosn't reply","<android><android-manifest>","1","0","","",""
"4384832","1","","","2010-12-08 06:41:26","0","324","<p>I am New to Android. My Requirement is to check an item of list view and i want show the selected items in next activity.</p><p>can anyone help me..</p>","534553","","","","","2012-01-09 18:20:37","custom checked listview","<android>","2","0","","",""
"4384877","1","4385028","","2010-12-08 06:47:00","1","684","<p>I have been building an application on android and wanted to do some user authentication using twitter oAuth. But is there any service by google which will allow user authentication easily? Could you please let me know if any other services exist for android ?</p><p>Regards,Lalith</p>","297119","","","","","2010-12-08 07:14:43","Authentication on Android Apps?","<android><authentication>","1","0","","",""
"4384890","1","4384994","","2010-12-08 06:48:53","100","102244","<p>I have created a layout that contains two buttons, Next and Previous. In between the buttons I'm generating some dynamic views. So when I first launch the application I want to disable the ""Previous"" button since there wont be any previous views. I also want to disable the ""Next"" button when there are not more views to display. Is there anyway to disable the buttons?</p><p><img src=""http://i.stack.imgur.com/5YF00.jpg"" alt=""screen shot of sample layout""></p>","395959","","651104","","2011-10-22 04:41:36","2014-03-21 08:08:27","How to disable an Android button?","<android><layout><button>","5","0","18","",""
"4384897","1","4385270","","2010-12-08 06:49:40","2","2200","<p>Can you please tell me how can i open the android inbuilt View Contact ActivityProgramatically.</p><p>I am having a list of contacts in my activity and i want to show the contact details on the selection of list Item, so i basically want to know to which android activity i should send the intent in order to open that activity.</p><p>Thanks in Advance.</p>","395661","","","","","2010-12-08 08:06:04","how can we open the android contact activity programatically?","<android>","2","0","","",""
"4385165","1","","","2010-12-08 07:35:31","0","833","<p>in my application when  i click on exit button  the application has to run in background or my hme screen must be visiblehow do i do thisi am new to android i have no idea about it please some one help</p>","531829","","","","","2010-12-08 07:49:18","runing android application in background","<android>","3","1","","2012-08-18 05:51:08",""
"4385182","1","4385199","","2010-12-08 07:39:13","1","760","<p>I have a twitter application which uses Sign-in with twitter.It's 'Settings' screen opens an instance of web browser which goes to twitter, asks the user to authenticate my client application, and comes back to the 'Settings' page after redirection from twitter.Every other thing with twitter and else works fine, except this:</p><ul><li>After the authentication, when the control has come back into the 'Settings' activity, the browser instance remains opened.</li><li>This causes hindrance in the UI experience whenever the user navigates away from the 'Settings' activity by back button, after logging in.</li><li>Pressing the back button takes the user to the web browser instead of taking her to the activity she was at before coming to 'Settings' activity.</li></ul><p>Is there any way to get rid of this?Can I pass any flag with the intent that opens the browser so that the browser knows that it has to close or has not to be there in the view stack of my application?or any other solution?</p><p>Thanks!</p>","243709","","21234","","2010-12-11 11:18:46","2010-12-11 11:18:46","Force close the web browser","<android><view><android-sdk-2.1><android-browser>","1","0","","",""
"4385278","1","4385321","","2010-12-08 07:53:52","0","44","<p>I am assuming that , in the host machine , i can find a file calling <code>$(PREFIX)/data/hello.apk</code>. But I did not find it , either in <code>android-sdk-linux_x86/platforms/android-8/data</code> nor in <code>~/.android/avd/myAvd</code>`</p>","115722","","","","","2010-12-08 08:47:51","where can I found the file in the host machine when installed it using `adb push /data/hello.apk` on simulator","<android>","2","0","","",""
"4385283","1","","","2010-12-08 07:54:48","3","992","<p>Before the newest version I was able to create hierarchies using dragn' drop, performed on the outline view.Since the upgrade, I can't and the controls ('+', '-' and arrows) aremissing.</p><p>So how am I suppose to build view hierarchies now?</p>","258429","","","","","2010-12-19 15:10:17","Android Eclipse ADT 8.0.0 (and 8.0.1) problem - can't create views hierarchy with drag and drop in the Outline view","<android><eclipse><adt><outline-view>","4","0","","",""
"4385323","1","4385365","","2010-12-08 08:04:26","1","1153","<p>I am writting an applications launcher (like home screen application). And I am wondering whether we can intercept the default dialog occurs when some application doesn’t respond in 5 seconds. What I want is: instead show the default alert dialog the launcher will show another dialog. I was googling for awhile but haven’t found anything. Could anyone please tell me whether it is possible ?Thank you in advance</p>","424721","","","","","2010-12-08 08:13:43","Handle ANR(Application not responding) dialog (Android)","<android>","1","0","","",""
"4385414","1","","","2010-12-08 08:20:29","0","614","<p>I have a problem with my Magento. When I login and view my orders page, the following error is shown:</p><blockquote>  <p>Fatal error: Call to a member function setCollection() on a non-object in C:\wamp\www\danfemall\app\code\core\Mage\Sales\Block\Order\History.php on line 58</p></blockquote><p>When I remove the <code>setCollection</code> function from the code, it runs well but I wonder what the <code>setCollection</code> function does and is it wise to remove that function from the code.</p><p>Please someone help me out.</p>","534714","","471559","","2010-12-11 15:43:22","2010-12-11 22:14:39","Magento Error Call to a member function setCollection() on a non-object","<android><magento><wamp><magento-1.4>","1","1","","",""
"4385682","1","","","2010-12-08 08:58:12","0","622","<p>I am working on client server for as many as 2 weeks and things are not going that good.I have a android client and .net web service as my server.</p><p>I have to collect the data from the android screens and want to send the data to server which will do my basic CRUD operations.</p><p>I had spent some time and managed to send data to server but it is limited for individual parameters like if i wan to send employee name i can send it using ksoap2 envelop and managed to get the data on my server.</p><p>but things are NOT FINE when i want to send class object which has employeename,employeeid, etc as its parameters. </p><p>I used KVM serializer to create a class employee with the fields above mentioned.</p><p>i can only able to retrieve data from server using KVM but not able to send data to server.</p><p>I read ""Unlocking Android"" (good book) book where the author said not to use ksoap if i am not expert in Ksoap. Now my question is what i have to use to get this thing working.</p><p>Please suggest me quickly so that i can work on it. i have deadline which i have already crossed.</p><p>ThanksIshwar Naste</p>","534723","","","","","2010-12-08 09:07:21","passing data from Android Client .net Webservice","<.net><android>","1","5","","",""
"4385728","1","4516649","","2010-12-08 09:06:13","1","3103","<p>I'm saving an image onto sd card using the following code:</p><pre><code>ContentValues values = new ContentValues();   values.put(MediaColumns.TITLE, mFileName);values.put(MediaColumns.DATE_ADDED, System.currentTimeMillis()); values.put(MediaColumns.MIME_TYPE, ""image/jpeg"");resultImageUri = ApplyEffects.this.getContentResolver().insert(Images.Media.EXTERNAL_CONTENT_URI, values);try{ OutputStream out = ApplyEffects.this.getContentResolver().openOutputStream(resultImageUri); mResultBitmaps[positionSelected].compress(Bitmap.CompressFormat.JPEG, 70, out);   out.flush(); out.close();} catch(FileNotFoundException e){ e.printStackTrace();} catch(Exception e){ e.printStackTrace();}</code></pre><p>But the image file name is always the System.currentTimeMills. How do I specify a name for it?</p>","514257","","","","","2010-12-30 14:47:24","Android - set file name while saving image using Bitmap.compress","<android>","2","0","1","",""
"4385752","1","4385984","","2010-12-08 09:08:50","1","2429","<p>My application plays ShoutCast Streaming and the target OS is 1.6 and above. I have applied some code from NPR application with some modification.</p><p>Here is the code</p><pre><code>mediaPlayer = new MediaPlayer();mediaPlayer.reset();mediaPlayer.setDataSource(url);mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);// Log.d(LOG_TAG, ""Preparing: "" + playUrl);mediaPlayer.prepareAsync();mediaPlayer.start();`</code></pre><p>The code doesnot play anything on simulator or device(Testing in Samsung Galaxy with 2.1).</p><hr><p>Here is the LogCat message. </p><blockquote>  <p>About to play <a href=""http://88.191.81.31:8206"" rel=""nofollow"">http://88.191.81.31:8206</a><br>  12-08 14:16:42.229: WARN/MediaPlayer(5520): info/warning (1, 26)<br>  12-08 14:16:42.239: ERROR/PlayerDriver(1870): Command PLAYER_INIT completed with an error or info PVMFFailure<br>  12-08 14:16:42.239: ERROR/MediaPlayer(5520): error (1, -1)<br>  12-08 14:16:42.239: WARN/PlayerDriver(1870): PVMFInfoErrorHandlingComplete<br>  12-08 14:16:42.259: ERROR/MediaPlayer(5520): start called in state 0<br>  12-08 14:16:42.259: ERROR/MediaPlayer(5520): error (-38, 0)<br>  12-08 14:16:42.299: INFO/MediaPlayer(5520): Info (1,26)<br>  12-08 14:16:42.299: ERROR/MediaPlayer(5520): Error (1,-1)<br>  12-08 14:16:42.304: ERROR/MediaPlayer(5520): Error (-38,0)  </p></blockquote><hr><p>Here is the question. 1. Can you tell me whats happening in device? 2. How to solve this error?.</p>","246942","","83446","","2011-12-31 22:01:15","2011-12-31 22:01:15","Android Shoutcast: Want help to play ShoutCast Streaming in 1.6","<android><streaming><shoutcast>","1","1","2","",""
"4385895","1","","","2010-12-08 09:26:40","0","597","<p>I have a list view, and the row view has 2 child views: an image view and a text view. The image view is actionable. Both of the child views have a selector. My problem is that when I press the text view the image view gets selected too. Is like the row view transmits the selected state to it's children. How can I remove that so each child view gets selected independently?</p><p>Best regards,Gratzi</p>","460611","","","","","2011-08-30 10:38:31","Selector for listview row child view","<android>","2","0","","",""
"4385936","1","4389495","","2010-12-08 09:30:48","0","249","<p>I would like to encrypt data using XOR on Android, iPhone, and BlackBerry.  I need to decrypt the data in a .net webservice.</p><p>Is XOR encryption available on BlackBerry and iPhone?</p>","1746300","","75204","","2010-12-08 15:54:42","2010-12-08 15:59:03","xor encryption help need","<.net><iphone><android><blackberry>","1","4","","",""
"4386079","1","","","2010-12-08 09:47:03","0","157","<p>How to capture photo from our application in android.Can anyone give some ideas to do this?</p>","512192","","","","","2010-12-08 09:51:00","capture image in android?","<android>","1","0","","",""
"4386080","1","","","2010-12-08 09:47:06","2","263","<p>can we send a chart in email in android app.</p>","515616","","","","","2011-04-18 05:46:45","can we add arraylist directly to listview in android","<android>","2","1","2","",""
"4386123","1","4386219","","2010-12-08 09:52:44","0","378","<p>I am uploading a new application on Android Market and it warned me that the new version needs higher <code>versionCode</code>. But since I made just a little improvement, I didn't want to assign version 2 from version 1 instead I wanted to say ""1.1"" but <code>versionCode</code> doesn't allow me to type in float numbers.</p><p>So I think I can use <code>versionName</code> which is the one shown to the users but still I am wondering how to do it in <code>versionCode</code> as well.</p><p><strong>Android doc says :</strong></p><p><em><strong>android:versionCode</em></strong> -</p><blockquote>  <p>An internal version number. This number is used only to determine  whether one version is more recent  than another, with higher numbers  indicating more recent versions. This  is not the version number shown to  users; that number is set by the  versionName attribute.</p>    <p>The value must be set as an integer, such as ""100"". You can define  it however you want, as long as each  successive version has a higher  number. For example, it could be a  build number. Or you could translate a  version number in ""x.y"" format to an  integer by encoding the ""x"" and ""y""  separately in the lower and upper 16  bits. Or you could simply increase the  number by one each time a new version  is released.</p></blockquote><p>But I didn't understand the second paragraph.</p><p>Thanks.</p>","44852","","","","","2010-12-08 10:02:40","How to set builtNumber in Android","<android><versioning>","1","0","","",""
"4386140","1","4386930","","2010-12-08 09:54:41","1","539","<p>I released my first Android app two weeks ago (an MMO called Agent Syndicate) and everything has been working well, except for sounds and music!</p><p>Using standard MP3 files created in Sony's Sound Forge Pro 10 at 128kps, I immediately received reports from many users complaining about Force Close issues on a wide variety of handsets, mostly running Android 2.1 and 2.2. I released a new version which has all sounds turned off, and the complaints ceased. I'd really like to have sounds however, so this is far from ideal.</p><p>I don't have access to the resources to test the game on anything other than my personal phone and the emulator (where everything works flawlessly), but it's obvious there is a major issue for many players!</p><p>Should I not be using MP3s? Is there a universal method that works best for all handsets for just playing simple sound files?</p><p>This is what I'm using to start my sound effects:</p><pre><code>final MediaPlayer player = MediaPlayer.create(GlobalState.Instance, resId);player.setOnCompletionListener(new MediaPlayer.OnCompletionListener(){    public void onCompletion(MediaPlayer mp)    {        mp.release();    }});player.setVolume(0.5f, 0.5f);player.start();</code></pre><p>I originally was calling player.prepare() before player.start(), but kept getting IllegalStateExceptions on some of the sound files. Some of the information out there is very confusing on when exactly to call these methods, and what the exception means. Removing player.prepare() made it work 100% of the time for me on the emulator and my local dev device.</p>","530821","","419","","2011-12-04 15:01:36","2011-12-04 15:01:36","Android MP3 MediaPlayer Crashes Some Handsets","<android><audio>","1","0","","",""
"4386209","1","4387039","","2010-12-08 10:02:02","0","258","<p>I need to insert two new contacts with same display name. But all other fields are different.</p><p>How its possible?</p><p>I tried to insert like this, but both contacts are conflicted on Android 2.2 contacts.</p>","488433","","","","","2010-12-08 11:47:02","Is it possible to insert the two new contacts with same display name on Android 2.2?","<android>","1","0","","",""
"4386252","1","4797347","","2010-12-08 10:06:18","1","347","<p>I'm programming a Android application which have a background service that polls the GPS now and then. My question regards if it's possible for other applications to access the GPS during my service uses it? </p>","438234","","","","","2011-01-25 18:22:42","Multiple subscriptions on the GPS device","<android><gps>","1","0","","",""
"4386318","1","4386384","","2010-12-08 10:15:37","3","734","<p>I have developed an application in Android 2.2 and my clients want me to support it on 2.1So I have some dependency for XML parsingas I am using following code: </p><pre><code>XPathFactory factory = XPathFactory.newInstance();XPath xpath = factory.newXPath();//Set xmlns namespace otherwise xmlns will not be parsedxpath.setNamespaceContext(new PersonalNamespaceContext());//Parse XML stringXPathExpression expr = xpath.compile(CCRKEY1);          Object result = expr.evaluate(doc, XPathConstants.NODESET); </code></pre><p>Now in 2.1 I cannot access <code>XPathFactory</code>, <code>XPath</code>, <code>XPathExpression</code>So what could be the similar methods to replace these in 2.1??</p><p>Thanks,</p>","521380","","539542","","2012-01-15 06:17:55","2012-01-15 06:17:55","Supporting my Android 2.2 application  on Android 2.1 ","<android><xml><compatibility><backwards-compatibility>","1","0","1","",""
"4386353","1","","","2010-12-08 10:18:24","0","998","<p>Can anyone please tell me how to find country name from any number?</p><p>For example, Suppose i entered +91773654398 on edittext and on onclick i want to show the number is from INDIA.</p><p>I hope my query is clear.</p><p>Thanks &amp; Regards,Mona</p>","437833","","","","","2011-06-22 05:48:47","how to get country name/code from any nu","<android>","1","0","","",""
"4386392","1","4386434","","2010-12-08 10:22:40","17","17508","<p>I just updated ADT, than the SDK and now I have in only one project the issue, that my aapt isn't found</p><pre><code>Error executing aapt. Please check aapt is present at /opt/android/platform-tools/aapt</code></pre><p>The path is correct, I checked twice and more times.</p><pre><code>-rwxrwxrwx 1 martin martin 3,5M 2010-12-08 10:41 /opt/android/platform-tools/aapt</code></pre><p>I can start aapt via console, the permissions are 777, I restarted eclipse, closed/reopened the project, restarted adb and finally my Ubuntu.</p><p>Some ideas why this might happen only at one project?</p>","180538","","","","","2014-04-04 09:16:23","aapt not found under the right path","<android><eclipse><aapt>","10","0","5","",""
"4386403","1","4386463","","2010-12-08 10:24:25","1","2728","<p>When i installed my application in different devices Color of dialog box changes Devices to device          How can i set the color of Dialog box </p><p>Regards,Kariyachan</p>","482604","","302328","","2010-12-08 10:59:31","2010-12-08 12:04:38","How to change the color of Dialog box","<android><gui><dialogbox>","3","0","","",""
"4386449","1","","","2010-12-08 10:29:44","4","9706","<p>I am trying to send touch events to a device using ADB shell command, so that I can do some basic automation for UI tests. I have followed the discussion in some previous threads regarding this. </p><p>I confirmed about getting the events and using sendevents,to send out 6 events for each touch ( xcoord, ycoord, 2 for press,2 for release) and it was easy to use this information to sendevents, but a getevent for the touchscreen for a device seems to generate far too many events.</p><p>Has somebody managed to send touch event from ADB to a device? Could you please share the solution.</p><p>I really appreciate your help.</p><p>I am working on recording the touch events on phone. After that i wish to send the same event back to the device as part of UI testing.</p><p>Please help</p>","534839","","","","","2013-12-29 21:29:18","send touch event from ADB to a device","<android>","3","0","7","",""
"4386484","1","","","2010-12-08 10:35:17","-3","2836","<p>i have the coding for draw the user signature.now i need the coding for save that signature in database and i need to compare the signature is correct or not.you can see my coding for draw signature on screen</p><pre><code>import android.app.Activity;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Path;import android.graphics.RectF;import android.os.Bundle;import android.util.AttributeSet;import android.view.MotionEvent;import android.view.View;import android.view.View.OnClickListener;import android.view.ViewGroup.LayoutParams;import android.widget.Button;import android.widget.LinearLayout;public class sign extends Activity {  LinearLayout content;  signature pnlpanel;  Button btn,btn1;@Overridepublic void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   setContentView(R.layout.main);   content = (LinearLayout) findViewById(R.id.linear);   pnlpanel = new signature(this, null);   pnlpanel.setBackgroundColor(Color.WHITE);   content.addView(pnlpanel, LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);   btn = (Button) findViewById(R.id.bt);   btn.setOnClickListener(new OnClickListener() {               public void onClick(View v) {         pnlpanel.clear();      }   });   btn1 = (Button) findViewById(R.id.button);   btn1.setOnClickListener(new OnClickListener() {               public void onClick(View v) {       switch(v.getId())    {    case R.id.linear:  //db.open();  //if(equals(linear));      }}   });}public class signature extends View {private static final float STROKE_WIDTH = 5f;/** Need to track this so the dirty region can accommodate the stroke. **/private static final float HALF_STROKE_WIDTH = STROKE_WIDTH / 2;private Paint paint = new Paint();private Path path = new Path();/*** Optimizes painting by invalidating the smallest possible area.*/private float lastTouchX;private float lastTouchY;private final RectF dirtyRect = new RectF();public signature(Context context, AttributeSet attrs) { super(context, attrs); paint.setAntiAlias(true); paint.setColor(Color.BLACK); paint.setStyle(Paint.Style.STROKE); paint.setStrokeJoin(Paint.Join.ROUND); paint.setStrokeWidth(STROKE_WIDTH); }public void save() {// TODO Auto-generated method stub}/*** Erases the signature.*/public void clear() { path.reset(); // Repaints the entire view. invalidate();}@Overrideprotected void onDraw(Canvas canvas) { canvas.drawPath(path, paint);}@Overridepublic boolean onTouchEvent(MotionEvent event) { float eventX = event.getX(); float eventY = event.getY(); switch (event.getAction()) {   case MotionEvent.ACTION_DOWN:     path.moveTo(eventX, eventY);     lastTouchX = eventX;     lastTouchY = eventY;     // There is no end point yet, so don't waste cycles invalidating.     return true;   case MotionEvent.ACTION_MOVE:   case MotionEvent.ACTION_UP:     // Start tracking the dirty region.     resetDirtyRect(eventX, eventY);     // When the hardware tracks events faster than they are delivered, the     // event will contain a history of those skipped points.     int historySize = event.getHistorySize();     for (int i = 0; i &lt; historySize; i++) {       float historicalX = event.getHistoricalX(i);       float historicalY = event.getHistoricalY(i);       expandDirtyRect(historicalX, historicalY);       path.lineTo(historicalX, historicalY);     }     // After replaying history, connect the line to the touch point.     path.lineTo(eventX, eventY);     break;   default:     debug(""Ignored touch event: "" + event.toString());     return false; } // Include half the stroke width to avoid clipping. invalidate(     (int) (dirtyRect.left - HALF_STROKE_WIDTH),     (int) (dirtyRect.top - HALF_STROKE_WIDTH),     (int) (dirtyRect.right + HALF_STROKE_WIDTH),     (int) (dirtyRect.bottom + HALF_STROKE_WIDTH)); lastTouchX = eventX; lastTouchY = eventY; return true;}private void debug(String string) {// TODO Auto-generated method stub}/*** Called when replaying history to ensure the dirty region includes all* points.*/private void expandDirtyRect(float historicalX, float historicalY) { if (historicalX &lt; dirtyRect.left) {   dirtyRect.left = historicalX; } else if (historicalX &gt; dirtyRect.right) {   dirtyRect.right = historicalX; } if (historicalY &lt; dirtyRect.top) {   dirtyRect.top = historicalY; } else if (historicalY &gt; dirtyRect.bottom) {   dirtyRect.bottom = historicalY; }}    /**    * Resets the dirty region when the motion event occurs.    */    private void resetDirtyRect(float eventX, float eventY) {     // The lastTouchX and lastTouchY were set when the ACTION_DOWN     // motion event occurred.     dirtyRect.left = Math.min(lastTouchX, eventX);     dirtyRect.right = Math.max(lastTouchX, eventX);     dirtyRect.top = Math.min(lastTouchY, eventY);     dirtyRect.bottom = Math.max(lastTouchY, eventY);    }    }}</code></pre>","543019","","21234","","2010-12-08 11:00:14","2012-09-14 11:09:10","How to save and compare the signature in Android","<android><graphics>","2","2","","2013-04-10 03:58:55",""
"4386529","1","4386555","","2010-12-08 10:39:30","4","7354","<p>Hi everyoneI am playing with UI Event Handling, and I have found something that I cannot find the explanation from the <a href=""http://developer.android.com/guide/topics/ui/ui-events.html#EventListeners"" rel=""nofollow"">Android Dev</a>: I have an ImageView, and a TextView , whenever I touch on the ImageView, the TextView show a message. But the following codes doesn't work:</p><pre><code>    public class ShowSomething extends Activity { private LinearLayout ll; public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);    LinearLayout ll = (LinearLayout)findViewById(R.id.linearLayout);  final TextView textview = (TextView)findViewById(R.id.textview);  MyImageView image = new MyImageView(this, textview);  image.setImageResource(R.drawable.icon);  ll.addView(image, 48, 48); }}</code></pre><p>And MyImageView.java</p><pre><code>public class MyImageView extends ImageView implements OnTouchListener{ private TextView textview; public MyImageView(Context context,TextView textview) {  super(context);  this.textview = textview; } @Override public boolean onTouch(View v, MotionEvent event) {  textview.setText(""Event captured !"");  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:id=""@+id/linearLayout""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical""&gt;&lt;TextViewandroid:id=""@+id/textview""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:text=""Holder""/&gt;&lt;/LinearLayout&gt;</code></pre><p>But when I attach an OnTouchListener on the MyImageView like this, it does work:File ShowSomething.java</p><pre><code>public class ShowSomething extends Activity { private LinearLayout ll; public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);    LinearLayout ll = (LinearLayout)findViewById(R.id.linearLayout);  final TextView textview = (TextView)findViewById(R.id.textview);  MyImageView image = new MyImageView(this,textview);  image.setImageResource(R.drawable.icon);  image.setOnTouchListener(new OnTouchListener() {       @Override     public boolean onTouch(View v, MotionEvent event) {      textview.setText(""Event captured!"");            return false;     }    });  ll.addView(image, 48, 48); } }</code></pre><p>And file MyImageView.java</p><pre><code>public class MyImageView extends ImageView {  private TextView textview; public MyImageView(Context context,TextView textview) {  super(context);  this.textview = textview; }}</code></pre><p>But as far as I know, the 2 implementation is the same (implement an Event Listener) - do I misunderstand anything ?</p>","424721","","","","","2010-12-08 10:44:02","Android: onTouch() never gets called?","<android>","2","0","","",""
"4386722","1","","","2010-12-08 11:04:30","2","945","<p>I have custom Java calendar application that I would like to sync with Android. First issue is how to connect Windows PC and Android and do sync. Is there official API for sync custom data with Android? What should I do to perform PC->Android sync? Don't want to sync my calendar to Google calendar and then Google calendar to Android.</p>","533725","","","","","2010-12-09 10:06:46","Sync custom PC calendar app with Android phone","<android><calendar><sync><pc><3rd-party>","1","0","4","",""
"4386807","1","4387874","","2010-12-08 11:14:02","2","1754","<p>I am developing an android project that uses a lot of JNI to interact with native application code for it to work. </p><p>Many times it happens that some part of my native application code crashes, stalling the java application. I have introduced signal handler to atleast catch any segmentations or anything of that sort happens in native layer, and accordingly informed the java layer to gracefully and cleanly shutdown the entire application so that the next time it start, it works fine.</p><p>Now i have reached a stage where i still have some crashes left in native layer but logcat is not enough now to debug where and why this is happening. </p><p>Can anyone help me on how i can capture the stack trace on segmentation/signal handling of native application? The native code is compiled using the Android's NDK toolchain and linked in apk using ant.</p><p>I am desperately in need of a way to get to know what is happening in native layer. </p><p>Thanks.</p>","473184","","473184","","2010-12-17 08:19:44","2011-03-06 04:06:57","How to get a stack trace in native layer on Android at runtime programatically","<android><android-ndk>","1","0","1","",""
"4386823","1","4409222","","2010-12-08 11:16:59","1","2563","<p>Is it possible to get the manifest permissions of any installed Android application?</p>","434175","","950983","","2013-03-20 01:31:16","2013-03-20 01:31:16","How to get manifest permissions of any installed Android app","<android><permissions><manifest>","2","1","2","",""
"4386854","1","","","2010-12-08 11:23:05","3","2800","<p>I am a newbie in Android and I was trying to build an app to record audio data. I am using Eclipse Galileo IDE with ADT plugin. And my app is targetted for the Andriod 2.1 platform.</p><p>Unfortunately the <a href=""http://developer.android.com/guide/topics/media/index.html"" rel=""nofollow"">example</a> provided in the Dev Guide throws many exceptions.</p><p>For example:to get MIME type the code uses <code>recorder.getMimeContentType()</code>. But this method does not exist in my version of <code>MediaRecorder</code> class. </p><p>I have searched online as well as this forum and came up with one or two alternatives which show how to record audio and place it in an EXISTING file. But ideally i want the code given in the dev guide to work. </p><p>Or even better if i can record the audio and store it directly in a byte array?</p><p>I have spent a lot of time trying to get this to work but with not much success :(</p><p>I would really appreciate if someone can show me how to achieve audio recording.</p>","534909","","213269","","2010-12-08 12:12:36","2012-07-10 10:45:39","Audio Recording","<android><audio-recording>","4","2","1","",""
"4386971","1","","","2010-12-08 11:39:23","1","6492","<p>I would like my email to be sent without having the email client ot open on the Android screen.</p><p>my code is standard:  </p><pre><code>final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.setType(""plain/text"");emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{addresses});emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);startActivity(Intent.createChooser(emailIntent, ""Send mail...""));</code></pre><p>How to?Thanks.Charles.</p>","586482","","418183","","2010-12-08 11:41:39","2010-12-09 03:49:10","Sending email without Intent.createChooser","<android><email>","1","0","","",""
"4387007","1","4387042","","2010-12-08 11:43:12","1","288","<p>is there any way to store bluetooth chat history device wise.if yes then please guide me.</p>","304961","","","","","2010-12-08 11:47:16","Bluetooth save chat history in android","<android>","1","1","0","",""
"4387307","1","4387388","","2010-12-08 12:16:37","0","115","<p>HI, I m using this query but it didn't work. It returns error</p><pre><code>12-08 17:04:21.498: ERROR/AndroidRuntime(1867): android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1Cursor mCursor = dbRead.query(DBHandler.TABLE_NAME, new String[] {""LevelNumber"", ""LevelState"" }, ""LevelNumber = "" + level_Number +"""", null, null, null, null);for(int i=0; i&lt;mCursor.getCount(); i++) { levelNumber = mCursor.getString(0); levelState = mCursor.getString(1);}</code></pre>","534957","","158288","","2010-12-08 12:21:35","2010-12-08 12:26:12","Query didn't work","<android><database>","2","0","","",""
"4387326","1","4387381","","2010-12-08 12:18:24","1","1259","<p>is it possible to get the name of the mobile phone operator from the android <a href=""http://developer.android.com/reference/android/provider/CallLog.Calls.html"" rel=""nofollow"">CallLog</a>? E.g. in Germany phone numbers have xxxx - xxxxxxx form.</p><p>Normally the first 4 numbers of the phone number are an identifier for the mobile phone operator. But in Germany you can switch the operator, porting your mobile phone number to your new operator. So the xxxx itself is no longer a hint what operator is behind a phone number or a call.</p><p>Is it possible to get such information from the CallLog or any other log of the android phone?</p>","401025","","401025","","2010-12-08 12:54:03","2010-12-08 13:32:20","Get mobile phone operator from android CallLog","<android><android-sdk-2.2><calllog>","2","0","1","",""
"4387340","1","4405662","","2010-12-08 12:19:24","1","746","<p>I'm building an Android app that runs off of a rails server. At first, when I tried to post simple String data to the server, I ran into an InvalidAuthenticityToken issue, but realized that I can bypass the authentication by setting the content type to ""json""</p><pre><code>HttpClient client = new DefaultHttpClient();HttpPost post = new HttpPost(Constants.REST_HOST + ""/add_comment"");post.addHeader(""Content-Type"", ""application/json"");</code></pre><p>The next step was trying to get upload profile picture working. However, when I tried uploading a photo via a MultipartEntity post, setting the content type to ""json"" causes the following error</p><blockquote>  <p>StandardError (Invalid JSON string):</p></blockquote><p>but not setting the content type brings back the InvalidAuthenticityToken exception. What's the correct way to post an image to a rails server from a foreign Java client?</p><blockquote>  <p>ActionController::InvalidAuthenticityToken  (ActionController::InvalidAuthenticityToken):</p></blockquote>","325072","","","","","2010-12-15 11:58:18","Post an image from Android client to Rails server without triggering InvalidAuthenticityToken","<android><ruby-on-rails><ruby><post><paperclip>","3","0","","",""
"4387408","1","8664502","","2010-12-08 12:28:57","2","307","<p>When page starts to loaded, the progress will show..and after the page loaded, the progress will disppear..</p>","","user466730","","","","2011-12-29 06:07:04","How to show and stop progress when navigating to other page in webview of android app?","<android><eclipse><android-emulator><webview>","2","0","","",""
"4387474","1","","","2010-12-08 12:36:06","2","382","<p>I have one android application, in which I have to display calendar in one screen. On clicking on a particular date, I have to add or delete my particular items and events. I need some help on this topic please guide me.</p>","461503","","1351522","","2012-09-20 10:05:55","2012-11-02 10:37:08","Display Calendar in android application","<android>","1","0","","",""
"4387609","1","4702413","","2010-12-08 12:51:10","1","4201","<p>Is there a limit on the size of an android application in the market ?</p><p>I've an application with a lot of sound, so the apk size is more than 10 Mb...</p><p>Thanks.</p>","312025","","308315","","2011-09-29 14:38:51","2011-09-29 14:38:51","Size max of an Android market app?","<android>","3","0","","",""
"4387610","1","4388403","","2010-12-08 12:51:18","0","448","<p>Hey, I want to get the id of the contact which is in the list of contacts on Android. I mean, when I add a contact to the phone, I think it has an Id, what is the class that provides this parameter? I mean the exactly Id.</p><p>I've search if some constants on CallLog.Calls can provide it, but I didn't found. Maybe it's Contacts.Contract, I don't know. Does anyone knows?</p><p>Thanks!</p>","399459","","","","","2010-12-15 14:41:20","How to get the id of the contact on Android contact list?","<android><contactscontract><android-contacts><calllog>","2","0","","",""
"4387631","1","4387864","","2010-12-08 12:53:28","2","4544","<p>I'm trying to integrate twitter to my app, but I can't seem to get it to work.</p><p>This is my code:</p><pre><code>public class OAuthForTwitter extends Activity {    private CommonsHttpOAuthConsumer httpOauthConsumer;    private OAuthProvider httpOauthprovider;    public final static String consumerKey = ""xxxxxxxxxxxxxx"";    public final static String consumerSecret = ""xxxxxxxxxxxx"";    private final String CALLBACKURL = ""sosInternational:///HierBenIkNu"";    private Twitter twitter;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        doOAuth();    }    /**     * Opens the browser using signpost jar with application specific     * consumerkey and consumerSecret.     */    private void doOAuth() {        try {            httpOauthConsumer = new CommonsHttpOAuthConsumer(consumerKey, consumerSecret);            httpOauthprovider = new DefaultOAuthProvider(                    ""http://twitter.com/oauth/request_token"",                    ""http://twitter.com/oauth/access_token"",                    ""http://twitter.com/oauth/authorize"");            String authUrl = httpOauthprovider.retrieveRequestToken(httpOauthConsumer, CALLBACKURL);            this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));        } catch (Exception e) {            Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();        }    }    @Override    protected void onNewIntent(Intent intent) {        super.onNewIntent(intent);        Uri uri = intent.getData();        if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACKURL)) {            String verifier = uri                    .getQueryParameter(oauth.signpost.OAuth.OAUTH_VERIFIER);            try {                // this will populate token and token_secret in consumer                httpOauthprovider.retrieveAccessToken(httpOauthConsumer,                        verifier);                // TODO: you might want to store token and token_secret in you                // app settings!!!!!!!!                AccessToken a = new AccessToken(httpOauthConsumer.getToken(),                        httpOauthConsumer.getTokenSecret());                // initialize Twitter4J                twitter = new TwitterFactory().getInstance();                twitter.setOAuthConsumer(consumerKey, consumerSecret);                twitter.setOAuthAccessToken(a);                // create a tweet                Date d = new Date(System.currentTimeMillis());                String tweet = ""#OAuth working! "" + d.toLocaleString();                // send the tweet                twitter.updateStatus(tweet);            } catch (Exception e) {                Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();            }        }    }}</code></pre><p>When I'm done authenticating on the Twitter site, it should redirect me back to the app.</p><p>But instead, I get this Page not found:</p><p><img src=""http://i.stack.imgur.com/piffm.png"" alt=""alt text""></p><p>I have this in my AndroidManifest:</p><pre><code>&lt;intent-filter&gt;          &lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;          &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;          &lt;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;          &lt;data android:scheme=""sosInternational"" android:host=""HierBenIkNu""&gt;&lt;/data&gt;      &lt;/intent-filter&gt;  </code></pre><p>How can I go back to my app with the keys i get back?</p>","517460","","517460","","2010-12-08 12:56:28","2011-07-20 18:33:40","CallBack after Twitter authentication","<java><android><twitter><callback><twitter4j>","3","2","1","",""
"4387651","1","","","2010-12-08 12:54:52","0","859","<p>I apologise if this is the wrong place to ask this question, I did my best to make sure it has not been asked before and thorougly searched the web for any similar answer.</p><p>So here goes: I am having a very hard time finding any sort of reference, or better yet a tutorial on how to create a wallpaper pack for android.</p><p>To elaborate, I do not mean a live wallpaper of any kind. Just a pack of selected wallpapers packaged into an applications for distribution through the market. Ideally wih its own selection interface.</p><p>There are precedents on the market but for the life of me I cannot find any information.</p><p>Any ideas, opinions or suggestions? Maybe I'm going about this the wrong way?</p><p>Many thanks for the help!</p>","534997","","","","","2011-06-02 09:18:10","Android wallpaper pack","<android>","1","0","","",""
"4387718","1","4387747","","2010-12-08 13:01:14","2","802","<p>I have a header view which contains 4 buttons. When I click each of these 4 buttons it should start  four different activities. And also I want these buttons in every view of my application.</p><p>I can include this header view using include tag. But how can I include the java code (button click etc) in every activities?</p><p>Thank you</p>","523058","","","","","2010-12-08 13:04:31","Include in android using java","<android><include>","1","0","2","",""
"4387785","1","4397032","","2010-12-08 13:08:29","0","46","<pre><code>I need a suggestion that how to perform the sendbackward and sendfront action in Android.Actually Im having 2 images in my mapview and the second image is overlapped with the first one half of it.Here I need a suggestion when I click on to the first image it should come front and the secod image should go front and its vice versa.Hope I will get a quick response from ur side.</code></pre><p>Thanks all,monish.</p>","384253","","","","","2010-12-09 11:44:28","how to perform the action sendbackward and sendfront in Android","<android>","1","0","1","",""
"4387833","1","","","2010-12-08 13:15:11","2","90","<p>When a third party calls a phone I'd like to be able to detect what buttons they press. I figure I could record the voice downstream and then after the call run some algorithm to figure out what keys where pressed during the call. so how can i do this...which functions and methods should i used......?  </p>","533863","","","","","2010-12-08 13:15:11","Make DTMF Dectator For My Mobile","<android><android-emulator>","0","0","","",""
"4387869","1","","","2010-12-08 13:19:23","-1","2349","<p>Hey,im trying to start the Monkeyrunner-Example-Project with my App.When he trys to install the apk, it returns this error:</p><pre><code>device.installPackage-&gt;101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Error starting command: monkey --port 12345101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice]com.android.ddmlib.ShellCommandUnresponsiveException101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408)101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.ddmlib.Device.executeShellCommand(Device.java:276)101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbMonkeyDevice$1.run(AdbMonkeyDevice.java:89)101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.util.concurrent.FutureTask.run(Unknown Source)101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.lang.Thread.run(Unknown Source)</code></pre><p>and device.startActivity returns this:</p><pre><code>101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Error executing command: am start -n de.match2blue.mobilverlieben.SignUpWizard1 101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice]com.android.ddmlib.ShellCommandUnresponsiveException101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.ddmlib.Device.executeShellCommand(Device.java:276)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbMonkeyDevice.shell(AdbMonkeyDevice.java:237)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbMonkeyDevice.shell(AdbMonkeyDevice.java:230)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbMonkeyDevice.startActivity(AdbMonkeyDevice.java:351)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyDevice.startActivity(MonkeyDevice.java:297)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.lang.reflect.Method.invoke(Unknown Source)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:175)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyObject.__call__(PyObject.java:355)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyMethod.__call__(PyMethod.java:215)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.pycode._pyx0.f$0(C:\Users\Dustin Augstein\workspace\PythonTest\src\MonkeyTest.py:34)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.pycode._pyx0.call_function(C:\Users\Dustin Augstein\workspace\PythonTest\src\MonkeyTest.py)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyTableCode.call(PyTableCode.java:165)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyCode.call(PyCode.java:18)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.Py.runCode(Py.java:1197)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.__builtin__.execfile_flags(__builtin__.java:538)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:156)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.ScriptRunner.run(ScriptRunner.java:116)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:101)101208 13:44:15.233:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:212)</code></pre><p>Does anyone know how to solve this errors?</p><p>thanks in advance</p>","535023","","132528","","2010-12-16 17:15:56","2011-04-19 11:47:04","Android MonkeyRunner doesn't start","<python><android>","1","0","","",""
"4387875","1","4387944","","2010-12-08 13:19:49","26","6550","<p>Is it possible to view the activity stack in Android for debugging purposes?</p>","143378","","","","","2013-07-25 13:53:13","View activity stack in Android","<android><debugging><activity><stack>","1","1","11","2012-12-09 14:39:08",""
"4387954","1","9507280","","2010-12-08 13:26:43","7","2244","<p>Does anybody know how (and if) you can change the password used to sign android builds?</p><p>We have a live app, but want to change the signing password. The problem is that we don't want to force our users to reinstall the app (if we use a new key users won't be able to install the new build as an update to the original app).</p><p>I've looked all over the android documentation, but have been unable to find anything even related to the subject (except for making a new key...).</p>","428556","","","","","2013-01-22 10:32:32","Changing android signing key password","<android><code-signing>","3","0","1","",""
"4387960","1","4397357","","2010-12-08 13:27:25","7","5064","<p>I am trying to add a contact in Android using <code>getContentResolver</code>.First I created an <code>ArrayList</code>:</p><pre><code>ArrayList&lt;ContentProviderOperation&gt; ops =  new ArrayList&lt;ContentProviderOperation&gt;();</code></pre><p>then populated the array list by</p><pre><code>int rawContactInsertIndex = ops.size();ops.add(ContentProviderOperation.newInsert(RawContacts.CONTENT_URI)   .withValue(ContactsContract.RawContacts.ACCOUNT_NAME,accountName)   .build());ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)   .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,rawContactInsertIndex)   .withValue(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)   .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, name)   .build());</code></pre><p>and finally in a try block</p><pre><code>getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);</code></pre><p>when I excecute this, I am not getting any error or exception. But the contact does not appear in the Android contacts. When I retrieve the invisible contacts I could find this contact. Can any one figure out what is going wrong?</p>","430652","","2680216","","2013-12-08 04:49:07","2014-01-11 20:26:09","Contact API storing contact as an invisible contact: How to make it visible?","<android><native><contacts><invisible>","1","14","4","",""
"4387965","1","4388254","","2010-12-08 13:27:44","0","2674","<p>Hey I'm trying to insert data that I get from CallLog.Calls. But it returng a NUllPointerException at this line, considering what the LogCat says:</p><pre><code>this.dh.insert(1, contactName, numType, contactNumber, duration, callDate, currTime);</code></pre><p>Here is the error:</p><pre><code>12-08 11:18:16.377: ERROR/AndroidRuntime(16418): Caused by: java.lang.NullPointerException12-08 11:18:16.377: ERROR/AndroidRuntime(16418):     at com.psyhclo.RatedCalls.onCreate(RatedCalls.java:58)</code></pre><p>Here is the method insert from the class <strong>CallDataHelper.java</strong></p><pre><code>public boolean insert(Integer cId, String cName, String numType,String cNum, String dur, String date, String currTime) {this.db.execSQL(""insert into ""+ TABLE_NAME+ ""(id, contact_id, contact_name, number_type, contact_number, duration, date, current_time, cont) ""+ ""values( ? ,"" + cId + "", "" + cName + "", "" + numType + "", ""+ cNum + "", "" + dur + "", "" + date + "", "" + currTime + "", ? )"");return true;  }</code></pre><p>And here is the code of the class <strong>RatedCalls.java</strong> that I try to insert the data</p><pre><code>package com.psyhclo;import java.text.DateFormat;import java.util.ArrayList;import java.util.Date;import com.psyhclo.R;import android.app.Activity;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;public class RatedCalls extends ListActivity {  private static TextView txtView;  private CallDataHelper dh;  StringBuilder sb = new StringBuilder();  public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   Cursor cursor = getContentResolver().query(android.provider.CallLog.Calls.CONTENT_URI, null, null, null,android.provider.CallLog.Calls.DATE + "" DESC "");startManagingCursor(cursor);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 dateId = cursor.getColumnIndex(android.provider.CallLog.Calls.DATE);int numTypeId = cursor.getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE);Date dt = new Date();    int hours = dt.getHours();    int minutes = dt.getMinutes();    int seconds = dt.getSeconds();    String currTime = hours + "":""+ minutes + "":""+ seconds;ArrayList&lt;String&gt; callList = new ArrayList&lt;String&gt;();if (cursor.moveToFirst()) { do {String contactNumber = cursor.getString(numberColumnId);String contactName = cursor.getString(contactNameId);String duration = cursor.getString(durationId);String callDate = DateFormat.getDateInstance().format(dateId);  String numType = cursor.getString(numTypeId);this.dh.insert(1, contactName, numType, contactNumber, duration, callDate, currTime);Toast.makeText(getBaseContext(), ""Inserted!"", Toast.LENGTH_LONG);callList.add(""Contact Number: ""  + contactNumber + ""\nContact Name: "" + contactName  + ""\nDuration: "" + duration + ""\nDate: "" + callDate);} while (cursor.moveToNext());}   setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listitem, callList));   ListView lv = getListView();   lv.setTextFilterEnabled(true);   lv.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {   @Override   public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position,   long id) {   Toast.makeText(getApplicationContext(), ((TextView) view).getText(),          Toast.LENGTH_SHORT).show();   }   });     }   }</code></pre>","399459","","135152","","2011-05-25 03:05:25","2011-05-25 03:05:25","NullPointerException when try to insert on Android SQLite database","<android><sqlite>","1","9","","",""
"4388003","1","4470546","","2010-12-08 13:31:13","4","8403","<p>I recently updated my SDK Tools and the ADT Plugin to the latest version (got Android 2.3 as well). This required a few changes in my config (mainly I added <code>proguard.config=procfg.txt</code> to <code>default.properties</code> so that I could use the built-in support for proguard), and removed the old proguard config from <code>build.xml</code>. Now, my problem is that Eclipse gives a pretty lengthy error (which I'll embed at the end of the question) The problem is that I did not recently add any libraries. And again, compiling using <code>ant</code> works as expected:</p><pre><code>$ ant debugBuildfile: /home/felix/workspace/XXX/build.xml    [setup] Android SDK Tools Revision 8    [setup] Project Target: Android 2.3    [setup] API level: 9    [setup]     [setup] ------------------    [setup] Resolving library dependencies:    [setup] No library dependencies.    [setup]     [setup] ------------------    [setup]     [setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (4) is lower than the project target API level (9)    [setup]     [setup] Importing rules file: tools/ant/main_rules.xml-debug-obfuscation-check:-set-debug-mode:-compile-tested-if-test:-dirs:     [echo] Creating output directories if needed...-pre-build:-resource-src:     [echo] Generating R.java / Manifest.java from the resources...-aidl:     [echo] Compiling aidl files into Java classes...-pre-compile:compile:    [javac] /opt/android-sdk/tools/ant/main_rules.xml:361: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds    [javac] Compiling 1 source file to /home/felix/workspace/XXX/bin/classes-post-compile:-obfuscate:-dex:     [echo] Converting compiled files and external libraries into /home/felix/workspace/XXX/bin/classes.dex...-package-resources:     [echo] Packaging resources     [aapt] Creating full resource package...-package-debug-sign:[apkbuilder] Creating XXX-debug-unaligned.apk and signing it with a debug key...debug:     [echo] Running zip align on final apk...     [echo] Debug Package: /home/felix/workspace/XXX/bin/XXX-debug.apkBUILD SUCCESSFULTotal time: 6 seconds</code></pre><p>However, Eclipse is whining about repeated classes or something:</p><pre><code>[2010-12-08 15:06:43 - XXX]: DxUNEXPECTED TOP-LEVEL EXCEPTION:java.lang.IllegalArgumentException: already added: Lcom/android/vending/licensing/AESObfuscator;[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:143)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.processClass(Main.java:338)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.processFileBytes(Main.java:315)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.access$100(Main.java:56)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:266)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.processOne(Main.java:284)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.processAllFiles(Main.java:220)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.run(Main.java:176)[2010-12-08 15:06:43 - XXX]: Dx at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[2010-12-08 15:06:43 - XXX]: Dx at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[2010-12-08 15:06:43 - XXX]: Dx at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[2010-12-08 15:06:43 - XXX]: Dx at java.lang.reflect.Method.invoke(Method.java:597)[2010-12-08 15:06:43 - XXX]: Dx at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(Unknown Source)[2010-12-08 15:06:43 - XXX]: Dx at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(Unknown Source)[2010-12-08 15:06:43 - XXX]: Dx at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(Unknown Source)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)[2010-12-08 15:06:43 - XXX]: DxUNEXPECTED TOP-LEVEL EXCEPTION:java.lang.IllegalArgumentException: already added: Lcom/android/vending/licensing/AESObfuscator;[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:143)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.processClass(Main.java:338)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.processFileBytes(Main.java:315)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.access$100(Main.java:56)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:266)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.processOne(Main.java:284)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.processAllFiles(Main.java:220)[2010-12-08 15:06:43 - XXX]: Dx at com.android.dx.command.dexer.Main.run(Main.java:176)[2010-12-08 15:06:43 - XXX]: Dx at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[2010-12-08 15:06:43 - XXX]: Dx at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[2010-12-08 15:06:43 - XXX]: Dx at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[2010-12-08 15:06:43 - XXX]: Dx at java.lang.reflect.Method.invoke(Method.java:597)[2010-12-08 15:06:43 - XXX]: Dx at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(Unknown Source)[2010-12-08 15:06:43 - XXX]: Dx at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(Unknown Source)[2010-12-08 15:06:43 - XXX]: Dx at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(Unknown Source)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)[2010-12-08 15:06:43 - XXX]: Dx at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)[2010-12-08 15:06:43 - XXX]: Dxtrouble processing:[2010-12-08 15:06:44 - XXX]: Dxclass name (com/android/vending/licensing/LicenseCheckerCallback) does not match path (classes/com/android/vending/licensing/LicenseCheckerCallback.class)...while parsing classes/com/android/vending/licensing/LicenseCheckerCallback.class...while processing classes/com/android/vending/licensing/LicenseCheckerCallback.class[2010-12-08 15:06:44 - XXX]: Dxtrouble processing:[2010-12-08 15:06:44 - XXX]: Dxclass name (com/android/vending/licensing/NullDeviceLimiter) does not match path (classes/com/android/vending/licensing/NullDeviceLimiter.class)...while parsing classes/com/android/vending/licensing/NullDeviceLimiter.class...while processing classes/com/android/vending/licensing/NullDeviceLimiter.class[2010-12-08 15:06:44 - XXX]: Dxtrouble processing:[2010-12-08 15:06:44 - XXX]: Dxclass name (com/android/vending/licensing/PreferenceObfuscator) does not match path (classes/com/android/vending/licensing/PreferenceObfuscator.class)...while parsing classes/com/android/vending/licensing/PreferenceObfuscator.class...while processing classes/com/android/vending/licensing/PreferenceObfuscator.class[2010-12-08 15:06:44 - XXX]: Dx... --------------------------------------- ...... and so on for every class in my project ...... --------------------------------------- ...[2010-12-08 15:06:44 - XXX]: Dx229 warnings[2010-12-08 15:06:44 - XXX]: Dx2 errors; aborting[2010-12-08 15:06:44 - XXX] Conversion to Dalvik format failed with error 1</code></pre><p>Why is this happening? Why is it looking in <code>classes/</code>, which doesn't exist?</p><p>The project worked without any problems until yesterday, and it still works if compiled via <code>ant</code>.</p><hr><p><strong>Edit:</strong> The usual <code>Fix project properties</code> and <code>Clean project</code> don't work.</p><hr><p><strong>Edit 2:</strong> The errors keep coming and going. I do not have any <code>.jar</code>s. Also, I'm using ProGuard. At some point ant stopped working as well (can't remember the errors), I did a</p><pre><code>touch `find .`</code></pre><p>and things started working again (both Eclipse and ant), for a while. Now Eclipse spews errors again. What's going on!?</p><hr><p><strong>Edit 3:</strong> It would seem the problem lies with the ProGuard integration. Whenever I comment out the <code>proguard.config</code> directive from <code>default.properties</code> and to a project refresh + clean, it works. This is pretty weird because, when building in debug mode, Eclipse shouldn't obfuscate / optimize the code via ProGuard anyway. Also, my ProGuard configuration works just fine via Ant.</p><hr><p><strong>Edit 4:</strong> Eclipse + Ant + ProGuard = not getting along together. If I close Eclipse, uncomment my <code>proguard.config</code> directive, build with Ant, comment my <code>proguard.config</code> directive, open Eclipse, Eclipse starts spewing errors. It would seem like Ant is leaving something behind. If I do a clean project it works just fine.</p>","180784","","180784","","2010-12-14 16:00:11","2013-07-01 01:50:20","Eclipse gives ""Conversion to Dalvik format failed"" while ant works","<android><eclipse>","7","3","","",""
"4388061","1","","","2010-12-08 13:35:59","0","232","<p>I would like to give same linux user ID for more than one applications.How can I give the same linux user ID for more than one applications.</p><p>thanks,Venu.</p>","535039","","","","","2010-12-08 13:48:11","How can I give the same linux user ID for more than one applications?","<android>","1","0","","",""
"4388068","1","4388099","","2010-12-08 13:36:57","27","26898","<p>Is there anyway to remove activity label bar and label itself which is set by default from application label? I'd like to have whole layout from my design and need to remove the label bar and label which is in TOP layout. </p>","436498","","","","","2013-11-28 11:36:20","How disable / remove android activity label and label bar?","<android>","7","0","7","",""
"4388120","1","","","2010-12-08 13:42:33","0","5182","<p>Now, I am developing one <em>JSON</em> project. All <em>JSON</em> values are stored in sqlLite database and the list view is displayed. Some values displayed it correctly and at that moment where the error is shown here below. Please help me.</p><pre><code>12-08 19:00:27.818: ERROR/AndroidRuntime(1042): FATAL EXCEPTION: main12-08 19:00:27.818: ERROR/AndroidRuntime(1042): java.lang.IndexOutOfBoundsException: Invalid index 0, size is 012-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at java.util.ArrayList.get(ArrayList.java:311)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at ez.com.Action_module_screen.database(Action_module_screen.java:2443)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at ez.com.Action_module_screen$2.handleMessage(Action_module_screen.java:623)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at android.os.Handler.dispatchMessage(Handler.java:99)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at android.os.Looper.loop(Looper.java:123)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at java.lang.reflect.Method.invokeNative(Native Method)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at java.lang.reflect.Method.invoke(Method.java:521)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)12-08 19:00:27.818: ERROR/AndroidRuntime(1042):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","533787","","1556478","","2013-04-25 07:35:15","2013-04-25 07:35:15","How to solve Fatal Exception error?","<android>","1","0","","",""
"4388140","1","","","2010-12-08 13:44:17","0","2543","<p>I am developing an android application. In my application, I am displaying images from url using xml parsing. I want to store images in device's Shared Preferences. How can I store image in shared preferences and retrieve image from shared preferences? How is it possible?</p><p>Thanks All.</p>","500595","","366898","","2012-07-14 06:46:02","2012-07-14 06:46:02","how can I store image in Shared Preferences and retrieve it?","<android><sharedpreferences>","2","0","","",""
"4388142","1","4414301","","2010-12-08 13:44:23","1","6275","<p>I can get a progress bar to appear with the following code</p><pre><code>pd = ProgressDialog.show(myActivity.this, """", ""Loading. Please wait..."", true);</code></pre><p>straight forward, but once I have the code execute I want it to go away, but when I run the dismiss method after I never see the dialog box show at all.</p><p>Heres the code in context which is wrapped in oncreate</p><pre><code>pd = ProgressDialog.show(myActivity.this, """", ""Loading. Please wait..."", true);runCode();  setListAdapter(new CustomAdapter(myActivity.this)); pd.dismiss();</code></pre><p>I thought you can show/dismiss progress dialog's anywhere in the activity but I must be wrong.</p>","461631","","54501","","2010-12-19 10:58:12","2011-01-11 10:22:11","How do I show and then remove an android progress dialog","<android><progressdialog>","2","0","","",""
"4388255","1","","","2010-12-08 13:55:29","2","333","<p>As titled, how to implement a function that can zoom child views inside a ViewGroup (RelativeLayout for example)?</p>","423989","","","","","2010-12-08 13:55:29","Zoom function on a view group","<android><user-interface><zoom>","0","0","1","",""
"4388258","1","","","2010-12-08 13:55:49","1","1150","<p>I'm very new to Android development (think started yesterday) and in my application I'm trying to listen for when the camera is used to take a picture.  Also, I need to listen for this action <em>all the time</em> such that my application can ""close"", but it'll still be listening in the background for when the camera takes an image (my application will execute almost entirely in the background once it's setup initially).  Anyway, I've been doing a ton of reading and searching online and such and I've found that the best way, probably, to do this is to use a BroadcastReceiver, but what I've not seen is a good example of setting something like this up.  I'm actually just very confused how to set up the BroadcastReceiver and how to start it working. Could someone provide me with a good example of how this should be done? Has anyone ever used something like this to listen for the camera taking a picture? Will this method work for me even if the application is ""closed""?</p><p>Thanks in advance for any help you can provide!</p>","397985","","","","","2010-12-08 14:38:49","Android: Continually Listen in Background for Camera Taking Photo","<android><camera><broadcastreceiver><android-camera><android-camera-intent>","1","1","1","",""
"4388415","1","4389021","","2010-12-08 14:13:18","20","13600","<p>how to call Main thread from secondary thread in Java/Android.</p>","397901","","418183","","2010-12-08 14:14:11","2013-06-26 18:37:05","call Main thread from Secondry thread in Java/Android","<java><android><multithreading>","4","1","4","",""
"4388459","1","4388491","","2010-12-08 14:18:33","10","30749","<p>Hey I want to create a database with an AUTO_INCREMENT column. But I don't know how to parse the value in the method insert. I just don't know what to parse to an AUTO_INCREMENT argument, and I parsed 1 where should be auto_increment, but I know its not that I should parse.</p><p>Here is the <strong>CallDatHelper.java</strong> class where I declare the method insert, and the method that creates the database.</p><pre><code>package com.psyhclo;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteStatement;import android.util.Log;import java.util.ArrayList;import java.util.List;public class CallDataHelper {private static final String DATABASE_NAME = ""calls.db"";private static final int DATABASE_VERSION = 1;private static final String TABLE_NAME = ""contact_data"";private Context context;private SQLiteDatabase db;public CallDataHelper(Context context) {    this.context = context;    OpenHelper openHelper = new OpenHelper(this.context);    this.db = openHelper.getWritableDatabase();}public boolean insert(Integer cId, String cName, String numType,        String cNum, String dur, String date, String currTime) {    this.db.execSQL(""insert into ""            + TABLE_NAME            + ""(id, contact_id, contact_name, number_type, contact_number, duration, date, current_time, cont) ""            + ""values( ? ,"" + cId + "", "" + cName + "", "" + numType + "", ""            + cNum + "", "" + dur + "", "" + date + "", "" + currTime + "", ? )"");    return true;        }public void atualiza(String word) {    this.db.execSQL(""UPDATE words SET cont = cont + 1 WHERE (word= ?)"",            new String[] { word });}public void deleteAll() {    this.db.delete(TABLE_NAME, null, null);}public boolean select(String wrd) {    String word;    Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""word"" },            ""word like ?"", new String[] { wrd }, null, null, null);    if (cursor.moveToFirst()) {        do {            word = cursor.getString(0);        } while (cursor.moveToNext());    }    if (cursor != null &amp;&amp; !cursor.isClosed()) {        cursor.close();        return true;    } else {        return false;    }}public List&lt;String&gt; selectAll() {    List&lt;String&gt; list = new ArrayList&lt;String&gt;();    Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""word"" },            null, null, null, null, ""cont desc"");    if (cursor.moveToFirst()) {        do {            list.add(cursor.getString(0).toUpperCase());        } while (cursor.moveToNext());    }    if (cursor != null &amp;&amp; !cursor.isClosed()) {        cursor.close();    }    return list;}private static class OpenHelper extends SQLiteOpenHelper {    OpenHelper(Context context) {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db) {        db.execSQL(""CREATE TABLE ""                + TABLE_NAME                + ""(id INTEGER PRIMARY KEY AUTOINCREMENT, contact_id INTEGER, contact_name VARCHAR(50), number_type VARCHAR(50), contact_number VARCHAR(50), duration TIME, date DATE, current_time TIME, cont INTEGER)"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        Log.w(""RatedCalls Database"",                ""Upgrading database, this will drop tables and recreate."");        db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);        onCreate(db);    }}}</code></pre><p>And here is where I call the <strong>insert</strong> method parsing the data I want to insert.</p><pre><code>this.dh.insert(1 , 1, contactName, numType, contactNumber,                    duration, callDate, currTime);</code></pre>","399459","","135152","","2011-05-25 03:05:10","2013-04-24 11:05:11","How to make AUTO_INCREMENT on Android SQLite database?","<android><sqlite>","3","1","2","",""
"4388674","1","","","2010-12-08 14:39:38","2","5680","<p>Is there a way to set an icon on a custom dialog without using the AlertDialog methods?Dialog has title, but is missing that nice divider and the ability to set an icon, but surely there must be a way of getting both without having to use AlertDialog?</p>","507991","","61479","","2011-02-16 19:38:05","2011-06-03 10:41:45","Icons in custom dialogs android","<android><dialog><icons>","2","0","3","",""
"4388877","1","4390245","","2010-12-08 14:58:22","1","77","<p>Owing to problems with the upgrade to SDK2.3, I now need to back out to an earlier version. Fortunately I had saved a cutdown version of SDK 2.1 which would allow me to continue development. However I upgraded my Eclipse pluigin to 8.0.0, which expects a 2.3 SDK environment. Eclipse now complains that it's now missing the new platform-tools folder when I point the  SDK location to the old 2.1 version and won't allow me to compile.</p><p>I need to uninstall the 8.0.0 plugin and replace it with 0.9.9 but there is no option to download it on the can't find it on the developer.android pages.</p>","440010","","","","","2010-12-08 17:11:57","Is Android Eclipse Plugin 0.9.9 available anywhere?","<android>","1","4","","",""
"4388992","1","","","2010-12-08 15:08:53","62","64794","<p>I m working on Android app, in which I want to integrate facebookposting feature, i downloaded the facebook-android-sdk and I gotreadme.md(text file) in there, in which it is mentioned to generatethe key hash for android. I m confused about how to generate it.pls help me , how to generate it,Thanx.</p>","535162","","17","","2011-11-01 17:53:58","2014-01-09 09:35:11","key hash for android-facebook app","<android><windows><facebook>","17","2","69","",""
"4389143","1","9305954","","2010-12-08 15:24:35","1","2765","<p>I'm sure there must be an easy answer to this but everything i've googled seems to over complicate things and now im not so sure.</p><p>So here's what i'd have to do to insert records into my table now</p><pre><code>INSERT INTO CAT_BUD_TAB (_id, CAT_ITEM, IN_OUT) VALUES (null, 'Student Loan', 'out');INSERT INTO CAT_BUD_TAB (_id, CAT_ITEM, IN_OUT) VALUES (null, 'Food', 'in');</code></pre><p>I figure there must be a shorter way, say something like..</p><pre><code>INSERT INTO CAT_BUD_TAB (_id, CAT_ITEM, IN_OUT) VALUES (null, 'Student Loan', 'out'),(null, 'Food', 'in');</code></pre><p>I'm using SQLite as im developing for android, but i'm pretty sure it's SQLite3 which means INSERTS like above should be possible right? how do i do it?</p>","523874","","","","","2012-02-16 09:16:54","SQLite3, combining multiple INSERT statements?","<android><database><sqlite><statements>","5","2","","",""
"4389166","1","","","2010-12-08 15:27:22","1","102","<p>i was wondering whether there is a way for a BroadcastReceiver contained in an activity/service, to be remotely registered/unregistered in code.</p><p>Is it feasible at all or should i implement an intermediate external BroadcastReceiver to do the job?</p>","485328","","244296","","2010-12-08 15:29:48","2011-01-04 17:03:52","Remotely registering/unregistering a BroadcatReceiver","<android><activity><broadcastreceiver><registering>","1","2","","",""
"4389196","1","4389319","","2010-12-08 15:30:09","0","541","<p>I have a 2d array displaying on the screen and decided to implement a method where it would detect the touch location and find the tile in which the touch is located and remove it, r more precisely, change the int at map[x][y].I currently have a 2d map array full of 3s 15 by 15.Touch a location and this method, which i created because I could not find a way to round down numbers, would calculate the position in the array and change the value:</p><pre><code>public boolean onTouchEvent(MotionEvent event) {    mX = (int) event.getX();    mY = (int) event.getY();    calculate();    return true;}public void calculate() {    indexX = 0;    indexY = 0;    for (int n = 32; n &lt; mX; n += 32) {        indexX++;    }    for (int n = 32; n &lt; mY; n += 32) {        indexY++;    }    map[indexY][indexX] = 1;}</code></pre><p>It'll force close if I starting mashing the screen or dragging my finger around, but if I touch a single location one by one slowly it works fine.I assumed the method to calculate should not be in the touch event method but still am not quite sure.</p>","507007","","","","","2010-12-08 16:30:12","Android touch event force closes","<java><android>","1","1","","",""
"4389260","1","4390079","","2010-12-08 15:36:23","0","3611","<p>I'm trying to use a method insert from SQLiteDatabase in my Activity. But I'm having this error:</p><blockquote>  <p>12-08 13:28:24.497: ERROR/AndroidRuntime(20051): Caused by: java.lang.NullPointerException  12-08 13:28:24.497: ERROR/AndroidRuntime(20051):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)  12-08 13:28:24.497: ERROR/AndroidRuntime(20051):     at com.psyhclo.RatedCalls.onCreate(RatedCalls.java:42)</p></blockquote><p>The error is in this line:</p><blockquote>  <p>this.db = openHelper.getWritableDatabase();</p></blockquote><p>here is the code for the activity named <strong>RatedCalls.java</strong>:</p><pre><code>import java.text.DateFormat;import java.util.ArrayList;import java.util.Date;import com.psyhclo.R;import com.psyhclo.CallDataHelper.OpenHelper;import android.app.Activity;import android.app.ListActivity;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;import android.content.ContentValues;import android.content.Context;public class RatedCalls extends ListActivity {private Context context;private static TextView txtView;private SQLiteDatabase db;private CallDataHelper dh = null;StringBuilder sb = new StringBuilder();OpenHelper openHelper = new OpenHelper(this.context);public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Cursor cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null, null, null,            android.provider.CallLog.Calls.DATE + "" DESC "");    dh = new CallDataHelper(this);      db = openHelper.getWritableDatabase();    startManagingCursor(cursor);    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 dateId = cursor.getColumnIndex(android.provider.CallLog.Calls.DATE);    int numTypeId = cursor            .getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE);    Date dt = new Date();    int hours = dt.getHours();    int minutes = dt.getMinutes();    int seconds = dt.getSeconds();    String currTime = hours + "":"" + minutes + "":"" + seconds;    ArrayList&lt;String&gt; callList = new ArrayList&lt;String&gt;();    if (cursor.moveToFirst()) {        do {            String contactNumber = cursor.getString(numberColumnId);            String contactName = cursor.getString(contactNameId);            String duration = cursor.getString(durationId);            String callDate = DateFormat.getDateInstance().format(dateId);            String numType = cursor.getString(numTypeId);            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"", callDate);            values.put(""current_time"", currTime);            values.put(""cont"", 1);            this.db.insert(CallDataHelper.TABLE_NAME, null, values);            this.dh.insert(1, contactName, numType, contactNumber,                    duration, callDate, currTime);            Toast.makeText(getBaseContext(), ""Inserted!"", Toast.LENGTH_LONG);            callList.add(""Contact Number: "" + contactNumber                    + ""\nContact Name: "" + contactName + ""\nDuration: ""                    + duration + ""\nDate: "" + callDate);        } while (cursor.moveToNext());    }    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listitem,            callList));    ListView lv = getListView();    lv.setTextFilterEnabled(true);    lv.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; parent, View view,                int position, long id) {            Toast.makeText(getApplicationContext(),                    ((TextView) view).getText(), Toast.LENGTH_SHORT).show();        }    });}    }</code></pre><p>And here is the Datahelper class named <strong>CallDataHelper.java</strong> where the OpenHelper class is declared as a subclass.</p><pre><code>import android.content.ContentValues;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteStatement;import android.util.Log;import java.util.ArrayList;import java.util.List;public class CallDataHelper {private static final String DATABASE_NAME = ""calls.db"";private static final int DATABASE_VERSION = 1;protected static final String TABLE_NAME = ""contact_data"";private Context context;private SQLiteDatabase db;public CallDataHelper(Context context) {    this.context = context;    OpenHelper openHelper = new OpenHelper(this.context);    this.db = openHelper.getWritableDatabase();}public boolean insert(Integer cId, String cName, String numType,        String cNum, String dur, String date, String currTime) {    this.db.execSQL(""insert into ""            + TABLE_NAME            + "" (contact_id, contact_name, number_type, contact_number, duration, date, current_time, cont) ""            + "" values( "" + cId + "", "" + cName + "", "" + numType + "", ""            + cNum + "", "" + dur + "", "" + date + "", "" + currTime + "", 1)"");    return true;        }   public void update(String word) {    this.db.execSQL(""UPDATE words SET cont = cont + 1 WHERE (word= ?)"",            new String[] { word });}public void deleteAll() {    this.db.delete(TABLE_NAME, null, null);}public boolean select(String wrd) {    String word;    Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""word"" },            ""word like ?"", new String[] { wrd }, null, null, null);    if (cursor.moveToFirst()) {        do {            word = cursor.getString(0);        } while (cursor.moveToNext());    }    if (cursor != null &amp;&amp; !cursor.isClosed()) {        cursor.close();        return true;    } else {        return false;    }}public List&lt;String&gt; selectAll() {    List&lt;String&gt; list = new ArrayList&lt;String&gt;();    Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""word"" },            null, null, null, null, ""cont desc"");    if (cursor.moveToFirst()) {        do {            list.add(cursor.getString(0).toUpperCase());        } while (cursor.moveToNext());    }    if (cursor != null &amp;&amp; !cursor.isClosed()) {        cursor.close();    }    return list;}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 ""                + TABLE_NAME                + ""(id INTEGER PRIMARY KEY AUTOINCREMENT, contact_id INTEGER, contact_name VARCHAR(50), number_type VARCHAR(50), contact_number VARCHAR(50), duration TIME, date DATE, current_time TIME, cont INTEGER)"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        Log.w(""RatedCalls Database"",                ""Upgrading database, this will drop tables and recreate."");        db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);        onCreate(db);    }}    }</code></pre>","399459","","399459","","2011-09-28 18:14:32","2011-09-28 18:14:32","Error when using Android SQLiteDatabase insert() method","<android><sqlite>","3","0","1","",""
"4389301","1","4390786","","2010-12-08 15:40:56","4","1091","<p>if you have an android app that has more than one Activity, and Activity A starts B, so if Activity b crashes the process is killed but is revived by android OS and starts Activity A again instead of just shutting down the app, why ?</p>","312288","","","","","2010-12-08 18:11:07","why does android 'revives' crashing apps?","<android><activity><kill>","1","3","3","",""
"4389343","1","","","2010-12-08 15:44:44","2","2239","<p>all i want to do is call onFinish() when the homebutton is pressed, i want to do this so i always enter the main activity when opening my app, i dont want the user to jump back to where he left of(i know this is a bad concept in most cases but for my app it makes more sense to always enter into main activity)</p><p>thank you!</p>","525726","","","","","2010-12-08 16:00:30","make homebutton call onFinish()","<android>","2","0","","",""
"4389370","1","4389450","","2010-12-08 15:46:49","1","756","<p>(I know I can just use the built-in alarm clock app but I'm a <strong>noob</strong> and I want to learn to do this myself...)</p><p>I want to write a reminder app where I can set a time for it pop up a dialog to remind me of something important.  (I want something annoying that I have to dismiss hence a dialog with a message, not just a Notification beep.)   I can pick a time with the TimePicker and execute a service - that's easy.   But now what?</p><p>I've read you shouldn't (or can't) launch an AlertDialog from a service.  Should I bind an Activity to the service and launch an AlertDialog from there?   What's best practice?    </p><p>Thanks in advance!!</p>","424690","","","","","2011-05-31 12:04:34","Triggering an alert dialog from AlarmManager (Android)","<android><alertdialog>","1","0","","",""
"4389427","1","4389821","","2010-12-08 15:52:54","6","4594","<p>I'm working on an Android application which needs to perform an action each time a new image is taken with the phone.  I don't want to take the image within my application, but rather perform some action when the Camera app takes an image and saves it to the SD card.  Right now, I've gotten a BroadcastReceiver implemented that's currently listening for ""android.intent.action.CAMERA_BUTTON"".  However, this doesn't seem to get called when I'm wanting it to.  I've tried to debug the application on my own phone with a linebreak on the first line of the BroadcastReceiver's OnReceive method, but it never reaches that code.  </p><p>Does anyone know what the correct intent for which I should be listening is? Or is using a BroadcastReceiver not even the best way to do this? (For example, is there a better way to accomplish this such as listening for when a new image is saved to the card)?</p><p>Thanks!</p><p><strong>Update:</strong> I do have a Trackball on my phone (HTC Eris), so is it possible that taking photos that way doesn't get sent as ""Camera Button""? If so, is there a workaround for a phone without a ""Camera Button"", but rather something like a Trackball?</p>","397985","","397985","","2010-12-08 16:00:17","2012-06-05 11:06:20","Android: BroadcastReceiver intent to Detect Camera Photo Taken?","<android><android-intent><broadcastreceiver><android-camera><android-camera-intent>","2","0","4","",""
"4389464","1","","","2010-12-08 15:55:51","11","1048","<p>In general, the Eclipse Android plug in is working as expected with auto-complete.  However, it is not working for a custom control that I wrote.  Basically, the auto complete list is empty other than the default namespace options.</p><p>The control inherits from the Button widget and adds some additional text.  I have a couple of extra attributes that I use defined as such:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;     &lt;declare-styleable name=""SubTextButton""        &lt;attr name=""sub_text"" format=""string"" /&gt;        &lt;attr name=""sub_text_size"" format=""float"" /&gt;        &lt;attr name=""sub_text_color"" format=""color"" /&gt;    &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p>otherwise it uses all the standard attributes of the Button widget.</p><p>In the layout file I specify the namespace:</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/com.mycompany""    ...</code></pre><p>and I use the control:</p><pre><code>&lt;com.mycompany.SubTextButton    android:layout_width=""@dimen/status_bar_button_w""    android:layout_height=""@dimen/status_bar_button_h""    android:layout_alignParentRight=""true""    android:background=""@drawable/button_bg""    android:text=""HCD""    android:textColor=""@color/static_text""    android:textSize=""@dimen/font_size_standard""    app:sub_text=""SET""    app:sub_text_size=""12.0""/&gt;</code></pre><p>Everything works fine, but users don't have the benefit of the auto-complete to see what attributes are available.  Ideally, I'd like to see the inherited <code>Button</code> attributes as well as the custom attributes I've defined.</p><p>Any ideas?</p>","512309","","119895","","2011-03-26 13:34:37","2011-03-30 15:34:28","Eclipse Android plugin not listing attributes with auto-complete for custom component","<android><eclipse-plugin>","1","3","3","",""
"4389480","1","4389507","","2010-12-08 15:57:38","2","16147","<p>I have previously written a Hangman game for my java class in school. I am now currently porting it to Android and have met a few problems. The original java program wrote all outputs to the console. Now i have to somehow beutify the output so that it fits the layout that i have designed.</p><p>How do i print an array without the brackets and commas? The array contains slashes and gets replaced one by one when the correct letter is guessed.</p><p>I am using the usual .toString() function of the ArrayList class and my output is formatted like: [ a, n, d, r, o, i, d ]. I want it to simply print out the array as a single string.</p><p>This problems seems so simple although i haven't been able to find a solution to it. Not by using the search function either.</p><p>I fill the array using this bit of code:</p><pre><code>for(int i = 0;i&lt;secretWordLength;i++){        hiddenArray.add(secretWord.substring(i,i+1));        publicArray.add(""-"");    }</code></pre><p>And i print it like this:</p><pre><code>final TextView currentWordView = (TextView) findViewById(R.id.CurrentWord);    currentWordView.setText(publicArray.toString());</code></pre><p>Any help would be appreciated</p>","535199","","","","","2013-05-23 15:50:41","Print array without brackets and commas","<java><android><arrays><list>","6","1","1","",""
"4389529","1","","","2010-12-08 16:02:54","1","2864","<p>I am working on a program for Android, and I want to make a 3x7 (3 columns, 7 rows) table, where each cell holds a button.</p><p>I have tried using tableLayout, but every time the width of the tables are always too short or too long, meaning that there is either blank space or the buttons go off of the page.  I am not having a problem with the height, just the width.</p><p>This problem could also be solved easily with a layout like GridLayout from java.  Is there an equivalent to that in Android?</p><p>any ideas are greatly appreciated.</p>","578602","","","","","2010-12-08 19:07:14","How can I make a full-screen table in android","<android><tablelayout>","2","0","","",""
"4389569","1","","","2010-12-08 16:06:22","0","413","<p>I know a similar question had been put up here earlier, but sadly I have tried that too. </p><p>I have given <br>""keytool.exe -list -alias androiddebugkey -keystore ""C:\path to .android\debug.keystore"" -storepass android -keypass android""<br>The generated fingerprint to <a href=""http://code.google.com/android/maps-api-signup.html"" rel=""nofollow"">http://code.google.com/android/maps-api-signup.html</a>, then a generated API key to main.xml.</p><p>In AndriodManifest.xml, under manifest ""Internet permission"" line and under Application <br> uses-library android:name=""com.google.android.maps""has been put up. </p><p>3G icon is also active on the emulator.</p><p>But still <strong>grids</strong> are coming instead of a map. Please help!!!</p>","507905","","881229","","2013-12-12 06:05:49","2013-12-12 06:05:49","Grid coming in Google Maps Android Tutorial","<android><google-maps><google-maps-api-3>","1","0","","",""
"4389600","1","","","2010-12-08 16:09:28","9","1151","<p>I am having a redraw issue, when you are scrolling the canvas will not redraw until you release your touch. The problem with that is I depend on ""ontouchmove"" to move my character around. So until the touch is release, the canvas will not redraw.</p><p>Another problem is when ever the canvas is touched it is focus, or activated. It develops a focus ring around it. I tried setting both the :focus and :active pseudo's borders and outlines to nothing. Also I saw ""drawFocusRing"" for the context of the canvas, however that didn't seem to resolve the issue.</p><p>Currently I tested on Android stock browser 2.2 (MyTouch 3G)</p>","134617","","","","","2011-01-12 21:52:36","HTML5 Canvas on Android Phones - Redraw and Highlight Issues","<javascript><android><html5><canvas>","2","0","4","",""
"4389678","1","","","2010-12-08 16:17:06","1","425","<p>I have a MapView with an ItemizedOverlay and a bunch of OverlayItem:s. When an OverlayItem is tapped on custom layout balloon is displayed on MapView. I can add a close button that hides the balloon layout. But how can I close the balloon if the user tap:s on the map outside the balloon? I have an OnTouchListener on the MapView, but how can I from this localize the open balloon layout and hide it?</p><p>/P</p>","274426","","","","","2010-12-08 16:17:06","Close balloon showed on MapView","<android><android-mapview><balloon>","0","0","","",""
"4389766","1","4389893","","2010-12-08 16:26:26","3","3554","<p>I'm trying to write an application that will execute a task based on the time of day. Example: it's noon, send a reminder to go to lunch. Anyone know how to accomplish this?</p><p>I can schedule tasks based on a timer, but that's not exactly what I'm looking for. </p><p>Thanks</p>","450780","","","","","2010-12-08 16:38:06","Android Task Schedule","<android><scheduled-tasks><scheduling>","1","0","","",""
"4389780","1","","","2010-12-08 16:27:55","1","2664","<p>There are complete downloadable packages for developing php, java, etc with Eclipse, but has anyone put together an Android specific package?</p><p>I realize it's not that hard to get it up and running, but would be nice to just download and unpack ""Eclipse: Android"" and be up and running with the latest SDKs, etc.</p>","194","","","","","2013-01-06 01:10:56","Complete Android Eclipse Development Package","<android><eclipse>","3","0","","",""
"4389781","1","4390419","","2010-12-08 16:28:04","0","2119","<p>I'm repeating a post I've made at the android group in google groups (<a href=""http://groups.google.com/group/android-developers/browse_thread/thread/78d0b7496a51e3b7#"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/78d0b7496a51e3b7#</a> ), hopefully I'll have some luck here!</p><p>I have an activity displaying a list of items. Upon clicking an item, I display a full-screen dialog with some buttons and an image. This looks great in landscape, but doesn't look good in portrait (Due to the image aspect ratio). I would like to know if its possible to always display this dialog in landscape irrespective of current screen orientation. And after the dialog is dismissed, I'll handover the orientation back to the sensor. Here's what I have so far: </p><pre><code>OnItemClickListener listlistener = new OnItemClickListener() {                 @Override                 public void onItemClick(AdapterView parent, View arg1, int position,                                 long arg3) {                         final Dialog dialog = new Dialog(getParent());                         dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);                         final int orientation = getResources().getConfiguration().orientation;                         if (orientation == 1){ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);                         }                         dialog.setContentView(R.layout.dialog);                         dialog.setCancelable(true);                         ImageView img = (ImageView) dialog.findViewById(R.id.img); //A static image for testing UI                         //BUTTON LISTENERS HERE                         dialog.show();                         dialog.setOnCancelListener(new OnCancelListener() {                                 @Override                                 public void onCancel(DialogInterface dialog) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);                                 }                         });                 }         }; </code></pre><p>But by doing so, the screen changes orientation first and then tries to display the dialog. But on orientation change the screen is restarting the activity and my dialog isn't shown. Is there a simpler way to do this? Could I use two different layout for the dialog and load a corresponding one depending on the orientation? If so, then what would the XML for the portrait mode  look like? Thanks!</p>","506091","","","","","2010-12-08 17:30:35","always view dialog in landscape","<android><dialog><orientation>","1","0","","",""
"4389782","1","4389849","","2010-12-08 16:28:04","2","305","<p>I was looking at the source code of the open source Google IO App for android, and I relazied that they only have drawables in the ""drawables-hdpi"" (with only 2 exception out of 50 or so).</p><p>Reading the android guides and articles, I came to think that we need to support different screen sizes and resolution, but Google's IO app, which is supposed to reflect good GUI design patterns only has drawables for hdpi.  </p><p>What is even more confusing to me is that it looks fine on my small low-dpi screen (SE Xperia X10 Mini).</p><p>Can someone please clarify my confusion.</p>","481009","","","","","2012-08-09 11:00:04","Why does the official Google IO app only have drawables that support hdpi and yet look fine on my small ldpi device?","<android><gui><design-patterns>","3","0","","",""
"4389902","1","","","2010-12-08 16:39:47","2","1401","<p>I´m trying to export an image from my application to other applications like twitter, facebook or other apps accepting it images.I'm doing the following:</p><pre><code>private void exportImage(){    storeBitmapOnDisk(this.bitmap);    Intent i = new Intent(Intent.ACTION_SEND);    i.addCategory(Intent.CATEGORY_LAUNCHER);    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK    | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);    File imgFile = context.getFileStreamPath(""export.png"");    Uri uri = Uri.fromFile(imgFile);    i.putExtra(Intent.EXTRA_STREAM, uri);    i.setType(""image/png"");    i.setComponent(componentName);    context.startActivity(i);}private void storeBitmapOnDisk(Bitmap bitmap){    try    {        FileOutputStream outStream = context.openFileOutput(""export.png"",        Context.MODE_WORLD_READABLE);        bitmap.compress(Bitmap.CompressFormat.PNG, 50, outStream);        outStream.close();    }    catch (IOException e)    {        Log.d(TAG, e.getMessage());    }}</code></pre><p>This is not working because I'm writing internal storage with is not accessible by other applications. As I don't want to use external storage (SD card) I think what I need is a ContentProvider but all examples I saw is about custom ContentPovider are using a SQlite database to store the data. I can't figure out how I could store a bitmap in internal storage and make it available through a ContentProvider to other applications without storing my bitmap in a database. MatrixCursor seems not to be adapted too...</p><p><strong>SOLUTION</strong>  I create a custom Content Provider and set the path of the file in the the content provider as the Uri EXTRA_STREAM extra parameter of the intent:</p><p>First my provider class where I only needed to override <strong>openFile</strong> which is not clear in the doc...</p><pre><code>public class ExportContentProvider extends ContentProvider{  public static Uri CONTENT_URI = Uri                                    .parse(""content://com.path.to.my.provider"");  @Override  public int delete(Uri uri, String selection, String[] selectionArgs)  {    return 0;  }  @Override  public String getType(Uri uri)  {    return null;  }  @Override  public Uri insert(Uri uri, ContentValues values)  {    return null;  }  @Override  public boolean onCreate()  {    return false;  }  @Override  public ParcelFileDescriptor openFile(Uri uri, String mode)  {    int imode = 0;    if (mode.contains(""w""))      imode |= ParcelFileDescriptor.MODE_WRITE_ONLY;    if (mode.contains(""r""))      imode |= ParcelFileDescriptor.MODE_READ_ONLY;    if (mode.contains(""+""))      imode |= ParcelFileDescriptor.MODE_APPEND;    try    {      return ParcelFileDescriptor.open(new File(uri.getEncodedPath()), imode);    }    catch (FileNotFoundException e)    {      e.printStackTrace();    }    return null;  }  @Override  public Cursor query(Uri uri, String[] projection, String selection,      String[] selectionArgs, String sortOrder)  {    return null;  }  @Override  public int update(Uri uri, ContentValues values, String selection,      String[] selectionArgs)  {      return 0;  }}</code></pre><p>And then my export function:</p><pre><code>private void exportImage(){    storeBitmapOnDisk();    Intent i = new Intent(Intent.ACTION_SEND);    i.addCategory(Intent.CATEGORY_LAUNCHER);    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK        | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);    i.putExtra(Intent.EXTRA_STREAM, Uri.withAppendedPath(        ExportContentProvider.CONTENT_URI, context.getFileStreamPath(            ""export.png"").getAbsolutePath()));    i.setType(""image/png"");    i.setComponent(componentName);    if (exportFileObserver == null)    {      this.bitmapPath = context.getFileStreamPath(""export.png"")          .getAbsolutePath();      exportFileObserver = new ExportFileObserver(this.bitmapPath);      exportFileObserver.startWatching();    }    listener.launchExportActivity(Dms.ACT_IMAGE_EXPORT, i);  }</code></pre><p>Nevertheless there are 2 problems remaining:- When trying to delete my temporary export.png file on my internal memory using result of the activity I received the onResult when the activity is launch...- It s not working for mail app in my 2.3 emulator. I'm getting ""File to large"" message...</p><p>Somenone tested that ?</p>","520469","","520469","","2010-12-21 11:10:47","2010-12-21 11:10:47","Exporting image through ContentProvider","<android><bitmap><export><android-intent><android-contentprovider>","0","1","0","",""
"4390021","1","4391477","","2010-12-08 16:51:03","0","306","<p>The spinner comes up with but with nothing in it</p><p>what am I doning wrong?</p><pre><code>cbookmarks = Browser.getAllBookmarks(getContentResolver());SimpleCursorAdapter ABM = new SimpleCursorAdapter(this,android.R.layout.simple_spinner_item, cbookmarks,new String[] {android.provider.Browser.BookmarkColumns.URL},new int[]{R.id.Spinner});ABM.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); SpinnerBM.setAdapter(ABM);</code></pre><p>Thanks.</p>","440279","","","","","2010-12-09 19:47:20","android java sdk, loading bookmarks into spinner?","<java><android><sdk><spinner><bookmarks>","1","0","","",""
"4390230","1","4390479","","2010-12-08 17:10:34","0","1137","<p>Basic question here, can I put String variables into a position in a string array along with more text? </p><p>Here's what I'm trying to do</p><pre><code>public static final String CAT_BUD_TAB = ""CAT_BUD_TAB"";public static final String inI = ""INSERT INTO "";public static final String val = "" VALUES "";public static final String[] catInsertArray = new String[13];catInsertArray[0] = inI + CAT_BUD_TAB + val + ""(null, 'Student Loan', 'in', 0.00, 0.00, 0.00, 0, 0 );"";</code></pre><p>But obviously that's not going to work because it's expecting "" to mark the start of the string to be contained. Is there anyway this will work?</p><p><strong>EDIT</strong></p><p>Nope its not the SQL im concerned with, I'm just trying to combine a bit of text with text from a string variable and hold them all as one long string in an array. Might have just made it more confusing, if so ignore this edit and just re-read the original question.</p><p>Got rid of the parenthesis as suggested and updated the code block above with all the relevant code.</p><p><strong>but eclipse is still saying there's a ""syntax error on tokens, delete these tokens""</strong> And has squiggly red lined the whole line of code (catInsertArray[0] = ....)</p><p><strong>pastebin of the class here if you'd be good enough to take a look <a href=""http://pastebin.com/cKa0sKEj"" rel=""nofollow"">http://pastebin.com/cKa0sKEj</a></strong></p>","523874","","86860","","2010-12-08 19:04:28","2012-09-16 21:15:05","Can I hold string variables in a string array? (Java)","<java><android><arrays>","4","8","","",""
"4390290","1","4390314","","2010-12-08 17:16:25","4","1874","<p>The decision to jump on the Android bandwagon has been made. The entire development environment has been installed and configured properly. I went through the steps suggested in <a href=""http://developer.android.com/sdk/installing.html"" rel=""nofollow"">http://developer.android.com/sdk/installing.html</a> and even managed to ""write"" the Hello World application and run it on the emulator. :)</p><p>Unfortunately, however, I am not an experienced Java programmer and so, despite successfully completing all the suggested steps, and consulting an excellent speedy <a href=""http://triton.towson.edu/~mzimand/os/Lect2-java-tutorial.html"" rel=""nofollow"">Java tutorial for C++ programmers</a>, I feel that a lot is missing on the way to mastering Android development.</p><p>It would have been great to first master the Java world (note: I didn't say language, as Java is so much more than just syntax), then delve into Android, but in the real world there are deadlines to meet and so starting to develop/learn directly on Android is very tempting...</p><p>My question: Is it possible to develop good Android code while skipping the step of being an experienced Java programmer?</p><p>Do you know of a fast track that allows mastering both?</p>","418055","","13793","","2012-05-01 01:40:12","2012-05-01 01:40:12","Fastest path to Android development for a non-Java programmer","<java><android>","2","0","3","",""
"4390374","1","","","2010-12-08 17:26:43","1","150","<p>I have basic knowledge of Java but have never developed for Android.A friend asked me for an app that seems easy enough to develop but I would need some help for Android.All the app needs to do is send a text field (for example license plate number) to a predetermined SQL Server database.Is this easy in Android as it sounds?</p><p>Thanks in advance. Cheers.Darko.</p>","535335","","","","","2010-12-09 23:15:37","How easy/difficult it is to create app to send text field to sql for Android?","<java><android>","3","1","","",""
"4390509","1","","","2010-12-08 17:40:40","2","717","<p>I am using GWT(google web toolkit) as my javascript library.I am using PhoneGap to convert it to a native Android app.My problem is that my project is 480px*320px (landscape) for a HVGA emulator which works good it takes up the whole screen.If I test on the WVGA800 emulator the project is considerably smaller which makes sense.</p><p>How can I compensate for both resolutions?</p><p>Thanks</p>","529926","","","","","2010-12-08 19:03:55","Supporting different resolutions in PhoneGap(Android)","<android><gwt><phonegap>","1","0","1","",""
"4390517","1","","","2010-12-08 17:41:22","0","655","<p>My Main Activity is <code>AddressFinder</code>, here i start a <code>AddressController</code>:</p><pre><code>AddressController ac = new AddressController();</code></pre><p>The AddressController should update in some cases:</p><pre><code>import android.content.Context;....private void updateAddresses() throws IOException {    Geocoder geocoder = new Geocoder(context); for (Address a: address) { List&lt;Address&gt; addressIn = geocoder.getFromLocation(a.getLatitude(),                                                        a.getLongitude(), 1); }}</code></pre><p>Now i have no idea which context i have to use. I don't understand how to use it. I tried <code>this</code>, <code>context</code>, <code>getBaseContext()</code>, <code>getApplicationContext()</code> but nothing worked. Furthermore i tried to give the Adresscontroller an argument with the <code>context</code> (<code>getApplicationContext</code>) of the main activity. Thx for any help.</p>","535360","","","","","2011-01-25 01:54:37","Geocoder Context in Subclass","<android><context><geocoding>","2","0","","",""
"4390518","1","4390585","","2010-12-08 17:41:27","5","7472","<p>I have built my app into a signed SDK.  I would like for beta testers to be able to install this on their devices without having to install and use the android sdk tools (I realize the apk can be installed with command line tools, but would prefer that not be necessary).  </p><p>I tried manually installing it, but it failed.  I have an android tablet that I am using for testing.  I copied the apk to my device's sdcard, and clicked on it.  Which gave the option to install it with the App Manager.  Unfortunately the install fails with message ""Application not installed"".  </p><p>Is there a way to manually install an apk, without using the command line tools?  </p>","426493","","","","","2011-01-16 20:55:22","Android: how to install apk on device, without using android sdk tools","<android><android-install-apk>","5","0","5","",""
"4390557","1","4390687","","2010-12-08 17:44:29","1","1595","<p>Hey, I'd like to know if there is a way to know if the content provider of callings has changed. I mean, if I make a call, or I answer a call, it returns a ""flag"" that a new log has been added to the call log, or the place where Android store informations about callings.</p><p>Because, when I make a call, Android stores the number, the contact name(if exists), the hour of the calling, the duration, blah blah blah, all in the content provider. So is there a way to capture this ""flag"" that says the content provider of callings is bigger, I mean, that a new data has been inserted on the content provider CallLog.Calls.</p><p><strong>(Updated)</strong></p><p>So, I still have a lot of doubts related to this issue. I don't know where to register the content observer. My intention is when something change in the CallLog content provider, the insert method of the code will be used. </p><p><strong>I mean, the code wont do anything unless new data has been added to the CallLog content provider. If some data has been added to the CallLog content provider, then the code will query the new data, and then will insert. I wanna do this because withou a Content observer the  application was inserting data in the database that was already inserted every time I run the application, got it?</strong></p><p>So here is my code. If someone could tell me where to put the registerContentObserver and everything else is needed I thank you.</p><pre><code>package com.psyhclo;import java.text.DateFormat;import java.util.ArrayList;import java.util.Date;import com.psyhclo.R;import com.psyhclo.CallDataHelper.OpenHelper;import android.app.Activity;import android.app.ListActivity;import android.database.ContentObserver;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.os.Handler;import android.provider.ContactsContract.RawContacts;import android.util.Log;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;import android.content.ContentValues;import android.content.Context;import android.content.ContentProvider;public class RatedCalls extends ListActivity {private SQLiteDatabase db;private CallDataHelper dh = null;StringBuilder sb = new StringBuilder();OpenHelper openHelper = new OpenHelper(RatedCalls.this);public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Cursor cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null, null, null,            android.provider.CallLog.Calls.DATE + "" DESC "");    dh = new CallDataHelper(this);    db = openHelper.getWritableDatabase();    startManagingCursor(cursor);    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 dateId = cursor.getColumnIndex(android.provider.CallLog.Calls.DATE);    int numTypeId = cursor            .getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE);    Date dt = new Date();    int hours = dt.getHours();    int minutes = dt.getMinutes();    int seconds = dt.getSeconds();    String currTime = hours + "":"" + minutes + "":"" + seconds;    ArrayList&lt;String&gt; callList = new ArrayList&lt;String&gt;();    if (cursor.moveToFirst()) {        do {            String contactNumber = cursor.getString(numberColumnId);            String contactName = cursor.getString(contactNameId);            String duration = cursor.getString(durationId);            String callDate = DateFormat.getDateInstance().format(dateId);            String numType = cursor.getString(numTypeId);            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"", callDate);            values.put(""current_time"", currTime);            values.put(""cont"", 1);            this.db.insert(CallDataHelper.TABLE_NAME, null, values);            Toast.makeText(getBaseContext(), ""Inserted!"", Toast.LENGTH_LONG);            callList.add(""Contact Number: "" + contactNumber                    + ""\nContact Name: "" + contactName + ""\nDuration: ""                    + duration + ""\nDate: "" + callDate);        } while (cursor.moveToNext());    }    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listitem,            callList));    ListView lv = getListView();    lv.setTextFilterEnabled(true);    lv.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; parent, View view,                int position, long id) {            Toast.makeText(getApplicationContext(),                    ((TextView) view).getText(), Toast.LENGTH_SHORT).show();        }    });}}</code></pre>","399459","","399459","","2010-12-12 00:54:50","2010-12-12 00:54:50","How to know that the content provider of calls has changed","<android><android-contacts><android-contentprovider><calllog>","1","0","","",""
"4390745","1","","","2010-12-08 18:06:04","1","91","<p>I have used .NET and ShDocVw for years to grab data off webpages without any issues I couldn't overcome.  This website has me beat though.  It seems like such as easy task to grab the titles and other information off a library search page, but I can't see the data to be able to grab it.  Usually, I just look in the DOM, but the data wasn't there.  I did a view source, but the data wasn't there.  I am sooooo confused.</p><p>I am learning Android right now and that is how I would like to solve my problem, but if .NET would be easier...  Right now I will take any help, in any form.</p><p>The URL is <a href=""http://catalog.kcls.org/opac/en-US/skin/kcls/xml/rresult.xml?if=&amp;it=h&amp;bl=&amp;lf=&amp;a=&amp;la=&amp;cl=&amp;d=1&amp;l=1&amp;s=pubdate&amp;sd=desc&amp;adt=ml&amp;tp=&amp;t=bibcn%3ADVD%20FIC%20ON%20ORDER&amp;av=&amp;rt=multi"" rel=""nofollow"">http://catalog.kcls.org/opac/en-US/skin/kcls/xml/rresult.xml?if=&amp;it=h&amp;bl=&amp;lf=&amp;a=&amp;la=&amp;cl=&amp;d=1&amp;l=1&amp;s=pubdate&amp;sd=desc&amp;adt=ml&amp;tp=&amp;t=bibcn%3ADVD%20FIC%20ON%20ORDER&amp;av=&amp;rt=multi</a></p>","535389","","","","","2010-12-08 21:03:41","Android: How do I retreive problematic data from a specific webpage?","<html><android><vb.net><dom><shdocvw>","1","0","","",""
"4390785","1","4680227","","2010-12-08 18:11:03","4","793","<p>I have a MapView with an ItemizedOverlay and a bunch of OverlayItem:s. When an OverlayItem is tapped on custom layout balloon is displayed on MapView. I can add a close button that hides the balloon layout. But how can I close the balloon if the user tap:s on the map outside the balloon? I have an OnTouchListener on the MapView, but how can I from this localize the open balloon layout and hide it?</p><p>/P</p>","274426","","","","","2011-01-13 12:49:33","Close balloon showed on MapView","<android><android-mapview><balloon>","1","0","2","",""
"4390804","1","4390892","","2010-12-08 18:12:31","8","5652","<p>Is there any possible way to uncheck a RadioButton by cliking on the checked RadioButton?</p>","2443607","","","","","2010-12-09 18:10:05","Unchecking RadioButton's - alternative method","<android><widget><radio-button>","1","0","2","",""
"4391059","1","4483904","","2010-12-08 18:47:56","3","2020","<p>I'm developing an Android app for an Archos 101 Android Tablet (Link: <a href=""http://www.archos.com/products/ta/archos_101it/index.html"" rel=""nofollow"">http://www.archos.com/products/ta/archos_101it/index.html</a>). The Tablet runs Android 2.2 and as you can see here <a href=""http://blogote.com/wp-content/uploads/2010/11/android_101_tablet.jpg"" rel=""nofollow"">http://blogote.com/wp-content/uploads/2010/11/android_101_tablet.jpg</a> the Android buttons (Home, Menu, Back and Search) are software buttons, and not hardware buttons like on most other Android devices.</p><p>My question is: Is it possible to hide this software buttons in my application? IMHO, there need to be something like an adapted SDK for the tablet devices?!</p><p>Technically the Tablet seems to support this functionality, because some default (pre-installed) apps like the video player do this when showing a full screen video.</p><p>In my app I use</p><pre><code>this.requestWindowFeature(Window.FEATURE_NO_TITLE);this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);</code></pre><p>to set the application to full screen, but of course this does not hide the softkeys.</p>","516472","","","","","2011-01-29 19:57:08","Archos 101 internet tablet: Is it possible to hide default Android (software) buttons","<android><tablet><archos>","3","2","","",""
"4391289","1","","","2010-12-08 19:11:21","3","729","<p>I have a question:how to draw a number from 0 to 4 in Java (andoid)?how to use the Random function?</p>","500067","","244296","","2010-12-08 19:13:17","2011-08-09 21:19:40","Random numbers","<java><android><random>","4","0","1","",""
"4391388","1","","","2010-12-08 19:22:13","5","1283","<p>I am new to Android programming, however I am quite used working with SQLite databases.</p><ul><li><p>My application opens a SQLite3 database on the SD card and runs a relatively complex query (5 joins, 1 subquery, 2 where clauses) using <code>SQLiteDatabase.rawQuery</code></p><pre><code>public Cursor queryDataBase(String sql, String[] selectionArgs){    Cursor c = myDB.rawQuery(sql, selectionArgs);    return c;}</code></pre></li><li><p>The SQL statement is given by a hardcoded <code>String</code>.</p></li><li>The query returns 585 rows with 24 columns.</li><li>I had to do a trade-off between storage space and indexing, but on all bigger tables (about ~ 40 000 entries, for now) indexes are used, SQLite shows for the query: <code>Steps: 155 , Sorts: 0, AutoIdx: 1077</code></li><li><p>I am not using primary keys, thus I also didn't rename anything to ""_id"".</p></li><li><p>The execution of rawQuery is relatively fast, execution time is about <strong>2 ms</strong>.</p></li><li><em>Accessing this data takes way too much time, e.g. by c.moveToFirst(), execution time is about <strong>1700 ms!</em></strong> (same for Cursor.getRowCount(), or apparently all first time access to the actual result set).</li><li>Doing the same on a PC (2 GHz, 1 GB RAM, SATA2 HDD) with e.g. SQLiteSpy it takes <strong>15 ms</strong> to display the result set.</li><li>Doing it on the PC with a C++ Implementation it's also <strong>15 ms up to 30 ms</strong>.</li></ul><p>So what am I missing here? Is it actually possible that my handset with 800 MHz, 2 GB RAM, MicroSD is about 120 times slower?</p>","535464","","38403","","2011-02-10 23:06:30","2011-08-03 04:14:19","Poor SQLite implementation? First time data access way too slow","<android><sqlite>","2","3","3","",""
"4391448","1","","","2010-12-08 19:28:27","6","5683","<p>I will Format a Floating Point Number in android with 2 Digits after the point.I search for a Example but i din´t find one.</p><p>Can some one help me.</p>","535484","","","","","2014-03-21 06:39:44","Floating Point with 2 Digits after Point","<android><formatting><floating-point>","1","0","2","",""
"4391486","1","4391838","","2010-12-08 19:34:36","0","85","<p>I installed the adt-plugin for eclipse. I'm using Ubuntu 10.4 and have been stuck on this issue for 2 days now. </p><ol><li>Select Window > Preferences... to open the Preferences panel (Mac OS X: Eclipse > Preferences).</li><li>Select Android from the left panel.</li><li><p><strong>For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.</strong></p><p>I cant find the location of the downloaded plugin and have looked in /usr /etc /home everywhere possible, I still can't believe im stuck on something so simple.  Anyone who could point me into the right direction, would help me sooo much.</p></li></ol><p>thnxhi.im.new</p>","823715","","","","","2010-12-08 20:14:38","ADT-PLUGIN ISSUE","<android><programming-languages>","1","0","","",""
"4391508","1","4391590","","2010-12-08 19:36:32","0","1941","<p>So here's the problem. I'm writing an application that queries a web-service for some data. The returned data is an arbitrary number of strings.</p><p>I need to display a list of these strings, which obviously is most easily done by nesting a ListView in an other ListView. That is making a ListView whose rows contain other ListViews. The problem I've run into is, that when I do this, the inner ListViews only display the first element in the backing array.</p><p>I'm using a custom ListAdapter that extends BaseAdapter. Using the Eclipse debugger I've been able to determine that the getView(int,View,viewGroup)-method for each instance (one for each row in the nesting ListView) gets always called three times, but always with the same int-argument (that is 0). The number of times the getView() for a ListAdapter gets called seems to have little to do with the number of elements the backing array contains.</p><p>I've created a fairly simple test application that illustrates what I'm actually doing.</p><p>This is my ListAdapter. An other ListAdapter, the nested InnerListAdapter is used to populate the inner lists.</p><pre><code>package org.my.tests;import java.util.List;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.ListView;import android.widget.TextView;public class NestedListAdapter extends BaseAdapter {  Context context;  List&lt;List&lt;String&gt;&gt; list;  public NestedListAdapter(Context context, List&lt;List&lt;String&gt;&gt; list) {    this.context = context;    this.list = list;  }  @Override  public int getCount() {    return list.size();  }  @Override  public Object getItem(int position) {    return list.get(position);  }  @Override  public long getItemId(int position) {    return position;  }  @Override  public View getView(int position, View convertView, ViewGroup parent) {    ListView view = new ListView(context);    view.setAdapter(new InnerListAdapter(list.get(position)));    return view;  }  public class InnerListAdapter extends BaseAdapter {    List&lt;String&gt; list;    public InnerListAdapter(List&lt;String&gt; list) {      this.list = list;    }    @Override    public int getCount() {      return list.size();    }    @Override    public Object getItem(int position) {      return list.get(position);    }    @Override    public long getItemId(int position) {      return position;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {      TextView view = new TextView(context);      view.setText(String.valueOf(position) + ' ' + list.get(position));      return view;    }  }}</code></pre><p>This is the code for my Activity-class:</p><pre><code>package org.my.tests;import java.util.ArrayList;import java.util.List;import android.app.ListActivity;import android.os.Bundle;public class ListViewTest extends ListActivity {  private static final List&lt;List&lt;String&gt;&gt; lists = new ArrayList&lt;List&lt;String&gt;&gt;(3);  static {    List&lt;String&gt; list = new ArrayList&lt;String&gt;(2);    list.add(""a"");    list.add(""b"");    lists.add(list);    list = new ArrayList&lt;String&gt;(2);    list.add(""c"");    list.add(""d"");    lists.add(list);    list = new ArrayList&lt;String&gt;(2);    list.add(""e"");    list.add(""f"");    lists.add(list);  }  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.list_view_test);    setListAdapter(new NestedListAdapter(this, lists));  }}</code></pre><p>The custom ListAdapter used in the actual application is much more complex and uses layout inflation for the nested ListViews. The outcome is the same though.</p><p>Does anyone have any ideas on how to fix this to show the two elements in each of the inner Lists?</p>","515029","","","","","2010-12-08 20:38:01","How to nest ListViews?","<android><user-interface><listview><layout><listadapter>","2","0","1","",""
"4391668","1","","","2010-12-08 19:57:09","0","211","<p>greetings all!</p><p>i'm trying to work my way through a twitter implementation.  i've followed several tutorials and finally made progress with this implementation: <a href=""http://agirardello.googlecode.com/svn/trunk/OAuthExample/src/ch/ethz/oauth/OAuth.java"" rel=""nofollow"">code.</a></p><p>All appears well as i'm authorized through the twitter browser app and even returned back to my app/view via the callback.  this is where i'm confused... at this point, i assumed the onNewIntent() method is called and a test tweet is sent?  if so, this doesn't work for me...no error are thrown/logged.  can someone pls tell me what i'm missing?</p><p>resources used: - twitter4j-core-2.1.7 - signpost-core-1.2.1.1 - signpost-commonshttp4-1.2.1.1 - 2.1 SDK</p>","535514","","","","","2010-12-14 15:57:36","android/twitter4j question","<android><twitter4j>","1","0","1","",""
"4391670","1","4536092","","2010-12-08 19:57:18","0","3084","<p>I'm currently developing a game for android.</p><p>I have added buttons to allow the user to navigate the camera in the x-axis and zooming in and out.</p><p>To do this I'm using the following matrix code:</p><pre><code>// c is the canvas..Matrix m = c.getMatrix();// Make sure that the ground is always at the bottom of the screenm.setScale(zoom,zoom,0.0f,height);m.preTranslate(camera_x, 0); // Change offset in x-directionc.setMatrix(m);</code></pre><p>This works on the emulator but gives me some weird results on my real device.</p><p>Can anyone tell me what's wrong with it? I find working with matrixes to be tricky, especially since there are many options available for the Matrix object (pre,post and set).</p><p>Thanks</p>","242348","","","","","2010-12-27 00:54:19","Canvas matrix transformation","<java><android><matrix>","1","0","2","",""
"4391720","1","4391811","","2010-12-08 20:03:08","32","23423","<p>I want to read strings from an <code>xml</code> file before I do much of anything else like <code>setText</code> on widgets, so how can I do that without an activity object to call <code>getResources()</code> on?</p>","491739","","1542891","","2014-02-28 11:14:48","2014-02-28 11:14:48","How can I get a resource content from a static context?","<java><android><static><const><android-resources>","2","0","21","",""
"4391732","1","","","2010-12-08 20:04:47","0","189","<pre><code>Cursor c = getContent().query(Phones.CONTENT.URI, null, null, null, null);</code></pre><p>How do you read this line of code? First, are these two method calls within a method call?  I thought when you have a method call within a method call the first method call is an argument inside the parentheses of the second method call.  Am I reading this wrong?</p><p>And second what exactly does this line of code do?</p>","434716","","","","","2010-12-08 20:11:29","Android Java method invocation","<java><android>","3","0","","",""
"4391739","1","4391775","","2010-12-08 20:05:13","2","903","<p>On my HTC Desire (Froyo) I use Power Control Widget to enable Wi-Fi.When I press Wi-Fi button a message ""Turn on Wi-Fi"" (inside gray tiny box) appears at bottom of home screen (and fades out after 2-3 seconds).I looked through Settings package (platform/packages/apps/Settings.git), but haven't found any usage of that specific string other that within Preferences view.</p><p>Does anyone have any idea what how this message is displayed and if this mechanism is available for 3rd party app?</p>","535479","","","","","2010-12-08 20:13:44","Home Screen - Tiny info message","<android><messagebox><homescreen>","2","0","","",""
"4391796","1","","","2010-12-08 20:10:42","0","4357","<p>I am trying to build dictionary app(actually it is a modification of google SearchableDictionary sample), whose source of words and their definitions is very big, around 5MB. I tried many ways and using many formats and it still cant run properly on android. Sqlite database should be the best solution, I have built it and its size is 10MB(tried building it both before runtime and during runtime).The main problem is the size of the definitions, but I have seen some other applications have managed to do this. It might be that there are some file size limits built into android system, but anyways if they werent it all takes so much to search and run queries in this sqlite database.</p><p><strong>What am I doing wrong?</strong>BTW: It HAS to be offline dictionary (download definitions max 1 time).</p><p>Problem in a nutshell:</p><pre><code>word -definition word2 -definition2...</code></pre><p>Stored in a 10MB sqlite database (tried loading it from assets), not working.With some hacks (loading it manually with eclipse DDMS tool) it is working but terribly slow.</p>","508216","","","","","2014-02-25 10:33:28","big sqlite database in android application","<android><sqlite>","6","1","","",""
"4391832","1","","","2010-12-08 20:14:02","13","877","<p>What is the javascript to delete a cookie on android web browser. The usual method of setting an expiration date of the cookie to a date in the past does not work in android web browser.</p><p>For e.g. the below code works in desktop web browsers and mobile safari but does not work in android web browser.</p><pre><code>document.cookie = 'cookiename=cookievalue; expires=Thu, 2 Aug 2001 20:47:11 UTC; path=/';</code></pre>","463061","","851498","","2013-11-27 10:11:08","2013-12-04 13:39:46","Javascript to delete cookie on android web browser","<javascript><android><cookies>","4","4","0","",""
"4391881","1","","","2010-12-08 20:19:16","0","1201","<p>I'd like to have my application do some on-screen changes (outside the ListView) based on what the first visible item in my list is.</p><p>What I've done is override the onScroll handler.  When this handler is invoked, I set the position of my Cursor to the first visible position so I can look at the data for that row:</p><pre><code>        public void onScroll(AbsListView view, int firstVisibleItem,                int visibleItemCount, int totalItemCount) {            mCursor.moveToPosition(getListView().getFirstVisiblePosition());            ...</code></pre><p>I then reference the data in the Cursor to make my display changes.</p><p>Here's the thing:  This working is spotty.  Most of the time it works perfectly.  I can't make it screw up.</p><p>However, sometimes getListView().getFirstVisiblePosition() does not return 1 until the 3rd item (index 2) is really the first visible item.  It displays 0 when the 0 index is showing.  It displays 0 when the 1 index is showing.  It displays 1 when the 2 index is showing and so on.  Additionally, it only does this when the user is scrolling down the list.  If the user is scrolling backwards (up), getFirstVisiblePosition() returns the correct value.</p><p>I'm wondering if this isn't related to some efficiency problem.  This handler is going to execute over and over and over as the user scrolls.</p><p>Does anyone have any ideas on what could be the problem?  Does anyone have any better solutions?</p><p>Update:</p><p>Do I remember hearing that getFirstVisiblePosition() is really only a guess; and that Android essentially supposes what index might be available by rows' probable height?  If this is so, then I have a problem.  Some rows in my list are bigger than others.  If this is the case, is there any way around it?</p>","406790","","406790","","2010-12-08 22:18:56","2011-05-26 19:01:05","Problem with getListView().getFirstVisiblePosition()","<android><listview>","1","0","","",""
"4391907","1","4392619","","2010-12-08 20:22:29","2","631","<p>I am trying to create localized versions of my application. The <a href=""http://developer.android.com/guide/topics/resources/localization.html"" rel=""nofollow"">Localization</a> article doesn't help me much, since it refers only to xml resources. How can I tell the app to use a different database for each locale?</p><p>I am assuming it has something to do with the <code>android_metadata</code> table that is required for each Android database, but I have yet to find a good explanation of how to go about this.</p>","508912","","135152","","2011-07-05 17:52:13","2011-07-05 17:52:13","Android Database: Alternate database for different locale?","<android><sqlite>","1","3","","",""
"4391974","1","4392499","","2010-12-08 20:29:14","16","8273","<p>I want to create a broadcast receiver as an inner class in my main activity. But I have problems defining the broadcast receiver in manifest xml file,because android can't find it.</p><p>Code:</p><pre><code>public class MyActivity extends Activity{    ...    public class Receiver extends BroadcastReceiver{        @Override        public void onReceive(Context context, Intent intent) {            ....        }    }    ...}</code></pre><p>Manifest:</p><pre><code>&lt;receiver android:name="".org.danizmax.myapp.MyActivity$Receiver"" android:enabled=""true""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""org.danizmax.myapp.BROADCAST_INITIAL_DATA""&gt;&lt;/action&gt;            &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>I tried with:</p><ul><li>.org.danizmax.myapp.MyActivity$Receiver</li><li>org.danizmax.myapp.MyActivity$Receiver</li><li>.MyActivity$Receiver </li><li>.Receiver</li></ul><p>I saw others also having similar problems, but did not find any answers.</p><p>So is it possible? If not, what's better way to use broadcast receivers?</p><p>Thanks!</p>","491320","","491320","","2010-12-08 21:49:09","2012-06-01 14:18:38","Is it possible to define a broadcast receiver as an inner class in manifest file?","<android><android-manifest><broadcastreceiver>","3","3","2","2013-12-03 16:20:13",""
"4392101","1","4393069","","2010-12-08 20:41:57","0","412","<p>I just updated my Android SDK/etc (Eclipse IDE) and, while there seems to be some nice, new aspects/features of the Graphical Layout part for xml's, the previous ability of moving items using the Red Arrows up/down is missing and I'm not able to move items around (in or out of layouts).</p><p>Yes, I know I can (and guess I'll have to) move the actual xml code around but, I really like the ability to move items graphically.</p><p>Am I missing something?Thanks</p>","382200","","404469","","2010-12-08 21:38:09","2012-06-30 17:11:15","How To Move Layout Items After SDK Update?","<android><android-layout>","1","0","","",""
"4392179","1","4459294","","2010-12-08 20:50:25","3","13036","<p>There is apparently a <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/c9b74dc80c26a5a2"" rel=""nofollow"">bug</a> in Android which breaks <code>View.bringToFront</code>.</p><p>If I have Views arranged in a GridView and want to bring a View to front by calling bringToFront(), it may get moved to the bottom right position in the GridView.</p><p>Something shady is going on there, so I can't use bringToFront(). When I don't call it, everything works fine. But the Views overlap - if I use scale animation to scale up a View, it's partially obscured by the Views to the bottom and to the right.</p><p>I've checked out bringToFront's source and it calls parent.bringChildToFront(...)</p><p>it's this method</p><pre><code>public void bringChildToFront(View child) {     int index = indexOfChild(child);      if (index &gt;= 0) {          removeFromArray(index);          addInArray(child, mChildrenCount);          child.mParent = this;      }  }</code></pre><p>it apparently <strong>removes the View from itself! Without mercy!</strong> Is a ViewGroup so dumb that it can't manage Z-indexes in any other way that shuffling controls around? Obviously when GridView removes its child and then adds it back again, it gets placed at the end of the Grid!</p><p>Is there anything I can do to show a View on top of others without resorting to some hacking? One thing that comes to my mind is to create another View above the GridView, which will appear to be above the one I'm trying to bringToFront(), but I don't like this solution.</p>","72746","","","","","2010-12-16 09:42:57","How to bring a view to front without calling bringToFront()?","<android><layout><view><z-index><viewgroup>","2","0","","",""
"4392300","1","","","2010-12-08 21:02:55","0","959","<p>In my app, I have a dynamic number of edittexts and after the user changes some settings I need the focus outline graphic to appear on some but not all of the edittexts.  This is needed to highlight the importance of those fields.  </p><p>Is there an easy way to do this?  I have seen some things about modifying some graphic code  <a href=""http://stackoverflow.com/questions/3182393/android-textview-outline-text""> here </a> but I didn't think that was applicable to what I am trying to do.</p>","409686","","","","","2011-01-13 16:20:40","Android EditText: Focus Outline","<android><focus><border><edittext><outline>","1","0","","",""
"4392350","1","4392747","","2010-12-08 21:08:51","1","1561","<p>I am modifying my program to get its values from a database and I am having some issues and I am a little bit confused on what to do. I've been stuck for days, I would appreciate the help.</p><p>When I select an item on my spinner(populated from database), I need it to pass the INT value along with it so I can send it to another activity.</p><p>So far my code looks like this, the database utility:</p><p>public class DbUtility {</p><pre><code>static final String DB_NAME=""food"";static final String BEEF_TABLE=""beef"";static final String CHICKEN_TABLE=""chicken"";SQLiteDatabase db=null; Context context;public static class DatabaseHelper extends SQLiteOpenHelper{    public DatabaseHelper(Context context, String name, CursorFactory factory, int version)     {        super(context, name, factory, version);        // TODO Auto-generated constructor stub    }    @Override    public void onCreate(SQLiteDatabase db)     {                   db.execSQL(""CREATE TABLE IF NOT EXISTS BEEF_TABLE (_id INT PRIMARY KEY,name VARCHAR, cookTime INT);"");        db.execSQL(""INSERT INTO BEEF_TABLE values(1,'Skirt Steak', 23000);"");        db.execSQL(""INSERT INTO BEEF_TABLE values(2,'Flank Steak',23000);"");        db.execSQL(""INSERT INTO BEEF_TABLE values(3,'Filet Mignon',23000);"");        db.execSQL(""CREATE TABLE IF NOT EXISTS CHICKEN_TABLE (_id INT PRIMARY KEY,name VARCHAR, cookTime INT);"");        db.execSQL(""INSERT INTO CHICKEN_TABLE values(1,'Breast',20000);"");        db.execSQL(""INSERT INTO CHICKEN_TABLE values(2,'Wings',10000);"");        db.execSQL(""INSERT INTO CHICKEN_TABLE values(3,'Burger',30000);"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {      }   }public DbUtility(Context context) {    this.context=context;}public SimpleCursorAdapter getBeefAdapter(){    DatabaseHelper dbhelper=new DatabaseHelper(this.context, DB_NAME, null, 1);    db=dbhelper.getWritableDatabase();    Cursor beefCursor=db.rawQuery(""SELECT * FROM BEEF_TABLE"", null);    while(!beefCursor.isLast())    beefCursor.moveToNext(); //I don't understand why but it's necessary (alternative call c.getCount() )    String[] beefType=new String[1];    int[] to=new int[1];    beefType[0]=""name"";    to[0]=android.R.id.text1;    SimpleCursorAdapter beefAdapter=new SimpleCursorAdapter(this.context, android.R.layout.simple_spinner_item, beefCursor, beefType, to);    beefAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    db.close();    return beefAdapter; }   public SimpleCursorAdapter getChickenAdapter(){    DatabaseHelper dbhelper=new DatabaseHelper(this.context, DB_NAME, null, 1);    db=dbhelper.getWritableDatabase();    Cursor chickenCursor=db.rawQuery(""SELECT * FROM CHICKEN_TABLE"", null);    while(!chickenCursor.isLast())    chickenCursor.moveToNext(); //I don't understand why but it's necessary (alternative call c.getCount() )    String[] chickenType=new String[1];    int[] type=new int[1];    chickenType[0]=""name"";    type[0]=android.R.id.text1;    SimpleCursorAdapter chickenAdapter=new SimpleCursorAdapter(this.context, android.R.layout.simple_spinner_item, chickenCursor, chickenType, type);    chickenAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    db.close();    return chickenAdapter;  }   public int getCookTime(String theTable, String theFood) {    DatabaseHelper dbhelper=new DatabaseHelper(this.context, DB_NAME, null, 1);    SQLiteDatabase db=dbhelper.getReadableDatabase();    int TheCookTime = 0;    Cursor foodCursor = db.rawQuery(""SELECT * FROM "" + theTable + "" WHERE name='"" + theFood + ""'"", null);    TheCookTime = foodCursor.getInt(foodCursor.getColumnIndex(""cookTime""));    return TheCookTime;}</code></pre><p>I need to grab, cookTime INT and pass it to my spinner activity:</p><pre><code>package com.tsilo.grillbuddy;</code></pre><p>import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.SimpleCursorAdapter;import android.widget.Spinner;</p><p>public class ChickenActivity extends Activity {</p><pre><code>int option1value;int option2value;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.spinner);    final DbUtility db=new DbUtility(this);    SimpleCursorAdapter beefAdapter=db.getBeefAdapter();    final Spinner beefSpinner=(Spinner)this.findViewById(R.id.spinner);    beefSpinner.setAdapter(beefAdapter);    SimpleCursorAdapter chickenAdapter=db.getChickenAdapter();    final Spinner chickenSpinner=(Spinner)this.findViewById(R.id.spinner2);    chickenSpinner.setAdapter(chickenAdapter);    Button TimerButton = (Button)findViewById(R.id.TimerActivityButton);    TimerButton.setOnClickListener(new View.OnClickListener(){        public void onClick(View v)        {            String beefSelection = (String) beefSpinner.getSelectedItem();            option1value = db.getCookTime(DbUtility.BEEF_TABLE, beefSelection);            String chickenSelection = (String) chickenSpinner.getSelectedItem();            option2value = db.getCookTime(DbUtility.CHICKEN_TABLE, chickenSelection);            Intent timer = new Intent (ChickenActivity.this,TimerActivity.class);            timer.putExtra(""option1"", option1value);            timer.putExtra(""option2"", option2value);            startActivity(timer);        }    });}</code></pre><p><strong>Edit</strong>: As you can see I incorporated the solution, I was required to change my spinners to final for them to work and change DbUtility to db. It compiles fine with no errors, and I am able to get to my chicken activity when I click it, but I now get a force close when I click my Timer Button, my DDMS looks as follows</p><hr><p><img src=""http://i.stack.imgur.com/Ck8mG.png"" alt=""alt text""></p>","484707","","484707","","2010-12-10 02:54:40","2010-12-10 05:49:29","Android SQlite, How do you pass two values to another activity?","<android><sqlite><activity><android-intent><spinner>","1","0","1","",""
"4392405","1","","","2010-12-08 21:13:35","2","378","<p>Is there a way to run a video while the video is one of my resources (located in /res/raw)?with audio files its working but when I try to run the video, nothing happens.</p><p>Thanks in advanceAmigal</p>","495967","","","","","2010-12-08 21:13:35","android - using video as a resource","<android><video><media-player>","0","7","","",""
"4392445","1","","","2010-12-08 21:18:16","1","271","<p>I'm using Androids TabActivity as described in <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">TabLayout Demo</a>.<br>In each of these tabs I want to show data in a differently way which should be gathered by a LocalService.</p><p>Currently only one of the tab activities consumes my local service. What is the best way that all my tab activities (which are called by intents) consume the data synchronised?(For example one tab activity should show the data in a TextView, an other should show the data on a map...)</p><p>Thank you for your help!</p>","535612","","","","","2011-05-20 09:01:28","TabActivity and Local Service: How to consume data from services in each tab?","<android><service><tabactivity>","2","0","","",""
"4392507","1","11411244","","2010-12-08 21:24:03","4","2499","<p>I'm developing an Android app which includes a video component; I'm hoping to provide support for subtitles encoded into the stream but I can't find any references to whether they are supported natively within the Android media player. Does anyone here have any experience with this situation?</p>","198846","","211160","","2011-09-21 23:19:33","2012-07-10 10:20:16","Subtitle / Closed caption support in Android","<android><video><media-player><subtitle><closed-captions>","1","2","4","",""
"4392521","1","","","2010-12-08 21:26:10","4","1373","<p>I am porting an app that displays Hebrew to Android 2.3. The 2.3 emulator displays the strings correctly when in a TextView, but when I try to put the strings in a WebView, the webview just displays gibberish. </p><p>This tells me that the Hebrew fonts are available in the emulator but the webview code has something missing.</p><p>This is the code:</p><pre><code>     WebView mWebView = (WebView) findViewById(R.id.webview);     mWebView.loadData(""&lt;html&gt;&lt;body&gt;""+temp1 +""&lt;/body&gt;&lt;/html&gt;"",            ""text/html"", ""UTF-8"");</code></pre><p>Any ideas on how to get the emulator to display the webview correctly.</p>","327415","","177728","","2011-09-02 02:09:51","2011-09-02 02:09:51","Android 2.3 Hebrew fonts in Webview","<android><webview><emulator>","2","2","","",""
"4392636","1","4393210","","2010-12-08 21:37:53","16","4699","<p>I am trying to determine if the current locale is set to 12 or 24 hour, and set am/pm accordingly. This is what I have got right now, but it shows am/pm all the time regardless if it is set to 24.</p><pre><code>        if (DateFormat.is24HourFormat(this))    {    mHour = mCalendar.get(Calendar.HOUR_OF_DAY);    int hourOfDay = mHour;    if(hourOfDay&gt;12)    {        views.setTextViewText(R.id.AMPM, ""pm"");    }    if(hourOfDay==12)    {        views.setTextViewText(R.id.AMPM, ""pm"");    }    if(hourOfDay&lt;12)    {        views.setTextViewText(R.id.AMPM, ""am"");    }    }    else {        views.setTextViewText(R.id.AMPM, """");               }</code></pre>","525720","","","","","2010-12-09 22:25:10","How do I check if system is 12 or 24 hour?","<android><time><locale>","1","0","2","",""
"4392656","1","4393126","","2010-12-08 21:40:31","0","61","<p>I have a layout with 5 items.</p><blockquote>  <p>TextView - fixed height</p>    <p>TextView - fixed height</p>    <p>TextView with many lines and scroll <strong><em>*</em>**</strong><em>WILL SHRINK AND GROW</em><strong><em>*</em>**<em>*</em>***</strong></p>    <p>CustomView - fixed height (NOT PRESENT AT THE START IN THE XML, ADDED BY CODE)</p>    <p>LinearLayout(with items inside, fixed height)</p></blockquote><p>so since there are different devices, I need the middle Textview to shrink and grow.</p><p>What is the best Layout to use and how can I do it?</p>","237115","","356440","","2013-02-25 20:57:28","2013-02-25 20:57:28","android - help on layout for different devices","<android><layout>","1","1","","",""
"4392669","1","4392869","","2010-12-08 21:42:16","0","2360","<p>I have a class that I would like to store specific times in. The times will be used to schedule tasks to execute. And right now I'm working with the <code>Time</code> class from <code>android.text.format</code>, but this isn't exactly what I'm looking for.</p><p>I can create time stamps, but it pads it with the date, timezone, etc.</p><pre><code>Time startTime = new Time();startTime.setToNow();tvConsole.setText(startTime.toString());  // just to view it in the emulator</code></pre><p>and the results:</p><pre><code>20101208T162807America/New_York(3,341,-18000,0,1291843687)</code></pre><p>I do not need all of this information, nor do I want it. Is there any way to just access the hh/mm/ss members? I am aware I can set just time of the object, but then it displays as some date in 1970... and I can't retrieve just the time members. Is there another class I am not aware of that I can do this with?</p><p>Thanks</p>","450780","","","","","2014-04-09 10:09:30","Android Time Structures","<android><datetime><time>","3","0","","",""
"4392671","1","4393695","","2010-12-08 21:42:21","0","49","<p>I'm using the built in ContactPicker with the Phone.CONTENT_URI to build a list of contacts that the user selects. So far it's worked pretty well, but I would love to have it not show contacts my user has already selected. </p><p>I didn't think it was possible until just recently when I noticed my quick contacts widget manages to filter the list before displaying it - ensuring I only see contacts I haven't selected. </p><p>Does anyone know how to do this? Right now my implementation is just a simple: </p><pre><code>new Intent(Intent.ACTION_PICK, Phone.CONTENT_URI);</code></pre>","215166","","","","","2010-12-09 00:17:34","How do I provide a filter for the initial results in the ContactPicker?","<android><android-contacts>","1","0","","",""
"4392674","1","4767748","","2010-12-08 21:42:41","0","781","<p>I know I ran across a specific mention of a maximum number of touch inputs that are theoretically recognized by Android (hardware limits not-withstanding), but have Googled and Googled with no tangible results.</p><p>Can anyone point me to an official document/spec/blog/something listing touch capabilities (max inputs specifically) of various flavors of Android (Froyo, Gingerbread, etc)?</p><p>Thanks for the help,</p><p>Paul</p>","357801","","","","","2011-01-22 12:15:43","Maximum Number of Touch Inputs on Android 2.2+","<android><input><touch>","2","2","","",""
"4392835","1","","","2010-12-08 22:03:55","2","1695","<p>I'm in the process of developing an Android application that will need to connect to a central database. Users should be able to access records and add records to the database through the application. The data itself will be fairly simple with each record being made up of a number of text fields.</p><p>The database will be developed specifically for the application and only needs to be accessed through the application. Initial reading seems to indicate that a web service should be written to parse data into xml format, for use by the app.</p><p>Seen as the database is being developed from scratch, specifically for this purpose, I would like to make sure I am heading in the right direction. I have very little experience with databases and would really just like a pointer on where to start reading. Any suggestions on the format the database should take would be greatly recieved too.</p><p>Thank you</p>","535651","","","","","2010-12-09 00:05:49","Android Remote Database","<android><database>","2","0","1","",""
"4392921","1","4393743","","2010-12-08 22:15:01","0","982","<p>For a new Android project I need buttons which are 'shining' when focused or pressed, meaning a bigger image should show up on top of the first image. My problem here is: The clickable area should be not as large as this overlay image.</p><p>In ASCII-Art:</p><pre><code>+------------------------------------------+|                                          ||                                          ||         +---------------------+          ||         | Inner image, always |          ||         | visible &amp; clickable |          ||         +---------------------+          || Overlay (image with alpha on top)        || visible on focus or press, NOT clickable |+------------------------------------------+</code></pre><p>So basically there may be other items under the overlay image which should still be fully accessible, e.g. by clicking &amp; dragging.</p><p>Do you know how I may solve this in Android? A XML layout solution would be the best! Any best practices here?</p>","446461","","446461","","2010-12-08 23:58:08","2010-12-09 00:26:41","Android: Create image button with a non-clickable overlarge overlay when focused?","<android><gui><layout><overlay><imageview>","1","0","4","",""
"4393082","1","4393422","","2010-12-08 22:36:46","2","1075","<p>at beggining, the list shows three items and when I scroll down, it creates the fourth and fifth item, but the sixth and next ones are not being created. These views mix the information with the first five items and they are repeated until the application crash with a ClassCastException. The reason it's simple, each item has a differente layout and type, and I have a different ViewHolder for each one. So as the views are not being created, the ViewHolders are the same as the first five items, and when the list reach one that has a different ViewHolder it crash (it's luck that it happens at the twelfth item). I need to discover why the items are being mixing with the first ones.</p><p>This is the code of the adapter, I think it's enough.</p><pre><code>public class PostsListAdapter extends BaseAdapter {    private FacebookPost[] posts;    private LayoutInflater mInflater;    public PostsListAdapter (Context ctx, FacebookPost[] user_posts) {        mInflater = (LayoutInflater)ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        posts = user_posts;    }    @Override    public int getCount() {        return posts.length;    }    @Override    public Object getItem(int position) {        return posts[position];    }    @Override    public long getItemId(int position) {        return position;    }    private abstract static class ViewHolder {        TextView fromName;        TextView arrow;        TextView toName;        TextView message;        TextView attribution;    }    private static class VideoViewHolder extends ViewHolder {        TextView name;        TextView caption;        TextView description;        ImageView icon;    }    private static class PhotoViewHolder extends ViewHolder {    }    private static class LinkViewHolder extends ViewHolder {    }    private static class StatusViewHolder extends ViewHolder {    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        ViewHolder holder;        Log.d(""POSITION"",""""+position);        if(convertView == null) {            switch(posts[position].getType()) {                case FacebookPost.VIDEO:                    Log.d(""""+position,""VIDEO"");                    convertView = mInflater.inflate(R.layout.post_list_item_video, parent, false);                    holder = new VideoViewHolder();                    holder.fromName = (TextView)convertView.findViewById(R.id.post_list_item_video_from_name);                    holder.arrow = (TextView)convertView.findViewById(R.id.post_list_item_video_arrow);                    holder.toName = (TextView)convertView.findViewById(R.id.post_list_item_video_to_name);                    holder.message = (TextView)convertView.findViewById(R.id.post_list_item_video_message);                    ((VideoViewHolder)holder).name = (TextView)convertView.findViewById(R.id.post_list_item_video_name);                    ((VideoViewHolder)holder).caption = (TextView)convertView.findViewById(R.id.post_list_item_video_caption);                    ((VideoViewHolder)holder).description = (TextView)convertView.findViewById(R.id.post_list_item_video_description);                    break;                case FacebookPost.LINK:                    Log.d(""""+position,""LINK"");                    convertView = mInflater.inflate(R.layout.post_list_item_link, parent, false);                    holder = new LinkViewHolder();                    holder.fromName = (TextView)convertView.findViewById(R.id.post_list_item_link_from_name);                    holder.arrow = (TextView)convertView.findViewById(R.id.post_list_item_link_arrow);                    holder.toName = (TextView)convertView.findViewById(R.id.post_list_item_link_to_name);                    holder.message = (TextView)convertView.findViewById(R.id.post_list_item_link_message);                    break;                case FacebookPost.STATUS:                    Log.d(""""+position,""STATUS"");                    convertView = mInflater.inflate(R.layout.post_list_item_status, parent, false);                    holder = new StatusViewHolder();                    holder.fromName = (TextView)convertView.findViewById(R.id.post_list_item_status_from_name);                    holder.arrow = (TextView)convertView.findViewById(R.id.post_list_item_status_arrow);                    holder.toName = (TextView)convertView.findViewById(R.id.post_list_item_status_to_name);                    holder.message = (TextView)convertView.findViewById(R.id.post_list_item_status_message);                    break;                case FacebookPost.PHOTO:                    Log.d(""""+position,""PHOTO"");                    convertView = mInflater.inflate(R.layout.post_list_item_photo, parent, false);                    holder = new PhotoViewHolder();                    holder.fromName = (TextView)convertView.findViewById(R.id.post_list_item_photo_from_name);                    holder.arrow = (TextView)convertView.findViewById(R.id.post_list_item_photo_arrow);                    holder.toName = (TextView)convertView.findViewById(R.id.post_list_item_photo_to_name);                    holder.message = (TextView)convertView.findViewById(R.id.post_list_item_photo_message);                    break;                default:                    holder=null;                    break;            }            convertView.setTag(holder);        }        else {            holder = (ViewHolder)convertView.getTag();        }        Spanned text = Html.fromHtml(posts[position].getFrom().getName());        holder.fromName.setText(text);        if(posts[position].getTo() != null)            text = Html.fromHtml(posts[position].getTo()[0].getName());        else            text=null;        if(text==null) {            holder.arrow.setVisibility(View.GONE);            holder.toName.setVisibility(View.GONE);        } else            holder.toName.setText(text);        text = Html.fromHtml(posts[position].getMessage());        holder.message.setText(text);        switch(posts[position].getType()) {            case FacebookPost.VIDEO:                text = Html.fromHtml(((FacebookVideoPost)posts[position]).getCaption());                Log.d(""CAST: ""+position,holder.getClass().getName());                ((VideoViewHolder)holder).caption.setText(text);                text = Html.fromHtml(((FacebookVideoPost)posts[position]).getName());                ((VideoViewHolder)holder).name.setText(text);                text = Html.fromHtml(((FacebookVideoPost)posts[position]).getDescription());                ((VideoViewHolder)holder).description.setText(text);                break;            case FacebookPost.LINK:                break;            case FacebookPost.STATUS:                Log.d(""CAST: ""+position,holder.getClass().getName());                break;            case FacebookPost.PHOTO:                break;        }        return convertView;    }}</code></pre><p>Thanks for everything.</p>","383628","","","","","2010-12-08 23:34:25","Android Listview repeat the items starting a specific item","<android><listview>","1","1","2","",""
"4393144","1","","","2010-12-08 22:47:25","17","2094","<p>I have some problems with my widgets. Here is the description:</p><p><strong>Context:</strong></p><p>I have a home widget.</p><p>When I add it, it pops a configuration Activity for setting some parameters for the widget.</p><p>If I call <strong>setResult(RESULT_OK, resultValue);</strong> before finishing the configuration Activity, the widget is added to the Home.</p><p>If I delete the widget by dragging it to the trash bin, <strong>public void onDeleted(Context context, int[] appWidgetIds)</strong> from my AppWidgetProvider class gets called.So far so good.</p><p>Problem:If the configuration Activity exits with result code RESULT_CANCELED (<strong>setResult(RESULT_CANCELED);</strong>), <strong>public void onDeleted(Context context, int[] appWidgetIds)</strong> from my AppWidgetProvider class is not called and the widget remains in the active widgets list. When I restart the phone, <strong>onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)</strong> from my AppWidgetProvider class is called and in int[] appWidgetIds I have all widgets (the ids) that supposed to be canceled (deleted before being added) + the active ones (the ones that are actually displayed on Home). The Widgets that were deleted by dragging to the trash bin are not displayed in this list. With time this list of widgets ids keeps getting bigger and bigger if the user is canceling from the configuration Activity.</p><p>The API reference says something like:""If you return RESULT_OK using Activity.setResult(), the AppWidget will be added, and you will receive an ACTION_APPWIDGET_UPDATE broadcast for this AppWidget. If you return RESULT_CANCELED, the host will cancel the add and not display this AppWidget, and you will receive a ACTION_APPWIDGET_DELETED broadcast.""</p><p>Can anyone give me some hints on this?Thank you.</p><p>Here is my manifest:</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;    &lt;receiver android:name="".MytWidget"" android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data android:name=""android.appwidget.provider""                    android:resource=""@xml/my_widget_provider"" /&gt;    &lt;/receiver&gt;    &lt;activity android:name="".ConfigurationActivity""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.appwidget.action.APPWIDGET_CONFIGURE"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;</code></pre><p>The rest of the code is not relevant since it was explained above (and I don't have permission to post it).</p>","316877","","","","","2014-01-14 13:22:25","Widget not deleted when passing RESULT_CANCELED as result for configuration activity","<android><android-widget>","3","1","11","",""
"4393184","1","","","2010-12-08 22:56:18","5","1392","<p>I have testing an app I ported to 2.3 on the Android 2.3 emulator, the app includes Hebrew strings displayed in a WebView required solving three problems:</p><ol><li>Telling webview to use hebrew fonts (see my post with solution her <a href=""http://stackoverflow.com/questions/4392521/android-2-3-hebrew-fonts-in-webiew"">Android 2.3 Hebrew fonts in Webiew</a>)</li><li><p>Telling webview to display the string right to left, which I solved by adding</p><pre><code>        &lt;p dir=""rtl""&gt;</code></pre></li><li><p>The last problem is that webview mirrors the text: in other words the first word that should be on the right is the last word on the left and also the letters of that word are flipped, the first letter that should be on the right is the first letter from the left. </p></li></ol><p>BTW, the 2.3 emaulator displays the string correctly if in a TextView.</p><p>Any ideas on how to fix #3?</p>","327415","","569101","","2013-06-05 11:40:00","2013-06-05 11:40:00","Android 2.3 Hebrew Support in Webview","<android><webview><hebrew><right-to-left>","1","0","","",""
"4393234","1","","","2010-12-08 23:04:34","0","377","<p>Im trying to get an overview of what  android.R.layout does in an android project.</p><p>From the spinner tut at <a href=""http://developer.android.com/resources/samples/Spinner/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/Spinner/index.html</a></p><pre><code> this.mAdapter = ArrayAdapter.createFromResource(this, R.array.Planets,                android.R.layout.simple_spinner_dropdown_item);</code></pre><p>I can see a private member</p><pre><code>public static final int simple_spinner_dropdown_item</code></pre><p>But what is this?</p>","179285","","","","","2010-12-08 23:06:00","what does android.R.layout do? An overview","<android>","1","0","","",""
"4393279","1","4393312","","2010-12-08 23:10:23","0","1040","<p>i saw that android 2,3 is ready so i tried to install it in my eclipse.Firstly,i went to ""Android SDK and AVD manager"" in my installed packages and i updated them all.Secondly, i went from help to check for updates,i was waiting eclipse to download them and finally i restarted my eclipse!my problem is that all my old apps are not playing now and they have a red x in the package explorer.i wrote a helloWorld app in 2,3 android and its playing but as i try to run my old apps ,eclipse says that i have error in my code.please help,i m confused!!:)</p>","519526","","","","","2010-12-08 23:15:43","problem with eclipse","<android><eclipse>","1","3","0","",""
"4393285","1","","","2010-12-08 23:11:43","3","882","<p>I'm working on a menu for my app that is made of a Gallery and sliding it I select a different background image.</p><pre><code> gallery.setOnItemSelectedListener(new Gallery.OnItemSelectedListener() {   @Override   public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,     int arg2, long arg3) {    imageSwitcher.setImageResource(imm[arg2]);</code></pre><p>The idea works decently but the sliding effect is not fluid.My idea is to set a delay, setting:</p><pre><code>imageSwitcher.setImageResource(imm[arg2]);</code></pre><p>only after a <em>200ms</em> or so...is something like this possible?</p><p>Thank you :)Marco</p>","535704","","674530","","2011-08-23 08:51:20","2011-08-23 08:51:20","How to set a Delay on imageSwitcher image change (Android)","<android><delay>","1","0","2","",""
"4393479","1","","","2010-12-08 23:43:13","0","401","<p>i got a API provided like below: </p><pre><code> public class HeadsetConnection extends Connection {        private StreamConnection conn;        private InputStream input;        private OutputStream output;    public boolean openConnection(String deviceID, int channel) throws IOException {         String inURL = ""btspp://"" + deviceID + "":"" + channel;         conn = (StreamConnection)Connector.open(inURL);            input = conn.openInputStream();             output = conn.openOutputStream();            return true;        }}</code></pre><p>i don't know how to change this J2ME codes fit for Android? </p>","431903","","","","","2010-12-08 23:43:13","what is the same class of StreamConnection(javax.microedition.io.* ) fit for android?","<java><android>","0","2","","",""
"4393525","1","4393800","","2010-12-08 23:50:34","0","1056","<p>Ok I am trying to make a project from a command line ( not really sure how my book doesn't say WHAT OR WHERE the command line is ) and when I try to run android.bat from the windows command prompt I get this error telling me that it checked for Java 64 bit and it wasn't found , then it checked for Java 32 and it wasn't found. The thing is I just installed Java SE 32 bit last night from Oracles site. </p><p>In Control Panel Programs I see :</p><p>Java (TM) SE Development Kit 6 Update 23  Oracle 141 MB 1.6.0.230 </p><p>Why is Android telling me it's not found?</p><p>Windows 7 Ultimate 64 bit Q6600 Intell quad core 4GBs DDR2 RamNvidia 8800 GTS Asus D2X<br>Gigabyte EP45-DSL3R</p><p><strong>UPDATE: Ok now I get this error :</strong> </p><p>Microsoft Windows [Version 6.1.7600]Copyright (c) 2009 Microsoft Corporation.  All rights reserved.</p><p>G:\Programming\android-sdk_r08-windows\android-sdk-windows\tools>android createproject --target 2 --path ./FirstApp --activity FirstApp --packageError: Missing argument for flag --package.</p><p>Usage:  android [global options] create project [action options]</p><p>Global options:  -v --verbose  Verbose mode: errors, warnings and informational messages are printed.  -h --help     Help on a specific command.  -s --silent   Silent mode: only errors are printed out.</p><p>Action ""create project"":  Creates a new Android project.Options:  -n --name     Project name  -t --target   Target ID of the new project [required]  -p --path     The new project's directory [required]  -k --package  Android package name for the application [required]  -a --activity Name of the default Activity that is created [required]</p><p>G:\Programming\android-sdk_r08-windows\android-sdk-windows\tools>apt.tutorial<strong>strong text</strong></p>","534538","","534538","","2010-12-09 01:46:56","2010-12-09 01:46:56","Android Command Line Error","<android><command-line>","1","4","","",""
"4393587","1","","","2010-12-08 23:58:17","0","147","<p>I want to write an Android application which generates the current View as well as the logic behind it (Activity) dynamically everytime it starts, based on a protocol which is loaded from a server. It is a form whose input fields can change daily. Thus, my question is whether it is possible on the Android platform to write an Interpreter class which dynamically generates code at runtime.</p><hr><p>[Originial German question]</p><p>Hallo Leute</p><p>Ich möchte eine Android Applikation schreiben, die sich bei jedem start die aktuelle view sowie die Logik dahinter(activity) dynamisch generiert, basierend auf eienm Protokoll, dass zuvor von einem Server geladen wird. Es handelt sich dabei um ein Formular wo sich täglich eingabefelder ändern können. Meine Frage ist deshalb, ob es auf der Android Plattform möglich ist, eine Interpreterklasse zu schreiben die mir zur Laufzeit code dynamisch generiert.</p><p>lg Lx</p><p>Translation (condensed): Is it possible to create code dynamically at runtime on the anroid platform?</p>","535744","","2988","","2010-12-09 01:14:39","2010-12-09 01:14:39","Code dynamisch erzeugen und ausführen auf Android","<android>","1","1","","",""
"4393612","1","4398578","","2010-12-09 00:03:11","23","12196","<p>So I have a bit of confusion with trying to set the background drawable of a view as it is displayed. The code relies upon knowing the height of the view, so I can't call it from <code>onCreate()</code> or <code>onResume()</code>, because <code>getHeight()</code> returns 0. <code>onResume()</code> seems to be the closest I can get though. Where should I put code such as the below so that the background changes upon display to the user?</p><pre><code>    TextView tv = (TextView)findViewById(R.id.image_test);    LayerDrawable ld = (LayerDrawable)tv.getBackground();    int height = tv.getHeight(); //when to call this so as not to get 0?    int topInset = height / 2;    ld.setLayerInset(1, 0, topInset, 0, 0);    tv.setBackgroundDrawable(ld);</code></pre>","321697","","1806193","","2013-01-17 11:59:58","2013-03-08 18:45:56","When Can I First Measure a View?","<android><layout><height><android-lifecycle>","4","3","20","",""
"4393732","1","4394011","","2010-12-09 00:24:21","1","1295","<p>I've asked a question similar to this but thought I would ask a more general question to get a wider range of input.</p><p>I ask this question because the last two apps I've developed, I threw all image resources in the drawable-hdpi folder, didn't deal with landscape-mode, tested it mainly on my own personal Droid phone, and basically felt like I was only developing for my own device.  Although I did always use dpi and sp in the appropriate places, this was not enough for my app to scale appropriately on other screen sizes/densities.  It scaled okay sometimes, but would always tend to cut off a portion of the screen on smaller sizes.</p><p>What are the best ways to begin an app that will scale at least somewhat well on all devices?</p><p>For example, should I construct my app layouts so that it looks correct on the default HVGA screen and allow it to scale to larger densities?  Would it be a best practice to be actively building both portrait and landscape layout files?</p><p>What are you doing to ensure your apps look nice on all devices without just focusing on one size and then scrambling around later to manage this?</p>","487840","","","","","2010-12-09 01:35:53","How do you begin developing an Android app for multiple devices sizes/densities?","<android><layout><dip>","1","1","2","",""
"4393775","1","4401369","","2010-12-09 00:33:14","34","11262","<p>I'm trying to add a header to an ExpandableListView like so:</p><pre><code>headerView = View.inflate(this, R.layout.header, null);expandableListView.addHeaderView(headerView);expandableListView.setAdapter(new SectionedAdapter(this));</code></pre><p>Which gives me the following error:</p><pre><code> 12-08 16:23:42.354: ERROR/AndroidRuntime(421): Caused by:java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams 12-08 16:23:42.354:   ERROR/AndroidRuntime(421): at android.widget.ListView.clearRecycledState(ListView.java:504) 12-08 16:23:42.354: ERROR/AndroidRuntime(421): at android.widget.ListView.resetList(ListView.java:490) 12-08 16:23:42.354:ERROR/AndroidRuntime(421):at android.widget.ListView.setAdapter(ListView.java:422) 12-08 16:23:42.354:ERROR/AndroidRuntime(421): at android.widget.ExpandableListView.setAdapter(ExpandableListView.java:475)</code></pre><p>This is happening at the call to <code>expandableListView.setAdapter(new SectionedAdapter(this))</code>, but I can't figure out why. Any ideas?</p>","413414","","1722818","","2014-02-06 12:44:42","2014-02-06 12:44:42","Android: ClassCastException when adding a header view to ExpandableListView","<android><android-linearlayout><expandablelistview><classcastexception>","2","0","8","",""
"4393817","1","","","2010-12-09 00:39:46","1","484","<p>I am new to android development, so sorry for maybe a stupid question.</p><p>I am going to write simple soft keyboard. I started with the followingsample:<a href=""http://developer.android.com/resources/samples/SoftKeyboard/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/SoftKeyboard/index.html</a></p><p>When I compiled and launched it on emulator (WVGA800, 240 dpi, Android 2.2) Inoticed that key shapes and font is blurry. When I opened stockandroid soft keyboard keys are perfect as well as their font. I triedto install this keyboard (from the sample) to my htc desire hd andquality of keys / fonts was bad as on the emulator.</p><p>How can I achieve the same quality as stock keyboard has.</p>","535767","","535767","","2010-12-09 01:09:57","2012-09-24 21:40:41","SoftKeyboard Sample blurry font / key background problem","<android><soft-keyboard>","1","0","","",""
"4393889","1","4393947","","2010-12-09 00:55:42","5","7232","<p>I have created an arraylist that is made up of custom objects. Basically the user will create a class and every time a class is created, a new Lecture (my custom object) is added to the arraylist. I need to save the generated arraylist so the user's classes will be saved even when the app is restarted.</p><p>From my understanding, I have to make my class serializable. But how exactly do I do that? And then once its serialized what do I do? </p><pre><code>public class Lecture{public String title;public String startTime;public String endTime;public String day;public boolean classEnabled;public Lecture(String title, String startTime, String endTime, String day, boolean enable){    this.title = title;    this.startTime = startTime;    this.endTime = endTime;    this.day = day;    this.classEnabled = enable;}//Getters and setters below</code></pre>","511082","","135152","","2011-05-25 03:04:36","2012-01-12 08:46:35","How can I store an arraylist of custom objects?","<android><sqlite>","3","0","1","",""
"4393976","1","4393999","","2010-12-09 01:12:21","1","2332","<p>I have two images, a red light and a green light. I have a custom ListView that I would like to display a red light when a list item is inactive, and a green light when it is active. A list item is activated when it is pressed.</p><p>Here is my code</p><p>row.xml</p><pre><code>&lt;ImageView    android:id=""@+id/iconLight""    android:src=""@drawable/light_off""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;</code></pre><p>main.java</p><pre><code>ImageView iconLight = (ImageView)findViewById(R.id.iconLight);iconLight.setImageResource(R.drawable.light_on);</code></pre><p>I get a NullPointerException executing the line that sets the image resource. So I did a little testing, I deleted the line setting the src in the XML file and just tried to set it in the main class. Still a NPE. So I tried not changing the resource, but just changing the alpha. Still NPE.</p><p>I'm not sure what I'm doing wrong. The files <code>light_off.png</code> and <code>light_on.png</code> are both in <code>res/drawable-ldpi</code> and either of them work when I specify them in the XML. But any change I attempt to make to <code>iconLight</code> in the main file causes this NPE. Any ideas?</p>","450780","","","","","2012-07-15 02:54:37","Android ImageView NullPointerException","<android><android-widget><image-manipulation><android-layout>","2","2","","",""
"4394025","1","4416827","","2010-12-09 01:23:03","5","10965","<p>I have implemented my TabActivity with different child activities:</p><pre><code>intent = new Intent().setClass(this, MyChildTabActiviy.class);// Initialize a TabSpec for each tab and add it to the TabHostspec = getTabHost.newTabSpec(""tag"").setIndicator(""indicator"", getResources().getDrawable(R.drawable.icon)).setContent(intent);getTabHost.addTab(spec);...</code></pre><p>So far no problems, everything works perfectly fine. I'm switching programmatically between tabs, replacing activities within tabs with ActivityGroups, etc. just as it's shown in many tutorials.</p><p>But my problem is, that when I want to check for a fling gesture my gestureDetector.onTouchEvent(event) is always returning false, thus no gesture is registrated.</p><p>This is my implementation of gestureDetector:</p><pre><code>public class MyChildTabActiviy extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        // ... building views, controls, etc.        GestureDetector gestureDetector = new GestureDetector(this, new MyGestureDetector());    }    @Override    public boolean onTouchEvent(MotionEvent event) {        return gestureDetector.onTouchEvent(event);    } class MyGestureDetector extends SimpleOnGestureListener {  @Override  public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {   if (Math.abs(e1.getY() - e2.getY()) &gt; SWIPE_MAX_OFF_PATH)    return false;   // left to right swipe and right to left swipe   if (e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE     &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {    //... fling logic ...    return true;   } else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE     &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {    //... fling logic ...    return true;   }   return false;  } }</code></pre><p>The thing is, that this code (and also the fling detection) works perfectly fine, when I'm starting these activities (there are four basic activities, that I sometimes switch to other activities) outside of a TabActivity, e.g. as a Launcher Activity. But I can't get it to work within a TabActivity. I already tried to append the GestureDetector to the TabActivity, but it doesn't work. I tried to append the GestureDetector to specific views like some layout views or buttons, ViewFlippers, etc. but it just doesn't work.When I'm debugging, I can see that the touch event is triggered and a motion is registered, but it just isn't evaluated as a fling or any other gesture.</p><p>So my question is, are there are any limitations regarding the usage of GestureDetectors with Tabs in Android? As I said, the gestures are registrated perfectly outside a TabActivity.</p><p>I would greatly appreciate the help of someone who knows the answer.If there is a limitation, how could someone get a workaround for that problem?</p><p>Thanks in advance for answers.</p>","535762","","","","","2010-12-11 16:49:19","Android: GestureDetector not working (gestureDetector.onTouchEvent(event) always false) with Tabs (TabActivity, Tabwidget)","<android><tabs><gestures><swipe>","2","0","","",""
"4394105","1","4394175","","2010-12-09 01:39:32","0","6881","<p>i have several markers on the google map displayed in android,  i wish to display more information (information such as - some text,a picture) when a particular marker is clicked. could some one please guide me how can i go about implementing that.</p>","377337","","","","","2011-04-21 10:36:35","android google map marker","<android><google-maps-markers><android-maps>","2","0","","",""
"4394132","1","4394212","","2010-12-09 01:46:38","0","533","<p>I have a ListActivity as my main activity.  I want to be able to do a few things on a single item in the list i.e.</p><p>Longpress to bring up a contextmenu for that itemSwipe left to right to slide a new screen from the right to edit the list item.</p><p>Does anyone have any code they can show me that does this?</p>","346309","","","","","2010-12-09 02:15:20","Android ListActivity Clicks","<android><list><listactivity><swipe>","2","6","","",""
"4394217","1","","","2010-12-09 02:06:11","0","544","<p>how can i add .so file to apk when packaging with ANT??? i dont know the code to do it,Any suggestion?</p>","443407","","","","","2011-12-08 02:23:04","how can i add a .so file to apk when packaging with ANT?","<android><ant>","0","2","","",""
"4394238","1","","","2010-12-09 02:10:24","1","1017","<p>How to force a tombstone/crash in a Froyo phone?</p><p>I need a way to perform a test, forcing a tombstone generation in a Froyo phone. Preferably using adb commands.</p><p>Does anyone know how to do this?</p><p>Thanks a lot!</p>","535828","","345717","","2010-12-09 02:13:07","2010-12-09 19:09:37","How to force a tombstone/crash in a Froyo phone?","<android><tombstoning>","1","0","","",""
"4394250","1","4395002","","2010-12-09 02:13:13","2","5396","<p>My app takes a lot of time to load at the start, the screen is blank meanwhile. Is there a way to display an image when the app starts and later display the layouts once its done loading?</p>","377337","","","","","2010-12-10 00:24:17","android startup image","<android>","4","0","","",""
"4394293","1","","","2010-12-09 02:22:22","7","50085","<pre><code>String[] textArray={""one"",""two"",""asdasasdf asdf dsdaa""};int length=textArray.length;RelativeLayout layout = new RelativeLayout(this);RelativeLayout.LayoutParams relativeParams = new RelativeLayout.LayoutParams(        LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);for(int i=0;i&lt;length;i++){    TextView tv=new TextView(getApplicationContext());    tv.setText(textArray[i]);    relativeParams.addRule(RelativeLayout.BELOW, tv.getId());    layout.addView(tv, relativeParams);}</code></pre><p>I need to do something like that.. so it would display as</p><pre><code>onetwoasdfasdfsomething</code></pre><p>on the screen..</p>","535837","","1134705","","2012-09-25 16:01:43","2014-02-15 00:00:44","create a new textview programmatically then display it below another textview","<android><relativelayout>","4","3","3","",""
"4394391","1","4394428","","2010-12-09 02:48:01","1","511","<p>So I have a little app I am working on that scrapes comics from the web and displays them on my phone.  Nothing fancy, just using it to learn the ropes.  The function called comicReload(); does most of the work and it is called many times in the application (on first run, and when the user clicks certain buttons.  Here is the function:</p><pre><code>public void comicReload () throws IOException {    //clears some Vectors that have things in them from the last run    imagetitles.clear();    imagetext.clear();    imagelinks.clear();    //forms the link it will connect to, and connects    connector = siteBase + Integer.toString(comicNumber);    doc = Jsoup.connect(connector).get();    media = doc.select(""[src]"");    //gets the required media from the site    for (Element src : media) {        if (src.tagName().equals(""img""));            imagetitles.add(src.attr(""alt""));            imagetext.add(src.attr(""title""));            imagelinks.add(src.attr(""src""));    }    //some variables I could probably get rid of, but it's easy to read    Integer titlesize = imagetitles.size();    Integer textsize = imagetext.size();    Integer linkssize = imagelinks.size();    comicTitle = (imagetitles.get(titlesize-4));    hoverText = (imagetext.get(textsize-4));    comicLink = (imagelinks.get(linkssize-4));    //gets the picture I am looking for along with the associated text    URL url = new URL(comicLink);    InputStream is = (InputStream) url.getContent();    image = Drawable.createFromStream(is, ""src name"");    //finally puts the scraped information into the layout    comicView.setImageDrawable(image);    title.setText(comicTitle);    htext.setText(hoverText);}</code></pre><p>It works 100% fine when it is called, but it's a little slow over 3G so I tried to add a ProgressDialog to show while it loads.  This is my attempt (this is the code that runs where I used to just have comicReload();)</p><pre><code>pd = ProgressDialog.show(this, ""Getting Comic"", ""Loading"", true, false);    new Thread(new Runnable() {             public void run() {               try {                   comicReload();               } catch (IOException e) {                   Log.i(""ComicReloadFail"",""Sam"");               }               pd.dismiss();               return;           }    }).start();</code></pre><p>The Thread itself runs fine, and when I put some random code to execute in place of the try-catch block with the comicReload(); in it everything goes dandy.  The second I put the comicReload() back in there, however, running the app causes the ProgressDialog spinner to spin for a few seconds before the app force closes.  What is causing this?  And why does comicReload() stop working when it's in a thread.  I just want a way to execute that method with a spinner going while it works.</p><p>Thanks in advance guys, I know that was a lot to read.</p>","324977","","","","","2010-12-09 02:57:46","Android: Function not working in Thread but works otherwise (trying to add ProgressDialog)","<java><android><multithreading><methods><progressdialog>","2","0","1","",""
"4394439","1","4395282","","2010-12-09 03:01:04","10","10607","<p>My Android application talks to a php server.  I have Apache/php running locally on WAMP Server.  I am running Windows 7.  If I go to localhost on Windows 7 the site shows but on the phone it will look for localhost on the current Android OS so no site shows. </p><p>I managed to get around this by opening my apache configuration to the internet and then using my external IP address, this is annoying because I am on a dynamic IP and sometimes don't have internet (+ not secure).</p><p>How do I make a http request from android access localhost (or another alias in the hosts file)?</p>","248521","","","","","2013-08-17 14:31:24","Getting Android to talk to Apache on localhost","<android>","5","1","8","",""
"4394584","1","","","2010-12-09 03:31:59","57","69460","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4382178/android-sdk-installation-doesnt-find-jdk"">Android SDK installation doesn&#39;t find JDK</a>  </p></blockquote><p>I have installed Java runtime 6 to C:\src\libraries\jre6.</p><p>I installed Java JDK to C:\src\libraries\javasdk</p><p>My %PATH% is set to:</p><blockquote>  <p>PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32  \WindowsPowerShell\v1.0;C:\src\libraries\javasdk\bin;C:\src\libraries\javasdk;C:  \src\libraries\javasdk\jdk\bin;C:\src\libraries\javasdk\jdk;C:\src\libraries\jav  asdk;</p></blockquote><p>When I run the Android SDK installer I get the error ""Java SE development Kit (JDK) not found"".</p><p>I'm at a loss as to what the Android SDK cannot really find.  What is wrong?</p>","535867","","334849","","2010-12-09 03:35:05","2012-04-28 17:33:19","Android SDK install problem","<android><sdk><install>","6","0","11","2012-04-18 19:25:19",""
"4394602","1","4394648","","2010-12-09 03:36:35","2","1087","<p>I am working on an app which will provide route for the student shuttle. I successfully built this app which will show route map along with stops. I now like to add new functionality which will show the location of student shuttle in real time. When student looks at the shuttle route, they should also see a moveining icon on the map which is the real time location of the shuttle.  ANy idea how this can be done ...???</p><p>Thanks in advance</p>","522505","","","","","2013-11-09 15:17:36","Android Map tracking and moving an icon","<android><map>","1","0","","",""
"4394647","1","4394711","","2010-12-09 03:48:11","4","1640","<p>Here is my XML</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/refresh"" android:title=""Home""  android:icon=""@drawable/menu_home"" /&gt; &lt;item android:id=""@+id/search"" android:title=""Search""  android:icon=""@drawable/menu_search"" /&gt; &lt;item android:id=""@+id/help"" android:title=""Help"" android:icon=""@drawable/menu_help"" /&gt;&lt;/menu&gt;</code></pre><p>Icon is getting displayed but title doesn't. Please advise.</p>","352263","","244296","","2010-12-09 03:49:45","2013-09-09 08:22:50","Android Menu Icon with Title : Title doesn't display","<android>","2","5","0","",""
"4394737","1","","","2010-12-09 04:06:52","0","850","<p>I'm running into an interesting problem.</p><p>I've got this app working nicely on iPhone. However, when I try to run it on android bring it over to android I'm not receiving any values when I do my HTTPClient Call.</p><p>Here is my connection code:</p><p>if ((Titanium.Network.networkType !=Titanium.Network.NETWORK_NONE) &amp;&amp; valid ){     var server = Ti.App.MyData[2] + ""CheckUserServlet"";    xhr.open('POST',server);</p><pre><code>xhr.setRequestHeader(""Content-Type"", ""application/x-www-form-urlencoded"");xhr.setRequestHeader('User-Agent','');xhr.send(data); </code></pre><p>}</p><p>This part seems to work great. I've run traces and it looks good.</p><p>xhr.onload = function(){    Ti.API.info(""Xhr status code is: "" + xhr.status);    Ti.API.info(""text: -"" + xhr.responseText+""-"");    Ti.API.info(""Data: -""+ xhr.responseData+""-"");}</p><p>The status returns 200, so that's right. But my responseText and responseData are empty values.</p><p>Now, this code works like a dream on iPhone, and KitchenSink works for its image calls and the like, although they don't have additional info in send().</p><p>Other info: Titanium 1.2.1, Titanium SDK 1.4.0 (also on 1.2.0). JDK 1.6.22, tried on Android SDK 2.2 and 2.1 (not worrying about 2.3, rumor has it that its too new and buggy)</p><p>Can anyone see what I'm missing?</p>","535889","","","","","2010-12-09 05:00:45","HTTPClient response only returning empty values in Titanium","<android><httpclient><titanium>","1","0","","",""
"4394794","1","","","2010-12-09 04:18:18","0","750","<p>I'm using Eclipse 3.5 (on MacOS 64-bit) and had the ADT installed, and things were working.</p><p>I attempted to update the ADT and after the update my Eclipse would no longer start.  The error in the log file is</p><pre><code>java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:556) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311)</code></pre><p>To work around this, I've re-installed Eclipse 3.5.</p><p>Anyone else having this problem?</p><p>NOTE: I tried the suggestions in <a href=""http://stackoverflow.com/questions/2493415/i-am-getting-a-following-error-while-launching-my-eclipse"">I am getting a following error while launching my eclipse</a>but (starting with -clean did not work, nor did changing the startup property).</p>","535888","","1061728","","2012-04-09 06:15:44","2012-04-09 06:15:44","Eclipse won't start after upgrading ADT (Android Development Toolkit)","<android>","0","2","","",""
"4394823","1","4396145","","2010-12-09 04:23:39","3","712","<p>Hey everyone, when I run my app on my phone the icon shows up as the one I want it to be, the one i placed in the drawable folder in eclipse. However, when I upload the app to google, the apps icon is still the default android icon. How come it is doing this?</p><p>this is in my androidmanifest.xml:application android:icon=""@drawable/icon"" android:label=""@string/app_name""</p>","533049","","","","","2010-12-09 09:44:17","My app's icon is still default when I upload to the android market","<android><google-play>","1","2","1","",""
"4394885","1","4395011","","2010-12-09 04:37:29","5","3927","<p>I have a custom cursor adapter and I am trying to set the color of a text box of one of the row views:</p><pre><code> txtChange.setTextColor(0xE01B4C); txtChange.setText(""Hey I'm some Text!"");</code></pre><p>If I remove the <code>setTextColor</code> call the text appears as expected. What am I missing?</p>","13688","","","","","2010-12-09 05:01:04","After calling setTextColor, text does not appear in TextView","<android>","1","0","","",""
"4394907","1","4394959","","2010-12-09 04:41:45","1","1282","<p>I want to record the Voice on my android mobile and I have no clue how to do that particularly. I have searched a lot but couldn't found anything useful.</p><p>Can anyone have a solution to this particularly.</p><p>Thanks,david</p>","422859","","","","","2013-04-07 05:34:08","Recording Voice on Android Phone","<android><mobile><voice-recording>","2","0","3","",""
"4394972","1","4395091","","2010-12-09 04:55:36","2","4499","<p>I am developing a SoundBoard application. My class extends ListActivity and the listview is as follows</p><pre><code>[Image] [Text][Image] [Text][Image] [Text]</code></pre><p>Now when the user clicks on any textview, I need to change the image of that textview. I implement that by the following code.</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View view,           int position, long id) {TextView tv1 = (TextView) view;//Here I change the image with tv1 as reference}</code></pre><p>But I need an <strong>alternate way to get the selected TextView</strong> . Because when I change the image using the above method,  if user selects third row in the list, the image changes in the third row of the second scroll page, the third row of the third scroll page and so on gets affected.Not only the required textview image changes, but one textview in upcoming scroll pages are changed when list is scrolled. Hope you get my problem. Any help is appreciated. Thanks</p>","527053","","","","","2010-12-09 05:17:45","Android: Get the TextView in onItemClickListener() of ListView","<android><listview><listviewitem>","2","0","0","",""
"4395062","1","4395089","","2010-12-09 05:11:23","6","4973","<p>I developed an android application and I am facing a problem with <code>Toast</code>.Suppose I am displaying a Toast, it is displayed on the application window.When a Dialog box is appears, the toast doesn't disappear instantly .</p><p>I want to know how I can cancel the toast.</p>","482604","","592025","","2011-11-28 09:37:24","2013-07-19 07:37:52","How to cancel Toast","<android><toast>","4","0","5","",""
"4395107","1","4395166","","2010-12-09 05:20:47","1","1868","<p>I am trying to design a simple chat application for android. The concept is, users have to register and login to their account and can chat with each other. A basic chat...</p><p>Can anyone please tell me the simplest and the most efficient way to design a chat application... Any input will be valuable. Any samples also will be of great help...</p><p>EDIT:</p><p>I am trying to use jwchat.org as a sample jabber server to establish connection. Can anyone plz help me with a tutorial or sample code of how to do it... </p>","303155","","303155","","2010-12-09 08:09:20","2014-04-15 06:11:42","Designing a chat application","<android>","2","1","","",""
"4395131","1","4395143","","2010-12-09 05:23:45","0","4657","<p>Can I get the complete source code of android market app, as it is an open source product...please any one send me some links to download.</p>","505580","","309086","","2014-01-08 11:33:52","2014-01-08 11:33:52","source code of android market app","<android><google-play>","2","1","1","2012-06-12 21:13:37",""
"4395220","1","","","2010-12-09 05:40:01","2","961","<p>in my custom listview that Contain an image and EditText ,and in EditText i can comment the photo ,i can give text comment max length of 50 ,when i lost the focus in EditText i want to rearrange the text in EditText in following format</p><p>EG: suppose comment contain 40 char and user can at a time directly view only 20 char,then if i lost the focus text should be rearranged that at the end there should be 3 dot</p><p>Original Comment i wirte:eg-> eeeeeeeeeeeeeeeeeeeeeeeeeeeafter i lost focus it should shown as-> eeeeeeeee...</p><p>it's importent that the nothing happens to original text because these text i want to send to server, and i directly take these values,and if am replace the text by new this type of text this will create problem, also when i gain focus i need to see full text also. </p><p>NB: i set android:singleline=true</p>","487219","","","","","2010-12-09 05:50:18","Android EditText","<android>","2","1","","",""
"4395309","1","4395391","","2010-12-09 05:56:34","45","33438","<p>Is it possible to set any custom font in every control of the application? And not necessarily runtime ? (i.e. from xml if possible or only once for whole application in JAVA file)</p><p>I can set the font for one control from this code.</p><pre><code>public static void setFont(TextView textView) {    Typeface tf = Typeface.createFromAsset(textView.getContext()            .getAssets(), ""fonts/BPreplay.otf"");    textView.setTypeface(tf);}</code></pre><p>And the problem with this code is it should be called for every control. And i want to call this or any similar method once, or if possible set the property in xml.  Is it possible?</p>","246942","","","","","2014-03-09 10:59:35","Android: Want to set custom fonts for whole application not runtime","<android><fonts>","7","6","59","",""
"4395320","1","5575805","","2010-12-09 05:58:16","3","12942","<p>I have a standard code to call a <code>.net webservice</code></p><p>I get <code>exception ""org.xmlpull.v1.xmlpullparserexception expected start_tag""</code> at line</p><pre><code>transportSE.call(SOAP_ACTION,soapSerializationEnvelope);</code></pre><p>However, if i call the same webservice from a <code>.NET code</code> i get a well structured proper output as desired.</p><p>It primarily seems that from <code>kSOAP2</code>, there is a definite output that it gets but when it goes to parse further w.r.t SoapPrimitive objects, it fails.</p><p>So, is there other way to look at the actual output (actual soap envelope) received and then may be parse it myself appropriately.</p>","475243","","1206052","","2013-06-06 07:51:19","2013-10-26 10:15:27","kSOAP2 output / org.xmlpull.v1.xmlpullparserexception expected start_tag","<android><android-ksoap2>","5","3","","",""
"4395386","1","4689428","","2010-12-09 06:09:28","2","4018","<p>I've tried all the suggestions in other comments without avail and I hope someone can help me. I've been struggling with this problem for three days now. I'm quite sure my UUIDs are correct and I know that the bluetooth access is enabled in the manifest.</p><p>I'm trying to connect my android application to a python server running in Fedora. It has worked intermittently and not at all right now. The android exceptions I'm receiving generally are along the lines of.. These are thrown when btSocket.connect(); is executed in the code attached below.</p><pre><code>12-09 05:08:42.331: ERROR/BluetoothService(676): java.io.IOException: Service discovery failed</code></pre><p>or</p><pre><code>12-09 05:27:00.757: ERROR/BluetoothService(729): java.io.IOException: Service discovery failed</code></pre><p>This is my android bluetooth class that is supposed to take care of everything. The thread is started when the main application class receives a message that the socket has been connected to. My bluetooth class is based on <a href=""http://www.anddev.org/viewtopic.php?p=35487#35487"" rel=""nofollow"">http://www.anddev.org/viewtopic.php?p=35487#35487</a>.</p><pre><code>package spin.halo;import java.io.*;import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;import java.util.UUID;import android.bluetooth.*;import android.os.Handler;import android.util.Log;public class BluetoothService extends Thread{    private static final String TAG = ""BluetoothService"";    private static final boolean D = true;    private BluetoothAdapter mBluetoothAdapter = null;    private BluetoothSocket btSocket = null;    private OutputStream outStream = null;    private InputStream inStream = null;    private static final UUID MY_UUID = UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB"");    private static String address;    private Handler appHandler;    public BluetoothService(Handler h) {        if (D)            Log.e(TAG, ""+++ ON CREATE +++"");        appHandler = h;        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();        if (mBluetoothAdapter == null) {            Log.e(TAG, ""NO BT ADAPTER!"");            return;        }        if (!mBluetoothAdapter.isEnabled()) {            Log.e(TAG, ""Bluetooth is not enabled!"");            return;        }        if (D)            Log.e(TAG, ""+++ DONE IN ON CREATE, GOT LOCAL BT ADAPTER +++"");    }    public void connectToServer() {        connectToServer(""60:33:4B:25:0D:37"");    }    public void connectToServer(String serverMacAddress) {        address = serverMacAddress;        //        if (D) {            Log.e(TAG, ""+ ABOUT TO ATTEMPT CLIENT CONNECT +"");        }        BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);        Log.v(TAG, ""REMOTE DEVICE: "" + device.toString());        try {            btSocket = device.createRfcommSocketToServiceRecord(MY_UUID);            Log.v(TAG, ""SOCKET: "" + btSocket.toString());        } catch (Exception e) {            Log.e(TAG, ""ON RESUME: Socket creation failed."", e);        }        /* Discovery may be going on, e.g., if you're running a         'scan for devices' search from your handset's Bluetooth         settings, so we call cancelDiscovery(). It doesn't hurt         to call it, but it might hurt not to... discovery is a         heavyweight process; you don't want it in progress when         a connection attempt is made.*/        mBluetoothAdapter.cancelDiscovery();        // Blocking connect, for a simple client nothing else can        // happen until a successful connection is made, so we        // don't care if it blocks.        try {            btSocket.connect();            Log.e(TAG, ""ON RESUME: BT connection established, data transfer link open."");            appHandler.sendMessage(appHandler.obtainMessage(ValidationApp.BT_CONNECTION_MADE, """"));        } catch (IOException e) {            try {                Log.e(TAG, ""ON RESUME: Could not connect"", e);                btSocket.close();            } catch (IOException e2) {                Log.e(TAG, ""ON RESUME: Unable to close socket during connection failure"", e2);            }        }        // Create output stream        try {            outStream = btSocket.getOutputStream();        } catch (IOException e) {            Log.e(TAG, ""ON RESUME: Output stream creation failed."", e);        }        // Create input stream        try {            inStream = btSocket.getInputStream();        } catch (IOException e) {            Log.e(TAG, ""Input stream creation failed."", e);        }    }    public void write(String message) {        if(message.length() &gt; 0) {            byte[] msgBuffer = message.getBytes();            try {                outStream.write(msgBuffer);            } catch (IOException e) {                Log.e(TAG, ""ON RESUME: Exception during write."", e);            }        }    }    public void run() {        LineNumberReader mLineReader = new LineNumberReader(new InputStreamReader(inStream));        while(true) {            try {                String message = mLineReader.readLine();                if(D) {Log.v(TAG, ""Bluetooth says: "" + message);}                Log.v(TAG, appHandler.obtainMessage(ValidationApp.BT_MESSAGE, message).toString());                appHandler.sendMessage(appHandler.obtainMessage(ValidationApp.BT_MESSAGE, message));            } catch (IOException e) {                Log.e(TAG, ""startListen: "", e);            }        }    }}</code></pre><p>The key portions of my python code are below. I am quite confident about this code.</p><pre><code># pybluez libraryimport bluetoothserver_socket = bluetooth.BluetoothSocket( bluetooth.RFCOMM )client_sockets = []server_socket.bind(("""",bluetooth.PORT_ANY))port = server_socket.getsockname()[1]uuid = ""00001101-0000-1000-8000-00805F9B34FB""print ""Listening for devices...""# advertise serviceserver_socket.listen(1)bluetooth.advertise_service( server_socket, ""Validation Host"",    service_id = uuid,    service_classes = [ uuid, bluetooth.SERIAL_PORT_CLASS ],    profiles = [ bluetooth.SERIAL_PORT_PROFILE ],)# accept incoming connectionsclient_sock, client_info = server_socket.accept()client_sockets.append(client_sock)print ""Accepted Connection from "", client_info</code></pre><p>Thanks for taking a look.</p>","535961","","535961","","2010-12-09 06:46:57","2011-01-14 09:01:21","android.bluetooth.BluetoothSocket cannot connect","<python><android><sockets><bluetooth>","1","0","3","",""
"4395400","1","4395452","","2010-12-09 06:12:16","2","773","<p>In my hybrid Android application, on a <code>ListView</code> item click I'm loading a <code>WebView</code> by passing the <code>WebView</code> activity with the url to display in it. The user can come back to the earlier view by clicking back button.</p><p>But what is happening is after clicking on 3-4 <code>ListView</code> items, the app is becoming slow, which I think is because <code>WebView</code> activity is loaded again and again without deallocating it.</p><p>Can anybody please help me in this context?</p>","227943","","244296","","2010-12-09 06:25:12","2011-02-12 02:57:29","Webview building up the memory Android","<android><keyboard><webview>","1","0","1","",""
"4395402","1","4396351","","2010-12-09 06:12:32","1","857","<p>While testing and analyzing code of Bluetooth Chat, I have questions about my own program.</p><p>a) My program sends a command to another bluetooth device. (I can handle it using sample code provided)</p><p>b) It then receives a response to my previous command.</p><p>c) Based on the response received, my device sends another command.</p><p>d) It then receives a response to my command.</p><p>and the same procedure continues ...</p><p>My question is , in Bluetooth Chat program there is a handler which receives a response. How can I make sure to receive first response and then used that to send another command ... and then receive a response again based on second command, using that same handler. </p>","435597","","","","","2010-12-09 08:50:32","Android -- Bluetooth Read Write Problem?","<java><android><bluetooth><chat>","1","0","","",""
"4395411","1","4395482","","2010-12-09 06:13:57","1","3707","<p>I have a main activity that launches a child activity using the following code:</p><pre><code>Intent intent = new Intent();intent.setClassName(MyChildActivity.class.getPackage().getName(), MyChildActivity.class.getName());((Activity)context).startActivity(intent);</code></pre><p>I am trying to perform a time-consuming task in the child activity and would like to display a ProgressDialog while I do so. My code looks like this:</p><pre><code>private ProgressDialog _progressDialog;private OnClickListener btn_onClick = new OnClickListener() {    public void onClick(View v) {        _progressDialog = ProgressDialog.show(            v.getContext(),            ""Please wait"",            ""Performing task...""        );        TaskThread t = new ExportThread(v.getContext());        t.start();    }};private class TaskThread extends Thread{    private Context _context;    public TaskThread(Context context) {        _context = context;    }    private Handler _handler = new Handler() {        @Override        public void handleMessage(Message msg) {            _progressDialog.dismiss();        }    };    @Override    public void run() {        performTask(_context);        _handler.sendEmptyMessage(0);    }}</code></pre><p>For some reason, the ProgressDialog is not displaying. If I use that same code in the main activity, it works - but not in the child activity. In addition, the following code also fails to display the ProgressDialog (but the Toast does display):</p><pre><code>private ProgressDialog _progressDialog;private OnClickListener _btn_onClick = new OnClickListener() {    public void onClick(View v) {        _progressDialog = ProgressDialog.show(            v.getContext(),            ""Please wait"",            ""Performing task...""        );        try {            Thread.sleep(2000);        } catch (InterruptedException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        _progressDialog.dismiss();        Toast.makeText(v.getContext(), ""Done with progress dialog."", Toast.LENGTH_SHORT).show();    }};</code></pre><p>Any ideas out there? Are we not allowed to display a ProgressDialog from a child activity?</p><p>Thank you.</p>","398641","","","","","2010-12-09 06:26:49","Android: Progress Dialog Not Displaying","<android><progressdialog>","1","0","1","",""
"4395496","1","4395604","","2010-12-09 06:29:21","0","96","<p>I got a problem in Android application, I don't know how to make the selected pins on top of overlaaped pins.</p><p>In objective-c, iPhone we use the below methods But, I don't know how it can be implemented in Android phone, java.</p><pre><code>[annotationView.superview bringSubviewToFront:annotationView];[annotationView.superview sendSubviewToBack:annotationView];</code></pre><p>Please suggest any solution,</p><p>Thank you,Madan Mohan</p>","249634","","","","","2010-12-09 06:47:07","How to make selected pins on top which are overlapped in the MapView in Java, in Android phone","<java><android><android-mapview>","1","0","","",""
"4395532","1","","","2010-12-09 06:34:04","6","3018","<p>I use following <code>Intent</code>s for recording video and taking pictures, but in Motorola Droid 2.2 the camera <code>Intent</code> save option fails, ie nothing get saved, and the camcoder <code>Intent</code> cancel crashes my application.</p><p>In both <code>Intent</code> I explicitly passing the file and after it return result ""ok"" I use the file, ie when user press the save/insert options in the intent: SAVE in camcoder no problem, only cancel casues crash in camcorder.</p><p>Camera</p><pre><code> Intent intent2 = new Intent(""android.media.action.IMAGE_CAPTURE""); imgUri = Uri.fromFile(photofile); intent2.putExtra(MediaStore.EXTRA_OUTPUT, imgUri); startActivityForResult(intent2, 1);</code></pre><p>Camcoder</p><pre><code> Intent i = new Intent(""android.media.action.VIDEO_CAPTURE""); i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(videofile)); i.putExtra(android.provider.MediaStore.EXTRA_VIDEO_QUALITY, 0); i.putExtra(""android.intent.extra.durationLimit"", 60); startActivityForResult(i, 2);</code></pre><p>NB: The Recorded Video can't be played with HTC ERIS</p>","487219","","810368","","2012-10-15 08:28:26","2013-01-27 09:41:44","Android Video Recording ,Camera Intent","<android><android-intent><android-camera>","1","2","4","",""
"4395552","1","4395580","","2010-12-09 06:37:46","5","1838","<p>I am trying to post some content to Facebook wall through my Android application. I am using the following Intent code for sharing</p><pre><code>Intent msg = new Intent(Intent.ACTION_SEND);msg.setType(""text/plain"");msg.putExtra(Intent.EXTRA_TEXT, display_quote.getText().toString() );startActivity(Intent.createChooser(msg, ""Share Quote""));</code></pre><p>However when i select 'Facebook' from the options which i get , i am redirected to a URL <a href=""http://m.facebook.com/sharer.php"" rel=""nofollow"">http://m.facebook.com/sharer.php</a> and i get an error saying that ""Your Link could not be shared"" . </p><p>Is there any other way of posting to Facebook wall through Android application?</p>","282826","","244296","","2010-12-09 06:45:49","2013-02-22 09:57:06","Unable To Share Content on Facebook through Android Application","<android><facebook>","2","1","1","",""
"4395644","1","","","2010-12-09 06:52:20","0","227","<p>I am new to android development.I tried to use couchdb on android emulator.I was installed and used successfully in android emulator.</p><p>Now my scenario is,</p><p>I am able to do replication process in android emulator couchdb, it is replicated in remote couchdb database. i was done the same replication from remote database to emulator database, it works fine, the couch database replicated.</p><p>My question is how to display the notification in android emulator when the couchdb database updated from the remote couchdb.(means updating the database in android couchdb from the remote couchdb, at the time of updating how to display the notification in android emulator?)</p><p>Please help me</p>","536013","","","","","2010-12-09 23:49:30","Couchdb Replication Notifications on Android Emulator","<android>","1","0","","",""
"4395815","1","4395841","","2010-12-09 07:19:35","2","1830","<p>I want to get the number of NOT NULL records from my sqlite database. Since I'm using autoinceament, the last inserted row won't give me the real number of records in the table as even if I delete any middle record, it'll insert at the position higher than the last inserted record.</p><p>The insert statement returns me the number of last inserted row, but I want this value on the fly.</p><p>Can anybody please help me?</p><p>Thanx in advance.</p>","227943","","","","","2010-12-09 07:24:13","Get total number of not null records in Android sqlite database","<android><sqlite><records><notnull>","2","0","","",""
"4395824","1","4395983","","2010-12-09 07:20:42","2","2533","<p>I am developing a soundboard application in which I use Listview Activity. But since Listview of Android has the property of recycling its listviews, <strong>the changes I make to the selected textview gets reflected in all the pages while scrolling the listview.</strong> I don't want this to happen. So how do I handle it properly. If somebody can help me out with code snippet, it will  be really helpful and I appreciate your effort. Thank you!</p><p>Edit: Hope this will explain better</p><p>My class extends ListActivity and the listview is as follows</p><pre><code>[Image] [Text][Image] [Text][Image] [Text]</code></pre><p>Now when the user clicks on any textview, I need to change the image of that textview. I implement that by the following code.</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View view,           int position, long id) {TextView tv = (TextView) view;//Here I change the image with tv as referencefinal Resources res = getBaseContext().getResources();    final Drawable myImage = res.getDrawable(R.drawable.pause);  //  myImage.    final Drawable myImage1 = res.getDrawable(R.drawable.play);    tv.setCompoundDrawablesWithIntrinsicBounds(myImage, null, null, null);    MediaPlayer.OnCompletionListener listener = new MediaPlayer.OnCompletionListener(){      public void onCompletion(MediaPlayer mp) {         tv.setCompoundDrawablesWithIntrinsicBounds(myImage1, null, null, null);      }    };}</code></pre>","527053","","527053","","2010-12-09 07:57:58","2010-12-09 07:57:58","Android: Handle ListView Recycle","<android><listview><recycle>","1","0","","",""
"4395831","1","4544625","","2010-12-09 07:21:54","3","1644","<p>hi everyone i m trying to send a chart via email in android application how can i attach that chart to email application. Thanks .....</p>","515616","","","","","2012-02-06 08:29:13","convert view to image in android","<android>","2","0","3","",""
"4395835","1","4397595","","2010-12-09 07:22:34","-1","717","<p>Got a performance issue when lots of nested RelativeLayouts are used.<br></p><p>For example if we have some RelativeLayout as a UI root, and every container(button, label, textview, imageview) is a RelativeLayout +  Android based component (ex. aButton = RelativeLayout + ImageView + TextView), then in a complex view of 4 buttons, 3 images and 6 labels we get ~15 nested RelativeLayouts.<br></p><p>RelativeLayout has a very complex onMeasure method, that calculates size of every child to determine the size of layout. Calculating size of a complex view of 15-20 nested RelativeLayouts costs ~5 seconds, that's too much. onMeasure is most expensive of all calls, even drawing finished much faster then measurement.&lt;=UPD=><br>To prevent appearing suggestions to use native android views to build something complex: <br><b>Ability to add everything to everything is required. That's why every container has to be not just View, but ViewGroup. And RelativeLayout features like gravity and alignment can also help alot, that's why lot's of RelativeLayouts are used.</b>&lt;=/UPD=></p><p>Had anyone got these performance problems?<br>Should replacing RelativeLayout with some other Layout solve issue?<br>Or removing all these nested layouts is the only way to deal with the problem?<br>Does anyone know how much layouts can be nested without some performance problems appearing?</p>","453991","","453991","","2010-12-09 07:48:24","2011-01-03 13:37:19","Complex RelativeLayout-based View - performance issue","<android><relativelayout>","3","2","","",""
"4395891","1","","","2010-12-09 07:29:44","0","637","<p>I used to have Windows XP on my machine and now i decided to turn to windows 7.The LunarLander application used to run on windows XP on 50-60fps but now it runs on 20-30fps on windows 7. The hardware configuration didnt change at all. </p><p>It seems that it has to do with drivers of video card. I have installed the latest drivers for video card (Mobile Intel(R) 4 Series Express Chipset Family) but didnt make any differnce.</p><p>Does anyone have experience on this issue?</p><p>please help</p>","536065","","","","","2012-07-07 17:15:39","Android Emulator Windows 7 low fps","<android><windows-7><emulator>","2","0","","",""
"4395975","1","4406326","","2010-12-09 07:44:50","5","2717","<p>Is it possible to preserve system data (not SD card data) on Android emulator when it is shutdown?My specific problem is that I am trying to import a new root certificate into the <code>/system/etc/security/cacerts.bks</code> file, but that requires a restart, and when I do restart the emulator the file gets reverted to original state.</p>","279218","","","","","2010-12-10 06:34:42","How to restart Android emulator and preserve system data","<android><android-emulator>","2","1","1","",""
"4395989","1","4396355","","2010-12-09 07:46:36","0","253","<p>I have an ExpandaleList, and BaseExpandableListAdapter which I implements.</p><p>Now sometimes I need to show other xml content, So i am trying to do:</p><p>ExpandableList.this.setContentView(R.layout.errorscreen);</p><p>but then I get this exception:  ERROR/AndroidRuntime(23948): java.lang.RuntimeException, Your content must have a ExpandableListView whose id attribute is 'android.R.id.list'.</p><p>Now, I have been told to do this in order to fix it:</p><pre><code>add  ExpandableListView to your xml layout and set it's id to list. Like so:     &lt;ExpandableListView android:id=""@id/android:list"" android:layout_width=""fill_parent""android:layout_height=""fill_parent""/&gt;</code></pre><p>But I have no idea how to do it programmaticly, anyone could show me any example?</p><p>thanks,</p><p>ray.</p>","260511","","260511","","2010-12-09 07:59:37","2010-12-09 08:50:55","Change ExpandableList view programmaticly","<android>","1","0","1","",""
"4396009","1","","","2010-12-09 07:50:01","0","268","<p>I have a problem and need to resolve as soon as possible. I want to expose light image in android (processing image). But I can only adjust the Hue, or Brightness. Please help me!</p><p>Thanks!</p>","397849","","752878","","2012-08-24 17:52:36","2012-08-24 17:52:36","How to expose (light) image in android?","<android><image><image-processing><exposed>","2","5","","",""
"4396046","1","4396749","","2010-12-09 07:57:04","33","25565","<p>I want to develop an Speech recognizer in android, which should work in offline. As the android's built-in speech recognizer uses google server which needs internet, i want an alternative which works in the absence of internet.</p><p>Please suggest me some way to achieve the above feature.</p>","466549","","319204","","2013-09-02 03:35:27","2014-01-09 05:47:53","Android: Speech Recognition without using google server","<android><speech-recognition><offline>","5","2","18","",""
"4396059","1","","","2010-12-09 07:59:25","26","41509","<p>How to simulate a touch event with Android while giving the X and Y coordinates manually?</p>","536091","","31671","","2012-08-09 07:04:44","2014-03-12 12:39:40","How to simulate a touch event in Android?","<android>","8","1","14","",""
"4396221","1","4397835","","2010-12-09 08:26:22","3","2352","<p>I have a tab bar inside my app and to maintain it I have used activity group. On clicking these tabs I have to show a set of activities. My problem is I am not able to show an alert dialog or any other dialogs inside these activities. An error occurs saying ""unable to add window"". Can anyone tell how to solve this issue?</p>","504162","","","","","2013-05-26 01:36:19","how to show alert inside an activity group?","<android>","1","0","1","",""
"4396305","1","","","2010-12-09 08:41:58","1","85","<p>Hi i have an autocompltetextview but default filtering is not good for me,</p><p>eg The string ""hum"" should match to Hohum Plumbing, Humphrey Bogart, and Robert Mitchum .but currently it is not happening  </p><p>Currently am passing arraylist and create adapter.now i can customize the filtering </p>","487219","","487219","","2010-12-10 09:00:49","2010-12-10 09:00:49","Android Autocomplte Textview Filtering","<android>","2","0","","",""
"4396322","1","","","2010-12-09 08:45:15","4","680","<p><p>When I start typing in the name of the species I am looking for the jQuery autocomplete widget comes with a dropdown and some results. Great!!</p><p> The only problem is that when I select an item from the list the ""input element that is located under that list item gets activated"". And results in an android native dropdown over the top. I have tried to use z-indexes on the autocomplete results box and on the input elements. Neither work.</p> <p>Any ideas anyone?</p></p>","533161","","","","","2011-06-26 09:59:02","Input under jQuery autocomplete results gets activated when selecting from result","<jquery><android><autocomplete><input><z-index>","2","0","","",""
"4396376","1","4396400","","2010-12-09 08:53:50","9","28272","<p>i want to get the edittext value and view it on the textview while click the button.and also want to know about what modifications can be done on the string.xml file</p>","535020","","","","","2013-03-17 13:43:16","how to get edittext value and store it on textview","<android><textview><edittext>","7","1","","",""
"4396408","1","4470513","","2010-12-09 08:58:12","8","4612","<p>I just can't find the <code>help.py</code> file in order to create the API reference for the <code>monkeyrunner</code>. The command described at the <a href=""http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html#Help"">Android references</a></p><p><code>monkeyrunner &lt;format&gt; help.py &lt;outfile&gt;</code> does not work when i call <code>monkeyrunner html help.py /path/to/place/the/doc.html</code>.</p><p>It's quite obvious that the <code>help.py</code> file is not found and the monkeyrunner also tells me ""Can't open specified script file"". But a <code>locate</code> on my system doesn't bring me a help.py file that has anything to do with monkeyrunner or Android.</p><p>So my question is: Where did they hide the help.py file for creating the API reference?</p>","422060","","","","","2012-12-14 21:51:35","Where is the help.py for Android's monkeyrunner","<python><android><testing>","5","0","3","",""
"4396450","1","","","2010-12-09 09:05:18","0","609","<p>is there any possibility to intercept when a user clicks on a html button? I ve an webviewclient that load a login page with two buttons. Allow and Deny. I would you like to intercept when the deny button is pressed. (Deny and allow have the same basUrl and a js do the correct redirect).</p><p>thanks in advance</p>","501696","","","","","2012-04-10 22:04:48","Intercept html button click","<android><webview><webviewclient>","2","0","","",""
"4396537","1","4396585","","2010-12-09 09:16:18","0","664","<p><br>I wish to create an application in Android which can show the trains(details like train number, time, date, etc.) passing through a station, whose name will be clicked from a list by the user.   </p><p>Please guide me with some pointers on how to implement this.  </p><p>Thanks,<br>Sen </p>","449378","","","","","2010-12-09 09:27:19","A Railway Timetable Application in Android","<android>","2","0","2","2013-01-10 15:37:52",""
"4396604","1","","","2010-12-09 09:24:55","2","6096","<p>Now I am working json Application using sqllite for stored all json values.The values are stored correctly and i am fetching data for sqllite below error is occurred please help me...</p><pre><code>12-09 13:51:22.808: ERROR/AndroidRuntime(217): Uncaught handler: thread main exiting due to uncaught exception12-09 13:51:22.808: ERROR/AndroidRuntime(217): android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 512-09 13:51:22.808: ERROR/AndroidRuntime(217):     at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:172)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:41)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at ez.com.Action_module_screen.setListval1(Action_module_screen.java:1059)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at ez.com.Action_module_screen$4.handleMessage(Action_module_screen.java:695)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at android.os.Handler.dispatchMessage(Handler.java:99)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at android.os.Looper.loop(Looper.java:123)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at android.app.ActivityThread.main(ActivityThread.java:4203)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at java.lang.reflect.Method.invokeNative(Native Method)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at java.lang.reflect.Method.invoke(Method.java:521)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)12-09 13:51:22.808: ERROR/AndroidRuntime(217):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>This is my source:</p><pre><code>                  Cursor curser=myDB.rawQuery(""select * from ""+TABLE_NAME+"""",null);  if(curser.moveToFirst())     {      int k=0;      System.out.println(""enter first"");      do        {      System.out.println(""enter second"");      if(status1==true)      {      System.out.println(""enter third"");       for(int i=0;i&lt;items.length;i++)       {      System.out.println(""item""+items.length);      System.out.println(""enter fourth"");      Cursor dbcur = myDB.rawQuery(""select * from ""+TABLE_NAME+"" where Status='""+items[i]+""'"", null);      System.out.println(""enter fifth"");      int title=curser.getColumnIndex(""Title"");      String tit=curser.getString(title);      System.out.println(""value""+tit);     /* String title1=dbcur.getString(dbcur.getColumnIndex(""Title""));      System.out.println(""title""+title1);      String name1=dbcur.getString(dbcur.getColumnIndex(""Name""));      System.out.println(""name""+name1);      String open1=dbcur.getString(dbcur.getColumnIndex(""Open""));      System.out.println(""open""+open1);      String close1=dbcur.getString(dbcur.getColumnIndex(""Close""));      System.out.println(""close""+close1);      String no1=dbcur.getString(dbcur.getColumnIndex(""No""));      System.out.println(""no""+no1);      no.add(no1+"",""+k);   first.put(no1+"",""+k, title1);   second.put(no1+"",""+k,name1);   third.put(no1+"",""+k, open1);   fourth.put(no1+"",""+k,close1);   k=k+1;    mylist=sorting(no,1,true);  */     }       }        }while(curser.moveToNext());     }    curser.close();  myDB.close();           }</code></pre>","533787","","216517","","2010-12-09 10:10:15","2013-03-16 07:28:49","how to solve CursorIndexOutOfBoundsException","<android>","3","0","2","",""
"4396677","1","4396870","","2010-12-09 09:32:21","8","12829","<p>I developed an application. I would like to remove space that is used for showing application name on top of my application UI. (The Title Bar)</p><p>I set Application label as null In manifest File But it will not remove the space for showing Application name</p><p>Please tell me what is the correct or possible way to do that</p><p>Thanks in advance</p>","482604","","216517","","2010-12-09 10:08:35","2014-04-16 20:18:41","how to Remove the space for showing Application name","<android><android-manifest>","3","2","5","",""
"4396690","1","","","2010-12-09 09:33:49","0","1244","<p>my application has stored some images i want to store that images in the webserver from my android mobile</p>","535020","","","","","2010-12-09 12:20:54","how to connect webserver from android mobile","<android><webserver>","2","0","","",""
"4396742","1","","","2010-12-09 09:39:53","1","763","<p>I'm planning to implement a simple VOIP feature, using the new android.net.sip in Android 2.3, as an extra feature of an existing Android application. Earlier, i.e. before 2.3, I tried to do a naive solution but I could not connect the other mobile phone because of the carrier network operator's firewalls!</p><p>So, I wonder, how does this new SIP package in Gingerbread bypass those firewalls, allowing mobile phones to connect directly to each other? Or will there be problems anyway? (I scanned Googles Android documentation but could not find any information on this topic.)</p><p>Thanks in advance!<br>/Steve</p>","536197","","","","","2010-12-17 20:35:54","How does android.net.sip bypass firewalls?","<android><firewall><sip>","1","0","1","",""
"4396745","1","4396776","","2010-12-09 09:40:06","0","168","<p>My requirement is that i need to change all the images and colors at run time. But as far as i know the images needs to be in the drawable folders. So my question is, after i export the apk file will i be able to download the images from a server through the application and set them as the images in the app? </p><p>For an example, lets say i have a linear layout with a background image which is in my drawable folder. After installing the app in the device can i download an image from a server and set it as the background of the linear layout?</p><p>I hope i have made the question clear. Any help would be greatly appreciated. </p><p>Thanks in advance. </p>","511737","","","","","2010-12-09 09:44:13","Dynamic Branding on Android","<java><android><themes><branding>","1","0","","",""
"4396844","1","4397489","","2010-12-09 09:52:08","6","5275","<p>I am getting following Exception on Android 2.2.1:</p><p><code>java.lang.NoSuchMethodError: java.lang.String.isEmpty</code></p><p>I am calling <code>text.isEmpty</code> from Scala. Any idea, how to solve this?</p>","121968","","","","","2013-03-14 13:04:47","Scala on Android: java.lang.NoSuchMethodError: java.lang.String.isEmpty","<android><exception><scala><dalvik><nosuchmethoderror>","4","1","","",""
"4396939","1","4397061","","2010-12-09 10:01:45","1","454","<p>I am drawing on Canvas about who is on turn now. I am using validate() twice to invalidate the screen and drawing text again. But with invalidate() I am redrawing all board, which last quite a long, is there any way how to invalidate just this part of Canvas?</p><p>Thanks</p><p>Hmyzak</p>","513956","","","","","2010-12-09 10:15:32","Android - drawText invalidate","<android><drawtext>","1","0","1","",""
"4397011","1","4397094","","2010-12-09 10:09:18","0","914","<p>I have a simple ListView with 1 dip border around cells. But depending on position they renders as 1 ?r 2 pixel height. As I understand it is due to antialiasing - 1 dip line renders as 1 pixel only if it has precisely integer position. But in ListView scrolling position have floating point representation so line width jittering occurs during scroll even if cell heights are exactly integer.</p><p>Is there any way to do ""pixel snapping"" in such situation?</p>","146593","","","","","2010-12-09 10:20:03","Android antialiasing and pixel snapping","<android><android-layout><pixel><antialiasing><snap>","1","0","","",""
"4397088","1","4397127","","2010-12-09 10:19:41","1","1508","<p><strong>Hi All</strong>I m making an application in android 2.2 it layout has some text fields in linear layout and also some <strong>image Buttons</strong> at the botton of the page. its view on Portrait View is Perfect but now when i turn to Landscape view by pressing CTRL+F11 its bottom Image Buttons do no display.. just bcouse the screen size in landscape is diferent that of portrait.</p><p>what i want is to please guide me through code that if my mobile go to landscape mode it checks its mode and change the location of the buttons so that the image buttons shoudl be visible. </p><p>please please please friends help me in this.. </p><p>waiting for ur positive response and guide.. Thanks in advance</p>","521015","","","","","2010-12-09 11:48:22","Help in Android Landscape and Portrait Modes","<android><landscape>","2","0","","",""
"4397089","1","","","2010-12-09 10:19:51","4","2194","<p>i noticed that ADB.exe moved to platform-tools on Android 2.3 SDK and added it to the path so thats fine. But now, even with all tools and Eclipse plugin updated, my R.java does not get generated and the AIDL files get not converted into stub classes -> ergo the whole gen folder is empty (even if i delete the whole folder or clean my project). Our build is broken due to this and i want to ask if someone had/has the same experience and maybe some solution to this problem?</p><p>thanksRobert</p>","536245","","","","","2011-03-12 19:20:42","R.java not getting generated and AIDL files not getting compiled in Android SDK 2.3","<android><sdk>","2","6","","",""
"4397163","1","16188448","","2010-12-09 10:26:10","1","1983","<p>i want to show Video Thumbnails in GridView</p><pre><code>private void initVideosId() {        try        {            //Here we set up a string array of the thumbnail ID column we want to get back            String [] proj={_ID};            // Now we create the cursor pointing to the external thumbnail store            _cursor = managedQuery(_contentUri,                    proj, // Which columns to return                    null,       // WHERE clause; which rows to return (all rows)                    null,       // WHERE clause selection arguments (none)                    null); // Order-by clause (ascending by name)            int count= _cursor.getCount();            if(count==0)                showToast(""meiyou"");            // We now get the column index of the thumbnail id            _columnIndex = _cursor.getColumnIndex(_ID);            //initialize             _videosId = new int[count];            //move position to first element            _cursor.moveToFirst();                      for(int i=0;i&lt;count;i++)            {                           int id = _cursor.getInt(_columnIndex);                //                _videosId[i]= id;                //                _cursor.moveToNext();                //            }        }catch(Exception ex)        {            showToast(ex.getMessage().toString());                  }    }  public View getView(int position, View convertView, ViewGroup parent)     {        ImageView imgVw= new ImageView(_context);;        try        {            if(convertView!=null)            {                imgVw= (ImageView) convertView;            }            imgVw.setImageBitmap(getImage(_videosId[position]));            imgVw.setAdjustViewBounds(true);            imgVw.setBackgroundColor(Color.WHITE);            imgVw.setLayoutParams(new Gallery.LayoutParams(150, 100));            imgVw.setPadding(5,5,5,5);            imgVw.setScaleType(ImageView.ScaleType.FIT_CENTER);        }        catch(Exception ex)        {            System.out.println(""StartActivity:getView()-135: ex "" + ex.getClass() +"", ""+ ex.getMessage());        }        return imgVw;    }private final static Uri MEDIA_EXTERNAL_CONTENT_URI = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;    private final static String _ID = MediaStore.Video.Media._ID;    private final static String MEDIA_DATA = MediaStore.Video.Media.DATA;but the result is : called showToast(""meiyou"");</code></pre><p>i want to know if analog machine cannot have Video Thumbnails?if yes how to insert Video Thumbnails so that i can debug.anf give me:: </p><pre><code>ERROR/AndroidRuntime(290):java.lang.ClassCastException:android.widget.AbsListView$LayoutParamsERROR/AndroidRuntime(290):at android.widget.Gallery.setUpChild(Gallery.java:769) ERROR/AndroidRuntime(290): at android.widget.Gallery.makeAndAddView(Gallery.java:738)ERROR/AndroidRuntime(290):     at android.widget.Gallery.layout(Gallery.java:622)ERROR/AndroidRuntime(290): at android.widget.Gallery.onLayout(Gallery.java:336) ERROR/AndroidRuntime(290):     at android.view.View.layout(View.java:7035)ERROR/AndroidRuntime(290):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249) ERROR/AndroidRuntime(290):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125): ERROR/AndroidRuntime(290):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042): ERROR/AndroidRuntime(290):     at android.view.View.layout(View.java:7035) ERROR/AndroidRuntime(290):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)</code></pre>","233618","","233618","","2010-12-09 11:37:14","2013-04-24 09:32:52","Video Thumbnails","<android>","1","0","1","",""
"4397192","1","","","2010-12-09 10:28:55","4","8827","<p>I need to draw Pie Chart (Dynamic Values).How to create the Chart without using 3rd party API.</p>","512192","","","","","2014-02-18 08:23:18","Draw Pie Chart in Android?","<android>","4","0","4","",""
"4397205","1","4452777","","2010-12-09 10:29:57","1","1153","<p>I have created a custom text view just to solve the problem in <a href=""http://stackoverflow.com/questions/4395309/android-want-to-set-custom-fonts-for-whole-application-not-runtime"">my previous question</a></p><p>I have gone through many tutorials and many samples. I have created a custom text view but it can not be added into any layout file. It just throws an error on layout file stating that the class is not found. However I have written the same class.</p><p>What i want to know is what should i need to take care when i am creating a custom text view? My only requirement to create a custom text view to have the arial fonts in all text views i use. And extend this facility for button views also.</p><p>Thanks</p>","246942","","","","","2010-12-15 17:11:08","android custom text view can not be added in layout file","<android><custom-controls>","1","0","","",""
"4397231","1","","","2010-12-09 10:32:54","3","7858","<p>I am developing an android application,In my application,I have one image view,I want to determine long press listener on image view,when will i long press on image i want to vibrate device.How is possible?Thanks all</p>","500595","","","","","2012-09-25 20:57:03","How is determine long press listener on image view?","<android>","2","0","1","",""
"4397249","1","4452471","","2010-12-09 10:35:15","10","2057","<p>Bizarrely, the iPad can handle up to 11 points of contact on the touch screen and interpret them successfully, leading to some <a href=""http://techchunks.com/technology/plants-vs-zombies-play-multitouch-game-on-the-ipad-with-11-fingers-video/"">interesting games</a>.</p><p>Reference: <a href=""http://www.liewcf.com/ipad-tablet-multitouch-fingers-5202/"">http://www.liewcf.com/ipad-tablet-multitouch-fingers-5202/</a></p><p>Android devices don't have a unified limit on how many fingers they track. Instead, it varies from device to device and can be anything from two-touch on older devices to five fingers on some newer devices. </p><p>Any theories, however clever, on how one might fudge extra fingers on the Android?</p>","175051","","","","","2012-12-12 05:49:14","Using iPad with 11 Fingers... Extend Android's limit in Code","<iphone><android><ipad><touchscreen>","3","1","1","",""
"4397252","1","4397275","","2010-12-09 10:35:43","0","469","<p>How to  call startActivityForResult() method in back button,and please give me sample on how to result will back to calling activity?If not possible is there any way to like this?</p><p>Regards,Rajendar</p>","486216","","","","","2010-12-09 11:12:12","how to call startActivityForResult from back button android?","<android>","1","0","","",""
"4397349","1","","","2010-12-09 10:45:08","1","550","<p>An activity is supposed to be able to provide context information to a content provider like this:</p><pre><code>@Overridepublic boolean onSearchRequested() {    Bundle appSearchData = new Bundle();    appSearchData.putByte(""category"", category);    startSearch(null, false, appSearchData, false);    return true;}</code></pre><p>Search suggestions and results from the provider should be limited to 'category', but I can't find where to access the appSearchData bundle from my ContentProvider.</p>","509904","","","","","2011-01-07 23:51:29","Accessing appSearchData bundle from ContentProvider","<android><search><android-contentprovider>","1","1","1","",""
"4397358","1","4397372","","2010-12-09 10:46:13","5","1068","<p>I want to know whether the XML layout attribute <code>android:layout_toLeftOf</code> is specific to a layout or it can be used with any layout? Please help.</p><p>Regards &amp; Thanks.</p>","476747","","","","","2010-12-09 10:48:10","Android XML layout attribute android:layout_toLeftOf","<android><layout>","2","0","","",""
"4397360","1","4397470","","2010-12-09 10:46:15","0","499","<p>Does anyone know in android how you can call a non static public function of an activity from another activity ?</p><p>example : activity A want to access public function toto of activity B</p><p>thanks</p>","429222","","","","","2010-12-09 11:05:22","android: how to access from activity A a non static public function of activity B at runtime?","<android><function><activity>","1","1","","",""
"4397443","1","","","2010-12-09 10:55:43","1","1741","<p>I applyed a TranslateAnimation to an EditText with the FillAfter=true in order to keep its position at the end of the animation.The animation works properly but the problem is that I can't enter to the edittext anymore.I think it's due to the fact that the animation affects only the rendering without modifying the actual view coordinates.</p><p>Is there any possibility to maintain the final coordinates with the edittext normally working?</p><p>Thanks,Daniele</p>","536293","","536293","","2010-12-09 16:13:53","2011-10-28 12:42:39","How can I apply the changes to the position of a view after an animation?","<android><animation><coordinates><edittext>","1","0","","",""
"4397500","1","","","2010-12-09 11:03:33","0","125","<p>I've got such an issue on hand.  And I'm pretty sure that this has nothing to do with the DEVICE_PROVISIONED flag( though this flag will be changed at the first boot when user goes throw the setup wizard.) And If I remove the SetupWizard apk from system img, This issue is gone. So I wonder what other specials the set up wizard has done. One thing is that It kissed(by sending a SIG 9) and disabled itself after it's done. Anyone got other details? Thank you!</p>","536296","","","","","2010-12-09 11:03:33","How could a bug come out only at the first boot-- probably the SetupWizard's fault?","<android>","0","2","","",""
"4397547","1","","","2010-12-09 11:10:16","1","3413","<p>Im having activity A listening for someone shaking the device. This can happen even when the user is on activity B. When the device is being shake, i need to display a progress dialog and i so need the correct context. Like the shake function is in activity A, its appear that sometimes 'this' keyword that I use for the context is not correct (as i guess its activity B as the correct context) and i get kind of window exception bad token...</p><p>I resume...Activity B is foreground. User shake the device. Activity A is reacting to the shake and want to display something but activity A is not currently foreground. Activity A that is using 'this' keyword as the current context is sometimes crashing with window exception bad token. How can i get a correct and stable context ?</p><p>thanks for any device.</p>","429222","","","","","2010-12-09 12:27:21","android : how to access the current context from an activity that is not foreground?","<android><context>","2","0","","",""
"4397592","1","","","2010-12-09 11:16:42","0","443","<p>i want to store images which is in android application it is send to webserver .The server side is php language .i want to type any php coding for this?</p>","535020","","","","","2010-12-09 12:14:16","connecting webserver to android mobile","<php><android><webserver>","1","1","","",""
"4397677","1","4398017","","2010-12-09 11:28:07","2","460","<p>I am porting an app from iPhone to Android and I was wondering what the best way was to make this screen in Android?</p><p><img src=""http://i.stack.imgur.com/zs8fM.png"" alt=""alt text""></p><p>The places where it sais ""optioneel"" and where the phonenumbers are must be editable like this:</p><p><img src=""http://i.stack.imgur.com/JTHim.png"" alt=""alt text""></p><p>This is what I've come up with so far:</p><p><img src=""http://i.stack.imgur.com/nwCAv.png"" alt=""alt text""></p><p>So how can I make these 'editable listview' things in Android?</p>","517460","","","","","2010-12-09 12:12:13","How can i make this kind of View (from iPhone) in Android?","<iphone><android><gui><listview>","3","2","","",""
"4397757","1","4397863","","2010-12-09 11:36:49","5","14367","<p><strong>EDIT,Changed the code slightly based on answers below, but still haven't got it working. I also added a log message to tell me if getCount was returning > 0, and it was, so i supect somthing might be wrong with my query? or my use of the cursor..</strong></p><p>I've created a table, and i want to check if its empty or not, if it's empty i want to run some insert statements (that are stored in an array).</p><p>Below is my code, while i have no errors, when i pull the .db file out i can see that it doesn't work. How would you approach this problem? </p><pre><code>public void onCreate(SQLiteDatabase db) {        Log.i(""DB onCreate"", ""Creating the database..."");//log message        db.execSQL(createCATBUDTAB);        db.execSQL(createTWOWEETAB);        try{            Cursor cur = db.rawQuery(""SELECT COUNT(*) FROM CAT_BUD_TAB"", null);        if (cur.getCount() &gt; 0){            Log.i(""DB getCount"", "" getcount greater than 0"");//log message            //do nothing everything's as it should be        }        else{//put in these insert statements contained in the array            Log.i(""DB getCount"", "" getcount less than 0, should read array"");//log message            for(int i=0; i&lt;13; i++){                db.execSQL(catInsertArray[i]);            }        }        }catch(SQLiteException e){System.err.println(""Exception @ rawQuery: "" + e.getMessage());}    }</code></pre><p>Sorry if this is a pretty stupid question or approach, i'm new to all this. Any answers much appreciated!</p>","523874","","523874","","2010-12-09 12:19:43","2014-02-12 21:07:34","How can i check to see if my sqlite table has data in it?","<java><sql><android><database><sqlite>","8","0","4","",""
"4397814","1","4397884","","2010-12-09 11:42:01","1","1639","<p>When I put a view on a layout, it automatically has some padding/margin on it.</p><p>See this picture:</p><p><img src=""http://i.stack.imgur.com/03V4M.png"" alt=""alt text""></p><p>The red rectangle show the space that the button takes.  Note the empty space between the button and the red lines.  That's the space in question.</p><p>What controls that space and how to I change it ?</p><p>It's messing up my lisview's button alignments!</p><p>The code for that layout:        </p><pre><code>    &lt;Button         android:text=""@+id/Button01""         android:id=""@+id/Button01""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""/&gt;    &lt;Button         android:text=""@+id/Button02""         android:id=""@+id/Button02""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre>","466771","","","","","2010-12-09 11:52:34","What controls the default padding between views?","<android>","1","0","","",""
"4397877","1","4398000","","2010-12-09 11:51:36","0","878","<p>What is the use of shadow in Android?<br>How do I implement shadow in thumbnails?<br>If someone has a sample screenshot, do you mind sharing it?</p>","486554","","834063","","2012-11-15 01:19:54","2012-11-15 01:19:54","what is the use of shadow","<android><shadow><thumbnails>","2","0","","",""
"4397987","1","4398606","","2010-12-09 12:06:05","2","3286","<p>There is one activity in my program ""A1"".In A1 onCreate i use intent to call android's activity (""A2""):</p><pre><code>Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,                ContactsContract.CommonDataKinds.Phone.CONTENT_URI);        startActivityForResult(contactPickerIntent, 1010);</code></pre><p>when user picks a contact i want to use contact's information in A1.Everything is ok, but...</p><p>When i use ""home button"" in A2, A1 and A2 stil in memory, and if OS kill A1 (or i can do it from task manager), A2 is stil running and when i start my program i see an OLD A2, and when i pick a contact i cant see result in A1, because NEW A1 is started and it calls for NEW A2.</p><p>The question is: how can i kill A2, when somebody kills A1 from memory.</p>","527808","","","","","2010-12-09 13:33:38","Finish child activity when parent activity stops","<android><activity>","2","0","","",""
"4398122","1","4398574","","2010-12-09 12:20:43","1","811","<p>I have followed tutorial <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">here</a> about Tab view. Each Tab have now an image but when I select some tab then it doesnt got replaced with dark image. Is there some trick that I am missing. Forexample code for one tab is </p><pre><code> spec = tabHost.newTabSpec(""create"").setIndicator(""Create"",                          res.getDrawable(R.drawable.testimg))                      .setContent(intent);        tabHost.addTab(spec);</code></pre><p>Then I created <code>create.xml</code> with following contents</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;!-- When selected, use grey --&gt;    &lt;item android:drawable=""@drawable/testimg2""          android:state_selected=""true"" /&gt;    &lt;!-- When not selected, use white--&gt;    &lt;item android:drawable=""@drawable/testimg"" /&gt;&lt;/selector&gt;</code></pre><p>So when I select Create tab then its image should have been replaced by testimg2.png but it is not happening. Rest of the code is similar as tutorial.What am I missing here that selected image is not being toggled.</p><p>Thanks</p>","340002","","","","","2010-12-09 13:12:14","Tab View Selected image not working","<android><tabview>","1","0","0","",""
"4398125","1","4398208","","2010-12-09 12:20:56","2","274","<p>I need to toggle existing android contacts to favourite. I have a toggle button which is suppose to set/unset current contact as favourite.</p><p>Any help regarding this is appreciated.</p><p>Thanks in advance.</p>","536379","","","","","2010-12-09 12:30:31","How to set contact as favourite through coding?","<android>","1","0","1","",""
"4398194","1","","","2010-12-09 12:29:18","0","414","<p>I'm calling context.startActivity(intent) from within a seperate OnClickListener class.  In order for this to work I had to set the FLAG_ACTIVITY_NEW_TASK on the intent.</p><p>That all works as expected, but I'm wondering if there are any implications to doing this that I'm not aware of. Will this create any problems in terms of performance? Does it reflect poor design on my part?</p><p>What do you think?</p>","398293","","","","","2011-09-16 11:49:04","Implications of setting a flag on the Intent","<android>","1","0","","",""
"4398276","1","4406081","","2010-12-09 12:38:39","1","1418","<p>I need to use tamil on textviews in my app so I create a TypeFace fromassets and set it to the textview, but the characters appear out of order(mixed) for combined characters. I load the strings from the resources.(string.xml in utf-8 encoding)How to solve this issue? </p>","536413","","","","","2011-02-14 15:57:10","Incorrect characters displayed for Tamil font in android(Latha.ttf)","<android><fonts><textview><tamil><typeface>","2","1","","",""
"4398360","1","4398398","","2010-12-09 12:48:45","3","1334","<p>I have a edit text field in which reason can be entered. But if a person enters all spaces in the reason how can I detect it. Is there a way when a person enters all spaces or nothing , i have to save the text the text as a simple ""hiphen"". My main question is how to trim those spaces coming at the end. </p>","450487","","","","","2010-12-10 05:48:50","Trim text- when lot of space keys are entered at end","<java><android><trim>","3","0","","",""
"4398409","1","","","2010-12-09 12:54:18","2","378","<p>I have search functionality in my app. When the search bar is invoked from a ""show activity"" and the user performs a search, I want to finish the show activity and take the user to the search activity. Is there a way to know if SearchManager.onDismissListener is invoked because of a search being performed?</p><p>What I want to avoid is to have several screens of search results > show > search results > show etc, and rather ""go back"" to search results whenever a search is performed, and thus only have one search activity and one show activity in the stack at any one time.</p>","184844","","","","","2011-05-09 21:28:09","How can I finish the current activity when performing a search in Android?","<android><search><activity><android-searchmanager>","1","0","1","",""
"4398412","1","","","2010-12-09 12:54:36","6","3964","<p>When I use MapController.setZoom(x) and, for instance, zoom from level 5 to 15 the zoom is perform very fast and often the map tiles of the new level are not loaded.</p><p>This does not look so good to the user. Any Maps build in function to change this to a more slow zoom so tiles can be loaded, or at least almost loaded, before level 15 is reached?</p><p>Best regards</p><p>P</p>","274426","","","","","2011-06-10 15:31:37","Smooth zoom in mapview","<android><google-maps><zoom>","2","1","2","",""
"4398523","1","4398644","","2010-12-09 13:07:04","12","4608","<p>how we can remove a file from the assets folder at runtime? Is it even possible?</p>","516985","","","","","2010-12-09 13:29:18","how we can remove a file from the assets folder at runtime in android?","<android>","1","0","5","",""
"4398575","1","4398726","","2010-12-09 13:12:23","2","2695","<p>I am having a bit of difficulty understanding the concepts of how SQLite databases work in android. I have created a DatabaseHelper.java class which is as follows:</p><pre><code>import android.content.Context;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;public class DatabaseHelper extends SQLiteOpenHelper {    private static final String DATABASE_NAME = ""library.db"";    public static final String TITLE = ""title"";    public static final String MUSICTITLE = ""musictitle"";    public static final String AUTHOR = ""author"";    public static final String ARTIST = ""artist"";    public DatabaseHelper(Context context) {        super(context, DATABASE_NAME, null, 1);    }    @Override    public void onCreate(SQLiteDatabase db) {        db.execSQL( ""CREATE TABLE music (_id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, artist TEXT);"");        db.execSQL( ""CREATE TABLE books (_id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, author TEXT);"");        db.execSQL( ""CREATE TABLE movies (_id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT);"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        android.util.Log.v(""Constants"",                ""Upgrading database which will destroy all old data"");        db.execSQL(""DROP TABLE IF EXISTS books"");        db.execSQL(""DROP TABLE IF EXISTS music"");        db.execSQL(""DROP TABLE IF EXISTS movies"");        onCreate(db);    }}</code></pre><p>As far as i'm aware this does work and has been checked using the adb console. </p><p>My question is how do I query this database within the app from a different activity, for example I want in my app to query the database: SELECT title FROM books; which will return me the titles from the book table, how do I go about connecting to the database, running this query then storing all the results into an array?</p><p>----------------------------------Edit----------------------------------------</p><p>Right so in the part where I want to query I have placed this code:</p><pre><code>if (category.equals(""Books"")){            img.setImageResource(R.drawable.book);            ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();            dh = new DatabaseHelper(this);            SQLiteDatabase db = dh.getReadableDatabase();            Cursor cursor = db.query(""books"", new String[] { ""title"" }, null, null, null, null, ""title desc"");            if (cursor.moveToFirst()) {                do {                    list.add(cursor.getString(1));                } while (cursor.moveToNext());            }            if (cursor != null &amp;&amp; !cursor.isClosed()) {               cursor.close();            }            list.add(""Test"");            cont_array = (String[]) list.toArray();            db.close();        }</code></pre><p>Which passes the Category down prom the previous activity. From Olivier's answer. This code crashes the application and I have no idea why. the variable cont_array is used after this if statement to populate a ListView. Anybody got any ideas where I am going wrong, there is nothing in LogCat to tell me where it is failing?</p>","400406","","400406","","2010-12-09 14:48:54","2010-12-09 14:48:54","SQLite database in android and java","<java><sql><android><sqlite>","3","0","","",""
"4398582","1","4398617","","2010-12-09 13:13:38","0","311","<p>How to get the current location using IP Address?</p>","480716","","1755","","2010-12-09 13:55:26","2010-12-09 15:46:11","Android : How to location the application?","<android><geolocation><ip-address>","2","1","","",""
"4398586","1","4398619","","2010-12-09 13:14:06","0","96","<p>what is the use of transparent...which place its using for it...</p>","486554","","","","","2010-12-09 13:19:21","what is the use of transparent?","<android><transparent><thumbnails>","1","4","","2012-08-20 00:58:15",""
"4398599","1","","","2010-12-09 13:16:36","0","590","<p>I got list of checked contacts.However, i need to pass these selected contacts to another activity and display in edit Text.Please help.Thanks</p>","513658","","","","","2010-12-09 14:25:16","How to pass checked items to another activity?","<android><items><checked>","2","0","","",""
"4398661","1","8985119","","2010-12-09 13:24:52","0","370","<p>Hi friends  I have login page from login page if user click it will go to tab page .In tab page  I called activitygroup page from activity group page it will call home activity page .in home activity I will call webservices .when i click login it will come black screen for few mins it take time .that time I have to show splash screen for user upto tab bar loaded</p><p>I implemented but below code not working   style.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;style name=""Theme"" parent=""@android:style/Theme""&gt;   &lt;item name=""android:windowBackground""&gt;@drawable/quest&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt;</code></pre><p>androidmanifest.xml</p><pre><code> &lt;activity android:name="".HelloTabWidget""                   android:theme=""@style/Theme""&gt;      &lt;/activity&gt;   </code></pre><p>can anybody give sample code</p><p>thanks</p>","426344","","","","","2012-01-24 10:19:06","splash screen not working for activity group with tab bar in android","<android>","1","2","","",""
"4398834","1","","","2010-12-09 13:43:04","1","4786","<p>I am currently using the DDMS perspective to simulate movement of the android emulator with a gpx file.  However, I have only been able to find gpx files with lat/lon pairs in them and not with speed, altitude, etc.  Any recommendations on a place to find a good gpx file which contains the above data for emulator testing purposes?  Thanks.</p><p>Update : I've noticed that the file I am using does indeed have altitude in it, yet when I retrieve it it shows up as zero.  Only the lat/lon is showing up properly.  Can the android emulator only use the lat/lon of gpx files and not altitude?</p>","532933","","532933","","2010-12-09 14:21:57","2011-02-28 10:26:22","GPX file containing speed information","<android><android-emulator>","2","0","3","",""
"4398874","1","4409185","","2010-12-09 13:47:24","7","2221","<p>I am using the following C# source code to encrypt plain text using AES (ECB 256):</p><pre><code>public static string Encode(string PlainText){ byte[] Key = ASCIIEncoding.UTF8.GetBytes(""12345678901234567890123456789012""); string encrypted = null; RijndaelManaged rj = new RijndaelManaged(); rj.BlockSize = 256; rj.KeySize = 256; rj.Key = Key; rj.GenerateIV(); byte[] IV  = rj.IV; rj.Mode    = CipherMode.ECB; rj.Padding = PaddingMode.Zeros; try {  using (MemoryStream ms = new MemoryStream())  {   using (CryptoStream cs = new CryptoStream(ms, rj.CreateEncryptor(Key, IV), CryptoStreamMode.Write))   {    using (StreamWriter sw = new StreamWriter(cs))    {     sw.Write(PlainText);     sw.Close();     sw.Dispose();    }    cs.Close();    cs.Dispose();   }   byte[] encryptArray = ms.ToArray();   encrypted = (Convert.ToBase64String(encryptArray));   ms.Close();   ms.Dispose();  } } catch (Exception ex) {  throw ex; } finally {  rj.Clear(); } return encrypted;}</code></pre><p>And I need decrypt/encrypt data through same algorithm, but I don't know how.</p><p>Here my Java Class (<strong>not working</strong>):</p><pre><code> public static String encrypt(byte[] key, String cleartext, boolean base64) throws Exception {  byte[] rawKey   = key;  byte[] result   = encrypt(rawKey, cleartext.getBytes());  // Base 64  if (base64)   return toBase64(result);  // Hex  return toHex(result); } public static String decrypt(byte[] key, String encrypted)   throws Exception {  byte[] rawKey = key;  byte[] enc    = toByte(encrypted);  byte[] result = decrypt(rawKey, enc);  return new String(result); } private static byte[] encrypt(byte[] raw, byte[] clear) throws Exception {  SecretKeySpec skeySpec          = new SecretKeySpec(raw, ""AES"");  Cipher cipher                   = Cipher.getInstance(""AES/ECB/NoPadding"");  cipher.init(Cipher.ENCRYPT_MODE, skeySpec);  byte[] encrypted = cipher.doFinal(clear);  return encrypted; }</code></pre><p>Java call:</p><pre><code>encrypt(""12345678901234567890123456789012"".getBytes(), ""Example Message"", true);</code></pre><p>I dont know how I can select the block size or the <em>PaddingMode.Zeros</em> in Java.</p><p><strong>¿Any idea?</strong></p><p>Thanks in advance</p>","536484","","95573","","2010-12-09 13:53:26","2011-07-10 19:20:38","Encryption between Android and C#","<c#><java><.net><android><encryption>","3","3","4","",""
"4398907","1","","","2010-12-09 13:50:23","5","174","<p>I am trying to publish an app which can be used by other applications (meaning others apps can invoke my application to do some service for them). However I see that when I sign my app using my default.keystore and other application (who want to communicate with my app) which are signed by some other default.keystore cannot communicate or invoke my app. </p><p>If both my app and other app are signed with same keystore they are able to communicate.</p><p>Can you someone please guide me how can I sign an application and let other signed app invoke it?</p>","495013","","","","","2010-12-09 15:31:18","Android Signed Apps","<java><android><communication><self-signed>","1","3","2","",""
"4398958","1","4400932","","2010-12-09 13:57:33","3","839","<p>I've worked with OpenCV in combination with Android before and what I always tried to do is to use as few calls as possible between my native code and my java code. When I look at the OpenCV <a href=""http://code.google.com/p/android-opencv/"" rel=""nofollow"">port</a> for Android though, it seems like they just create a wrapper function for every native function and call these from java. Now unless I totally misunderstand the principal of swig wrappers and the whole idea of this port, won't this be a lot slower than doing the actual coding in native code? I noticed that passing data between native code and java code is really slow, so  I don't get why it seems to be the most normal thing in this port.</p><p>I did use it myself, but I just decided to ignore all the wrappers and use the code as it is and create my own wrapper using the normal way presented by Android tutorials. </p><p>So my question is, am I just wrong about the disadvantages? Or are they actually there and what is the real advantage of using OpenCV in this was? I know these questions are somewhat informal, but I hope you guys can help me out.  </p>","410647","","1104926","","2011-12-19 13:25:03","2011-12-19 13:25:03","Any disadvantages about the Android OpenCV port?","<android><opencv><swig><android-ndk>","1","0","","",""
"4399174","1","","","2010-12-09 14:17:53","0","313","<p>Is the functionality for fragmentation and reassembling concatenated SMS messages built in for the sendsendDataMessage() and the sendTextMessage() ? </p><p>In other words; If I put a arraybyte over 200 bytes as input to the sendDataMessage, will it be fragmented and reassembled automatically, so the getUserData() will give the same 200 bytes?</p>","500133","","","","","2011-06-18 08:47:08","Is it possible with concatinated data-SMS in Android?","<android><sms><concatenation>","1","0","","",""
"4399516","1","","","2010-12-09 14:52:47","0","419","<p>I am using sqllite for my search module.below code select single status value.how can select multiple status value in single query.........</p><p>This is My code:</p><pre><code> String sta=Search.status2; String doc=Search.document; String[] items=sta.split("",""); Cursor dbcur = myDB.rawQuery(""select * from ""+TABLE_NAME+"" where Status='""+items[i]+""'AND Ball_in='""+ball+""'"", null); if(dbcur.moveToFirst())     {      int k=0;      System.out.println(""enter first"");      do        {      String title1=dbcur.getString(dbcur.getColumnIndex(""Title""));      System.out.println(""title""+title1);      String name1=dbcur.getString(dbcur.getColumnIndex(""Name""));      System.out.println(""name""+name1);      String open1=dbcur.getString(dbcur.getColumnIndex(""Open""));      System.out.println(""open""+open1);      String close1=dbcur.getString(dbcur.getColumnIndex(""Close""));      System.out.println(""close""+close1);      String no1=dbcur.getString(dbcur.getColumnIndex(""No""));      System.out.println(""no""+no1);      no.add(no1+"",""+k);   first.put(no1+"",""+k, title1);   second.put(no1+"",""+k,name1);   third.put(no1+"",""+k, open1);   fourth.put(no1+"",""+k,close1);   k=k+1;    mylist=sorting(no,1,true);     }while(dbcur.moveToNext());     }     dbcur.close();  myDB.close();</code></pre>","533787","","244296","","2010-12-09 14:57:12","2010-12-09 14:59:59","How to select multiple value in single query","<android>","1","0","","",""
"4399517","1","","","2010-12-09 14:52:47","0","62","<p>I have discovered this strange bug on android while I was running my application. The thing is that after a while, one of my images couldn't be seen anymore. After I have changed it's name and updated the xml file with the new name, the image was displayed again. Does anybody know anything about this issue?</p><p>Thanks a lot,Gratzi</p>","460611","","","","","2010-12-09 15:14:46","Image can't be seen unless the name is changed","<android>","1","2","","",""
"4399547","1","4400730","","2010-12-09 14:55:34","1","406","<p>I need to work on the internals of android, especially create and test new kernel modules, native libraries and native application. Thus I need to create my own android disk image to use on android emulator. I'm looking for the source code for this operation, with all the tools and build programs to have a fully complete image with all standard applications. Does anyone know where I can found this (most of the source distribution are without build files, or dedicated to one platform) ?</p>","199148","","","","","2010-12-09 16:40:16","Create my own disk for Android emulator","<android><android-emulator><qemu>","1","2","","",""
"4399845","1","4399919","","2010-12-09 15:24:20","11","4799","<p>How do you show a loading icon in the activity titlebar?</p>","2172","","244296","","2010-12-09 16:06:32","2010-12-09 16:06:32","Show loading icon in the activity titlebar","<android><gui>","1","1","5","",""
"4399976","1","4400025","","2010-12-09 15:35:49","1","411","<p>I'm new to Android stuff. Currently I have someone else code in my hand and I'm trying to understand the functionality. Whoever wrote the code, used Handler and messages in it. For example, if a button is clicked, onClick listener is called which then posts a message to handler. Inside the handler there is a switch case statement which calls different methods based on a data passed in Message what attribute.</p><p>My question is, is this a correct approach or we should just call our method directly in the onClick handler.</p><p>As i understand, handler should be used to post a message to the main UI thread, from some other thread (worker thread which pulls data from server).</p>","260298","","","","","2010-12-09 16:58:45","Correct approach to update UI in Android","<android>","2","1","","",""
"4400013","1","","","2010-12-09 15:39:18","0","660","<p>this is my first question here, so if anything's wrong, do tell.</p><p>Now, I have a <code>public class MainMap extends MapActivity</code> which uses a <code>MyLocationListener</code> for the user's location and a <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">HelloItemizedOverlay</a>.I'm getting certain POI's from an XML-file which I want to add markers (pretty basic Overlays).</p><p>User presses a button, AsyncTask starts:</p><pre><code>private class GetPOITask extends AsyncTask&lt;String, Void, Void&gt; { protected Void doInBackground(String... params) {    clearMapOverlay();    if(!isBusyAddingOverlays)    {       connect(params[0]);    }    return null; } protected void onPreExecute() {  clearMapOverlay(); }}</code></pre><p>Clearing out the MapOverlay (this.mv is a MapView):</p><pre><code>public void clearMapOverlay() {  this.mv.getOverlays().remove(placesItemizedOverlay);  this.mv.postInvalidate();  this.mv.getOverlays().add(myLoc); }</code></pre><p>This is the method that my connect-method calls when I have enough information to add a marker:</p><pre><code>private void addOverlayToList(int id, GeoPoint point, String title, String description){ //Log.e(""Debug"", ""Adding overlay""); placesItemizedOverlay.addOverlay(new POIOverlay(id, point, title, description)); this.mv.getOverlays().add(placesItemizedOverlay);}</code></pre><p>That should be all the relevant code.</p><p>The problem is that when I add the POI's <em>and</em> zoom the map (or move it), I get a <code>ConcurrentModificationException</code>.</p><p>I've searched through this site, reading similar threads (<a href=""http://stackoverflow.com/questions/2870743/android-2-1-googlemaps-itemizedoverlay-concurrentmodificationexception"">this one</a> for example) but I can't really find what I'm doing wrong.</p><p>Knowing myself, it's probably something obvious.  </p><p>Thanks in advance,</p><p>iarwain</p>","525144","","525144","","2010-12-09 16:04:46","2011-02-12 23:05:31","ConcurrentModificationException in MapActivity","<android><android-mapview><concurrentmodification><mapactivity>","1","0","","",""
"4400133","1","","","2010-12-09 15:48:55","0","479","<p>This is a critical issue pertaining to an application we did. The code snippet attached here was working like a charm for the past several months. All of a sudden, it gives us the message in mediaplayer that video cannot be played.</p><p>Can anyone please suggest what need to be done, in order that this code will work for me by playing the video with no hassles.</p><p>Looking forward for your valuable comments, help and suggestions,</p><p>Please follow this link in order to view the code which was working perfectly -- <a href=""http://pastebin.com/NVT8eBC0"" rel=""nofollow"">http://pastebin.com/NVT8eBC0</a></p><p>Warm Regards,Rony </p><p><code></p><pre><code>import android.app.Activity;import android.media.MediaPlayer;import android.media.MediaPlayer.OnPreparedListener;import android.net.Uri;import android.os.Bundle;import android.widget.MediaController;import android.widget.VideoView;public class videoact extends Activity implements OnPreparedListener{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        MediaController mc = new MediaController(this);        VideoView vv = (VideoView)findViewById(R.id.VideoView01);        try        {         Uri ur = Uri.parse(""http://youtube.com/get_video?video_id=ZmX7zLCrcAI&amp;t=vjVQa1PpcFPmrj_j5y370BhPYfq3qHoWsFICYcBqEl4%3D&amp;asv=&amp;fmt=18"");         vv.setVideoURI(ur);         vv.setMediaController(mc);         vv.requestFocus();         vv.start();         mc.show();        }        catch(Exception e)        {         System.out.print(e.getMessage() + ""error"");        }    }public void onPrepared(MediaPlayer mp) {// TODO Auto-generated method stubmp.start();}}</code></pre><p></code></p>","264953","","1843560","","2013-05-27 10:47:25","2014-04-09 23:44:34","Youtube Video Playing issue in Android - Code Attached","<android><android-emulator><android-widget><youtube-api>","1","3","","",""
"4400351","1","","","2010-12-09 16:08:16","1","481","<p>I have a private online ticket system that has a RESTful interface to get a list of tickets, view their details and mark them as accepted, completed and invalid.</p><p>Now I want this app to be accessible from a very simple Android application, providing basically the same functionality as my web app, just with a leaner interface.</p><p>The problem that I stumbled upon as a novice Android developer was that I have no idea which of the many ways to go for synchronization of the tickets.The target of my application are Android 2.2+ based systems so there is at least AbstractSyncAdapter which wasn't clear to me how to use from the documentation.</p><p>Another possibility that came to my mind was simply setting up a scheduled task that would do the synchronisation at specific intervals.</p><p>Another problem is that I don't really understand how to use ContentProviders and how to specify custom content types (such as my ticket). Do I need these at all if I merely want to use my data from my own application?</p><p>What would be ideal is a reference to a decent open source project that has implemented something like this already.Apart from that any help is greatly appreciated.</p><p>Thanks.</p>","536683","","","","","2010-12-10 02:09:47","Finding the right way to sync on Android 2.2","<android><rest><synchronization>","1","0","2","",""
"4400399","1","4420786","","2010-12-09 16:12:18","0","1184","<p>I am doing the following code in order to listen for incoming SMS'sand it doesn't work, I never reach to the reciever class.</p><p><strong>I am Using i1 (Android 1.5)</strong></p><p>some code:</p><pre><code>  Manifest.xml: &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>    </p><pre><code>    &lt;receiver android:name="".SmsReceiver""&gt;        &lt;intent-filter&gt;             &lt;action android:name=""android.provider.Telephony.SMS_RECEIVED"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;    &lt;    &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;uses-permission android:name=""android.permission.RECEIVE_SMS"" /&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""&gt;&lt;/uses-permission&gt;</code></pre><p> </p><p>and this is the broadcaster class:</p><pre><code>        public class SmsReceiver extends BroadcastReceiver {@Overridepublic void onReceive(Context arg0, Intent arg1){    Log.d(""SmsReceiver"", ""I GOT THE SMS"");}</code></pre><p>}</p><p>After I send sms to my phone, the line above never printed on the Logcat.</p><p>Any idea what am I doing wrong?</p><p>thanks,</p><p>ray.</p>","260511","","260511","","2010-12-12 07:29:09","2010-12-12 08:07:26","Sms Listener doesnt respond","<android>","3","0","","",""
"4400569","1","","","2010-12-09 16:27:44","0","1914","<p>What is the best way to integrate a PDF document into my droid app?</p><p>I am attempting to recreate the same functionality we provide on our website in our mobile app.</p><p>I have 2 options of delivering the PDF to the device but the route I choose depends on the best way to implement this functionality on the device.  </p><p>I could stream the document do the client and store a local temp file for viewing OR I could simply provide an HTTP URI for the document and present it on the device.</p><p>My main question is, what is the best way to integrate PDF viewing on the DROID?  Can I check to see if they have Acrobat Viewer installed and make a call to the app, passing the URI data to it for loading?</p>","503511","","","","","2011-10-11 19:29:33","Embedded PDF's in a DROID App?","<android>","2","0","","",""
"4400677","1","4400724","","2010-12-09 16:35:42","3","720","<p>I have an activity for initialising a game, that does multiple selects and inserts from a number of SQLite tables.</p><p>I'm trying to understand AsyncTask, but, from all the examples I've read so far, I'm wondering if I am going to have to subclass AsyncTask for every single different data operation I need to do?</p><p>For example, my NewGame Activity does the following:</p><pre><code>1) Insert new player record into PLAYER table2) Insert new player's pet record into PET table3) Select cursor of n records from INVENTORY4) Insert array of ranomly chosen inventory items into PLAYER_OWNED table5) ....more things of a similar nature</code></pre><p>There are going to be a few more selects and inserts for various things too, so having an individual subclass for each one is going to get crazy.  Not to mention that there will be about 8 activities for this game, all relying heavily on database reads and writes.</p><p>So, basically, how do I best use AsyncTask to carry out a number of different SQLite operations?</p>","442912","","","","","2010-12-09 16:39:47","Android AsyncTask - One SubClass Per Database Operation?","<android><sqlite><android-asynctask>","1","1","","",""
"4400699","1","","","2010-12-09 16:37:14","1","893","<p>I have a web page that uses Google Maps API v3 to display markers with infowindows where my company has locations.</p><p>Whenever I'm on an iPhone or Android phone and have the device turned in landscape mode, the infowindow height is too small to see the content and no scrollbars appear (included photo shows what I mean). When the device is in portrait mode, the infowindows display correctly.</p><p>I've tried setting the height and min-height CSS properties of the HTML that makes up the content of the infowindows, but that has not worked.</p><p><img src=""http://i.stack.imgur.com/xRvdd.png"" alt=""alt text""></p>","265333","","","","","2011-02-24 11:32:42","Google Maps API InfoWindow Incorrect Height on iPhone/Android Browser","<iphone><android><html><css><google-maps>","1","0","","",""
"4400713","1","4400792","","2010-12-09 16:38:47","3","2869","<p>I'm a Java developer and I want to start developing mobile applications.The question is, which android or iOS seems to be better?What can you tell me about the learning curve of each one?</p><p>I also want to know about the market or the profits of each alternative.</p>","384984","","","","","2010-12-10 15:24:43","android vs iOS which choose","<android><programming-languages><ios>","7","0","0","2011-10-03 13:41:21",""
"4400799","1","","","2010-12-09 16:45:52","1","461","<p>I have tried my hands on compiling a Java project with Ant from scratch. Is it possible in Android too? If I have only the source code, can I compile the project? If so, how?</p>","363441","","","","","2010-12-10 06:34:58","Android and Ant","<java><android><ant><build><apk>","2","2","","",""
"4400846","1","4400967","","2010-12-09 16:49:14","3","3930","<p>I thought this would be easy but its eluding me.  I have an Activity that displays a custom dialog that allows the user to enter some text and then has OK and Cancel button defined.  I display it using show().  But I can't figure out how to get the value back from the Dialog.</p><p>I'm using a custom dialog because its doing some validation of the text entry.  I guess I could change it to derive from Activity and then display it using startActivityForResult but - at least based on my old windows programming days - I thought getting a user entered value back from an Android dialog would be easy. </p><p>Am I overlooking some type of call back or listener mechanism?</p><p>I even tried this as a simple solution but its not letting me assign to value (1) unless its modifier is set to final and then (2) if I say ok to make it final, won't let me assign to it because ""the final local variable value cannot be assigned, since it is defined in an enclosing type""</p><pre><code>    String value;    final EditText input = (EditText)findViewById(R.id.theText);     AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setView(input);    builder.setPositiveButton(""OK"", new DialogInterface.OnClickListener()     {        public void onClick(DialogInterface dialog, int whichButton)         {            value = input.getText().toString();            dialog.dismiss();        }    });    builder.show();</code></pre><p>[EDIT updated for solution]============================</p><p>The main thing I ended up doing was adding the ability to pass a Handler to the dialog.  In the dialog class I added:</p><pre><code>   private Handler clientHandler = null;   public void AddHandler(Handler client)   {      this.clientHandler = client;   }</code></pre><p>And updated the Dialog's OK button click:</p><pre><code>   /**    * The user pressed the OK button    * @param v    */   public void okClick(View v)   {      // save the entered string      this.tag = this.tagEditText.getText().toString();      if ( null != this.clientHandler )      {         // Notify the client to update itself         this.clientHandler.sendMessage( clientHandler.obtainMessage());      }      cancel();   }</code></pre><p>Then in the Activity's onCreate() that displays the Dialog I added:</p><pre><code> tagDialog = new tagDialog(this);  tagHandler = new Handler()  {    @Override    public void handleMessage(Message msg)     {       tag = tagDialog.tag;                   } }; tagDialog.AddHandler(tagHandler);</code></pre>","418714","","418714","","2010-12-09 23:14:41","2011-06-04 14:24:14","Android - how can an Activity get user entered text from a Dialog","<android><dialog>","3","0","2","",""
"4400991","1","4401299","","2010-12-09 17:02:55","1","1789","<p>When I have 1, 2 or 3 components I know how to get them to space properly.  But now I have a view that will have 4, 5, ... components in it.  Rather than increasing the size of the components (via weight), I need them to remain a fixed size.  So... is there any way to lay these out with justified spacing (evenly spaced within the view)?</p><p>Thanks,</p><p>J</p>","512309","","","","","2010-12-09 17:35:19","How to: Layout fixed size components with justified spacing","<android>","2","0","","",""
"4401028","1","4458450","","2010-12-09 17:06:07","13","20177","<p>I have problem with handling dynamically created Buttons on Android. I'm creating N buttons and I have to do the same method when button is clicked but I have to know which button is clicked.</p><pre><code>for (int i = 0; i &lt; NO_BUTTONS; i++){        Button btn = new Button(this);        btn.setId(2000+i);        ...        btn.setOnClickListener((OnClickListener) this);        buttonList.addView(btn);        list.add(btn);</code></pre><p>Cucurrently I'm adding ID to every button and I'm using the method below to see which button was clicked. (line <code>btn.setId(2000+i);</code> and <code>btn.setOnClickListener((OnClickListener) this);</code>). This method is also implemented in the activity. </p><pre><code>@Overridepublic void onClick(View v) {    switch (v.getId()){        case 2000: selectButton(0);        break;        ...        case 2007: selectButton(7);        break;    } }</code></pre><p>This doesn't look good to me so i'm asking is there some better way to do this? or how to send some information to onclick event? any suggestions?</p>","99821","","944657","","2012-10-24 08:19:12","2013-09-22 12:47:52","Dynamically creating Buttons and setting onClickListener","<android><button><android-widget><android-layout>","7","0","8","",""
"4401479","1","4455793","","2010-12-09 17:57:08","6","1256","<p>I want to test different behavior of my app in landscape and portrait mode.  I've got a subclass of android.test.InstrumentationTestCase that does a fine job of testing the behavior of my app in portrait mode, but if I (manually) put the emulator into landscape before running the test, it fails.  That's fine - the behavior in landscape shouldn't pass the portrait tests - and I know how to <em>check</em> the orientation from my test code, so I can avoid the test failures - but what I want to do is (from test code) put the emulator into the correct state for each of my tests.  How can I do that?</p>","82118","","","","","2011-07-30 02:01:17","How can I rotate the android emulator from test code?","<android><unit-testing>","4","0","1","",""
"4401499","1","","","2010-12-09 17:59:59","2","1248","<p>I have an Android application that connects to Bluetooth devices somewhat freely.  When I attempt to connect to a device that isn't paired with the phone, a dialog will prompt the user for a passkey.  The passkey is known a priori, but as there is no method to programatically enter it (in the standard Android APIs at least), it must be shown to the user then entered.</p><p>What I have presently is a thread that initiates a connection by grabbing a <code>BluetoothSocket</code> and calling <code>.connect()</code> on it.  If pairing is required, that call will block until the user enters a passkey in the dialog.</p><p>In order to preempt that, I added to my activity's handler something to display dialogs.  Before sending the message I made a dummy object to pass along, and between sending the message and attempting to connect, called <code>.wait()</code> on it, figuring that I could <code>.notify()</code> after receiving an <code>OnClick</code> from the dialog, however I'm unable to refer to the handled message in the inner <code>AlertDialog</code> class, as is the problem in <a href=""http://stackoverflow.com/questions/2028697/dialogs-alertdialogs-how-to-block-execution-while-dialog-is-up-net-style"">this question</a>.</p><p>I could have it do a call back up to the class holding the thread, but it seems a little clunky, leading me to the core question: <em>is my structure fundamentally broken?  How should I go about it?</em></p><p><a href=""http://stackoverflow.com/questions/1027149/popup-dialog-android-from-background-thread"">Another related question</a> suggests to use the notification system, however it seems much better design here to mirror the passkey dialog with another dialog.</p>","194586","","","","","2011-07-28 14:17:29","Blocking an Android thread with a dialog","<java><android><multithreading>","2","0","","",""
"4401694","1","","","2010-12-09 18:21:30","2","1692","<p>I have made Qr code Scanner using Intent using Zxing library and i have kept Library in application so that my app no longer require barcode scanner. But When barcode scanner is already in operating system, when i start my application , a dialog box appear asking complete action using : barcode scanner or My application . When I have all library in my own application Then how can i avoid this Dialog Box. Please help me out.</p><p>Example code :</p><p>Intent in = new intent(""com.google.zxing.android.SCAN"");</p>","536847","","21234","","2011-05-15 13:39:16","2013-01-23 22:28:43","Android : How to avoid complete action using Dialog","<android><barcode-scanner>","2","0","1","",""
"4401713","1","","","2010-12-09 18:24:39","1","352","<p>How does android platform handle different types of screen resolutions ? platform takes that work how does it actualy work? </p>","536871","","13895","","2010-12-09 18:31:15","2010-12-09 18:31:15","android platform screen resolutions","<android>","1","0","1","",""
"4401723","1","4401990","","2010-12-09 18:25:39","0","132","<p>I was during developing my map based android app, then after running it couple of times in emulator, suddenly map gone and shows crosses. I had obtained a new key yesterday.</p><p>I'm using android 2.2 V8.thanks all.</p>","536853","","","","","2010-12-09 23:09:13","working map suddenly display crosses","<android>","2","2","","",""
"4402060","1","4402125","","2010-12-09 19:06:18","7","15368","<p>I am new to Android programming, and looking for some general knowledge. I am considering writing logic of my application in javascript so that the same code could be executed in a webapp and in a desktop application. Would it be possible to also have it working on Android? I know that:</p><ul><li>SL4A is marked as alpha-quality, and user would need to install it to make such an app work. Still it provides access to Android API. SL4A scripts also cannot go to Android Market, as far as I know.</li><li>A simple webapp doesn't have access to most Android API.</li></ul><p>Would it be possible to write a simple Java app that would embed an HTML widget with javascript code and provide some wrapper to access necessary API?</p><p>I am not looking for a fully portable thing--I intend to adapt UI to each environment manually. I just would like to have the internal logic common to all ports.</p>","42610","","","","","2014-04-12 04:27:00","Javascript app in Android","<javascript><android>","4","0","2","",""
"4402178","1","4403075","","2010-12-09 19:21:56","1","2287","<p>I have an <code>ExpandableListView</code> view and I've implemented <code>OnChildClickListener</code>, but I need to get the group of that child, more specifically - the text staying as a label of that group.</p><p>How can I do that?</p><ol><li><p>Should I implement <code>OnGroupClickListener</code>?</p></li><li><p>Can somebody show me how to use <code>getPackedPositionGroup()</code> or any of the <code>getPacked&lt;somethingf&gt;()</code> methods to get to the text on the group element of expandable list view?</p></li></ol><p>Thanks!</p><p>[Edit - addition]</p><p>the called is in Map class, which is something like this:</p><pre><code>public class MapCommand extends Activity implements OnChildClickListener {.....@Overridepublic boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {    firstStepSwitcher(v, childPosition);            ///HERE IS WHERE I WANT TO FIND THE GROUP!!!        return true;    }}</code></pre><p>The view itself is in the layout XML.  I do not manage its display manually.</p><p>And it has separate class for adapter.</p>","481828","","1288","","2011-03-03 12:12:42","2011-03-03 12:12:42","How to get Group position from onChildClick()?","<android><position><group><expandablelistview>","1","0","","",""
"4402250","1","4402542","","2010-12-09 19:30:57","0","314","<p>I have an android app with a parent activity that creates a new activity:</p><blockquote>  <p>Intent intent = new Intent(myclass.this.getApplication(), someclass.class);<br>      startActivity(intent);<br>      }</p></blockquote><p>The someclass manages a database and I'd like to return a pointer to the database to the parent activity.</p><p>Any idea how can I do that?</p><p>Thanks!</p>","536912","","","","","2010-12-09 21:11:21","Returning a pointer to the parent activity","<java><android><android-widget>","2","2","","",""
"4402262","1","4403596","","2010-12-09 19:31:32","14","13239","<p>I want to test in the emulator an app that depends of the device identifier (ANDROID_ID).</p><p>I currently obtain device identifier with the following code:</p><pre><code>final String deviceID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);</code></pre><p>When I run this in an emulator it returns <code>null</code>, which gives me all sort of problems. It seems that higher Android versions it returns something.</p><p>Is there a way to get a device identifier in the Android emulator? Am I obtaining the device id wrongly?</p><p>Maybe it's possible to set the device identifier of the emulator through the console?</p>","143378","","143378","","2010-12-09 20:23:10","2013-04-13 19:38:44","Device identifier of Android emulator","<android><testing><emulator><identifier>","5","2","9","",""
"4402274","1","","","2010-12-09 19:32:24","2","956","<p>I'm trying to simluate motion of the emulator device in the ddms perspective.  I am using a gpx file which contains  elevation elements, but when my code runs, it only retrieves lat/lon and says that elevation = 0.  My question is, can the android emulator be used to simulate altitude, speed etc, or is it just for latitude and longitude data?</p>","532933","","","","","2010-12-10 08:37:33","Can the android emulator simulate altitude with a gpx file?","<android>","1","4","0","",""
"4402308","1","4402514","","2010-12-09 19:35:20","1","1190","<p>I don't believe this is a question limited to live wallpapers, but it is the use case I am trying to work with.</p><p>I have a 256 x 256 bitmap created as a ""tile"" for my live wallpaper. I am looking for a memory efficient way to scale this to fit an entire device screen. I continue to run into ""exceeding VM memory"" issues whenever the device rotates back and forth, which suggests I am not handling the problem correctly.</p><p>The image is being drawn using Canvas' <code>drawBitmap()</code> method. I have tried the following options:</p><ol><li>Create the bitmap, then call <code>createScaledBitmap()</code></li><li>Create the bitmap, then call <code>scale()</code> on my canvas</li><li>Create the bitmap, then create a matrix to ""stretch"" the width and height, and apply it with a <code>preScale()</code></li></ol><p>If I call <code>recycle()</code> the live wallpaper runs for one frame, then crashes. If I don't rotate the device at all, I get no out of memory crashes.</p><p>Thanks for any suggestions!</p>","213345","","","","","2011-03-23 15:10:53","Most memory-efficient way to scale bitmap for live wallpaper?","<android><memory-management><canvas><bitmap><scale>","1","1","","",""
"4402406","1","","","2010-12-09 19:46:10","1","335","<p>I am using the same Webview multiple times. When I load html that takes up more space, the webview expands to fit it, but once in awhile, it doesn't shrink back when less content is loaded into it again. How can I make this behavior more consistent?</p>","324518","","","","","2013-07-24 07:57:22","Android Webview not resizing consistently when data is changed","<android><webview>","1","1","","",""
"4402474","1","5179004","","2010-12-09 19:52:47","0","539","<p>I have an Activity that sets an ExpandableListAdapter for an ExpandableListView.  </p><p>I would like the adapter to notify the Activity when its underlying data changes.  How is this possible?</p><p>Thanks,wTs</p>","285417","","","","","2011-03-03 09:46:31","ExpandableListAdapter: Notifying calling code of changes","<android><expandablelistadapter>","1","0","","",""
"4402603","1","4402619","","2010-12-09 20:04:36","0","301","<p>I am an iPhone developer that is about to dive into the Android market. The price of the development phone (Nexus 1 - $530) is quite high, so I thought to myself, ""Why not spend $10 more and get something like the Dell Streak?"". I haven't read any particular reviews on that device, but for an iPhone user that just wants a dependable device to develop on - what is the best fit? Ideally I am looking for a device that matches the experience that most Android users have - is that even possible?</p>","250100","","","","","2010-12-09 21:55:34","Dell Streak for Android Development?","<android>","4","0","","",""
"4402740","1","4402854","","2010-12-09 20:20:34","13","28883","<p>I want to use the same button to perform 2 different methods.One method when user single clicks it and a second method (different) when the user LONG clicks it.</p><p>I use this for the single short click (which works great):</p><pre><code>Button downSelected = (Button) findViewById(R.id.downSelected);        downSelected.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                method();                }            }        });</code></pre><p>I've tried to add a longClickListener but it didn't work.</p><p>Appreciate any ideas on how to solve this.</p><p>Thanks!</p>","444324","","","","","2013-12-07 12:34:00","Android: long click on a button -> perform actions","<android>","4","1","2","",""
"4402813","1","","","2010-12-09 20:29:19","10","3705","<p>I have a problem.  I need to go from one activity to another. My second activity has a big xml layout, with a lot of elements (I'm speaking about four hundred aprox.), then it takes a few seconds (too much) to show this second Activity.</p><p>How can I show a Progress dialog between two activities?</p><p>I'm trying to use a background task to do this.</p><p>I have this method in my Activity A:</p><pre><code>  private void goToYear() {   Intent intent = new Intent();   intent.setClass (getBaseContext(), YearActivity.class);   startActivity( intent);  }</code></pre><p>And in my Activity B:</p><pre><code>public class YearActivity extends Activity { private String  TAG = ""YearActivity ::""; private ProgressDialog pd = null;    @Override    public void onCreate( Bundle savedInstanceState) {        super.onCreate( savedInstanceState);        // Show the ProgressDialog on this thread        this.pd = ProgressDialog.show(this, ""Working..."", ""Calculating the screen..."", true, false);        // Start a new thread that will download all the data        new MakeYearTask().execute();    }    private void initCalendar () {      this.setContentView( R.layout.calendar_year);      ...   ...   initialize values   ...   ...    }    private class MakeYearTask extends AsyncTask&lt;String, Void, Object&gt; {        protected Void doInBackground(String... args) {            Log.i(""YearActivity::MakeYearTask"", ""MakeYearTask Background thread starting"");   YearActivity.this.initCalendar();        }        protected void onPostExecute(Object result) {            if (YearActivity.this.pd != null) {             YearActivity.this.pd.dismiss();            }        }   } }</code></pre><p>You can see that I make the <code>setContentView</code> out of the <code>onCreate</code> method.</p><p>This doesn't work. It gives me one exception, like this:</p><pre><code>12-09 19:49:17.729: ERROR/AndroidRuntime(218): java.lang.RuntimeException: An error occured while executing doInBackground()12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at android.os.AsyncTask$3.done(AsyncTask.java:200)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at java.lang.Thread.run(Thread.java:1060)12-09 19:49:17.729: ERROR/AndroidRuntime(218): Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at android.view.ViewRoot.checkThread(ViewRoot.java:2629)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at android.view.ViewRoot.requestLayout(ViewRoot.java:545)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at android.view.View.requestLayout(View.java:7657)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at android.view.ViewGroup.addView(ViewGroup.java:1749)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at android.view.ViewGroup.addView(ViewGroup.java:1731)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2186)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2239)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:309)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at android.app.Activity.setContentView(Activity.java:1620)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at es.jota.app.YearActivity.initCalendar(YearActivity.java:42)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at es.jota.app.YearActivity.access$0(YearActivity.java:41)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at es.jota.app.YearActivity.initCalendar$MakeYearTask.doInBackground(YearActivity.java:120)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at es.jota.app.YearActivity.initCalendar$MakeYearTask.doInBackground(YearActivity.java:1)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at android.os.AsyncTask$2.call(AsyncTask.java:185)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)12-09 19:49:17.729: ERROR/AndroidRuntime(218):     ... 4 more</code></pre>","537023","","15168","","2013-10-24 01:10:15","2013-10-24 01:10:15","How can I show a Progress dialog between two activities?","<android><activity><progressdialog>","4","1","3","",""
"4402820","1","4414604","","2010-12-09 20:29:51","5","9038","<p>Just tried to test my app on real device (HTC Desire Z with Android 2.2). And found that my context menus doesn't work at all on <code>EditText</code>s. Otherwise context menus works: in <code>ListView</code>, <code>ImageView</code> and so on. On emulator everything works fine...</p><p>When I tap on EditText it shows something like zoom frame and then shows unusual (not standard Android alike) context menu which reads: ""select text"", ""select all"". It doesn't show my menus. Here are screenshots:</p><ol><li><a href=""https://docs.google.com/leaf?id=0B64TN1V7krz9NWQ5MzRiNjAtMWMxYS00MmU4LWJmNzYtNzRkODE3MTVhOTc0&amp;hl=en"">Before tap</a></li><li><a href=""https://docs.google.com/leaf?id=0B64TN1V7krz9ZThiNjA0NjctN2Y5MC00NTljLWFhMjQtYThmZmI5ZmViYWJi&amp;hl=en"">During tap</a></li><li><a href=""https://docs.google.com/leaf?id=0B64TN1V7krz9MTU3MmZkODItMTdkZi00ZTJkLWI1MzQtM2Q3NjY2NTU2NDM4&amp;hl=en"">After tap</a> (just ordinary select text, select all, paste)</li></ol><p>but no my menu like in emulator - <a href=""https://docs.google.com/leaf?id=0B64TN1V7krz9NGVjZWQ3ZmMtNWJhMi00NTgzLWEyMjQtNWExOGJlZTMzZmIz&amp;hl=en"">look here</a></p><p>Here's source code of my activity:</p><pre><code>public class MyActivity extends Activity{    private static final String TAG=MyActivity.class.getName();    EditText editText;    /**     * Called when the activity is first created.     */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        editText=(EditText )findViewById(R.id.editText);        this.registerForContextMenu(editText);    }    @Override    public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo)    {        Log.v(TAG, ""Creating context menu for view=""+view);        menu.add(Menu.NONE, Menu.FIRST+1, Menu.NONE, ""Test menu"");        super.onCreateContextMenu(menu, view, menuInfo);    }    @Override    public boolean onContextItemSelected(MenuItem item)    {        Log.v(TAG, ""Context item selected as=""+item.toString());        return super.onContextItemSelected(item);    }}</code></pre><p>I have thoroughly debugged/logged everything around my code, but still Activity.onCreateContextMenu() not even called (though it's registered in proper way).</p><p>Please help - what it can be? Does it related to HTC peculiarities? </p>","472270","","472270","","2010-12-10 16:47:11","2012-03-20 02:07:51","onCreateContextMenu() for EditText doesn't work on real device","<android><contextmenu><edittext><htc><android-compatibility>","2","5","4","",""
"4402844","1","4403591","","2010-12-09 20:32:46","4","2502","<p>hey guys,i'm currently building a website optimized for mobile devices.</p><pre><code>&lt;meta name=""viewport"" content=""width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;""/&gt;</code></pre><p>i have a dynamic javascript grid and i want no scaling on mobile devices.the line above works perfectly on the iphone however i think it does not work on android or webos. any idea how i can set a NO-SCALE mode for those mobile devices as well. So there is no pinch &amp; zoom and the device-width is the 100% browser-width?</p><p>thank you for your tips.</p><p>regards matt</p>","1444475","","","","","2010-12-09 22:08:00","android and webos no content scaling?","<iphone><android><css><webos>","1","0","1","",""
"4402873","1","4403082","","2010-12-09 20:38:09","-1","477","<p>I’ve been investigating how to use <a href=""http://www.3gmodem.com.hk/Huawei/E160.html"" rel=""nofollow"">this device</a> as an external antenna for an Android phone.  Ideally I’d like to be able to take advantage of the phone's Micro USB port to connect the device and provide the phone with LTE service without rooting the phone.  Is it possible to take advantage of the phone Micro USB port, and if so how? Ive search the web looking for direction and answers, and have failed to find much of anything.</p>","246639","","","","","2010-12-09 21:07:39","Is there a way to use a LTE Dongle as an external antenna an Android power phone?","<android><usb><dongle>","1","6","","",""
"4402948","1","4403142","","2010-12-09 20:47:37","1","405","<p>How to open database in Android programming ?</p>","616094","","260990","","2010-12-09 20:48:52","2011-09-02 14:45:23","android database","<java><android><database>","4","0","3","",""
"4403301","1","","","2010-12-09 21:28:49","3","4533","<p>Can someone provide an example as to how to use the proximity sensor?  I tried to use it the same way as other sensors, but it's not working.</p><p>This is the code snippet i have been using:</p><pre><code> final SensorManager mSensorManager; final Sensor mproximity;mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);mproximity =  mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);mSensorManager.registerListener(new SensorListener(){public void onAccuracyChanged(int arg0, int arg1) {   // TODO Auto-generated method stub   Toast.makeText(test.this,""proximity sensor accu "", Toast.LENGTH_SHORT).show();}public void onSensorChanged(int arg0, float[] arg1) {   // TODO Auto-generated method stub   Toast.makeText(test.this,""proximity sensor "", Toast.LENGTH_SHORT).show();}}, Sensor.TYPE_PROXIMITY, 1);</code></pre><p>Please tell me where I am going wrong.</p>","537084","","82118","","2011-02-21 22:00:17","2013-03-27 03:37:04","Not able to get proximity sensor's values in android","<android><sensor><proximity>","2","0","1","",""
"4403387","1","","","2010-12-09 21:39:30","0","2481","<p>I'm making some an advanced <code>TabActivity</code> but I need to get every <code>TabView</code> thats in the <code>TabHost</code>. With <code>tabHost.getCurrentTabView()</code> I can get the current <code>TabView</code> but is there a way to get a <code>TabView</code> by its ID?</p><hr><p>I managed to make a workaround by doing a for loop in the <code>onCreate()</code> method where I go to every tab and put all the <code>View</code> objects in an Array.</p><blockquote><pre><code>  private View[] tabs;  for(int i = 0; i &lt; getTabWidget().getTabCount(); i++)    {        tabHost.setCurrentTab(i);        tabs[i] = tabHost.getCurrentTabView();    }</code></pre></blockquote>","355651","","355651","","2010-12-11 11:03:49","2010-12-11 11:03:49","Android TabHost is there a way to get TabView by ID","<android><android-tabhost><tabactivity>","1","0","","",""
"4403399","1","","","2010-12-09 21:40:51","1","486","<p>My first android app was a soundboard, and it works great. When you set a sound as a ringtone, it saved the file to the ringtones folder. Someone took advantage of that and stole my sounds, and published their own soundboard with my sounds.</p><p>I dont want that to happen again with my next soundboard, so my question is:</p><p>is it possible to save a sound as a ringtone or notification without saving it?</p><p>EDIT: If this is not possible, I would like to know what I can do so I don't get my sound files stolen.</p>","425296","","425296","","2010-12-10 02:10:07","2012-01-10 09:11:07","Is it possible to set a sound from the raw folder as a ringtone without saving it to the sdcard?","<android>","2","0","","",""
"4403632","1","4666400","","2010-12-09 22:05:57","6","11239","<p>I am tring to load bitmaps from an internal resource in a View object (the source itself is in ""drawable"" files).</p><p>the code is:</p><pre><code>import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.util.AttributeSet;import android.view.View;public class BannerView extends View { private Bitmap m_Banner = null; public BannerView(Context context, AttributeSet attributeSet) {  super(context, attributeSet);  m_Banner = BitmapFactory.decodeResource(getResources(), R.drawable.banner); }}</code></pre><p>Why m_Banner value is null?</p><p>thank you in advance</p><p>Kobi</p>","537106","","","","","2013-06-15 11:29:21","BitmapFactory.decodeResource returns null value","<android>","4","1","","",""
"4403687","1","4403843","","2010-12-09 22:14:45","3","917","<p>I'm trying to figure out how to programatically know that Samsung Galaxy Tab cannot place phone calls. When I call <code>telephonyManager.getPhoneType()</code> it returns <code>PHONE_TYPE_CDMA</code>. When I call <code>telephonyManager.getLine1Number()</code> it returns a valid phone number.</p><p>However, there's no dialer.</p>","398469","","","","","2010-12-09 22:36:28","How can I tell that Samsung Galaxy Tab cannot place phone calls?","<android>","1","4","1","",""
"4403733","1","4403815","","2010-12-09 22:20:44","3","1486","<p>I've been using draw9patch on android a bit lately and am getting frustrated about how bad of a program it is. I generally takes me 5 mintues per image to add the patches which seems excessive. Worse is that when I have multiple states for an image I have to do the exact same patches on 3 images or they look wrong, I would rather be able to just copy patches between images. I've tried using gimp to do the same thing but find it more difficult.</p><p>Has anyone found a better program to create 9 pngs or created their own?</p>","304795","","","","","2013-09-03 03:34:54","Better version of draw9patch","<android>","4","3","","",""
"4403924","1","4404878","","2010-12-09 22:51:53","1","837","<p>I have a ListView with headerView, data is held by custom CursorAdapter:</p><pre><code>View headerView = mInflater.inflate(R.layout.list_header_item, null);mListView.addHeaderView(headerView);mAdapter = new NewsCursorAdapter(this, getItemsCursor());mListView.setAdapter(mAdapter);//here do some header initialization from cursor</code></pre><p>Could you please advice how to update header when cursor is changed?The problem is that data is populated from WebService, and not always exists onCreate()</p><p>ListView items are updated perfectly.</p>","12021","","","","","2010-12-10 01:34:05","How to update Listview's headerView when Cursor is updated?","<android><listview>","1","0","","",""
"4404243","1","4404247","","2010-12-09 23:34:40","2","16984","<p>this is my first question, so be gentle :)</p><p>I'm trying to clear the clipboard in Android.  I've read doc the doc for the ClipboardManager and the public methods don't seem germane:</p><p><a href=""http://developer.android.com/reference/android/text/ClipboardManager.html"" rel=""nofollow"">http://developer.android.com/reference/android/text/ClipboardManager.html</a></p><p>Any ideas of where I should start?</p>","214012","","","","","2012-07-16 12:00:37","Clear Clipboard on Android","<android><clipboard>","4","0","","",""
"4404265","1","4404587","","2010-12-09 23:39:17","0","1216","<p>i have developed an app that runs perfectly fine on the simulator but when I try to run it on the phone, the app errors out stating java.io.FileNotException: res/drawable/divider_horizontal_dark.9.png</p><p>i thought the app was missing this file (probably android system file) so i found this file elsewhere on the web and placed it under drawable but in vain. the app still errors out with the same error as before.</p><p>any idea whats the problem here?</p><p>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:layout_height=""wrap_content"" android:gravity=""left|center""    android:layout_width=""wrap_content"" android:paddingBottom=""5px""    android:paddingTop=""5px"" android:paddingLeft=""5px"" &gt;    &lt;ImageView android:id=""@+id/linkImage"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" android:layout_marginRight=""6dip""        android:src=""@drawable/icon"" /&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""0dip"" android:layout_weight=""1""        android:layout_height=""fill_parent""&gt;        &lt;TextView android:id=""@+id/firstLineView""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:gravity=""center"" android:textColor=""#FFFF00"" android:text=""first line title""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/secondLineView""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:text=""second line title"" android:layout_marginLeft=""10px"" android:gravity=""center""            android:textColor=""#0099CC""&gt;&lt;/TextView&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>and the part of the code where the app crashes while loading.. you could see that there is no where i have used the file divider_horizontal_dark.9.png </p><pre><code>public View getView(int position, View convertView, ViewGroup parent){            ViewHolder holder;            if(convertView == null){                convertView = mInflater.inflate(R.layout.listview,null);                holder = new ViewHolder();                holder.firstLine = (TextView) convertView.findViewById(R.id.firstLineView);                holder.secondLine = (TextView) convertView.findViewById(R.id.secondLineView);                holder.imageView = (ImageView) convertView.findViewById(R.id.linkImage);                //holder.checkbox = (CheckBox) convertView.findViewById(R.id.star);                holder.firstLine.setFocusable(false);                holder.secondLine.setFocusable(false);                holder.imageView.setFocusable(false);                //holder.checkbox.setFocusable(false);                convertView.setTag(holder);            }else{                holder = (ViewHolder) convertView.getTag();            }.....</code></pre><p>seems like they have fixed the issue<a href=""http://code.google.com/p/transdroid/issues/detail?id=144"" rel=""nofollow"">http://code.google.com/p/transdroid/issues/detail?id=14</a></p><p>but i somehow dont get it</p>","377337","","377337","","2010-12-11 05:22:51","2010-12-11 05:22:51","android failed to parse PNG file","<android><android-emulator>","1","2","","",""
"4404279","1","","","2010-12-09 23:40:52","3","1579","<p>Well the question is in the title.</p><p><strong>How can i obtain GPS location on a mobile device in Android Webkit or/and Opera Mobile 10?</strong></p><p>So in iPhone Safari this is doable. How about those 2 browsers? I looked for such functionalities and found nothing. Is that doable via javascript as well?</p>","537204","","","","","2010-12-10 00:05:07","How can i obtain GPS location in Android Webkit or Opera Mobile 10","<android><gps><opera><opera-mobile>","1","0","","",""
"4404349","1","4404369","","2010-12-09 23:50:52","2","2186","<p>I have a repository created with</p><pre><code>git clone git://android.git.kernel.org/platform/frameworks/base.git</code></pre><p>But I don't see any specific branch for 2.2.1 version</p><pre><code>git branch -r</code></pre><p>The output</p><pre><code>origin/HEADorigin/cdma-importorigin/cupcakeorigin/cupcake-releaseorigin/donutorigin/donut-plus-aosporigin/donut-releaseorigin/donut-release2origin/eclairorigin/eclair-passion-releaseorigin/eclair-releaseorigin/eclair-sholes-releaseorigin/eclair-sholes-release2origin/froyoorigin/froyo-releaseorigin/masterorigin/release-1.0origin/tools_r7</code></pre><p>So where can I get 2.2.1 sources?</p><p><strong>Answer (based on @Matthieu response)</strong></p><pre><code>git tag -l</code></pre><p>Output:</p><pre><code>...android-1.6_r2android-2.0.1_r1android-2.0_r1android-2.1_r1android-2.1_r2android-2.1_r2.1pandroid-2.1_r2.1p2android-2.1_r2.1sandroid-2.2.1_r1android-2.2_r1android-2.2_r1.1android-2.2_r1.2android-2.2_r1.3...</code></pre><p>git checkout android-2.2.1_r1</p>","62192","","62192","","2010-12-10 00:35:52","2010-12-10 00:35:52","How can I get Android 2.2.1 sources?","<android><sources>","1","0","1","",""
"4404439","1","","","2010-12-10 00:04:48","1","16214","<p>I am working in android sdk and using google maps api. I wanted to know if there is any way to find the nearest resturant or coffee shop or a grocery store from current  location of the user. </p><p>There are many apps available for this purpose but i want to code my own application for learning purpose. </p>","367121","","","","","2014-01-14 09:53:50","Find nearest resturant, coffee shop, and grocery store using google maps in android","<android><google-maps><google-maps-markers><google-maps-api-2>","4","0","3","",""
"4404462","1","","","2010-12-10 00:07:56","0","162","<p>I'm making a tile game. My application has an object (GraphicEngine) that handles all of the graphical operations. Each character in the game is its own object. When a character wants something drawn it sends an object (a package of sorts) to the GraphicEngine object. The GraphicEngine object stores this package in an ArrayList. Each of these packages contain x and y coordinates and a bitmap image. When the time comes GraphicEngine draws the whole list to a single bitmap and displays it.</p><p>I have programmed this, but I don't know how to get a <code>png image</code> from my resources folder and turn it into a <code>bitmap</code>. I can't find help anywhere which makes me think I'm mis-understanding the whole process.</p>","537215","","1043882","","2012-07-27 11:22:37","2012-07-27 11:22:37","Android: Using application resources","<android><resources><bitmap>","1","0","","",""
"4404553","1","4404582","","2010-12-10 00:26:35","37","50362","<p>I have an Android project developed on Eclipse (GNU/Linux) that I last touched half a year ago. I am trying to import the project into Eclipse 3.6 on Windows (with ADT installed) installed using File -> Import Project in Eclipse. When the project is imported, I see the following error twice on the console:</p><blockquote>  <p>[2010-12-10 02:17:12 -  com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper]  Unable to read C:\Program  Files\Android\android-sdk-windows\AndroidManifest.xml:  java.io.FileNotFoundException:  C:\Program  Files\Android\android-sdk-windows\AndroidManifest.xml  (The system cannot find the file  specified)</p></blockquote><p>Why is Eclipse looking for <code>AndroidManifest.xml</code> on the Android SDK path? The file actually seems to be in the project's directory.  How do I fix this problem and get the project to compile?</p>","186019","","","","","2013-10-03 19:04:17","Missing AndroidManifest.xml when importing an old Android project into Eclipse","<android><eclipse>","18","0","6","",""
"4404632","1","4404797","","2010-12-10 00:44:49","1","226","<p>I am using intent to start google maps. When I press the back key I want my application to get the focus.</p><p>Can you please let me know how can this be achieved??</p><p>Will using FLAG_ACTIVITY_REORDER_TO_FRONT flag help??I am not able to solve this.</p><p>Please help.</p><p>Thanks.</p>","511280","","","","","2010-12-10 01:15:56","Intent : Android","<android><android-emulator>","1","2","","",""
"4404689","1","","","2010-12-10 00:57:04","3","4132","<p>When I call an Android ContentProvider I get the following exception:</p><blockquote>  <p>java.lang.RuntimeException: Unable to  start activity  ComponentInfo{de.harm.android.couchone/de.harm.android.couchone.CouchContactClient}:  java.lang.IllegalArgumentException:  Unknown URL  content://de.harm.android.couchone.provider/test2</p></blockquote><p>These are the projects:</p><ul><li><a href=""https://github.com/der-harm/CouchOneProvider"" rel=""nofollow"">https://github.com/der-harm/CouchOneProvider</a></li><li>.../CouchOneContacts</li></ul><p>Android uses the so-called <code>ContentResolver</code> to communicate with <code>ContentProvider</code> which in turn handles the persistence functionality - accessing the database.</p><p>The <code>ContentProvider</code> registers itself with a unique Uri. The <code>ContentResolver</code> calls the <code>ContentProvider</code> with this Uri and passes additional data, like a SQL query string and/or data to be saved.</p><p>In the <code>CouchOneProvider</code>/<code>AndroidManifest.xml</code> I have the following:</p><pre><code>&lt;provider android:authorities=""de.harm.android.couchone.provider""   android:name="".Provider"" /&gt;</code></pre><p>The Provider uses</p><pre><code>static {    uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);    uriMatcher.addURI(PROVIDER_NAME, DB_Name, URI_COLLECTION);    uriMatcher.addURI(PROVIDER_NAME, DB_Name + ""/#"", URI_ENTITY);}</code></pre><p>and</p><pre><code>public static boolean isCollectionUri(Uri uri) {    return uriMatcher.match(uri) == URI_COLLECTION;}</code></pre><p>to process the <code>CONTENT_URI</code> used by the <code>ContentResolver</code> to call the <code>ContentProvider</code>:</p><ul><li>Am I missing permissions in any of both <code>AndroidManifest.xml</code>?</li><li>Am I defining the authority in <code>AndroidManifest.xml</code> wrongly?</li><li>Is the <code>CONTENT_URI</code> wrong?</li></ul><p><strong>Update:</strong></p><p>I have additional information:</p><p>Logcat says:</p><blockquote>  <p>Failed to find provider info for  de.harm.android.couchone.provider</p></blockquote><p>This should be the starting point. But so far I couldn't find any solution.</p><p>The fully qualified classname of the <code>ContentProvider</code> implementation is:</p><pre><code>de.harm.android.couchone.Provider</code></pre><p>In <code>AndroidManifext.xml</code> exactly this is specified as authority, except for the name being to lower case, but this should be fine.</p><p>The package name is defined previously in the xml file, so "".Provider"" should be ok, too.</p><p>As to be seen in the exception, the client calls:</p><pre class=""lang-none prettyprint-override""><code>content://de.harm.android.couchone.provider/test2</code></pre><p>Logcats answer is:</p><blockquote>  <p>Failed to find provider info for de.harm.android.couchone.provider</p></blockquote><p>I don't see what's missing, perhaps it's Eclipse or emulator problem?</p><p>I install the provider as ""run project as Android application"".</p>","537254","","995926","","2012-07-22 19:29:26","2012-07-22 19:34:46","Creating & using ContentProvider for android","<android><couchdb><android-contentprovider><android-contentresolver><couchone>","2","0","1","",""
"4404762","1","4405103","","2010-12-10 01:09:42","1","1055","<p>I'm trying to render some particle effects in Android using OpenGL. Each particle will be a billboarded textured quad and each particle is rendered with a rotation (i.e. around the z axis). I'm restricted to using OpenGL ES 1.1 so point sprites and pixel shaders aren't an option. What is a fast way of rendering and updating the positions of many particles (e.g. 100 to 5000)?</p><p>I know that using an OpenGL draw call for each particle is going to be very slow but I'm confused at how to use things like VBOs when I need to update my particle positions each frame.</p>","483701","","44729","","2010-12-10 02:42:50","2010-12-10 03:11:14","Drawing many textured particles quickly in OpenGL ES 1.1","<android><opengl-es>","1","5","","",""
"4404790","1","4404845","","2010-12-10 01:14:37","0","4838","<p>So i am trying to make a code which will change the color of the text in a textViewI declared the color in the XML as this:</p><pre><code>&lt;color name=""right""&gt;#FF00FF00&lt;/color&gt;</code></pre><p>However, when I try to change the color of the TextView score, in the following:</p><pre><code>if(input.equalsIgnoreCase(answer+"""")){        numRight++;        score.setTextColor(R.color.right);        correct=""Correct!"";    }</code></pre><p>The text just dissapears.  Am I referencing the color wrong?  why doesnt this work?</p>","578602","","","","","2012-12-17 09:48:40","How to change the text color in a TextView in Android?","<android><colors><textview>","2","0","1","",""
"4404922","1","4469943","","2010-12-10 01:43:07","-1","194","<p>I want to write something for android , I am new comer for it,I know the java,but I need some example for the android’s app for learn,can you tell me where to find the material?(eg:http://source.android.com/source/index.html)</p>","522416","","1131435","","2013-04-13 00:27:02","2013-04-13 00:27:02","Where can I find the android’s app code?","<java><android>","3","0","","2013-04-13 15:33:15",""
"4404993","1","4406196","","2010-12-10 01:56:44","0","2002","<p>When an Activity terminates, eg after screen orientation changing, is that possible to change an AsyncTask activity context? Else it will create an error because when the activity terminates AsyncTask's activity context is gone to.</p><p>My homework done is the following:</p><p>public void onSaveInstanceState(Bundle savedInstanceState) &lt;- doesn't solvepublic Object onRetainNonConfigurationInstance()  &lt;- doesn't solve</p><p>android:configChanges=""keyboardHidden|orientation"" &lt;- solve but doesn't handle well relative layouts</p>","537305","","","","","2010-12-10 06:22:04","Android AsyncTask Context Terminated","<android><activity><context><android-asynctask><terminate>","2","0","","",""
"4405063","1","","","2010-12-10 02:12:19","2","1128","<p>I'm trying to develop an android app that is capable of detecting led patterns on a screen in order to transmit data.</p><p>The screen that the phone will be looking at is a simple 5x19 array of red LEDs. I would like to be able to display numbers, most likely in binary and have the app detect the lit LEDs and determine the number being displayed and their pattern. This would probably require fiducial s similar to those used by QR codes.</p><p>Does anyone know what I will need to perform this type of image processing? Are there any good libraries?</p><p>Thanks, Thomas</p>","444791","","752878","","2012-08-24 17:53:21","2012-08-24 17:53:21","Android image processing and pattern detection","<android><image><image-processing><detection>","1","1","","",""
"4405123","1","","","2010-12-10 02:25:07","0","2195","<p>I have a custom list view in which I show name,date and time for each list item. I have an Adapter which extends BaseAdapter.I want to update this whenever the data in my database changes.Here is my code :</p><pre><code>public class UpcomingReminders extends Activity {private Button addReminderButton;public static DataHelper dh;private ListView lv;private DataSetObserver observer;private EfficientAdapter adapter;private static class EfficientAdapter extends BaseAdapter implements Observer {    private LayoutInflater mInflater;    private String date;    private String time;            //This list has the data to be shown in the listview    private List &lt;Reminder&gt; upcomingReminders;            //not sure how to use these        private final DataSetObservable mDataSetObservable = new DataSetObservable();     public void registerDataSetObserver(DataSetObserver observer) {          mDataSetObservable.registerObserver(observer);   }     public void notifyDataSetChanged() {         mDataSetObservable.notifyChanged();    }    public EfficientAdapter(Context context) {                //This will populate the list to be shown        upcomingReminders = dh.selectAllUpcoming();         mInflater = LayoutInflater.from(context);       }           public int getCount() {        // TODO Auto-generated method stub        return upcomingReminders.size();    }           public Object getItem(int position) {        // TODO Auto-generated method stub        return position;    }    public long getItemId(int position) {        // TODO Auto-generated method stub        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        // TODO Auto-generated method stub        ViewHolder holder;        if (convertView == null) {            convertView = mInflater.inflate(R.layout.upcominglistview, null);            holder = new ViewHolder();            holder.reminderName = (TextView) convertView.findViewById(R.id.nameUpcoming);            holder.reminderDate = (TextView) convertView.findViewById(R.id.dateUpcoming);            holder.addedBy = (TextView) convertView.findViewById(R.id.AddedByUpcoming);            holder.reminderTime = (TextView) convertView.findViewById(R.id.timeUpcoming);            convertView.setTag(holder);             }         else {             holder = (ViewHolder) convertView.getTag();        }           String str = upcomingReminders.get(position).getReminderName();        holder.reminderName.setText(str);        Calendar d = Calendar.getInstance();        d = upcomingReminders.get(position).getReminderDateAndTime();        date = """"+d.get(Calendar.MONTH)+""/""+d.get(Calendar.DAY_OF_MONTH)+""/""+d.get(Calendar.YEAR);        holder.reminderDate.setText(date);        time = """"+d.get(Calendar.HOUR_OF_DAY)+"":""+d.get(Calendar.MINUTE);        holder.reminderTime.setText(time);        holder.reminderName.setOnClickListener(new textViewClickListener(position));        holder.reminderDate.setOnClickListener(new textViewClickListener(position));        return convertView;    }    class textViewClickListener implements OnClickListener {           int posit;            public textViewClickListener( int pos)                {                    this.posit = pos;                }            public void onClick(View v) {              {// you can write the code what happens for the that click and                // you will get the selected row index in position                  Bundle b = new Bundle();                  b.putString(""title"", upcomingReminders.get(posit).getReminderName());                  b.putString(""date"", date);                  b.putString(""time"", time);                  try {                      Intent myIntent = new Intent();                      Context ctx = v.getContext();                      myIntent.setClass(ctx, ListItemDetails.class);                      myIntent.putExtras(b);                      ctx.startActivity(myIntent);                } catch (Exception e) {                    // TODO: handle exception                    Log.d(""Activity call error:%s"",e.getMessage());                }             }            }    }    static class ViewHolder {        TextView reminderName;        TextView reminderDate;          TextView reminderTime;        TextView addedBy;    }    public void update(Observable observable, Object data) {        // TODO Auto-generated method stub    }   } public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.dh = new DataHelper(this);        setContentView(R.layout.upcoming);        lv = (ListView)findViewById(R.id.list);    adapter = new EfficientAdapter(this);    lv.setAdapter(adapter);        //---------------------------------------        this.addReminderButton = (Button)findViewById(R.id.AddButton);        this.addReminderButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {              Intent i = new Intent();              i.setClass(v.getContext(),AddReminderInfo.class);              startActivity(i);            }          });    }        @Override    protected void onResume(){        super.onResume();        if(Globals.isReminderOK){            Globals.isReminderOK = false;            Log.i(""ReminderID"",""""+Globals.reminderID);            dh.updateRow(Globals.reminderID,1);            dh.selectAllUpcoming();            adapter.notifyDataSetChanged();        }    }  }</code></pre><p>After making some changes, I update the db using dh.upDateRow. This will delete a row which is currently shown in the list.How can I update the listview to show this change?</p><p>Thanks a lot.</p>","233773","","","","","2010-12-10 02:29:16","Update Custom ListView in Android","<android><listview><activity>","1","1","","",""
"4405149","1","","","2010-12-10 02:30:50","-1","220","<p>Is there any company has successfully deploy Android OS in car audio industry? And any SW arch of android in Car audio available in the web?</p>","536760","","","","","2010-12-10 02:58:46","Android in Car Audio","<android>","1","0","","",""
"4405167","1","","","2010-12-10 02:33:38","0","1484","<p>I'm trying to use HTC MyTouch 3G Slide for USB tether instead of my old G1, which works perfectly.</p><p>On the first try the ADB driver didn't recognize the phone, but worked fine after adding this to android_winusb.inf in both [Google.NTx86] and [Google.NTamd64]:</p><pre><code>;T-Mobile MyTouch 3G Slide%SingleAdbInterface%        = USB_Install, USB\VID_0BB4&amp;PID_0E03%CompositeAdbInterface%     = USB_Install, USB\VID_0BB4&amp;PID_0E03&amp;MI_01</code></pre><p>However, when enabling USB tethering, the PID changes to 0E04, and my guess requires to be associated with Remote NDIS driver.</p><p>So I've exported the Remote NDIS using Double Driver, and examined wceisvista.inf file.It says that compatible devices are: </p><pre><code>%WindowsCeDevice%    = RNDIS.NT.5.1, USB\Class_E0&amp;SubClass_01&amp;Prot_03</code></pre><p>While the actual device is: <code>USB\Class_02&amp;SubClass_02&amp;Prot_FF</code></p><p>I've already messed something up by adding the tether mode hardware Ids to the ADB driver.. so now it recognizes it as ADB driver..</p><p>At this point my knowledge of windows drivers expires.. Anyone has any experience with this? Thanks!</p>","322784","","","","","2010-12-10 02:33:38","Enabling HTC MyTouch 3G Slide USB tether in Windows 7","<android><windows-7><usb><driver><adb>","0","2","","",""
"4405284","1","4405512","","2010-12-10 03:04:37","0","672","<p>I am trying this</p><pre><code>    Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null,            null, null, null);    Cursor cursor1 = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,            null, null, null);    int nameIdx = cursor.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME);    int phoneIdx = cursor1.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Phone.NUMBER);    if (cursor.moveToFirst())        do {            // Extract the name.            String name = cursor.getString(nameIdx);            // Extract the phone number.            String phone = cursor.getString(phoneIdx);            Log.i(""ContentProvider"", name);            Log.i(""ContentProvider"", phone);        } while (cursor.moveToNext());</code></pre><p>I am able to read Names but Numbers i am getting an error</p><p><img src=""http://i.stack.imgur.com/Uv3ft.png"" alt=""alt text""></p>","155196","","","","","2010-12-10 03:59:03","Android Read Contacts Number","<android><android-contacts>","1","0","","",""
"4405328","1","","","2010-12-10 03:14:49","0","1137","<p>Trying to confirm that an EditText tool is not empty when the user clicks a button. Whenever the EditText is not blank the code works. But whenever it is blank my program crashes. Any ideas what I'm doing wrong? Thanks.</p><pre><code>if (et1.getText().toString() != null) {        inpt_weight = Integer.parseInt(et1.getText().toString());      Toast.makeText(getBaseContext(), ""weight is not null"", Toast.LENGTH_LONG).show();       } else {         inpt_weight = 0;        Toast.makeText(getBaseContext(), ""weight is null"", Toast.LENGTH_LONG).show();       };</code></pre>","512588","","","","","2013-11-20 09:08:13","validating EditText input","<android>","3","0","","",""
"4405334","1","4413716","","2010-12-10 03:17:36","6","3066","<p>Recently upgraded from BC 1.34 to 1.45. I'm decoding some previously-encoded data with the following:</p><pre><code>    SecretKeySpec skeySpec = new SecretKeySpec(raw, ""AES"");    Cipher cipher = Cipher.getInstance(""AES"");    cipher.init(Cipher.DECRYPT_MODE, skeySpec);    byte[] decrypted = cipher.doFinal(encrypted);</code></pre><p>When using BC 1.45 I get this exception:</p><pre><code>javax.crypto.BadPaddingException: pad block corrupted at org.bouncycastle.jce.provider.JCEBlockCipher.engineDoFinal(JCEBlockCipher.java:715) at javax.crypto.Cipher.doFinal(Cipher.java:1090)</code></pre><p>EDIT: More about this issue. I am using the following to generate raw keys from a passphrase:</p><pre><code>    KeyGenerator kgen = KeyGenerator.getInstance(""AES"", ""BC"");    SecureRandom sr = SecureRandom.getInstance(""SHA1PRNG"", ""Crypto"");    sr.setSeed(seed);    kgen.init(128, sr);    SecretKey skey = kgen.generateKey();    byte[] raw = skey.getEncoded();</code></pre><p>What I have found is that this results in two different values for BC 1.34 vs 1.45.</p><p>It might also not be BouncyCastle-related (I am testing on Android 2.3)</p>","104181","","21234","","2011-05-09 14:56:52","2011-09-21 04:24:08","BouncyCastle AES error when upgrading to 1.45","<java><android><cryptography><bouncycastle>","3","0","2","",""
"4405352","1","","","2010-12-10 03:22:42","0","180","<p>I would like to render a book and flip the pages .. so I tried to draw a quad using four vertices , how can I bend the the quad ? is it possible to do vertex teweening ??</p>","375666","","","","","2011-10-21 09:04:33","Android Opengles Vertex Tweening","<android><opengl-es>","1","0","","",""
"4405360","1","","","2010-12-10 03:24:16","0","2217","<p>I have an <code>EditText</code> that recieves input and prints in on the screen. I need to find a way wherein after click submit or enter, the phone will focus on the <code>EditText</code></p><p>I tried </p><pre><code>txtJoke.setFocusable(true);txtJoke.setFocusableInTouchMode(true);txtJoke.requestFocus();</code></pre><p>and it doesn't work.. requestfocus works during onCreate..I'm thinking of manually triggering a click an edittext..</p>","535837","","2345913","","2013-09-05 06:56:22","2013-09-05 06:56:22","Set focus on an edittext after using","<java><android><focus><android-edittext>","1","1","","",""
"4405366","1","4406706","","2010-12-10 03:26:58","0","711","<p>i am developing a apps for korean client.i have to search a data according to key press. like if i press A then all the data who started from A show in listview where data come from a webservice in listview.is it possible?if yes,then how to do it.if possible give me some code or link  which i can use.</p><p>thanks</p>","512383","","","","","2010-12-10 07:47:28","show data in listview from webservice according to keypress in android","<android>","2","0","","",""
"4405509","1","","","2010-12-10 03:57:52","0","615","<p>I have a Class which extends ListActivity, and is called by Activity_1.</p><p>ListActivity contains the listview with CheckedTextView. </p><p>When i select a row in listview, it should show a CheckedTextView and pass the data to Activity_1 and should remember the selected row.</p><p>The selected CheckedTextView should be shown when Activity_1 calls ListActivity again ?</p>","537371","","379693","","2010-12-10 06:30:20","2011-03-31 16:50:44","Android:How to setSelection() in ListActivity","<android><android-listview>","1","0","","",""
"4405671","1","","","2010-12-10 04:31:28","0","1087","<p>I'm writing an application to automatically sends an SMS when I replace my existing SIM card with a new SIM card. I can use the subscriber id of the SIM card to check this but how I check it every time android device start. thanks...</p>","520868","","","","","2012-11-30 14:16:34","I want to check the SIM state every time android device start","<android><sim-card>","2","0","","",""
"4405734","1","","","2010-12-10 04:45:08","2","621","<p>Hello FriendI just want to know it is possible for us to create our own emulator skins in andriod?</p><p>And how it being made?</p><p>please let me know if anybody have ans.</p><p>ThanksPintu</p>","537403","","","","","2010-12-21 11:11:04","Creating your own emulator skins in Android","<android><skins>","2","0","","",""
"4405743","1","4405810","","2010-12-10 04:47:12","1","69","<p>On specific event, I am opening an activity of other application (In my case Default phone dialer)</p><p>Once user is done with his job (in my case, terminating a call) I have to close the app so that user can see my app on top of UI stack. </p><p>How can I do that?</p><p>Thanks &amp; Best RegardsSudhakar Chavali</p>","512025","","","","","2010-12-10 04:58:17","Closing the activity of other application","<java><android><android-emulator>","1","0","","",""
"4405904","1","","","2010-12-10 05:17:10","2","817","<p>Seems like a simple question, but I couldn't find an answer to it. I'm trying to write an activity that takes a picture using the camera, and I want to attach an onClickListener to the shutter button on the phone itself, but I don't know how to reference the button. </p>","399741","","","","","2010-12-10 05:44:38","How do you set event handler to hardware buttons in Android?","<android><button><hardware><camera>","1","0","","",""
"4405930","1","4406292","","2010-12-10 05:23:24","0","443","<p>I am working on an application where I need to use Database, I particularly need to create a database by coding.</p><p>What I actually want is that When I click on the Image(an Icon that suggests the favorite songs of a user) the related audio file of that particular Image should be stored in database accordingly.</p><p>If anybody knows it, provide me a solution or code.</p><p>Thanks,david brown</p>","422859","","379693","","2011-03-02 04:02:20","2011-03-02 04:02:20","Android - Adding/Deleting/Updating records in Database by coding","<android><database><image><connection><click>","3","0","","",""
"4405985","1","","","2010-12-10 05:32:21","6","1323","<p>I am having list of contacts present in an Android device. I want to fetch the associated groupIds and GroupName of all the contacts. I have been trying to use ContactsContract.Groups._ID to get the ID, but I am not able to get it. Can someone provide me other way to get the groupID of contact?</p>","525175","","680925","","2012-05-03 10:19:15","2012-08-09 19:10:26","How can i get a groupId / GroupName of a Contact in Android?","<android><contacts><android-contacts>","1","2","","",""
"4406067","1","","","2010-12-10 05:47:12","33","53249","<p>Thanks for the two answers showing how to delete the database file from the <code>Android file system</code>.  Now for extra credit - How can I do this programatically?  Can I have a shell script launch <code>adb</code> which in turns runs a shell script in the Android space to do the database deletion? Can I get this done from within a <code>JUnit</code> test case (with a <code>system()</code> call)?</p><p>Thanks again</p><p>How do I delete an entire database in Android.  I need to make the whole thing go away so I can test database creation.  I can drop tables but that's not enough.  This is in the emulator, not on a phone.</p>","512578","","948041","","2012-05-16 13:38:20","2013-09-30 21:07:15","How to delete SQLite database from Android programmatically","<android><sqlite>","4","1","13","",""
"4406068","1","4406095","","2010-12-10 05:47:15","0","330","<p>So I was wondering if adding multiple activities in my app, do each require a manifest xml file or whatever?I tried switching activities without it and it crashed.Then I added the other activity and it worked.I ask because I hate the use of xml so I try to do everything programatically.</p>","507007","","","","","2010-12-10 06:31:36","Android do activities require a manifest file?","<java><android><activity>","2","2","1","",""
"4406169","1","","","2010-12-10 06:06:36","2","1483","<p>I'm using MediaPlayer to play back some videos in an Android application, and they are noticeably faster on my device as when viewed on a computer.  </p><p>Is there any way to control the playback speed of these videos in order to slow them down?</p>","436319","","","","","2012-04-08 12:47:15","Control the playback speed of Android MediaPlayer","<android>","1","1","","",""
"4406232","1","","","2010-12-10 06:17:13","0","176","<p>We have four ListViews in a FrameLayout in one of our activities. Wealso have a common WebView in this Framelayout set as EmptyView foreach of these lists.The content of this TextView is supposed to change at runtimedepending on different contexts.</p><p>As a result, we call:<br>1. mEmptyView.loadData(...) followed by<br>2. mListOne.setEmptyView(mEmptyView) calls.  </p><p>This works fine most of the times. But sometimes we are getting,IllegalStateException.</p><pre><code>java.lang.IllegalStateException: The content of the adapter haschanged but ListView did not receive a notification. Make sure thecontent of your adapter is not modified from a background thread, butonly from the UI thread. [in ListView(2131362332, classandroid.widget.ListView) with Adapter(class my.own.activity.MainAct$UIAdapter)]at android.widget.ListView.layoutChildren(ListView.java:1492)at android.widget.AbsListView.onLayout(AbsListView.java:1147)at android.widget.AdapterView.updateEmptyStatus(AdapterView.java:724)at android.widget.AdapterView.setEmptyView(AdapterView.java:637)</code></pre><p>Question: Is it safe to change content of an empty view and callListView#setEmptyView at runtime?</p>","236128","","","","","2010-12-10 18:29:00","Dynamically setting empty views : is it safe?","<android><listview>","1","0","","",""
"4406300","1","4406719","","2010-12-10 06:30:25","1","964","<p>I am starting one application ,this applications runs in iPhone, android, windows and web based. How can implement total starting to ending architecture all requirement and functional  requirements.</p><p>Thanks in Advance </p>","254790","","1051924","","2011-11-22 13:12:58","2011-11-22 13:12:58","how to design architecture of mobile android application","<android><architecture>","1","0","2","",""
"4406308","1","","","2010-12-10 06:31:46","0","856","<p>I have written a java program that takes screenshot of desktop... can i install this java app on android emulator and launch it by clicking on that..before installing on to emulator what all changes i should make to the java code and how to port it to the emulator later...</p><p>Thanks Manju</p>","505580","","","","","2010-12-10 08:07:42","how to install and run a java app on android emulator","<java><android><port>","1","0","","",""
"4406356","1","4408315","","2010-12-10 06:40:31","4","3511","<p>I am very new to Android sdk. I need to display a dotted circle with in the view. But My requirement is to display a dotted circle. But I don't have an idea how to do it?. Can you guys please let me know if any one know this ?</p><p>Thank you,-Sek.</p>","533835","","105224","","2010-12-10 07:02:57","2013-08-04 19:41:58","How to draw a dotted circle in android sdk?","<java><android>","1","0","","",""
"4406442","1","4406584","","2010-12-10 06:55:54","1","869","<p>I'm pretty new to OpenGl and am having trouble displaying a VBO based grid mixed with normal 3D objects. I can draw textured triangles on their own, but when I include the VBO grid the triangles stop displaying.I get a quick flash of the triangles before they're replaced by the grid - presumably because they're rendered first they feature in the first frame before being disabled.</p><p>I've tried to disable all the states I've enabled (and vice versa) and pop all the matrices I've pushed etc...</p><p>I've unrolled the OpenGl calls to simplify the code: </p><pre><code>// initial OpenGl setupgl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);gl.glClearColor(0.0f, 0.0f, 0.0f, 1);gl.glShadeModel(GL10.GL_FLAT);gl.glDisable(GL10.GL_DEPTH_TEST);gl.glEnable(GL10.GL_TEXTURE_2D);gl.glDisable(GL10.GL_DITHER);gl.glDisable(GL10.GL_LIGHTING);gl.glTexEnvx(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);gl.glViewport(0, 0, width, height); // width and height of surface// render loop startgl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);gl.glMatrixMode(GL10.GL_PROJECTION);gl.glLoadIdentity();final float halfWidth = State.me.viewWidth / 2;final float halfHeight = State.me.viewHeight / 2;gl.glOrthof(-halfWidth, halfWidth, -halfHeight, halfHeight, 0.0f, 1.0f);gl.glScalef(1f, -1f, 1f);// draw quad        gl.glMatrixMode(GL10.GL_MODELVIEW);gl.glPushMatrix();gl.glLoadIdentity();gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);gl.glEnable(GL10.GL_TEXTURE_2D);gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);gl.glTranslatef(x, y, -1.0f);gl.glRotatef(angle, 0f, 0f, 1f);gl.glBindTexture(GL10.GL_TEXTURE_2D, texture);gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mVertexBuffer);gl.glEnable(GL10.GL_TEXTURE_2D);gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, mTexBuffer);gl.glDrawElements(GL10.GL_TRIANGLES, VERTS, GL10.GL_UNSIGNED_SHORT, mIndexBuffer);gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);          gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);   gl.glDisable(GL10.GL_TEXTURE_2D);gl.glMatrixMode(GL10.GL_MODELVIEW);gl.glPopMatrix();gl.glLoadIdentity();// draw VBO gridgl.glBindTexture(GL10.GL_TEXTURE_2D, texture);gl.glMatrixMode(GL10.GL_MODELVIEW);gl.glPushMatrix();gl.glLoadIdentity();gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);gl.glEnable(GL10.GL_TEXTURE_2D);GL11 gl11 = (GL11) gl;gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertBufferIndex);gl11.glVertexPointer(3, mCoordinateType, 0, 0);gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mTextureCoordBufferIndex);gl11.glTexCoordPointer(2, mCoordinateType, 0, 0);gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mIndexBufferIndex);gl11.glDrawElements(GL11.GL_TRIANGLES, count, GL11.GL_UNSIGNED_SHORT, startIndex * CHAR_SIZE);gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);gl.glMatrixMode(GL10.GL_MODELVIEW);gl.glPopMatrix();gl.glLoadIdentity();</code></pre><p>so to re-cap, if I remove the draw VBO grid code the triangles display, but as soon as it's included the triangles disappear.</p><p>Any ideas, hints for something to try, a direction for me to research or anything like that would be appreciated.Feel free to point out if I'm doing anything unnecessary or stupid too.</p><p>Cheers.</p>","526478","","44729","","2010-12-10 15:42:04","2010-12-10 15:42:04","Why does drawing my OpenGL-ES VBO grid prevent other triangles from displaying?","<android><opengl-es><3d><vbo>","1","0","","",""
"4406485","1","","","2010-12-10 07:06:35","0","1885","<p>I using sqllite for my search module.I select multiple status value in sqllite using below code.The error is occured at run time. pls help me.......</p><p>Error:</p><pre><code>12-10 12:31:56.686: ERROR/AndroidRuntime(848): Uncaught handler: thread main exiting due to uncaught exception12-10 12:31:56.686: ERROR/AndroidRuntime(848): android.database.sqlite.SQLiteException: unrecognized token: ""'"": , while compiling: select * from issues where  Status IN (CLO,NEW)'12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at android.database.sqlite.SQLiteProgram.native_compile(Native Method)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:59)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:49)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:49)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1118)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1092)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at ez.com.Action_module_screen.setListval1(Action_module_screen.java:1062)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at ez.com.Action_module_screen$4.handleMessage(Action_module_screen.java:695)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at android.os.Handler.dispatchMessage(Handler.java:99)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at android.os.Looper.loop(Looper.java:123)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at android.app.ActivityThread.main(ActivityThread.java:4203)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at java.lang.reflect.Method.invokeNative(Native Method)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at java.lang.reflect.Method.invoke(Method.java:521)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)12-10 12:31:56.686: ERROR/AndroidRuntime(848):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>My Code:</p><pre><code> String sta=Search.status2; String doc=Search.document; String[] items=sta.split("",""); String statusFilter = "" Status IN ("" + items[0]; StringBuilder builder = new StringBuilder(statusFilter); for (int j = 1; j &lt; items.length; j++) {   builder.append("","");   builder.append(items[j]); } builder.append(')');  Cursor dbcur = myDB.rawQuery(""select * from ""+TABLE_NAME+"" where "" + builder.toString() + ""'"", null);  if(dbcur.moveToFirst())     {      int k=0;      System.out.println(""enter first"");        do         {      String title1=dbcur.getString(dbcur.getColumnIndex(""Title""));      System.out.println(""title""+title1);      String name1=dbcur.getString(dbcur.getColumnIndex(""Name""));      System.out.println(""name""+name1);      String open1=dbcur.getString(dbcur.getColumnIndex(""Open""));      System.out.println(""open""+open1);      String close1=dbcur.getString(dbcur.getColumnIndex(""Close""));      System.out.println(""close""+close1);      String no1=dbcur.getString(dbcur.getColumnIndex(""No""));      System.out.println(""no""+no1);      no.add(no1+"",""+k);   first.put(no1+"",""+k, title1);   second.put(no1+"",""+k,name1);   third.put(no1+"",""+k, open1);   fourth.put(no1+"",""+k,close1);   k=k+1;    mylist=sorting(no,1,true);         }while(dbcur.moveToNext());          }     dbcur.close();  myDB.close();</code></pre>","533787","","245706","","2010-12-10 07:08:31","2010-12-10 08:46:45","How to below sql query error","<android><sqlite>","2","1","","",""
"4406522","1","","","2010-12-10 07:11:36","0","695","<p>I am writing an application in which i have two Activities and one service.Now i want to get some values from service through main activity and send that values to second activity. Basically i want to get a string array back from service and send that array in to next activity. I know i can send that sring array to next activity by the help of Intent.putextra(). But i don't how to get string array from service which is running in background. Please help me..Thankx..</p>","537472","","683261","","2012-01-30 09:09:53","2012-01-30 09:09:53","How to get values back from service?","<android><android-service>","1","0","","",""
"4406524","1","5052224","","2010-12-10 07:11:42","13","11517","<p>I want to know how to add a shadow layer to any general View in android.  for eg: suppose i have a layout xml, showing something like this..</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;LinearLayout      android:layout_height=""wrap_content""      android:layout_width=""wrap_content""      &lt;Button....      ...  &lt;/LinearLayout&gt;  </code></pre><p>Now when it is displayed I want to have a shadow around it.  </p>","537512","","114066","","2011-11-10 16:31:16","2013-10-22 22:40:03","how to set shadow to a View in android?","<android><view><shadow>","3","0","8","",""
"4406545","1","","","2010-12-10 07:14:46","5","8712","<p>How we can insert multiple rows in Sqlite database at same time?  I'm using Android with Java.</p>","534957","","445131","","2013-01-14 15:51:00","2014-02-16 00:39:19","In Sqlite database, How to Insert Multiple Rows in Table at same time","<android><sqlite><insert>","3","2","4","",""
"4406580","1","4406915","","2010-12-10 07:21:16","0","1012","<p>Hi all Stack Overflow members,</p><p>I have written native Java code to capture a screen shot of the desktop. It uses the following libraries; are these libraries allowed in Android? If not, what should I do to take screen shots in Android?</p><pre><code>javax.swing.*;javax.imageio.*;java.awt.*;java.awt.event.*;java.awt.image.*;java.awt.AWTException;java.awt.Robot;java.awt.Rectangle;java.awt.Toolkit;java.awt.image.BufferedImage;</code></pre>","505580","","41619","","2010-12-10 09:28:11","2012-09-08 15:02:24","are java libraries allowed in android..?","<java><android>","3","2","","",""
"4406582","1","","","2010-12-10 07:21:55","1","6527","<p>I have defined a image view programatically and updating it asynchronously with the images downloaded from the webservice. </p><p>Now, i want to add a progress bar to image view so that the image view will show the progress bar till the image is loaded. I have not defined the imageview in the xml file because i am updating it inside a horizontal scroll view. </p><p>Please help need it desperately...!!!</p><p>Here's the code that i am updating the image view</p><pre><code>protected ImageView asImageView(final String message,final String path){    final ImageView iv=new ImageView(this);    AsyncImageLoaderv asyncImageLoaderTop = new AsyncImageLoaderv();    Bitmap cachedImageTop=    asyncImageLoaderTop.loadDrawable(            path, new AsyncImageLoaderv.ImageCallback() {                public void imageLoaded(Bitmap imageDrawable,                        String imageUrl) {                    iv.setImageBitmap(imageDrawable);                }            });    iv.setImageBitmap(cachedImageTop);    iv.setScaleType(ImageView.ScaleType.FIT_XY);    LinearLayout.LayoutParams params=  new LinearLayout.LayoutParams(100,120);    params.setMargins(10, 10, 10, 10);    iv.setLayoutParams(params);    iv.setOnClickListener(new OnClickListener() {        public void onClick(View arg0) {            startActivity(new Intent(getApplicationContext(),                    ShowPhotoActivity.class).putExtra(""imagePath"",                    path).putExtra(""message"", message));        }    });    return iv;}</code></pre>","303155","","303155","","2010-12-10 07:29:58","2012-10-28 00:39:03","How to insert a progress bar on a image view programatically","<android><progress-bar>","3","0","","",""
"4406590","1","","","2010-12-10 07:23:54","1","1961","<p>I am trying to extend the <a href=""http://developer.android.com/resources/samples/SampleSyncAdapter/index.html"" rel=""nofollow"">SampleSync</a> application. After I install the app, I can go to settings -> accounts &amp; sync -> add account to add an account. However, if I want to check from my Application code and want to trigger AccountManager to add a new account directly, what should be the best way?</p>","321098","","4100","","2011-03-12 21:36:44","2011-04-06 09:22:54","How to trigger Account Manager to add new account from application","<android><account-management>","1","0","1","",""
"4406615","1","4463807","","2010-12-10 07:29:19","0","622","<p>Is there any Android emulators for testing like Sprint Toolkit, Sun java toolkit?</p><p>I need to test my android application. How to test the android application?</p>","488433","","488433","","2010-12-16 11:48:38","2010-12-17 10:01:08","Is there any Android emulator toolkit for testing?","<android><testing><emulator>","5","2","1","",""
"4406625","1","4407587","","2010-12-10 07:31:08","1","1097","<p>Is there anyway to set onlickListener inside a flipper view. In my application, there is a question wizard with ""Next"",""Previous"" and ""Finish"" button. I have used the ViewFlipper to flip through all the questions. There is having a textview and 4 radiobuttons wrapped inside a Radiogroup for each view in flipper. I want to get the value of the RadioButton selected when users click the finish button. What I have planned to do is, call a function to store the value in an array each time when the radio button is clicked and get the array when clicking on the finish button. Is there any suggestion how to establish this!</p><p>My Question wizard will look like this:</p><p><img src=""http://i.stack.imgur.com/o3LM8.jpg"" alt=""alt text""></p>","395959","","","","","2010-12-10 09:56:07","How to set onclick listener inside Viewflipper","<android><onclick><viewflipper>","1","0","1","",""
"4406679","1","14103175","","2010-12-10 07:43:12","2","890","<p>Now I want to set the tab widget like this style:<img src=""http://i.stack.imgur.com/UB0Jb.png"" alt=""alt text""></p><p>how should I do? All I know the possibility is to modify the Android source code, Any better ideas? Thanks a lot!</p>","354459","","354459","","2010-12-13 05:53:02","2012-12-31 15:10:01","android: how to set tabs of tabhost in two lines?","<android><tabs><android-tabhost><tabwidget>","1","5","1","",""
"4406705","1","","","2010-12-10 07:47:03","2","506","<p>When I run my application, it is running as it is,but i don't want to close main screen.When any person want to close that activity than no one can close that applicationMeans in short, Once my app start, no one can interact other applicationIt is possible in android?</p><p>Please give me ans.</p><p>Thanks,</p><p>Pintu</p>","537403","","537403","","2010-12-10 12:10:27","2010-12-10 12:10:27","I don't want to close my app in Android?","<android>","2","0","","",""
"4406804","1","4447449","","2010-12-10 08:04:57","11","26334","<pre>AlertDialog.Builder builder = new AlertDialog.Builder(this);            builder.setTitle(""Title"");            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();</pre><p>I am using above code to show alert dialog , By default it fills the screen in width and wrap_content in height.<br>How to control the width and height of default alert dialog ?<br>I tried , alert.getWindow().setLayout(100,100); // It dint work.<br>How to get the layout params on the alert window and set manually the width and height ?   </p>","207646","","207646","","2010-12-10 12:42:25","2013-09-02 10:46:43","how to control the width and height of default alert dialog in Android?","<android><android-widget>","3","0","4","",""
"4406827","1","4407089","","2010-12-10 08:08:19","0","550","<p>I would like to set background image or a list item when selected or pressed and then back to normal state, just like a normal listview works.</p><p>I have created list using custom listadapter.</p><p>Cheers,Prateek</p>","481314","","","","","2010-12-10 08:53:07","Setting background image of a ListItem created using ListAdapter for a while in Android","<android><listview>","1","0","","",""
"4406866","1","","","2010-12-10 08:15:23","-1","138","<p>How do I uninstall an application using code? I have no idea...</p>","1837505","","840973","","2011-12-15 11:18:34","2011-12-15 11:18:34","Android - Uninstalling using Code","<android>","1","1","","",""
"4407003","1","","","2010-12-10 08:38:12","0","447","<p>I write simple program for tts. I want to study tts function. My code is below.</p><pre><code>    String wakeUpText = ""Are you up yet?"";    String destFileName = ""/mnt/sdcard/hello.wav"";    mTts.addSpeech(wakeUpText, destFileName);    mTts.speak(wakeUpText, TextToSpeech.QUEUE_ADD, null);</code></pre><p>you can see the code is very like <a href=""http://developer.android.com/resources/articles/tts.html"" rel=""nofollow"">http://developer.android.com/resources/articles/tts.html</a></p><p>My problem is that if the hello.wav is not exist, tts cannot speak.</p><p>error log is below</p><pre><code>DEBUG/MediaPlayer(398): java.io.IOException: Prepare failed.: status=0x1</code></pre><p>...</p><pre><code>DEBUG/SntpClient(70): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre><p>How can I do?</p>","537579","","1012284","","2013-02-28 07:07:47","2013-02-28 07:07:47","How can I do addSpeech() in TTS of Android?","<android><text-to-speech>","1","0","","",""
"4407069","1","4407714","","2010-12-10 08:50:20","0","709","<p>Does the android platform impose any restrictions on RESTful web service calls? Is there anything a developer should be aware of or is it simply a case of calling a given URL and handling the responses?</p><p>Do I need to use a framework, something like RESTlet?</p><p>I have used REST (yahoo developer APIs) a few times, but haven't done so from android, intersted to know if there is anything I need to be cautious of.</p><p>Regards</p>","155695","","","","","2010-12-10 10:08:28","Does the android platform impose any restrictions to REST that developers should be aware of?","<android><rest>","1","0","1","",""
"4407072","1","12390141","","2010-12-10 08:50:24","4","1846","<p>Is there a way we can achieve Pinch zoom ability to the imageview?</p>","450487","","","","","2012-11-29 00:13:32","Pinch zoom in android 2.1","<android><multi-touch><pinch>","1","0","1","",""
"4407106","1","4410407","","2010-12-10 08:55:42","0","479","<p>I want to know what profile will be better for implementing communication between device and tablet. The tablet will run on android platform? SPP or HID?Which tablets are available to test the functionality?</p>","296257","","","","","2010-12-10 15:32:19","Bluetooth profiles for tablets","<android><bluetooth><tablet>","1","0","","",""
"4407140","1","","","2010-12-10 09:01:52","9","1585","<p>Handler or Listeners. What is better use for notification of event? What is faster, more efficient etc.?</p>","479211","","","","","2012-03-05 23:49:29","Handler or Listeners. What is better?","<android><listener><handler>","2","0","2","",""
"4407146","1","","","2010-12-10 09:02:43","0","137","<pre><code>  I have a view for ads in my application .</code></pre><p>if my application has no ads to show then the View  must not be visible (no blank space).  how can i do that ??????????</p><p>Thanks in advance for your valuable  time time</p><p>Regards,Kariyachan.</p>","482604","","","","","2010-12-10 09:06:00","View does not Visible if it has nothing to show how?","<android><android-layout>","1","0","","",""
"4407185","1","4407278","","2010-12-10 09:08:50","0","270","<p>In my application, whenever the orientation of my screen changes, I want to display different images that will fit the screen. How can I do that?</p><p>Thanx in advance.</p>","227943","","","","","2010-12-10 09:20:00","Different size images for different orientations android","<android><image><screen-orientation>","1","0","","",""
"4407201","1","4407262","","2010-12-10 09:10:41","4","2035","<p>I have an app with main class called:com.quarlityaq.quarlityaqcall.QuarlityaqCall.</p><p>After finishing programming I've changed the app name to ""JCall for jobs""by changing <strong>app_name</strong> under <strong>strings.xml</strong> to ""<strong>JCall for jobs</strong>""</p><p>android:label=""@string/app_name""<br>android:name=""@string/app_name""</p><p>On my device it works just fine, but on some other devices it crashes and throws:</p><p>java.lang.RuntimeException: Unable to instantiate application com.quarlityaqcall.QuarlityaqCall.JCall for jobs: java.lang.<strong>ClassNotFoundException</strong>: <strong>com.quarlityaqcall.QuarlityaqCall.JCall for jobs</strong> in loader dalvik.system.PathClassLoader[/data/app-private/com.quarlityaqcall.QuarlityaqCall-1.apk]</p><p><strong>...</strong><br><strong>...</strong></p><p>Caused by: java.lang.ClassNotFoundException: <strong>com.quarlityaqcall.QuarlityaqCall.JCall for jobs</strong> in loader dalvik.system.PathClassLoader[/data/app-private/com.quarlityaqcall.QuarlityaqCall-1.apk]</p><p>I don't get it, why it looks for a class name ""JCall for jobs"", instead of ""QuarlityaqCall"", and why it only happens on some devices?</p><p>Thanks!</p>","257764","","","","","2013-09-17 13:37:36","ClassNotFoundException after changing app's name in Android","<android>","2","1","1","",""
"4407224","1","","","2010-12-10 09:13:09","0","1080","<p>I have an application in which I click:</p><p>Menu -> Catalogue -> Product Group -> Product Detail (where I click ""Add to cart"" and open the Cart) -> Cart (where I click ""Save cart"")</p><p>Cart Activity is then <code>finish()</code>-ed and Product Group is shown. But I want Menu Activity to be shown.</p><p>Should I just use<code>Intent intent = new Intent(this, Menu.class);startActivity(intent);</code></p><p>to open the menu, or is there a possibility to wake Menu Activity up.</p><p>Hope it's clear :)</p><p>EDIT 2010/12/15</p><p>This is call from Cart Activity</p><pre><code>Intent intent = new Intent(this, Menu.class);intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);startActivity(intent);</code></pre><p>and it closes the application :(</p><p><strong>SOLVED 2010/12/17</strong>:</p><pre><code>Intent intent = new Intent(this, Menu.class);//          intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);            startActivity(intent);</code></pre><p>Don't forget to add <code>android:launchMode=""singleTop""</code> into the manifest.xml</p>","295141","","114066","","2011-01-19 10:00:20","2011-01-19 10:00:20","How to wake up an Activity in Android?","<android><activity>","1","0","1","",""
"4407319","1","4407345","","2010-12-10 09:26:13","1","221","<p>How to produce shaking(revaberating) effect in android(Similar to PS2 when a car hit an obstacle)? </p>","527617","","","","","2010-12-10 09:30:00","Shaking Android device","<android>","1","1","","",""
"4407391","1","","","2010-12-10 09:35:05","2","1536","<p>I have 2 tabs each containing videoView. But when I switch to the second tab the video plays the audio is working, but the video doesn't plays and the view is only black. This works fine in Android 2.1 + , but it does't in 1.6 Here is my code:</p><p>TabActivity:</p><pre><code>package com.example.tab;import android.app.TabActivity;import android.content.Intent;import android.os.Bundle;import android.widget.TabHost;public class main extends TabActivity {    /** Called when the activity is first created. */ private TabHost tabHost; public void onCreate( Bundle savedInstanceState){ super.onCreate(savedInstanceState); tabHost = getTabHost();    Intent intent1 = new Intent(this, Video1.class);   Intent intent2 = new Intent(this, Video2.class);     tabHost.addTab(tabHost.newTabSpec(""Tab1"")        .setIndicator(""Video1"")        .setContent(intent1.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)));     tabHost.addTab(tabHost.newTabSpec(""Tab2"")    .setIndicator(""Video2"")    .setContent(intent2.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP))); }}</code></pre><p>Video1 activity:</p><pre><code>/** *  */package com.example.tab;import android.app.Activity;import android.content.Intent;import android.content.res.Configuration;import android.net.Uri;import android.os.Bundle;import android.util.Log;import android.view.Menu;import android.view.MenuItem;import android.view.SurfaceHolder;import android.view.View;import android.widget.MediaController;import android.widget.VideoView;/** * @author lyubomir.todorov *  */public class Video1 extends Activity implements SurfaceHolder.Callback { private String path = ""http://xxx.xxx""; private VideoView mVideoView; private SurfaceHolder holder; private static final int INSERT_ID = Menu.FIRST; private static final String TAG = ""Tab""; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.videoview1);  mVideoView = (VideoView) findViewById(R.id.surface_view1);//  holder = mVideoView.getHolder();//  holder.addCallback(this);//  holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); }      public boolean onCreateOptionsMenu(Menu menu) {  super.onCreateOptionsMenu(menu);  menu.add(0, INSERT_ID, 0, ""FullScreen"");  return true; } public boolean onOptionsItemSelected(MenuItem item) {  Log.d(TAG, ""Player re-started after device configuration change"");  return true; } @Override public void onConfigurationChanged(Configuration newConfig) {  super.onConfigurationChanged(newConfig); } @Override protected void onResume() {  // TODO Auto-generated method stub  super.onResume();  PlayVideo();  Log.d(TAG, ""onResume Video1""); } protected void onPause() {  super.onDestroy();  Log.d(TAG, ""onPause Video1"");  if (mVideoView != null) {   mVideoView.stopPlayback();   mVideoView.setVisibility(View.GONE);   mVideoView=null;   Log.d(TAG, ""onPause1 Video1"");  } } public void surfaceDestroyed(SurfaceHolder surfaceholder) {  holder.isCreating();  Log.d(TAG, ""video1 surfaceDestroyed called""); } public void surfaceCreated(SurfaceHolder holder) {  Log.d(TAG, ""Current 1 surfaceCreated called"");  Log.d(TAG, Boolean.valueOf(holder.isCreating()).toString());  // playVideo(extras.getInt(MEDIA)); } public void PlayVideo() {  mVideoView.setVideoPath(path);  mVideoView.start();  mVideoView.setMediaController(new MediaController(this));  mVideoView.setVisibility(View.VISIBLE); } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width,   int height) {  Log.d(TAG, Boolean.valueOf(holder.isCreating()).toString());  // TODO Auto-generated method stub  Log.d(TAG, ""Current video surfaceChanged called""); }}</code></pre><p>videoview1.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;VideoView android:id=""@+id/surface_view1""   android:layout_width=""320dip"" android:layout_height=""240dip""    /&gt; &lt;/LinearLayout&gt;</code></pre><p>Video2 activity:</p><pre><code>/** *  */package com.example.tab;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.SurfaceHolder;import android.view.View;import android.widget.MediaController;import android.widget.VideoView;/** * @author lyubomir.todorov *  */public class Video2 extends Activity implements SurfaceHolder.Callback { private String path = ""http://xxx.xxx""; private VideoView mVideoView; private SurfaceHolder holder; private static final String TAG = ""Tab""; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.videoview2);  mVideoView = (VideoView) findViewById(R.id.surface_view2);//  holder= mVideoView.getHolder();//  holder.addCallback(this);//  holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } @Override protected void onResume() {  // TODO Auto-generated method stub  super.onResume();      PlayVideo();  Log.d(TAG, ""onResume Video1""); } protected void onPause() {  super.onPause();  Log.d(TAG, ""onPause Video2"");  if (mVideoView!=null){   mVideoView.stopPlayback();   mVideoView.setVisibility(View.GONE);   Log.d(TAG, ""onPause1 Video2"");  } } public void surfaceDestroyed(SurfaceHolder surfaceholder) {  holder.isCreating();  Log.d(TAG, ""video1 surfaceDestroyed called""); } public void surfaceCreated(SurfaceHolder holder) {  Log.d(TAG, ""Current 1 surfaceCreated called"");  Log.d(TAG, Boolean.valueOf(holder.isCreating()).toString()); } public void PlayVideo() {       mVideoView.setVisibility(View.VISIBLE);       mVideoView.bringToFront();       mVideoView.setVideoPath(path);       mVideoView.start();       mVideoView.setMediaController(new MediaController(this));} @Override public void surfaceChanged(SurfaceHolder holder, int format, int width,   int height) {  Log.d(TAG, Boolean.valueOf(holder.isCreating()).toString());  // TODO Auto-generated method stub  Log.d(TAG, ""Current video surfaceChanged called""); }}</code></pre><p>videoview2.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;VideoView android:id=""@+id/surface_view2""   android:layout_width=""320dip"" android:layout_height=""240dip""    /&gt; &lt;/LinearLayout&gt;</code></pre>","446132","","","","","2012-09-09 09:38:47","VideoView doesn't show the video when switching tabs","<android><android-tabhost><videoview>","1","0","","",""
"4407454","1","","","2010-12-10 09:42:54","1","437","<p>I have included one header view to every views in my application. And also can implement  button click etc to this header with the help of answer :</p><p><a href=""http://stackoverflow.com/questions/4387718/include-in-android-using-java"">Include in android using java</a></p><p>But my requirement is on button click, it should start another activity. when I click the button, it stopped suddently. But other activitites like Toast, button.setText() etc is working fine on button click.</p><h2>Home.class</h2><pre><code> TextView txtMarket = (TextView) findViewById(R.id.txtMarket); TextView txtNews = (TextView) findViewById(R.id.txtNews); ImageButton imgLogout=(ImageButton)findViewById(R.id.imgLogout); ImageButton imgDashBoard=(ImageButton)findViewById(R.id.imgDashBoard); Header objHeader=new Header(imgLogout,txtMarket,txtNews,imgDashBoard,getBaseContext()); objHeader.init();</code></pre><h2>Header.class</h2><pre><code> //in Header class public Header(ImageButton btnLogin,TextView txtMarket,TextView txtNews,ImageButton imgDashBoard,Context context)  {               this.btnLogin = btnLogin;      this.txtMarket = txtMarket;          this.txtNews = txtNews;      this.imgDashBoard = imgDashBoard;      this.context=context; } public void init()  {        btnLogin.setOnClickListener(new View.OnClickListener() {                         public void onClick(View view)      {            Intent loginIntent=new Intent();                               Toast.makeText(context, ""u clicked the button"", 1).show();       loginIntent.setClass(view.getContext(),login.class);       startActivity(loginIntent);           }});}</code></pre><p>Please help me friends....</p><h2>Edited</h2><p>When I am defining like : </p><p>Intent loginIntent=new Intent(Home.this,login.class);</p><p>then it shows an error :</p><p>""No enclosing instance of the type loginHome is accessible in scope""</p><p>And if I am giving like :</p><p>When I am defining like : </p><p>Intent loginIntent=new Intent(Header.this,login.class);</p><p>then it  caught NullPointerException</p>","523058","","523058","","2010-12-10 11:56:38","2010-12-10 12:09:15","android: problem when including a layout","<android><layout><include>","2","2","0","",""
"4407516","1","","","2010-12-10 09:48:58","1","518","<p>I'm looking into game development across Android, iPhone AND Windows Phone 7, and i was wondering if anyone knows of good solutions and the state of the solutions. I'm considering MonoTouch/Droid as a development platform. There are a bunch of questions here:</p><ol><li>Does XNATouch support MonoDroid?</li><li>Does XNATouch have basic 3D support? (read: textured animated models)</li><li>Are there any other options that have WP7 support</li></ol><p>Please note, that i am fully aware of Unity, Airplay and other SDKs that support 2 of the 3 platforms, but i'm really hoping that there is a nice solution that fits all three without having to write a graphics abstraction layer ( due to project time constraints ).</p><p>Thanks in advance!</p>","25893","","","","","2011-08-11 11:02:01","Cross platform mobile gaming?","<iphone><android><mono><monotouch><monodroid>","2","2","1","",""
"4407532","1","4407731","","2010-12-10 09:50:43","18","39461","<p>I have problem when trying to parse with minimum value to map in Android.</p><p>There some sample JSON format with more information ex:</p><pre><code>[{id:""1"", name:""sql""},{id:""2"",name:""android""},{id:""3"",name:""mvc""}]</code></pre><p>This that example most common to use and easy to use just use <code>getString(""id"")</code> or <code>getValue(""name"")</code>.</p><p>But how do I parse to map using this JSON format with just only string and value minimum format to java map collection using looping. And because the string json will always different one with another. ex:</p><pre><code>{""1"":""sql"", ""2"":""android"", ""3"":""mvc""}</code></pre><p>Thank</p>","473962","","","","","2010-12-10 10:11:32","Parse JSON object with string and value only","<java><android><json><parsing><map>","2","0","9","",""
"4407553","1","4407803","","2010-12-10 09:53:01","18","8399","<p>I am generating RadioButtons dynamically with </p><pre><code>RadioButton radioButton=new RadioButton(context);  LayoutParams layoutParams=new LayoutParams(radioWidth,radioHeight);layoutParams.gravity=Gravity.CENTER;radioButton.setLayoutParams(layoutParams);radioButton.setGravity(Gravity.CENTER);BitmapDrawable bitmap = ((BitmapDrawable)drawableResource);bitmap.setGravity(Gravity.CENTER);radioButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.itabs_radio));radioButton.setButtonDrawable(bitmap);</code></pre><p>as you can see I am desperately trying to set gravity of button drawable to center, but without a reason its always center and left aligned, heres the reason- the default style of android radio button:</p><pre><code>&lt;style name=""Widget.CompoundButton""&gt;&lt;item name=""android:focusable""&gt;true&lt;/item&gt; &lt;item name=""android:clickable""&gt;true&lt;/item&gt;&lt;item name=""android:textAppearance""&gt;?android:attr/textAppearance&lt;/item&gt; &lt;item name=""android:textColor""&gt;?android:attr/textColorPrimaryDisableOnly&lt;/item&gt; &lt;item name=""android:gravity""&gt;center_vertical|left&lt;/item&gt; &lt;/style&gt;&lt;style name=""Widget.CompoundButton.RadioButton""&gt;&lt;item name=""android:background""&gt;@android:drawable/btn_radio_label_background&lt;/item&gt; &lt;item name=""android:button""&gt;@android:drawable/btn_radio&lt;/item&gt; &lt;/style&gt;</code></pre><p><strong>Is there any way I can align button drawable to center?</strong></p>","447238","","447238","","2010-12-10 10:12:49","2012-01-02 13:40:25","android RadioButton button drawable gravity","<android><radio-button><center><drawable>","1","0","7","",""
"4407584","1","","","2010-12-10 09:55:46","0","324","<p>I'm building a new android app an looking to use adobe flash in a web view that I am told is supported. However i'm having issues in getting the flash to display.</p><p>Is there a setting in the AndroidManifest.xml file that I need to set to enable this?</p><p>Thanks</p>","537671","","","","","2010-12-10 09:55:46","Android - enable adobe flash","<java><android><flash>","0","2","1","",""
"4407788","1","4407927","","2010-12-10 10:17:53","0","3884","<p>What hex colorcode for grey,<br>is the HTC Sense theme using ?</p>","77115","","","","","2010-12-10 10:48:47","What hex colorcode for grey, is the HTC Sense theme using?","<android><htc><htcsense>","2","6","","",""
"4407797","1","4407978","","2010-12-10 10:18:52","0","953","<p>I have an image and I need it to be shown with its full view as it is. But the image being shown in the phone after loading is a reduced to fit the screen. how do I include the image in full size and resolution as it is so that it can be scrolled to see the width.</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=""#EEEEEE""&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""  android:scrollbars=""vertical""  android:layout_height=""wrap_content""  android:layout_width=""fill_parent"" android:background=""#77aa88""&gt;&lt;LinearLayout android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:gravity=""center""android:background=""#FFFFFF""&gt;&lt;TextView   android:text=""Xkcd""        android:textColor=""#6E7B91""        android:textSize=""28dp""        android:textScaleX=""1.8""        android:id=""@+id/TextHead""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:paddingTop=""10dp""        android:paddingBottom=""10dp""        android:gravity=""center"" /&gt;&lt;TextView   android:text=""A webcomic of romance, sarcasm, math, and language.""        android:textColor=""#000000""        android:textSize=""15dp""        android:textScaleX=""1.1""        android:id=""@+id/TextSub""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:paddingTop=""5dp""        android:paddingBottom=""10dp""        android:gravity=""center"" /&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;&lt;ScrollView  android:scrollbars=""horizontal""  android:layout_height=""match_parent""  android:layout_width=""wrap_content""&gt;&lt;ImageView  android:id=""@+id/MainImage""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         /&gt;&lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","436765","","436765","","2010-12-10 10:27:48","2010-12-10 10:39:45","How To show the image in full view","<android>","1","0","","",""
"4407798","1","4407869","","2010-12-10 10:19:22","0","2237","<p>How to add the image and text to button in code ? and not via xml </p>","526359","","","","","2013-05-08 03:54:57","How to add the image and text to button in code ? and not via xml","<android>","4","0","1","",""
"4407818","1","5537293","","2010-12-10 10:22:23","8","5135","<p>Hi I would like to open the mobile network settings with this code:</p><hr><pre><code>Intent intentSettings = new Intent();intentSettings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);intentSettings.setAction(Settings.ACTION_DATA_ROAMING_SETTINGS);             cont.startActivity(intentSettings);</code></pre><hr><p>but it gives me this error. Any ideas anyone?</p><pre><code>12-10 11:17:34.902: ERROR/AndroidRuntime(623): android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.settings.DATA_ROAMING_SETTINGS flags=0x4000000 }</code></pre><p>Thanks</p>","496042","","750987","","2011-05-28 13:25:27","2012-10-15 18:54:28","Error opening mobile network settings menu","<android><android-intent>","3","0","5","",""
"4407865","1","4408010","","2010-12-10 10:28:29","4","20075","<p>i have a names list and i want to change the color to the rows depending on the letter the name starts with. This is what i'm using to show the ListView:</p><p><strong>main.xml</strong></p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;ListView android:id=""@+id/listview""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""      /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>lisviewrows.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;TextView 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&gt;</code></pre><p><strong>main.java</strong></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);        List&lt;String&gt; words = populateList();        List&lt;String&gt; l = removeDoubles(words);        Collections.sort(l);        ListView lv = (ListView)findViewById(R.id.listview);        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(getApplicationContext(), R.layout.listviewrows, l);        lv.setAdapter(adapter);        lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {            }        });    }</code></pre><p>Is there some useful link you can provide me with or some example?</p><p>Thanks!!</p>","526924","","","","","2013-06-28 05:28:15","how to customize listview row android","<android><listview>","3","0","3","",""
"4407888","1","","","2010-12-10 10:29:52","2","3246","<p>I am trying to create application for sending Email from titanium developer application</p><p>[Code]</p><pre><code>b.addEventListener('click', function() {var emailDialog = Titanium.UI.createEmailDialog();emailDialog.subject = ""Hello from Titanium"";emailDialog.toRecipients = ['foo@yahoo.com'];emailDialog.open();   });</code></pre><p>[/Code]</p><p>it open pop up window for sending email.after composing mail when i click on send .</p><p>It is not sending mail.</p><p>Please Help</p><p>Thanks in AdvancePratik Asthana</p>","537717","","122313","","2010-12-11 04:15:48","2010-12-11 04:44:50","Sending Email Using Titanium Developer Application","<android><titanium>","1","0","","",""
"4408184","1","4409493","","2010-12-10 11:07:25","2","1519","<p>I have a Service that calls some update-methods in a <code>GameLogic</code>-singleton. The<code>GameLogic</code> may decide that some status-update is needed. In this case it informs its listeners about a <code>StatusUpdateEvent</code>. The listeneres then update their view etc.</p><pre><code>public class GameLogic {    // ... attributes ...    private static GameLogic instance = null;    private GameLogic() {        // singleton pattern    }    public static synchronized GameLogic getInstance() {        if (instance == null) {            instance = new GameLogic();        }        return instance;    }    public void checkStatus() {        // called by service        // ... some checks        notifyStatusUpdate(new StatusUpdateEvent());    }    public void addStatusUpdateListener(StatusUpdateListener listener) {        if (!listeners.contains(listener)) {            listeners.add(listener);        }    }    public void removeStatusUpdateListener(StatusUpdateListener listener) {        listeners.remove(listener);    }    protected synchronized void notifyStatusUpdate(StatusUpdateEvent event) {        for (StatusUpdateListener l : listeners) {            l.onStatusUpdate(event);        }    }}</code></pre><p>I have a widget that should listen to the <code>StatusUpdateEvent</code>:</p><pre><code>public class ProjectWidget extends AppWidgetProvider implements StatusUpdateListener {    // ... attributes ...    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {        this.context = context;        this.appWidgetManager = appWidgetManager;        this.remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_2x1);        this.thisWidget = new ComponentName(context, ProjectWidget.class);        GameLogic.getInstance().addStatusUpdateListener(this);    }    @Override    public void onDeleted(Context context, int[] appWidgetIds) {        Toast.makeText(context, ""onDeleted"", Toast.LENGTH_SHORT).show();        GameLogic.getInstance().removeStatusUpdateListener(this);        super.onDeleted(context, appWidgetIds);    }    @Override    public void onStatusUpdate(StatusUpdateEvent e) {        android.util.Log.d(""ProjectWidget"", ""onStatusUpdate"");        // here some class fields are updated like this.project = e.getProject();        // ...        updateViews();        appWidgetManager.updateAppWidget(thisWidget, remoteViews);    }    // ... updateViews() etc.}</code></pre><p>But the problem now is:I add the widget to the homescreen, everythings fine. Then if I delete the widget from the homescreen, I see the onDelete Toast, but afterwards I still see that Log entry: ProjectWidget onStatusUpdate.</p><p>So the listener is not removed.. why? and how can I do that stuff?</p><p>Thanks!</p>","386201","","","","","2010-12-10 13:58:57","android widget after onDelete still listening","<android><widget><listener>","1","0","1","",""
"4408287","1","4489196","","2010-12-10 11:21:23","7","5339","<p>I have a strange issue with bluetooth socket.If I create socket and later close application, android device freeze with very hight CPU load.</p><p>Here my sample code:</p><pre><code>  // open socket  public ConnectThread(final BluetoothDevice device) {    Log.v(ConnectThread.class.getName(), ""Try to get a socket"");    try {      this.socket = device.createRfcommSocketToServiceRecord(UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB""));    } catch (IOException e) {      Log.e(ConnectThread.class.getName(), e.getMessage());    }    Log.v(ConnectThread.class.getName(), ""Got a socket"");  }  // close it  public void cancel() {    try {      Log.v(ConnectThread.class.getName(), ""cancel"");      this.socket.close();    } catch (IOException e) {      Log.e(ConnectThread.class.getName(), e.getMessage());    }  }</code></pre><p>Dispite that I close socket with <code>close()</code> method, I don't understand why Android device freeze after my app close.Please note, that it only socket created, but not connected...</p><p><strong>EDIT:</strong></p><p>OK, there sample code:</p><pre><code>package com.ss.test;import java.io.IOException;import java.util.UUID;import android.app.Activity;import android.bluetooth.BluetoothAdapter;import android.bluetooth.BluetoothDevice;import android.bluetooth.BluetoothSocket;import android.os.Bundle;import android.util.Log;public class testBump extends Activity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    BluetoothDevice device = this.bluetoothAdapter.getRemoteDevice(""58:B0:35:6F:8E:C7"");    Log.e(testBump.class.getName(), ""Try to get a socket"");    try {      this.socket = device.createRfcommSocketToServiceRecord(UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB""));    } catch (IOException e) {      Log.e(testBump.class.getName(), e.getMessage());    }    Log.e(testBump.class.getName(), ""Got a socket"");    Log.e(testBump.class.getName(), ""DESTROY"");    try {      this.socket.close();    } catch (IOException e) {      Log.e(testBump.class.getName(), e.getMessage());    }    Log.e(testBump.class.getName(), ""DESTROYED"");  }  @Override  public void onDestroy() {    super.onDestroy();  }  private BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();  private BluetoothSocket socket = null;}</code></pre><p>and log:</p><pre><code>12-16 11:42:40.558: ERROR/com.ss.test.testBump(3161): Try to get a socket12-16 11:42:40.558: DEBUG/BluetoothSocket.cpp(3161): initSocketNative12-16 11:42:40.558: INFO/BLZ20_WRAPPER(3161): blz20_wrp_socket: fam 31, type 1, prot BTPROTO_RFCOMM12-16 11:42:40.558: DEBUG/BLZ20_WRAPPER(3161): blz20_init: initializing...12-16 11:42:40.558: DEBUG/BTL_IFC_WRP(3161): wsactive_init: init active list12-16 11:42:40.562: INFO/BTL_IFC(3161): main_client_thread: Client main thread starting12-16 11:42:40.651: DEBUG/MediaProvider(2590): mMediaScannerReceiver - intent.getAction : android.intent.action.ACTION_MEDIA_SCANNER_PROGRESS12-16 11:42:40.769: DEBUG/MediaScanner(2590): Normal  556 done (3600msec)12-16 11:42:40.769: DEBUG/MediaScanner(2590): Sync..12-16 11:42:40.851: DEBUG/MediaScanner(2590): Start Nazca /mnt/sdcard/external_sd12-16 11:42:40.851: ERROR/MediaScanner(2590): Cannot get device path from mount info. Check SD Unmounted.12-16 11:42:40.851: DEBUG/MediaScanner(2590): Normal Meta &amp; DB Insert/Update Start12-16 11:42:40.851: DEBUG/MediaScanner(2590): Normal    0 done (1msec)12-16 11:42:40.855: DEBUG/MediaScanner(2590): postscan enter: directories - /mnt/sdcard12-16 11:42:40.874: DEBUG/MediaScanner(2590): start checking FileCacheEntry12-16 11:42:40.878: DEBUG/MediaScanner(2590): end checking FileCacheEntry12-16 11:42:40.940: DEBUG/MediaScanner(2590): postscan return12-16 11:42:40.940: DEBUG/MediaScanner(2590):  prescan time: 109ms12-16 11:42:40.940: DEBUG/MediaScanner(2590):     scan time: 8327ms12-16 11:42:40.940: DEBUG/MediaScanner(2590): postscan time: 86ms12-16 11:42:40.940: DEBUG/MediaScanner(2590):    total time: 8522ms12-16 11:42:40.956: DEBUG/MediaProvider(2590): mMediaScannerReceiver - intent.getAction : android.intent.action.MEDIA_SCANNER_FINISHED12-16 11:42:40.960: ERROR/CscReceiver(2585): onReceive android.intent.action.MEDIA_SCANNER_FINISHED12-16 11:42:40.960: DEBUG/CscReceiver(2585): isCSCimage12-16 11:42:40.960: INFO/global(2585): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.12-16 11:42:40.960: DEBUG/CscParser(2585): ID_path =/system/SW_Configuration.xml12-16 11:42:40.960: DEBUG/CscParser(2585): return ok ID path /system/SW_Configuration.xml12-16 11:42:40.960: DEBUG/CscReceiver(2585): Media DB Scanner finished.12-16 11:42:40.960: ERROR/CscReceiver(2585): check_912-16 11:42:40.972: VERBOSE/MediaProvider(2590): Resuming ThumbWorker12-16 11:42:40.972: INFO/MediaProvider(2590): MediaScanner stopped!!!12-16 11:42:40.983: DEBUG/MediaScannerService(2590): done scanning volume external12-16 11:42:40.983: INFO/MediaScannerService(2590): !@endofMediascannerservice12-16 11:42:41.034: INFO/TEST(3050): Got intent with action Intent { act=android.intent.action.MEDIA_SCANNER_FINISHED dat=file:///mnt/sdcard cmp=com.cooliris.media/com.cooliris.cache.BootReceiver (has extras) }12-16 11:42:41.034: DEBUG/BootReceiver(3050): ACTION_MEDIA_SCANNER_FINISHED: path = /mnt/sdcard12-16 11:42:41.034: DEBUG/BootReceiver(3050): ImageManager.hasStorage()truetrue12-16 11:42:41.190: INFO/CacheService(3050): Refreshing cache.12-16 11:42:41.190: ERROR/DiskCache(3050): Delete All Cache Files!!!12-16 11:42:41.210: ERROR/MTPRx(3059): In MtpReceiverandroid.intent.action.MEDIA_SCANNER_FINISHED12-16 11:42:41.214: WARN/MTPRx(3059): Media scanning is finished12-16 11:42:41.214: INFO/System.out(3059): setting Media scanner status012-16 11:42:41.214: INFO/System.out(3059): After setting Media scanner status012-16 11:42:41.245: WARN/BackupManagerService(2496): dataChanged but no participant pkg='com.android.providers.settings' uid=1003512-16 11:42:41.249: DEBUG/MediaScannerReceiver(2590): onReceive : EXTERNAL scan FINISHED.12-16 11:42:41.261: DEBUG/MediaReceiver(3065): MEDIA SCANNER FINISHED.12-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_init: success12-16 11:42:41.562: INFO/BTL_IFC(3161): BTL_IFC_RegisterSubSystem: Register subsystem [BTS]12-16 11:42:41.562: INFO/BTL_IFC(3161): btl_ifc_ctrl_connect: Connect control channel for subsystem [BTS]12-16 11:42:41.562: DEBUG/BTL_IFC_WRP(3161): wrp_sock_create: CTRL12-16 11:42:41.562: DEBUG/BTL_IFC_WRP(3161): wrp_alloc_new_sock: wrp_alloc_new_sock sub 112-16 11:42:41.562: DEBUG/BTL_IFC_WRP(3161): wrp_sock_create: 3212-16 11:42:41.562: DEBUG/BTL_IFC_WRP(3161): wrp_sock_connect: wrp_sock_connect brcm.bt.dtun:9000 (32)12-16 11:42:41.562: DEBUG/BTL_IFC_WRP(3161): DTUN_MAKE_LOCAL_SERVER_NAME return name: brcm.bt.dtun.900012-16 11:42:41.562: INFO/BTL-IFS(2751): main_server_thread: [CTRL] Client connected (22)12-16 11:42:41.562: INFO/BTL_IFC_WRP(3161): wrp_sock_connect: Connected. (32)12-16 11:42:41.562: INFO/BTL_IFC(3161): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_REGISTER_SUBSYS_REQ (BTS) 0 pbytes (hdl 32)12-16 11:42:41.562: INFO/BTL-IFS(2751): attach_client: multiclient index 112-16 11:42:41.562: INFO/BTL-IFS(2751): attach_client: ######## Attached client subsystem BTS (22) ######## 12-16 11:42:41.562: INFO/BTL-IFS(2751): btl_if_notify_local_event: Notify local event BTLIF_SUBSYSTEM_ATTACHED12-16 11:42:41.562: DEBUG/(2751): btlif_bts_api_ctrl_cb: btlif_bts_api_ctrl_cb : id BTLIF_SUBSYSTEM_ATTACHED (4112) on hdl 2212-16 11:42:41.562: INFO/(2751): btlif_rfc_ctrl_chan_attached: client attached ctrl handle 2212-16 11:42:41.562: DEBUG/BTL-IFS(2751): send_registration_rsp: send_registration_rsp [0]12-16 11:42:41.562: INFO/BTL-IFS(2751): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_REGISTER_SUBSYS_RSP (CTRL) 2 pbytes (hdl 22)12-16 11:42:41.562: DEBUG/BTL_IFC(3161): BTL_IFC_RegisterSubSystem: add new ctrl fd to active set12-16 11:42:41.562: DEBUG/BTL_IFC_WRP(3161): wrp_wsock_create: BTS12-16 11:42:41.562: DEBUG/BTL_IFC_WRP(3161): wrp_alloc_new_sock: wrp_alloc_new_sock sub 1512-16 11:42:41.562: DEBUG/BTL_IFC_WRP(3161): wrp_wsock_create: 3312-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): btsk_alloc_add: success12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_socket: return 3312-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_setsockopt:  fd (-1:33), bta -1, rc 0, wflags 0x0, cflags 0x0, port 012-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_setsockopt: configure rfcomm lm mode 0x26, (master:0, auth 1, enc 1)12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_setsockopt: success12-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_setsockopt:  fd (-1:33), bta -1, rc 0, wflags 0x0, cflags 0x0, port 012-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_setsockopt: configure rfcomm sndbuf len 71680 bytes12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_setsockopt: success12-16 11:42:41.562: DEBUG/BluetoothSocket.cpp(3161): ...fd 33 created (RFCOMM, lm = 26)12-16 11:42:41.562: DEBUG/BluetoothSocket.cpp(3161): initSocketFromFdNative12-16 11:42:41.562: DEBUG/ASOCKWRP(3161): asocket_init12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_fcntl: s 33, cmd 312-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_fcntl:  fd (-1:33), bta -1, rc 0, wflags 0x0, cflags 0x0, port 012-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_fcntl: s 33, cmd 412-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_fcntl:  fd (-1:33), bta -1, rc 0, wflags 0x0, cflags 0x0, port 012-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_fcntl: transparant fcntl12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_fcntl: s 35, cmd 312-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_fcntl: wsock not found, pass through transparantly12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_fcntl: s 35, cmd 412-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_fcntl: wsock not found, pass through transparantly12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_set_asocket: success (33,34,35)12-16 11:42:41.562: ERROR/com.ss.test.testBump(3161): Got a socket12-16 11:42:41.562: ERROR/com.ss.test.testBump(3161): DESTROY12-16 11:42:41.562: DEBUG/BluetoothSocket.cpp(3161): abortNative12-16 11:42:41.562: DEBUG/ASOCKWRP(3161): asocket_abort [33,34,35]12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_shutdown: s 33, how 212-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_shutdown:  fd (-1:33), bta -1, rc 0, wflags 0x0, cflags 0x0, port 012-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_shutdown: shutdown socket12-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_write: wrote 1 bytes out of 1 on fd 3512-16 11:42:41.562: DEBUG/BluetoothSocket.cpp(3161): ...asocket_abort(33) complete12-16 11:42:41.562: DEBUG/BluetoothSocket.cpp(3161): destroyNative12-16 11:42:41.562: DEBUG/ASOCKWRP(3161): asocket_destroy12-16 11:42:41.562: DEBUG/ASOCKWRP(3161): asocket_abort [33,34,35]12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_shutdown: s 33, how 212-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_shutdown:  fd (-1:33), bta -1, rc 0, wflags 0x0, cflags 0x0, port 012-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_shutdown: shutdown socket12-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_write: wrote 1 bytes out of 1 on fd 3512-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_close: s 3512-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_close: std close (35)12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_close: s 3412-16 11:42:41.562: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_close: std close (34)12-16 11:42:41.562: INFO/BLZ20_WRAPPER(3161): blz20_wrp_close: s 3312-16 11:42:41.569: DEBUG/BLZ20_WRAPPER(3161): blz20_wrp_close:  fd (-1:33), bta -1, rc 0, wflags 0x0, cflags 0x0, port 012-16 11:42:41.569: INFO/BLZ20_WRAPPER(3161): __close_prot_rfcomm: fd 3312-16 11:42:41.569: DEBUG/BTL_IFC(3161): BTL_IFC_CtrlSend: BTL_IFC_CtrlSend12-16 11:42:41.569: INFO/BTL_IFC(3161): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_BTS_RFC_CLOSE (BTS) 8 pbytes (hdl 32)12-16 11:42:41.569: DEBUG/(2751): btlif_bts_api_ctrl_cb: btlif_bts_api_ctrl_cb : id BTLIF_BTS_RFC_CLOSE (4468) on hdl 2212-16 11:42:41.569: DEBUG/(2751): btlif_rfc_close: scn 0, sock 3312-16 11:42:41.569: INFO/(2751): btlif_rfc_close: channel not found scn 0, sock 3312-16 11:42:41.569: DEBUG/BTL_IFC_WRP(3161): wrp_close_s_only: wrp_close_s_only [33] (33:-1) []12-16 11:42:41.569: DEBUG/BTL_IFC_WRP(3161): wrp_close_s_only: data socket closed12-16 11:42:41.569: DEBUG/BTL_IFC_WRP(3161): wsactive_del: delete wsock 33 from active list [ad3f5f70]12-16 11:42:41.569: DEBUG/BTL_IFC_WRP(3161): wrp_close_s_only: wsock fully closed, return to pool12-16 11:42:41.569: DEBUG/BLZ20_WRAPPER(3161): btsk_free: success12-16 11:42:41.569: DEBUG/BluetoothSocket.cpp(3161): ...asocket_destroy(33) complete12-16 11:42:41.569: ERROR/com.ss.test.testBump(3161): DESTROYED</code></pre><p>As you can see from log, socket closed successfully.Now, exit from app (it'll run in background), run to Task Manager and kill app. In that moment android device will freeze with very high CPU load.</p><p><strong>EDIT 2:</strong></p><p>I found, that issue reproduce on Samsung GALAXY Tab device only. For example, I can't reproduce it with my HTC Desire.</p>","136834","","136834","","2010-12-16 11:06:48","2011-10-14 12:50:04","Android Bluetooth socket freeze application","<java><android><sockets><bluetooth><rfcomm>","7","1","3","",""
"4408328","1","","","2010-12-10 11:25:41","0","69","<p>how an application works which runs on one phone with one resolution, then runs on another phone with a different resolution. </p>","536871","","","","","2010-12-10 11:58:24","how an application works which runs on one phone with one resolution, then runs on another phone with a different resolution","<android>","1","0","","",""
"4408346","1","4408376","","2010-12-10 11:27:36","4","489","<p>Hi  in my app contain a Button ,currently i customized using xml for changing the background and it work fine in 2.1 but when am reach to 2.2 ,The button is hard to hit ,how can i solve the issue?</p><p>my button xml code given below</p><pre><code> &lt;Button  android:id =""@+id/Button_Continue1"" android:background=""@drawable/continue_button"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:layout_marginTop=""4dp"" /&gt; </code></pre>","487219","","","","","2010-12-10 11:36:44","Android button hard to hit in 2.2","<android>","1","0","4","",""
"4408386","1","4408899","","2010-12-10 11:32:44","1","703","<p>basically i am reading image bytes from file i have a loop which has to read almost 20 images from file and in this loop i have making the object of my class which extends ASyncTask class and i am reading bytes and drawing on canvas in <code>doItBackground()</code> method and setting my image on <code>onPostExecute()</code> method. so basically Asynchronously 20 threads starts execution in background. now problem is it is not showing any image. </p><p>anybody have any idea how to handle multiple AsyncTask class? here is my code.</p><pre><code>    @Override    protected Void doInBackground(Void... params)     {//      Log.i(""start background thread"", ""start background thread"");        Set&lt;Integer&gt; keys;        keys = iTileListOffsets.keySet();        boolean found = false;        Object key[] = keys.toArray();        int k = 0;        for (int i=0; i &lt; key.length &amp;&amp; found==false ; i++)        {                           k = (Integer) key[i];            MapTileHeader tileHeader = iTileListOffsets.get(k);            if (tileHeader.equalsWith(mapTile.getiMapTileHeader()) )            {                                   found = true;             }        }        if(found)        {                       try             {                   synchronized (MapMaker.getSingletonObject())                 {                    fc.position(0);                                         input.skipBytes(k);                                             int tSizeOfTile = input.readInt();                                  mapTile.loadTileWithFileHeader(input, tSizeOfTile, headerBytesArray);                }                mapMaker.getBufferedTilesDataList().add(mapTile);                                   }            catch (Exception e)            {                // TODO Auto-generated catch block                e.printStackTrace();            }            byte imageTile[] = mapTile.getImageTilesBytes();             //bufferedTile.getImageTilesBytes();                               if(mapTile.getImageTilesBytes() != null)            {                                       try                {                    Bitmap tileBitmap = BitmapFactory.decodeByteArray(imageTile, 0, imageTile.length);                    canvas.drawBitmap(tileBitmap, rect.left, rect.top, null);                    tileBitmap = null;                }                catch(Exception e)                {                    e.printStackTrace();                }                               }        }//      Log.i(""ENDDDD background thread"", ""ENDDD background thread"");        return null;    }    @Override    protected void onPostExecute(Void result)    {        // TODO Auto-generated method stub        super.onPostExecute(result);                Log.i(""start POSTECEXCUTE thread"", ""start POSTECEXCUTE thread"");        MyRect mapRect = aBufferArea.GetScreenRectangle(buffer, aScrnArea);         Bitmap smallBitmap = Bitmap.createBitmap(bitmap, mapRect.left, mapRect.top, mapRect.width, mapRect.height);                 image.setImageBitmap(smallBitmap);        Log.i(""ENDDDDD POSTECEXCUTE thread"", ""ENDDDD POSTECEXCUTE thread"");    }</code></pre><p>thanks </p>","397901","","104117","","2010-12-10 12:42:25","2010-12-10 12:47:33","problem is in ASyncTask class in Android","<android><android-asynctask>","2","0","","",""
"4408600","1","4409583","","2010-12-10 11:57:30","1","961","<p>I've used C# quite a lot, it was my main programming language during University and I wondered which of the two languages for developing for Android or iPhone are easiest to learn bearing that in mind.</p><p>I'm interested in people's opinions on the two languages, I've dabbled a little in both but nothing more than a couple of hours. I'm also interested in people's opinions on Windows Phone 7 as an app/game platform, as this uses C# so would be an obvious choice for transitioning into that area.</p><p>Opinions?</p>","460493","","","","","2010-12-10 17:13:19","Which is easier to learn coming from a C# background: Objective C or Java?","<c#><java><iphone><android><objective-c>","8","0","1","",""
"4408648","1","","","2010-12-10 12:04:16","0","572","<p>I want to get the name of apk,That apk not yet installed in device.That apk just store in sd card,This kind of apk's name,How to get?.</p><p>Thanks All</p>","500595","","","","","2011-09-22 04:38:07","how to get apk's name?but not yet installed in device?","<android>","1","0","1","",""
"4408671","1","4408990","","2010-12-10 12:07:32","6","10114","<p>How i can draw a route on a mapview between two poi-s?</p>","472537","","","","","2013-02-13 15:41:01","Android draw route on a Mapview with twoo POI-s","<android><android-mapview>","1","1","8","",""
"4408715","1","","","2010-12-10 12:13:32","0","214","<p>I am implementing an camera application.When a click on the get image its does not work.No further action in performed on the button.Can anyone tell where's is the problem ??</p>","475349","","","","","2010-12-10 12:38:29","click Button event not firing in android while saving image","<android>","1","0","","",""
"4408731","1","","","2010-12-10 12:16:22","2","1596","<p>I manage to add adMob to the title screen, which layout is written in a *.xml-file.</p><pre><code>setContentView(R.layout.main); AdView adView = (AdView)findViewById(R.id.ad);adView.requestFreshAd();</code></pre><p>main.xml contains:</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/de.xazen.tictactoe""      android:background=""@drawable/title""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      &gt;      &lt;com.admob.android.ads.AdView                android:id=""@+id/ad""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:layout_alignParentBottom=""true""                myapp:backgroundColor=""#000000""                myapp:primaryTextColor=""#FFFFFF""                myapp:secondaryTextColor=""#CCCCCC""                 /&gt; &lt;/RelativeLayout&gt;</code></pre><p>The game itself is written in Tttview.</p><pre><code>public class TttView extends View</code></pre><p>The Activity Game.java create a instance of TttView and uses setcontent(tttView) to use it as layout. </p><pre><code>public class Game extends Activity{    private TttView tttView;    .    .    .    setContentView(tttView);}</code></pre><p>How can I add adMob to the game itself?</p>","537820","","","","","2011-01-28 14:06:42","How to add AdMob to ViewClass in Android","<android><view><admob>","1","0","2","",""
"4408802","1","","","2010-12-10 12:26:28","0","1353","<p>I'm writing an Android program using Webview that can use the hard back key on the device, no problem with this. </p><p>But when the program goes ""outside"" and navigates through  HTML / Javascript pages inside the Webview ""wrapper"" it cannot handle properly an href=""javascript:window.history.back();"" button, because it does not go up one level, just goes back and forward the previous page.</p><p>What am I doing wrong?</p>","537833","","","","","2011-02-19 10:34:08","Soft back button in Android using Webview","<android><button><webview>","1","0","","",""
"4408841","1","4445138","","2010-12-10 12:31:29","1","1720","<p>I am trying download zip file to SD card. I download it correctly, but when I open downloaded file (with ZipFile) I get this ZipException (""Central Directory Entry not found"").</p><p>Internet-file is okay, SD-copy-file is okay (from PC opened and show files correctly), but for some reason don't work in Android.</p><p>Code for download:</p><p><pre><code>BufferedInputStream stream = null;try {  stream = new BufferedInputStream(is, 8192);}....</p><p>try {  ByteArrayBuffer baf = new ByteArrayBuffer(50);  int current = 0;  while ((current = stream.read()) != -1 )     baf.append((byte) current);   </p><p>BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(path));  fos.write(baf.toByteArray());  fos.close();}...</pre></code></p><p>I supossed that the problem is in the ZIP file headers, which was not properly written, but I do not know for what reason. The source code ZipEntry class shows me this:</p><p><pre><code>long sig = (hdrBuf[0] &amp; 0xff) | ((hdrBuf[1] &amp; 0xff) &lt; &lt;  8) |           ((hdrBuf[2] &amp; 0xff) &lt; &lt;  16) | ((hdrBuf[3] &lt; &lt;  24) &amp; 0xffffffffL);if (sig != CENSIG) {     throw new ZipException(""Central Directory Entry not found"");}</pre></code></p><p>Thanks,</p>","500214","","","","","2012-10-04 14:20:24","Central Directory Entry not found (ZipException)","<android><header><download><zip><entry>","1","0","","",""
"4408879","1","","","2010-12-10 12:38:23","2","780","<p>I have a custom List that containts two TextViews and two Buttons.  I want one button to change the data shown in one TextView and I want the other button to inflate a Dialog explaining the purpose of that row.  So I need to dynamically update the Dialog content.  As far as I can tell the only way to imbed a clickable button in a list is to setOnClickListener in an adapter when you inflate the row, but I can't create a dialog outside of the activity (I'm getting a Force Close).  Here's my getView() call.  Any suggestions??</p><p>public View getView(final int position, View convertView, ViewGroup parent) {</p><pre><code>    final ViewHolder holder;    if (convertView == null) {        convertView=mInflater.inflate(R.layout.text_list_item,null);        holder=new ViewHolder();        holder.clear=(Button)convertView.findViewById(R.id.btnClr);        holder.label=(TextView) convertView.findViewById(R.id.textListItemLabel);        holder.value=(TextView) convertView.findViewById(R.id.textListItemValue);        holder.info=(Button)convertView.findViewById(R.id.btnInfo);        holder.group= (RadioGroup)convertView.findViewById(R.id.radiogroup);        holder.r1=(RadioButton)convertView.findViewById(R.id.radio1);        holder.r2=(RadioButton)convertView.findViewById(R.id.radio2);        holder.t1=(ToggleButton)convertView.findViewById(R.id.toggle1);        holder.clear.setOnClickListener(new OnClickListener(){            private int pos= position;            @Override            public void onClick(View v){                holder.value.setText(String.valueOf(pos));                notifyDataSetChanged();//I know there's a problem on here, and I'm working on that... but at least it reacts to the button press.            }            });        holder.info.setOnClickListener(new OnClickListener(){            private int pos= position;            @Override            public void onClick(View v){                Button button = (Button) v;                AlertDialog.Builder builder = new AlertDialog.Builder(context);                builder.setMessage(""Are you sure you want to display?"");                    .setCancelable(false)                       .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                           public void onClick(DialogInterface dialog, int id) {                                MyActivity.this.finish();                           }                       })                       .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                           public void onClick(DialogInterface dialog, int id) {                                dialog.cancel();                           }                       });                builder.create();//Ok to here...                builder.show();//Crash                String.valueOf(pos), Toast.LENGTH_SHORT).show();            }            });        convertView.setTag(holder);    } else {        holder = (ViewHolder) convertView.getTag();    }    return convertView;}</code></pre>","537843","","","","","2011-06-20 09:45:48","Android: Calling a dialog from a button imbedded in a list","<android><list><button><dialog>","1","0","","",""
"4408970","1","4409066","","2010-12-10 12:50:27","0","1146","<p>How wrap_content, fill_parent or the dp will guarantee that the view is given an appropriate size on the current device screen in android platform.</p>","536871","","","","","2010-12-10 13:07:31","wrap_content, fill_parent or the dp will guarantee that the view is given an appropriate size on the current device screen","<android>","3","0","","",""
"4408980","1","4426507","","2010-12-10 12:52:30","0","119","<p>Hi i have a EditText when writing in Editext ,some times my EditText do not move up word ,so am hard to write using the virtual keyboard, how can i manually do the auto moving of editext  up word when writing using virtual keyboard</p>","487219","","","","","2010-12-13 07:08:56","Android EditText AutoMoveing","<android>","1","0","","",""
"4409006","1","","","2010-12-10 12:56:03","2","4101","<p>I have a map application. I want to install it on a device having no maps library available.  Can't I burn in along the app.</p>","392574","","102536","","2013-03-25 17:46:49","2013-03-25 17:46:49","INSTALL_FAILED_MISSING_SHARED_LIBRARY","<android><google-maps>","1","2","","",""
"4409087","1","","","2010-12-10 13:04:30","2","995","<p>How can i keep my edit text floating above the on screen keyboard?</p>","335429","","","","","2010-12-10 13:28:33","Edit text hides behind on-screen keyboard","<android>","1","0","","",""
"4409203","1","","","2010-12-10 13:17:04","0","560","<p>Can someone point me in the right direction to have an Android Application reopen itself to the forefront after a user has pressed the home key? It should be able to be linked to some kind of countdown (which I already have setup, and runs when pushed to background).</p><p>I just can't find the function to force this action</p><p>*And yes, this is what the user will want, don't worry, I know this doesn't sound user friendly (forcing open) but in this case the user wants it.</p><p>Thanks</p>","534450","","","","","2010-12-12 05:06:13","Reopening Android App from background with timer or countdown","<android><timer><countdown>","1","2","","",""
"4409213","1","4409706","","2010-12-10 13:19:09","0","389","<p>I've been reading the documentation about Intents and Intent-Filters, and I was wondering if there is not such a thing as a predefined action to launch an activity expecting some data, for example, an IP address to connect.</p><p>I understand ACTION_MAIN is to offer an entry point to the Application, so not to expect data makes sense. But I don't think the case I'm talking about it's that strange.</p><p>Maybe I'm thinking too much and I just need a custom ACTION, but I wanted to find the proper way.</p><p>Any suggestion is welcome.</p><p>Manuel.</p>","467900","","","","","2010-12-10 14:22:47","ACTION_MAIN filter , expecting to receive data","<android><android-intent><intentfilter>","1","0","","",""
"4409244","1","4409307","","2010-12-10 13:24:10","1","83","<p>i have wrote an app getting rss feed from the website of my university.in the eclipse emulator the app  runs with no problem and i can reed the rss.but as i transferred it to my mobile(samsung gti 9000) the screen freeze when i push the button for the rss news...also,if i go for the menu button of the phone and change dom to sax the phone pops out a message to force down...any idea?may my phone has a problem?please keep on mind that my phone works on greek language and the emulator on english,i dont know if this matter..</p>","519526","","519526","","2010-12-10 18:12:00","2010-12-10 18:12:00","problem with an app on my phone","<android>","1","1","","",""
"4409270","1","4418266","","2010-12-10 13:27:49","0","2499","<p>When starting child activity from one activity tha second activity appears good.But in meantime blank screen appears.Why I don't know.Iam loading gps related data in oncreate() of second activity.How to avoid blank screen and load quickly.</p><p>regards,Rajendar</p>","486216","","","","","2013-01-10 04:44:06","how to avoid blank screen between activities android?","<android>","3","0","","",""
"4409274","1","","","2010-12-10 13:28:28","1","220","<p>I've got a <code>ViewSwitcher</code> containing a <code>LinearLayout</code> in position 0, and an <code>ImageView</code> in position 1.</p><p>Now I want the <code>LinearLayout</code> only to be shown as <strong>Portrait</strong>, and, when the <code>ImageView</code> is shown, give the user the chance to rotate the device and see that view in <strong>Landscape</strong> mode.</p><p>So, I added <code>android:configChanges=""orientation""</code> in the Activity in my <code>AndroidManifest.xml</code> file.</p><p>Then I need to override <code>onConfigurationChanged (Configuration newConfig)</code> in my Activity, but I can't find any way to get what I want...</p><p>I've tried editing <code>newConfig.orientation</code> param directly, before calling <code>super.onConfigurationChanged(newConfig)</code>, and also creating a new <code>Configuration</code> from <code>newConfig</code> and using <code>updateFrom</code> method, but It doesn't work.</p><p>Any idea?</p><p>Thank you</p>","453981","","","","","2010-12-10 13:39:59","Screen orientation in only one child of a ViewSwitcher in Android","<android><orientation><viewswitcher>","1","0","","",""
"4409282","1","","","2010-12-10 13:29:19","2","4252","<p>I know how to compare two string is same or not.this is coding for compare two stringsTextView t,t1;</p><pre><code>String s,s1;s=t.getText().toString();s1=t1.setText().toString();if(s.equals(s1)){   t.setText(""equal"");}else{   t.setText(""not equal"");}</code></pre><p>i need the coding for compare two images are same or not.please give me early</p>","543019","","21234","","2010-12-10 13:36:44","2012-05-11 08:28:05","compare two images is same or not","<android><image>","3","1","1","",""
"4409372","1","5215891","","2010-12-10 13:41:11","1","901","<p>I'm developing an Android application with some native code (used to render with OpenGL ES 2.0).</p><p>I have the following method signature:</p><pre><code>JNIEXPORT void JNICALL Java_com_xxxxxx_xxxx_ActivityRenderer_renderFrame  (JNIEnv *env, jobject obj,          jfloatArray vertices, jfloatArray normals,          jfloatArray texCoord, jintArray indices)</code></pre><p>To get access to <code>jfloatArray vertices, jfloatArray normals, jfloatArray texCoord, jintArray indices</code> elements I do the following:</p><pre><code>jfloat *vertPos, *vertNorm, *vertTexC;jint *indicesArray;vertPos = env-&gt;GetFloatArrayElements(vertices, 0);vertNorm = env-&gt;GetFloatArrayElements(normals, 0);vertTexC = env-&gt;GetFloatArrayElements(texCoord, 0);indicesArray = env-&gt;GetIntArrayElements(indices, 0);</code></pre><p>And, after glDrawElements(...), at the end, I do the following:</p><pre><code>env-&gt;ReleaseFloatArrayElements(vertices, vertPos, 0);env-&gt;ReleaseFloatArrayElements(normals, vertNorm, 0);env-&gt;ReleaseFloatArrayElements(texCoord, vertTexC, 0);env-&gt;ReleaseIntArrayElements(indices, indicesArray, 0);</code></pre><p>I'm not drawing the model that I want, probably, because I'm releasing pointers while they are still been using by glDrawElements. I'm not sure, but I want to check it before doing any other tests.</p><p>My question is how can I make an static array from a pointer?</p><p>I can get pointers' elements doing this:</p><pre><code>jsize numVertices = env-&gt;GetArrayLength(vertices);jsize numNormals = env-&gt;GetArrayLength(normals);jsize numTexCoords = env-&gt;GetArrayLength(texCoord);GLsizei numIndices = (GLsizei) env-&gt;GetArrayLength(indices);</code></pre><p>But I don't know how to continue.</p><p>Any advice?</p><p>I'm searching the web to find how, and if I find something I will tell you.</p><p>Thanks.</p>","68571","","68571","","2010-12-10 16:08:41","2011-03-07 04:39:36","Copy a pointer to a static array","<c++><android><jni><opengl-es-2.0>","1","0","","",""
"4409391","1","4410464","","2010-12-10 13:43:45","0","248","<p>I have a fledgling app under development, which I am installing to my Android phone via Eclipse debugging.</p><p>Now, my app is only 200KB in size at the moment, but it runs very slowly.  I have a button in my first activity that drops 4 SQLite tables, with a combined total of no more than 25 records, and then recreates the tables and data straight away.  To my mind, this should be a pretty damn fast operation, but it takes a good 4 or 5 seconds.</p><p>There isn't anything else going on at that moment in time, netiher in the app, or on my phone. I just can't understand how it can be so sluggish.  I've even made the operation above an AsyncTask, and it's made no difference.</p><p>Also, when I go into my phone's Settings -> Manage applications, the list of all my installed apps shows that they're all ""computing..."".  Every single other app finishes this a good 3 or 4 seconds before my tiny one stops ""computing..."" and displays the app size info, etc.</p><p>Could all this just be symptomatic of an app not having been installed via the Marketplace?  Is it something to do with the debuggable setting in my Manifest?</p><p>I'm not ready to play around with signing and release yet, not by a long shot, so I can't test to see if that's the reason.  Or can I?</p>","442912","","442912","","2010-12-10 13:52:14","2010-12-10 15:38:57","Android: My Own App Takes Ages To ""Compute"" under ""Manage applications"" and is Generally Slow","<android><performance>","1","3","","",""
"4409481","1","","","2010-12-10 13:57:49","1","1201","<p>Now i am working one json applivation.I am passing url in http they will reply one json.I getting json and display listview.These working fine but session will not maintain long live.pls help me how to maintain session long live.......</p>","533787","","440502","","2010-12-10 13:58:25","2011-09-28 19:28:59","How to maintain session","<android>","1","0","3","",""
"4409599","1","4409826","","2010-12-10 14:11:48","0","613","<p>I have my database query currently set up like so:</p><p><strong>Edit, By the way my variables (_ID, CAT_ITEM and BUDGET_AMOUNT) actualy contain exactly the same text and formatting as they are written, silly i know, but anyway that shouldn't be the problem</strong></p><pre><code>private String[] from = {_ID, CAT_ITEM, BUDGET_AMOUNT, };private String orderBy = _ID + "" ASC"";private String whereIn = ""IN_OUT='in'"";Cursor cursor = db.query(CAT_BUD_TAB, from, whereIn, null, null, null, orderBy);</code></pre><p>Which does exactly what i want it to do, but i wanted to try using a rawQuery instead (just to get the hang of query statements and test it out, also i wouldn't need so many string variables).</p><p>Here's what i came up with:</p><pre><code>private String incomeQuery = ""SELECT _ID, CAT_ITEM, BUDGET_AMOUNT FROM CAT_BUD_TAB WHERE IN_OUT=’in’"";Cursor cursor = db.rawQuery(incomeQuery, null);</code></pre><p>However this isn't working (I get the SQLException no such column) so i'm trying to work out what the difference is, I figure there's just something wrong with my statement but no idea what. Can anyone offer me any advice? Thanks</p>","523874","","523874","","2010-12-10 14:40:01","2010-12-10 14:40:01","How can i convert this query into a rawQuery?","<sql><android><database><sqlite>","2","0","","",""
"4409657","1","4409689","","2010-12-10 14:16:12","1","313","<p>i have very annoying scenario</p><p>on button click i show toast or start thread.</p><p>what problem i am facing right now is</p><p>user presses same button many times and there are lots of toasts and threads starts one by one i have seen some mobile apps after pressing button they disable touch screen </p><p>or any one guide me how to handle this situation in android? or how android developers deals with this problem?</p><p>any help would be appreciated.</p>","249991","","","","","2010-12-10 14:20:55","Android multi time button press problem?","<android>","1","0","","",""
"4409719","1","","","2010-12-10 14:24:14","1","775","<p>I've successfully build the Platinum UPnP stack (6.4.690 and NDK r4b) for and Android and ended up with a libPlatinumJNI.so file.</p><p>And now I'm wondering how to add/ use this the library in the code in my Android project.</p><p>Anyone has any idea ?</p><p>UPDATE:</p><p>I have asked the creator of Platinum and he told me that the intermediate layer for android is on his todo list.</p><p>Thanx</p>","533751","","533751","","2010-12-17 11:15:32","2010-12-17 11:15:32","How to use Platinum UPnP in Android?","<java><android><jni><shared-libraries><upnp>","0","2","1","",""
"4409757","1","4409987","","2010-12-10 14:28:26","0","447","<p>How to add tabbar in doinbackground asynctask  in android? or how to run splash screen in thread ?  .I want to show progress dialog  or splash screen until tab bar is loaded from calling tabbar class I am calling webservices and parsing value take time for few mins mean time I have to show progessbar or splash screen can anybody tell how to implement? can anybody give sample code?I tried but its not working</p><p>dlg = ProgressDialog.show(this, ""Working.."", ""Downloading Data..."", true, false); </p><pre><code> Thread splashThread = new Thread() {         @Override        public void run() {            try {                 sleep(100000);            } catch (InterruptedException e) {               // do nothing            } finally {            }         }      };      splashThread.start(); </code></pre>","426344","","","","","2010-12-10 14:49:43","How to add tabbar in doinbackground asynctask in android","<android>","1","0","","",""
"4409823","1","4409896","","2010-12-10 14:35:06","1","493","<p>I understand this may not be the best place to ask about legal issues, but I'm sure someone must have had a similar experience to my situation and I would appreciate any help.</p><p>I'm making an application which will charge a fee (an Android app). The application itself is all my own work, but to give the user an added bonus I want to use a website based dictionary (there are tons of free dictionaries online), which I will open up in my app (In Android parlance I will open a WebView of the dictionary at any point the user wants to chaeck a word). It isn't necessary for my app but it makes the experience far better for the user.</p><p>However, I don't know if it is right to do this. Legally and morally. Technically all I'm doing is linking to a website, but in using the websites resources and charging for the privelage, it seems I'm doing something wrong. </p><p>I could create a quick script to scrape dictionary defs off the net and stick them in a database instead of opening the internet in the app, but this must be unethical/illegal use of someone elses work.</p><p>if my app were free this might not be a problem. SO I think I have two options:1)ditch 3rd party free resources and charge a fee for MY work.2) make it free and use all the free resources I want. </p>","485498","","","","","2010-12-10 14:42:04","Legal issue linking application to third party website","<android><legal>","1","1","1","2013-07-28 18:30:20",""
"4409950","1","6959894","","2010-12-10 14:46:01","5","1488","<p>Using an <code>ImageView</code>, I can set a square height and width (say 100dip x 100dip). Then using <code>android:scaleType=""centerCrop""</code> gives me an image which is cropped to square regardless of aspect ratio.</p><p>Can we do this with a <code>VideoView</code>?</p><p>I've tried just setting a square height and width, but it just re-sizes to fill the square as best as it can while maintaining the aspect ratio, which I guess is completely expected.</p><p>It doesn't seem to have any scale or crop properties / methods unlike <code>ImageView</code>, but this in the <code>VideoView</code> documentation makes me think I'm missing something:</p><blockquote>  <p>[VideoView] ...provides various display options  such as scaling and tinting.</p></blockquote><p>Any ideas would be much appreciated.</p>","187100","","334849","","2013-07-12 17:14:34","2014-03-24 09:00:52","VideoView crop to square","<android><video><crop><videoview>","2","0","4","",""
"4410152","1","","","2010-12-10 15:06:25","9","3148","<p>Here's my story:</p><p>I got a custom ViewGroup that I want to create from code using a predefined style, my approach so far has been creating an AttributeSet object from a style.xml element, like so (warning, beware of the copy-paste code ahead):</p><pre><code>    XmlPullParser parser = getResources().getXml(R.style.my_stylez);    AttributeSet attributes = Xml.asAttributeSet(parser);</code></pre><p>But when doing so I get some crazy error:""..android.content.res.Resources$NotFoundException: Resource ID #0x7f090002 type #0x12 is not valid""</p><p>I'm know I'm probably missing something very obvious here (or am I?), and would be grateful if any of you guys can point me in the right direction.</p><p>Thanks</p>","502232","","","","","2014-01-17 17:22:10","How to create an AttributeSet from a style.xml","<android><android-widget><android-layout>","5","1","2","",""
"4410328","1","4410349","","2010-12-10 15:23:23","5","8540","<p>I have a class that needs to obtain a reference to it's application's <code>AssetManager</code>.  This class does not extend any sort of android UI class, so it doesn't have a <code>getContext()</code> method, or anything similar.  Is there some sort of static <code>Context.getCurrentApplicationContext()</code> type of method?  </p><p>To clarify: my class is intended to be used like a library, for other applications. It has no associated <code>AndroidManifest.xml</code> or control over the context which is calling it.</p>","426493","","244296","","2011-08-18 03:45:28","2013-01-16 23:32:15","How to obtain AssetManager without reference to Context?","<android><context>","2","0","3","",""
"4410362","1","4410423","","2010-12-10 15:27:00","1","1148","<p>Is there any way i can detect for how long a button is press?? I want to capture the time for which a button is press and act accordingly. So if a user kept pressing the button for 5 sec i want to detect that 5 sec on android.</p><p>Please let me know</p><p>Thanks Pranay</p>","443694","","","","","2012-01-04 16:18:00","how to detect the period for which a button is press in android","<android><android-widget><android-layout>","3","1","","",""
"4410398","1","4410571","","2010-12-10 15:30:48","2","5893","<p>I want to get some clues about posting the values to the webservice...</p><p>When i post the values, i get the response in xml that has to be parsed. Any tutorials of posting the values to webservice will be of great help... </p>","303155","","303155","","2010-12-10 15:40:08","2013-12-31 09:49:53","How to post values to webservice in android","<android>","4","0","5","",""
"4410420","1","4770593","","2010-12-10 15:33:58","1","15110","<p>So I'm trying to find an easy way to get the background color or a table row to change when its clicked on. I've been trying to find a way to call what the background color is and check it but I haven't found a way to call the color. Here is what I have right now. </p><pre><code>    RowName = (TableRow) findViewById(R.id.RowName);     RowName.setBackgroundColor(Color.TRANSPARENT);    RowName.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            if (RowName.equals(Color.TRANSPARENT))            RowName.setBackgroundColor(Color.YELLOW);            else if (RowName.equals(Color.YELLOW))            RowName.setBackgroundColor(Color.TRANSPARENT);        }    });</code></pre><p>I know that its wrong. Hopefully you can see what I'm trying to accomplish. If not, what I want to do is have the table row start of transparent. When someone clicks on the table row I want it to change to yellow. Then, if they click it again, I want it to change back to transparent. Thanks. </p>","288437","","","","","2011-01-22 21:08:42","OnClick change tablerow background color","<android><colors><tablerow>","2","1","","",""
"4410453","1","4412501","","2010-12-10 15:36:55","1","594","<p>My device always gives me location updates wrongly first time and after some time it shows currectly.I had given time 5000 ms for location updates in LocationListener.But first time my application loads I need quick location update after that need it is ok, in round robin manner.How to make change in my snippet for first time use</p><pre><code>locationManager.requestLocationUpdates(bestProvider, 5000, 0, this);</code></pre><p>Please give me guidance?</p><p>Regards,rajendar</p>","486216","","","","","2010-12-10 19:24:06","how to get quick location updates when first time android application loading?","<android>","2","0","1","",""
"4410619","1","","","2010-12-10 15:54:14","1","1372","<p>I am getting this error on my Archos 32 Android device.  I found this post : <a href=""http://stackoverflow.com/questions/2734886/droids-mediaserver-dies-on-camera-takepicture"">Droid's mediaserver dies on camera.takePicture()</a></p><p>But it's not very specific as to what ""missing pieces"" are besides the preview.  </p><p>My code runs on the emulator and on at least one other droid device.  Is there just an incompatibility with the archos or could I still be missing something? </p><p>The archos has a working camera program so I know it's possible to have an app that takes a picture but I'm beginnning to think there's some incompatibility with the sdk. Where can I download a complete working camera eclipse project?   All I can find is code snippets.   </p><p>Here's the debug log:</p><pre><code>12-10 10:37:46.827: DEBUG/CameraHalUtils(16242): PPM: STOPPED PREVIEW :5691.681 ms12-10 10:37:46.835: INFO/cat(1096): &lt;6&gt;video4linux video0: w 640, h 480, fmt 56595559 -&gt; w 640, h 48012-10 10:37:47.110: DEBUG/CameraHalUtils(16242): PPM: AFTER CAPTURE YUV IMAGE :5975.250 ms12-10 10:37:47.131: INFO/DEBUG(16218): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***12-10 10:37:47.131: INFO/DEBUG(16218): Build fingerprint: 'archos/g8/G8A/:2.2.1/FROYO/eng..20101126.043425:user/test-keys'12-10 10:37:47.131: INFO/DEBUG(16218): pid: 16242, tid: 16250  &gt;&gt;&gt; /system/bin/mediaserver &lt;&lt;&lt;12-10 10:37:47.131: INFO/DEBUG(16218): signal 11 (SIGSEGV), fault addr 0000000012-10 10:37:47.131: INFO/DEBUG(16218):  r0 00000000  r1 aba8ee30  r2 fefefeff  r3 0000000012-10 10:37:47.131: INFO/DEBUG(16218):  r4 a7940a6c  r5 000119c0  r6 00010b04  r7 40506eb412-10 10:37:47.131: INFO/DEBUG(16218):  r8 00100000  r9 a811c319  10 40407000  fp 0001240012-10 10:37:47.131: INFO/DEBUG(16218):  ip 00000000  sp 40506ab8  lr a790f30f  pc a790f310  cpsr 2000003012-10 10:37:47.139: INFO/DEBUG(16218):  d0  643a64696f72646e  d1  20656c6261696c5212-10 10:37:47.139: INFO/DEBUG(16218):  d2  0049002e00650020  d3  0065006d0061004312-10 10:37:47.139: INFO/DEBUG(16218):  d4  7e7f7c7e7f7e7c81  d5  7b7e80827f807d7f12-10 10:37:47.139: INFO/DEBUG(16218):  d6  2728282a29292928  d7  3f8000002828282812-10 10:37:47.139: INFO/DEBUG(16218):  d8  000000003f800000  d9  000000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d10 0000000000000000  d11 000000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d12 0000000000000000  d13 000000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d14 0000000000000000  d15 000000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d16 3ff0000000000000  d17 3ff000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d18 7e37e43c8800759c  d19 000000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d20 0000000000000000  d21 000000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d22 0000000000000000  d23 000000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d24 0000000000000000  d25 000000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d26 0000000000000000  d27 000000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d28 0000000000000000  d29 000000000000000012-10 10:37:47.139: INFO/DEBUG(16218):  d30 0000000000000000  d31 000000000000000012-10 10:37:47.139: DEBUG/AudioHardwareAM(16242): acquire wakelock12-10 10:37:47.139: INFO/DEBUG(16218):  scr 2000001012-10 10:37:47.163: INFO/cat(1096): &lt;7&gt;Configure McBSP for 1 phase12-10 10:37:47.163: INFO/cat(1096): &lt;7&gt;Configure McBSP TX FIFO threshold to 126012-10 10:37:47.194: INFO/DEBUG(16218):          #00  pc 0000f310  /system/lib/libcamera.so12-10 10:37:47.202: INFO/DEBUG(16218):          #01  pc 0000d2cc  /system/lib/libcamera.so12-10 10:37:47.202: INFO/DEBUG(16218):          #02  pc 00009790  /system/lib/libcamera.so12-10 10:37:47.202: INFO/DEBUG(16218):          #03  pc 0001beea  /system/lib/libutils.so12-10 10:37:47.209: INFO/DEBUG(16218):          #04  pc 0001c380  /system/lib/libutils.so12-10 10:37:47.209: INFO/DEBUG(16218):          #05  pc 00011188  /system/lib/libc.so12-10 10:37:47.209: INFO/DEBUG(16218):          #06  pc 00010c68  /system/lib/libc.so12-10 10:37:47.209: INFO/DEBUG(16218): code around pc:12-10 10:37:47.217: INFO/DEBUG(16218): a790f2f0 2b004603 2300bf14 b2db2301 d0462b00 12-10 10:37:47.217: INFO/DEBUG(16218): a790f300 681bab13 7368f503 f0044618 4603ff0b 12-10 10:37:47.217: INFO/DEBUG(16218): a790f310 f102681a 6812020c 47904618 46194603 12-10 10:37:47.217: INFO/DEBUG(16218): a790f320 681aab56 6b9bab25 46114608 f7f9461a 12-10 10:37:47.217: INFO/DEBUG(16218): a790f330 ab13ed9c f503681b 46187368 fef2f004 12-10 10:37:47.217: INFO/DEBUG(16218): code around lr:12-10 10:37:47.217: INFO/DEBUG(16218): a790f2ec efeaf7f9 2b004603 2300bf14 b2db2301 12-10 10:37:47.217: INFO/DEBUG(16218): a790f2fc d0462b00 681bab13 7368f503 f0044618 12-10 10:37:47.217: INFO/DEBUG(16218): a790f30c 4603ff0b f102681a 6812020c 47904618 12-10 10:37:47.217: INFO/DEBUG(16218): a790f31c 46194603 681aab56 6b9bab25 46114608 12-10 10:37:47.217: INFO/DEBUG(16218): a790f32c f7f9461a ab13ed9c f503681b 46187368 </code></pre><p>Here's what the CameraHal is reporting:</p><pre><code>12-10 10:37:41.100: DEBUG/CameraHal(16242): opening ti camera hal12-10 10:37:41.100: DEBUG/CameraHal(16242): 5269: createInstance() ENTER12-10 10:37:41.131: INFO/CameraHal(16242): initDefaultParameters: Camera type is OV767512-10 10:37:41.131: DEBUG/CameraHal(16242): 1364: CameraCreate() ENTER12-10 10:37:41.460: DEBUG/CameraHal(16242): 1377: CameraCreate() EXIT12-10 10:37:41.460: DEBUG/CameraHal(16242): 378: initDefaultParameters() ENTER12-10 10:37:41.460: DEBUG/CameraHal(16242): 3749: setParameters() ENTER12-10 10:37:41.460: DEBUG/CameraHal(16242): PreviewFormat yuv420sp12-10 10:37:41.460: DEBUG/CameraHal(16242): PictureFormat jpeg12-10 10:37:41.460: DEBUG/CameraHal(16242): 350: validateSize() ENTER12-10 10:37:41.460: DEBUG/CameraHal(16242): Validating 640, 176 and 480, 14412-10 10:37:41.460: DEBUG/CameraHal(16242): Validating 176, 176 and 144, 14412-10 10:37:41.460: DEBUG/CameraHal(16242): 367: validateSize() EXIT12-10 10:37:41.460: DEBUG/CameraHal(16242): PreviewResolution by App 176 x 14412-10 10:37:41.460: DEBUG/CameraHal(16242): 350: validateSize() ENTER12-10 10:37:41.460: DEBUG/CameraHal(16242): Validating 640, 640 and 480, 48012-10 10:37:41.460: DEBUG/CameraHal(16242): 367: validateSize() EXIT12-10 10:37:41.460: DEBUG/CameraHal(16242): Picture Size by App 640 x 48012-10 10:37:41.460: DEBUG/CameraHal(16242): FRAMERATE 3012-10 10:37:41.460: DEBUG/CameraHal(16242): Picture Size by CamHal 640 x 48012-10 10:37:41.460: DEBUG/CameraHal(16242): Preview Resolution by CamHal 176 x 14412-10 10:37:41.460: DEBUG/CameraHal(16242): Zoom by App 012-10 10:37:41.530: DEBUG/CameraHal(16242): 4432: setParameters() EXIT12-10 10:37:41.530: DEBUG/CameraHal(16242): 679: initDefaultParameters() EXIT12-10 10:37:41.530: DEBUG/CameraHal(16242): 3339: ICaptureCreate() ENTER12-10 10:37:41.530: DEBUG/CameraHal(16242): 3382: ICaptureCreate() EXIT12-10 10:37:41.530: DEBUG/CameraHal(16242): STARTING PROC THREAD 12-10 10:37:41.530: DEBUG/CameraHal(16242): STARTING Shutter THREAD 12-10 10:37:41.530: DEBUG/CameraHal(16242): STARTING Raw THREAD 12-10 10:37:41.530: DEBUG/CameraHal(16242): STARTING Snapshot THREAD 12-10 10:37:41.530: DEBUG/CameraHal(16242): 2976: procThread() ENTER12-10 10:37:41.530: DEBUG/CameraHal(16242): 2913: shutterThread() ENTER12-10 10:37:41.530: DEBUG/CameraHal(16242): 2848: rawThread() ENTER12-10 10:37:41.530: DEBUG/CameraHal(16242): 2727: snapshotThread() ENTER12-10 10:37:41.530: DEBUG/CameraHal(16242): 843: previewThread() ENTER12-10 10:37:41.553: DEBUG/CameraHal(16242): 4724: getParameters() ENTER12-10 10:37:41.553: DEBUG/CameraHal(16242): 4979: getParameters() EXIT12-10 10:37:41.561: DEBUG/CameraHal(16242): 3749: setParameters() ENTER12-10 10:37:41.561: DEBUG/CameraHal(16242): PreviewFormat yuv420sp12-10 10:37:41.561: DEBUG/CameraHal(16242): PictureFormat jpeg12-10 10:37:41.561: DEBUG/CameraHal(16242): 350: validateSize() ENTER12-10 10:37:41.561: DEBUG/CameraHal(16242): Validating 640, 176 and 480, 14412-10 10:37:41.561: DEBUG/CameraHal(16242): Validating 176, 176 and 144, 14412-10 10:37:41.561: DEBUG/CameraHal(16242): 367: validateSize() EXIT12-10 10:37:41.561: DEBUG/CameraHal(16242): PreviewResolution by App 176 x 14412-10 10:37:41.561: DEBUG/CameraHal(16242): 350: validateSize() ENTER12-10 10:37:41.561: DEBUG/CameraHal(16242): Validating 640, 640 and 480, 48012-10 10:37:41.561: DEBUG/CameraHal(16242): 367: validateSize() EXIT12-10 10:37:41.561: DEBUG/CameraHal(16242): Picture Size by App 640 x 48012-10 10:37:41.561: DEBUG/CameraHal(16242): FRAMERATE 3012-10 10:37:41.561: DEBUG/CameraHal(16242): Picture Size by CamHal 640 x 48012-10 10:37:41.561: DEBUG/CameraHal(16242): Preview Resolution by CamHal 176 x 14412-10 10:37:41.561: DEBUG/CameraHal(16242): Zoom by App 012-10 10:37:41.631: DEBUG/CameraHal(16242): 4432: setParameters() EXIT12-10 10:37:41.631: DEBUG/CameraHal(16242): 4724: getParameters() ENTER12-10 10:37:41.631: DEBUG/CameraHal(16242): 4979: getParameters() EXIT12-10 10:37:41.631: DEBUG/CameraHal(16242): CameraHal setOverlay/1/00000000/0000000012-10 10:37:41.631: ERROR/CameraHal(16242): Trying to set overlay, but overlay is null!, line:347212-10 10:37:41.663: DEBUG/CameraHal(16242): CameraHal setOverlay/1/00020340/0000000012-10 10:37:41.663: DEBUG/CameraHal(16242): 3495: setOverlay() EXIT12-10 10:37:41.663: DEBUG/CameraHal(16242): 3502: startPreview() ENTER12-10 10:37:41.663: DEBUG/CameraHal(16242): Receive Command: PREVIEW_START12-10 10:37:41.663: DEBUG/CameraHal(16242): 1364: CameraCreate() ENTER12-10 10:37:41.663: DEBUG/CameraHal(16242): 1377: CameraCreate() EXIT12-10 10:37:41.663: DEBUG/CameraHal(16242): 1425: CameraConfigure() ENTER12-10 10:37:41.717: INFO/CameraHal(16242): CameraConfigure PreviewFormat: w=176 h=14412-10 10:37:41.717: DEBUG/CameraHal(16242): CameraConfigure: framerate to set = 3012-10 10:37:41.717: DEBUG/CameraHal(16242): CameraConfigure: Old frame rate is 30/1  fps12-10 10:37:41.772: INFO/CameraHal(16242): CameraConfigure: New frame rate is 30/1 fps12-10 10:37:41.772: DEBUG/CameraHal(16242): 1470: CameraConfigure() EXIT12-10 10:37:41.772: DEBUG/CameraHal(16242): 1487: CameraStart() ENTER12-10 10:37:41.772: DEBUG/CameraHal(16242): **CaptureQBuffers: preview size=176x14412-10 10:37:41.772: DEBUG/CameraHal(16242): mPreviewFrameSize = 0xd000 = 5324812-10 10:37:41.772: DEBUG/CameraHal(16242): number of buffers = 612-10 10:37:41.772: DEBUG/CameraHal(16242): User Buffer [0].start = 0x40d89000  length = 5324812-10 10:37:41.772: DEBUG/CameraHal(16242): User Buffer [1].start = 0x40d96000  length = 5324812-10 10:37:41.772: DEBUG/CameraHal(16242): User Buffer [2].start = 0x40da3000  length = 5324812-10 10:37:41.772: DEBUG/CameraHal(16242): User Buffer [3].start = 0x40db0000  length = 5324812-10 10:37:41.772: DEBUG/CameraHal(16242): User Buffer [4].start = 0x40dbd000  length = 5324812-10 10:37:41.780: DEBUG/CameraHal(16242): User Buffer [5].start = 0x40dca000  length = 5324812-10 10:37:41.874: ERROR/CameraHal(16242): Initial Crop: crop_top = 0, crop_left = 0, crop_width = 639, crop_height = 47812-10 10:37:41.874: DEBUG/CameraHal(16242): 1594: CameraStart() EXIT12-10 10:37:41.874: DEBUG/CameraHal(16242): PREVIEW_START ACK12-10 10:37:41.874: DEBUG/CameraHal(16242): Preview Started!12-10 10:37:41.874: DEBUG/CameraHal(16242): 3519: startPreview() EXIT12-10 10:37:45.663: DEBUG/CameraHal(16242): 3686: takePicture() ENTER12-10 10:37:45.663: DEBUG/CameraHal(16242): ENTER OPTION PREVIEW_CAPTURE12-10 10:37:45.694: DEBUG/CameraHal(16242): 1610: CameraStop() ENTER12-10 10:37:45.694: DEBUG/CameraHal(16242): Done dequeuing from Camera!12-10 10:37:46.827: DEBUG/CameraHal(16242): 1644: CameraStop() EXIT12-10 10:37:46.827: DEBUG/CameraHal(16242): 2297: ICapturePerform() ENTER12-10 10:37:46.827: DEBUG/CameraHal(16242):  PICTURE NUMBER =112-10 10:37:46.827: DEBUG/CameraHal(16242): Picture Size: Width = 640     Height = 48012-10 10:37:46.881: DEBUG/CameraHal(16242): pictureFrameSize = 0x96000 = 61440012-10 10:37:46.881: DEBUG/CameraHal(16242): Picture Buffer: Base = 0x40e25000 Offset = 0x012-10 10:37:46.913: DEBUG/CameraHal(16242): De-queue the next avaliable buffer</code></pre><p>My code:package com.example;</p><p>import android.app.Activity;import android.hardware.Camera;import android.hardware.Camera.PictureCallback;import android.hardware.Camera.ShutterCallback;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.FrameLayout;</p><p>public class CameraDemo extends Activity {    private static final String TAG = ""CameraDemo"";    Camera camera;    Preview preview;    Button buttonClick;</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    preview = new Preview(this);    ((FrameLayout) findViewById(R.id.preview)).addView(preview);    buttonClick = (Button) findViewById(R.id.buttonClick);    buttonClick.setOnClickListener( new OnClickListener() {        public void onClick(View v) {            preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback);        }    });    Log.d(TAG, ""onCreate'd"");}ShutterCallback shutterCallback = new ShutterCallback() {    public void onShutter() {        Log.d(TAG, ""onShutter'd"");    }};/** Handles data for raw picture */PictureCallback rawCallback = new PictureCallback() {    public void onPictureTaken(byte[] data, Camera camera) {        Log.d(TAG, ""onPictureTaken - raw"");    }};/** Handles data for jpeg picture */PictureCallback jpegCallback = new PictureCallback() {    public void onPictureTaken(byte[] data, Camera camera) {        Log.d(TAG, ""onPictureTaken - jpeg"");    }};</code></pre><p>}</p><p>package com.example;</p><p>import java.io.IOException;import android.content.Context;import android.hardware.Camera;import android.view.SurfaceHolder;import android.view.SurfaceView;</p><p>class Preview extends SurfaceView implements SurfaceHolder.Callback {</p><pre><code>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);}public void surfaceCreated(SurfaceHolder holder) {    // The Surface has been created, acquire the camera and tell it where    // to draw.    camera = Camera.open();    try {        camera.setPreviewDisplay(holder);    } catch (IOException e) {        e.printStackTrace();    }}public void surfaceDestroyed(SurfaceHolder holder) {    // Surface will be destroyed when we return, so stop the preview.    // Because the CameraDevice object is not a shared resource, it's very    // important to release it when the activity is paused.    camera.stopPreview();    camera = null;}public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {    // Now that the size is known, set up the camera parameters and begin    // the preview.    Camera.Parameters parameters = camera.getParameters();   // parameters.setPreviewSize(w, h);   // seems to crash if this code is enabled    camera.setParameters(parameters);    camera.startPreview();}</code></pre><p>}</p><p>Layout</p><p>    </p><pre><code>&lt;FrameLayout android:id=""@+id/preview""    android:layout_weight=""1"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;/FrameLayout&gt;&lt;Button android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:id=""@+id/buttonClick""    android:text=""Click"" android:layout_gravity=""center""&gt;&lt;/Button&gt;</code></pre><p></p>","538013","","538013","","2010-12-11 14:47:26","2011-08-25 20:35:11","Android Camera mediaserver dies after takepicture - works in Emulator","<android>","1","3","","",""
"4410689","1","4411305","","2010-12-10 15:59:39","1","718","<p><strong>Basically the question above, you don't need to read the lot below, just additional info on how i want to use it.</strong></p><p>I Have an activity (which extends tab activity) with two tabs. My tabs don't have different intentss, they're both filled within the same activity. Within each of these i have a list i'm filling from a Database.</p><p>The two tabs are ""income"" and ""outcome"" and I've been trying to set it up so that depending on the open tab a different query will be run and a different list is displayed.</p><p>The right data is displayed but whatever tab opens first is the only one that has anything in it, i realised this was because it wasn't re-querying the database (my getBudgetAmount method) and showing the list (showBudgetCategories method) when the tab changed and figured i'd have to test for that change but i haven't found a way to do that yet that works.. then i thought maybe there's a listener i could use instead? If anyone could point me the right way i'd really appreciate it!</p><p>Here's my activity:</p><p><strong>EDIT, formatting keeps going funny, you'll find it easier to read here-<a href=""http://codeviewer.org/view/code:1501"" rel=""nofollow"">http://codeviewer.org/view/code:1501</a></strong></p>","523874","","523874","","2010-12-10 16:41:46","2010-12-10 16:56:06","How can i test/ listen for tab change?","<android><tabs><listen>","1","0","","",""
"4410987","1","4412750","","2010-12-10 16:27:13","5","7711","<p>I am investigating using an Android device for a website that needs to be usable offline. I have not been able to find much information on how the Android browser handles HTML5's localStorage and WebSQL. Does anyone know the size limit for these? Are they changeable (I know mobile Safari allows WebSQL to store up to 50mb if requested). </p><p>Additionally, any good resources on the Android browser? I haven't been able to find anything good. </p><p>Thanks. </p>","143845","","","","","2010-12-10 20:01:04","HTML5 Offline Storage with Android Browsers","<android><html5><local-storage>","2","0","2","",""
"4410990","1","","","2010-12-10 16:27:27","1","198","<p>I have a widget with 2 different OnClick intents, and they both work as expected. Except after an acore restart. I think it has something to do with my pendingintent not getting refreshed after the restart.</p><p>Can anyone help me with this issue?</p><p>This is from my onRecieve()</p><pre><code>        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);</code></pre>","525720","","","","","2011-07-12 15:19:47","OnClick not working after acore restart","<android><restart><android-pendingintent>","1","0","","",""
"4411110","1","4411243","","2010-12-10 16:38:17","1","883","<p>What is the best layout to use to support the app on different devices (Size of screen)?</p><p><strong>EDIT</strong></p><p>I am not just talking about resizing the layout, obviously the OS does that automatically. I am talking about repositioning the objects in my layout.</p><p>by repositioning I mean moving the objects according to the size of the screen. For instance i created my layout for a larger screen which looks great, but when i run the app on a smaller device (smaller screen) some of my User Interface elements were out of the bound of my screen. </p>","242769","","244296","","2010-12-11 18:00:03","2010-12-11 18:00:03","What is the most flexible layout?","<android><layout>","4","8","2","",""
"4411369","1","4411432","","2010-12-10 17:03:33","14","2973","<p>Is there a way to get the android emulator into sleep mode?</p>","408079","","","","","2010-12-10 17:52:42","How can you put the android emulator into sleep mode?","<android><android-emulator>","2","2","","",""
"4411452","1","4411465","","2010-12-10 17:13:13","3","364","<p>I tried to find the right answer to my question but I couldn't, that's why I am here now.</p><p>Can I sell the application that I developed but contains some open source libraries? Or do I have to find people that created those libraries and ask them for permissions/pay them?</p><p>That might be a silly question but I really need to know how that  works. I am currently developing mobile app that uses someone else's library (hosted on Google Code) and I don't know if I should mention that to my client?</p><p>Thanks for any help,marqss</p>","400493","","707111","","2012-03-31 16:46:18","2012-03-31 16:46:18","Using open source code in my project","<android><open-source>","3","1","","",""
"4411488","1","","","2010-12-10 17:17:40","7","14169","<p>This may be more of a Linux bug than a programming error, but I am not sure. The AndroidManifest.xml is somewhat Greek to me. That said, my program has compiled and run before in it's current state perfectly fine, it is even on the Market. Its been around a month since I've opened the source in Eclipse, and today when I opened it, it refused to compile and displays the following errors:</p><pre><code>[2010-12-10 10:43:19 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read /media/DATA/code/Android/XXX/AndroidManifest.xml: org.eclipse.core.internal.resources.ResourceException: Resource is out of sync with the file system: '/XXX/AndroidManifest.xml'.[2010-12-10 10:43:19 - XXX] AndroidManifest.xml does not declare a Java package: Build aborted.</code></pre><p>where XXX is the package name (and directory it is located). I have confirmed that the file is perfectly fine in a text editor, and even refreshed it in Eclipse. Nothing.</p><p>I updated the ADT...maybe the criteria for AndroidManifest.xml changed?</p><p>My 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.XXX.XXX"" android:versionCode=""2"" android:versionName=""1.0.1"" &gt; &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;     &lt;activity       android:name="".XXX""   android:label=""@string/app_name""   android:screenOrientation=""portrait""   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="".FindLocationsActivity""   android:screenOrientation=""portrait""   &gt;  &lt;/activity&gt;  &lt;activity    android:name="".DeveloperActivity""   android:screenOrientation=""portrait""  &gt;  &lt;/activity&gt;  &lt;activity    android:name="".LegalActivity""   android:screenOrientation=""portrait""  &gt;  &lt;/activity&gt;  &lt;activity    android:name="".AboutActivity""   android:screenOrientation=""portrait""  &gt;  &lt;/activity&gt;  &lt;activity    android:name="".SettingsAndAboutActivity""   android:screenOrientation=""portrait""   &gt;  &lt;/activity&gt;  &lt;activity   android:name="".ResultsPageActivity""   android:screenOrientation=""portrait""   &gt;  &lt;/activity&gt;    &lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""1"" /&gt;&lt;/manifest&gt; </code></pre>","538147","","","","","2014-04-12 16:39:36","""AndroidManifest.xml does not declare a Java package"" error","<android>","5","1","2","",""
"4411531","1","4412569","","2010-12-10 17:23:11","0","2263","<p>The title for this question might be poor, but but it was hard to nail down a title. So here is the question.</p><p>I have an application that opens a database and creates a custom ListView based on the contents. So there are a few files involved in this process:</p><pre><code>Main.java - opens the database and stores the List&lt;MyClass&gt; of contentsmain.xml - main activity layout with the ListViewMyAdapter.java - extends BaseAdapter and calls MyAdapterView based on the contextMyAdapaterView.java - inflates the View from MyAdapater based on row.xmlrow.xml - layout of each custom row of the ListView</code></pre><p>This works fine. I am new to Android, but structurally this seems to be how everyone recommends building custom ListViews.</p><p>How do I retrieve data from the ListView? For instance, part of the row is a checkbox. If the user presses the checkbox to activate/deactivate the particular row, how do I notify the main application about that?</p><p>Thanks,</p><p>EDIT: </p><p>Main.java</p><pre><code>public class MyApplication extends Activity     implements OnItemClickListener, OnItemLongClickListener{    private List&lt;MyClass&gt; objects;    private ListView lvObjects;    private MyAdapter myAdapter;    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        objects = new ArrayList&lt;MyClass&gt;(); // setup the list        lvObjects = (ListView)findViewById(R.id.lvObjectList);        lvObjects.setOnItemClickListener(this);        lvObjects.setOnItemLongClickListener(this);        loadDatabase(DATABASE);        myAdapter = new MyAdapter(this, objects);        lvObjects.setAdapter(myAdapter);     }    ...    public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id)     {               // This is executed when an item in the ListView is short pressed    }    public void onItemLongClick(AdapterView&lt;?&gt; parent, View v, int position, long id)     {        // This is executed when an item in the ListView is long pressed        registerForContextMenu(lvObjects);        v.showContextMenu();    }</code></pre><p>MyAdapter.java</p><pre><code>public class MyAdapter extends BaseAdapter{    private Context context;    private List&lt;MyClass&gt; list;    public RuleAdapter(Context context, List&lt;MyClass&gt; list)    {        this.context = context;        this.list = list;    }    ...    public View getView(int position, View view, ViewGroup viewGroup)     {        MyClass entry = list.get(position);        return new MyAdapterView(context,entry);    }}</code></pre><p>MyAdapterView.java</p><pre><code>public class MyAdapterView extends LinearLayout{       public MyAdapterView(Context context, MyClass entry)     {        super(context);        this.setOrientation(VERTICAL);        this.setTag(entry);        View v = inflate(context, R.layout.row, null);        // Set fields based on entry object        // When this box is checked or unchecked, a message needs to go        // back to Main.java so the database can be updated        CheckBox cbActive = (CheckBox)v.findViewById(R.id.cbActive);        addView(v);    }}</code></pre>","450780","","450780","","2010-12-10 20:30:54","2010-12-10 20:30:54","Android Accessing Elements from a Custom ListView","<android><listview><android-layout><adapter>","2","0","","",""
"4411539","1","","","2010-12-10 17:23:58","-1","466","<p>I need some code to detect other android devices with bluetooth. How can I accomplish this?</p>","538626","","899344","","2012-08-18 16:21:55","2012-08-18 16:21:55","Access Bluetooth Devices on Android? ","<android><bluetooth>","2","0","","2012-08-19 02:59:54",""
"4411594","1","","","2010-12-10 17:28:32","1","1048","<p>I think I'm close to getting  a listener for soft keyboard IME_ACTION_SEND. The goal being for perform click of another button. It doesn't show in the on screen code here, but the ""OnEditorActionListener()"" is underlined in red in the source editor and gives the error:</p><p>""The type new TextView.OnEditorActionListener(){} must implement the inherited abstract method TextView.OnEditorActionListener.onEditorAction(TextView, int, KeyEvent)"", I thought I was.</p><p>The ""KeyEvent"" keyword is also an error in the editor: ""KeyEvent cannot be resolved to a type"".</p><p>Probably something dumb i'm doing (or not doing). Thanks for any help.  </p><pre><code>        et1.setOnEditorActionListener(new OnEditorActionListener() {         public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {             if (actionId == EditorInfo.IME_ACTION_SEND) {                 calculateButton.performClick();             }             return true;         }     }); </code></pre>","512588","","","","","2013-02-23 17:42:59","soft keyboard sending text from EditText to program","<android>","2","0","","",""
"4411611","1","4882896","","2010-12-10 17:30:22","4","3245","<p>I am trying to test an Android application that does GPS tracking. Unfortunately, I get the following error when installing the app on the emulator:</p><pre><code>Package: com.google.android.maps.appname requires unavailable feature android.hardware.location.gps; failing!</code></pre><p>The virtual device that I am using is ""Google APIs (Google Inc.) 8"" and I made sure that GPS was included in the hardware list.</p><p>The error above I believe happens at the following point in the manifest:</p><pre><code>&lt;uses-feature android:name=""android.hardware.location.gps"" android:required=""true""/&gt;</code></pre><p>Does anyone know what the cause of this error might be and what I can do to fix it?</p>","537152","","","","","2011-07-22 21:49:38","Android Emulator does not detect GPS","<android><gps><emulator>","3","0","1","",""
"4411621","1","4411719","","2010-12-10 17:31:54","1","869","<p>I have a bitmap that has greater dimensions than the canvas to which it will be drawn.  Can anyone suggest a method to center this bitmap on the canvas, i.e. the center point of the bitmap should overlap with the center point of the canvas?</p>","163757","","","","","2011-10-06 19:23:19","Android Center Oversized Bitmap On Canvas","<android><canvas><bitmap>","1","0","","",""
"4411680","1","4411728","","2010-12-10 17:38:26","1","741","<p>Without using any outside APIs, how do I draw a simple green horizontal bar to depict a percentage? (Full being 100%)</p><p>One way I thought of was using a SeekBar but I'm not sure how to customize the height, colors, etc of it.</p><p>Is there a formula I could use to draw a rectangle on a canvas or something that would use the desired scale that I need? </p><p>For example, if I have a refrigerator that can fit 38 items, a full bar would render when there was 38 items present.</p>","487840","","","","","2010-12-11 07:30:33","What is the easiest way to draw a horizontal bar in Android?","<android><graphics><canvas>","2","0","","",""
"4411711","1","4411861","","2010-12-10 17:42:21","1","1700","<p>I have a large <code>EditText</code> box.  I want a hint in the box to look like this (syntax highlight not intended):</p><pre><code>Hint about the first lineHint about the second lineHint about the third line</code></pre><p>I tried using <code>android:hint=""@string/hints""</code> on the <code>EditText</code> with the following in strings.xml, but the hint was still on a single line.</p><pre><code>&lt;string name=""hints""&gt;Hint about the first lineHint about the second lineHint about the third line&lt;/string&gt;</code></pre><p>How can one obtain a multiline hint in an <code>EditText</code>?</p>","174463","","","","","2010-12-10 18:08:27","EditText with a hint on multiple lines","<android><edittext>","2","0","","",""
"4411782","1","4427521","","2010-12-10 17:52:10","1","581","<p>Halo, </p><p>My ideia is to show a Context Menu by clicking on one of the options menu.</p><p>I don't think it will be quite difficult but I'm not being able to get the View in the OptionsMenu class.</p><p>So actually it is just call the showContextMenu() on the OptionsMenu class.</p><p>Can somebody give me a hint?</p><p>ty!</p>","508479","","","","","2010-12-13 13:52:30","How to get the contextview by clicking on the option menu","<android>","3","3","1","",""
"4411810","1","4421221","","2010-12-10 17:55:35","1","1072","<p>I want to have a GUI kindof like how Market is.  Mainly I want a title with an icon and the name.  So I've disabled the default titlebar and are using a 9 patch image as my custom titlebar.  It looks great, but the top system bar ( cannot remember what's it called atm ) is casting a shadow on my application - specifically on my titlebar.  I've looked at the Market's custom titlebar and it doesn't have a shadow, or the shadow is below the three main buttons casting on the contentlist.</p><p>How can I remove the shadow from my custom titlebar, and maybe have it below - casting on the content?</p>","324943","","","","","2010-12-12 10:31:16","Custom titlebar without the shadow","<android><gui><layout>","1","6","","",""
"4411913","1","","","2010-12-10 18:08:44","6","5374","<p>I'm having a real problem with my drawables that I just can't seem to figure out.</p><p>The problem is this:</p><p>There are screen sizes at approximately 320x480, 480x800, 480x854</p><p>Then there are most commonly densities at 1.0 (160) and 1.5 (240)</p><p>Now, on a Droid, the screen size is 480x800 and the density is reporting using DisplayMetrics as 1.5</p><p>On the G1, it's 320x480 and reporting back at a density of 1.0</p><p>BUT tablet devices are reporting back at 480x800 with a density of 1.0 (160)</p><p>So, I'm going mad because I can put 320x480 images in the drawables-mdpi folder and 480x800 images in the drawables-hdpi folder, but on Tablet computers, no matter what it's not resizing up anything to a full screen.</p><p>Any help would be greatly appreciated. I just want all of my 320x480 images to scale up regardless of the device.</p>","179518","","","","","2011-02-06 21:35:26","Android multiple screen sizes and density problems","<android><screen-size>","4","1","","",""
"4411933","1","4412094","","2010-12-10 18:12:56","0","174","<p>i have wrote an app getting rss feed from the website of my university.in the eclipse emulator the app runs with no problem and i can reed the rss.but as i transferred it to my mobile(samsung gti 9000) the screen freeze when i push the button for the rss news...also,if i go for the menu button of the phone and change dom to sax the phone pops out a message to force down...any idea?may my phone has a problem?please keep on mind that my phone works on greek language and the emulator on english,i dont know if this matter.. this is the error on logcat as i press the button(i have connected my devise to the pc):</p><p>12-10 20:09:37.187: INFO/ActivityManager(2235): Starting activity: Intent { cmp=com.example.unipi/.home } 12-10 20:09:37.206: INFO/AndroidNews(11130): ParserType=ANDROID_SAX 12-10 20:09:37.211: ERROR/AndroidNews(11130): java.lang.RuntimeException: java.net.UnknownHostException: Host is unresolved: www.kospol.gr:80 12-10 20:09:37.211: ERROR/AndroidNews(11130): java.lang.RuntimeException: java.lang.RuntimeException: java.net.UnknownHostException: Host is unresolved: www.kospol.gr:80 12-10 20:09:37.211: ERROR/AndroidNews(11130): at com.example.unipi.AndroidSaxFeedParser.parse(AndroidSaxFeedParser.java:55) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at com.example.unipi.home.loadFeed(home.java:75) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at com.example.unipi.home.onCreate(home.java:30) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at android.os.Handler.dispatchMessage(Handler.java:99) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at android.os.Looper.loop(Looper.java:123) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at android.app.ActivityThread.main(ActivityThread.java:4363) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at java.lang.reflect.Method.invokeNative(Native Method) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at java.lang.reflect.Method.invoke(Method.java:521) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at dalvik.system.NativeStart.main(Native Method) 12-10 20:09:37.211: ERROR/AndroidNews(11130): Caused by: java.lang.RuntimeException: java.net.UnknownHostException: Host is unresolved: www.kospol.gr:80 12-10 20:09:37.211: ERROR/AndroidNews(11130): at com.example.unipi.BaseFeedParser.getInputStream(BaseFeedParser.java:32) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at com.example.unipi.AndroidSaxFeedParser.parse(AndroidSaxFeedParser.java:53) 12-10 20:09:37.211: ERROR/AndroidNews(11130): ... 15 more 12-10 20:09:37.211: ERROR/AndroidNews(11130): Caused by: java.net.UnknownHostException: Host is unresolved: www.kospol.gr:80 12-10 20:09:37.211: ERROR/AndroidNews(11130): at java.net.Socket.connect(Socket.java:1054) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.(HttpConnection.java:62) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager$ConnectionPool.getHttpConnection(HttpConnectionManager.java:145) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection(HttpConnectionManager.java:67) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:821) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:807) 12-10 20:09:37.211: ERROR/AndroidNews(11130): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1051)</p>","519526","","","","","2010-12-10 18:33:58","problem with an app on my phone 2","<android>","1","1","","",""
"4412077","1","4442569","","2010-12-10 18:32:16","0","889","<p>I have some images that are 48 pixels (or greater) in height, and 48 pixels (or greater) in width. So basically I have images that are either 48 X greater than 48, or greater than 48 x 48. I want to make some thumbnails from these images that are center cropped and NOT scaled so that they maintain image quality. I can't use:</p><pre><code>setScaleType(ScaleType.CENTER_CROP)</code></pre><p>because although it achieves the cropping I am looking for, it unfortunately scales the image. What I am trying to achieve with the crop is that it either cuts off the left &amp; right of an image that is greater than 48 pixels in width, or the top &amp; bottom of an image that is greater than 48 pixels in height.</p><p>I tried <code>ScaleType.CENTER</code> in an XML layout, and it seems to be exactly what I want. I'm using these images in a Gallery, so in my gallery Adapter I do:</p><pre><code>    @Override    public View getView(int position, View convertView, ViewGroup parent) {        ImageView thumb = new ImageView(mContext);        thumb.setScaleType(ScaleType.CENTER);        thumb.setLayoutParams(new LayoutParams(THUMB_SIZE, THUMB_SIZE));        if (mPhotos != null) {            String imageUrl = mPhotos.get(position).getPhotoHref();            imageUrl = imageUrl.replaceAll(mPattern, mFormat);            ImageManager.instance().displayImage(imageUrl, mContext, thumb, DefaultThumbId);        } else {            thumb.setImageResource(DefaultThumbId);        }        return thumb;    }</code></pre><p>but for some reason, the entire image is shown, but scaled way down. It works perfect in an XML layout, but not when I do this in code and feed it to a <code>Gallery</code>. What gives?</p>","413414","","","","","2010-12-14 18:11:43","Android: Gallery interfering with scale setting of ImageView","<android><gallery><imageview><scaling>","1","0","","",""
"4412109","1","4412183","","2010-12-10 18:35:37","3","1105","<p>I've been looking through some of the Android examples on the developer's website (<code>http://developer.android.com/resources/samples/SoftKeyboard/res/xml/qwerty.html</code>), and I've seen %p being used as a dimension.</p><p>I've done a Google search, but can't find any information about what it means. Does anyone know?</p>","301839","","750613","","2012-07-12 07:10:19","2012-07-12 07:10:19","In Android what does the dimension %p mean?","<android><android-layout>","1","0","","",""
"4412224","1","8008017","","2010-12-10 18:49:12","3","898","<p>Source:  </p><pre><code>listener = new PhoneStateListener()    {        @Override        public void onCallStateChanged(int state, String incomingNumber) {            super.onCallStateChanged(state, incomingNumber);            Toast toast = Toast.makeText(getApplicationContext(), incomingNumber, Toast.LENGTH_LONG);            toast.show();        }    };    ((TelephonyManager)getSystemService(TELEPHONY_SERVICE)).listen(listener , PhoneStateListener.LISTEN_CALL_STATE )</code></pre><p>Hi,<br>I am using this code, with <code>android.permission.READ_PHONE_STATE</code> permission, to get toast message including number of started call. My problem is that incomingNumber is empty, it doest not matter if call is outgoing or incomming, toast appear, but empty.<br>I have seen some solutions for this, but solution was to get the number with completely different way and I wanna know if my code can be used for my needs.<br>Thanks for advices,<br>Adam</p>","538239","","750613","","2012-07-12 07:09:18","2012-07-12 07:09:36","Unable to get non-empty string from PhoneStateListener::onCallStateChanged","<android><telephonymanager>","1","2","","",""
"4412247","1","","","2010-12-10 18:51:27","1","806","<p>I plan on getting an android phone, and I would like to be able to develop audio apps on it. It looks like I need 2.3 and the following in the <strong>""manifest""</strong>:</p><p><strong>uses-feature android:name=""android.hardware.audio.low_latency""</strong></p><p>How do I check for this support on the devices as I shop?</p>","538242","","750613","","2012-07-12 07:09:53","2012-07-12 07:09:53","Finding Android 2.3 Phones with Low Latency Audio","<android>","1","3","","2010-12-10 21:21:43",""
"4412369","1","","","2010-12-10 19:08:18","0","381","<p>How can I copy a generic .db file (not part of my resources, like contacts.db) from the device filesystem to another location say sdcard?Can I use - </p><p>InputStream ins = getResources().openRawResource(""path to my .db file"");</p><p>And then proceed as you showed above.</p><p>Thanks in advance for your help</p>","538255","","","","","2010-12-11 01:25:08","Copying generic .db files to sdcard","<android>","1","2","","",""
"4412449","1","4412563","","2010-12-10 19:17:49","10","22580","<p>i got the following problem. </p><p>i have a ListView with custom rows consisting of an imageview and a textview.the textview's xml code is</p><pre><code>&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/label""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""26px""    android:layout_marginLeft=""3px""    android:singleLine=""true""    android:ellipsize=""end""    android:textColorHighlight=""#FEC403""/&gt;</code></pre><p>then i have an itemclicklistener that works fine and i want to highlight the textview that has been clicked by doing the following.</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; adaptview, View clickedview, int position,                long id) {            //TODO: ACTIONS            String pathtofile = (String) adaptview.getItemAtPosition(position);            View rowview = (View) adaptview.getChildAt(position);            rowview.setSelected(true);}</code></pre><p>i wanted the highlight color to be ""#FEC403"" in the xml (that is a light orange) but the highlightcolor still is gray. so how to set the highlightcolor correctly?</p><p>thanks in advance</p><p>EDIT: </p><p>here is how i did it finally:</p><p>this is my ListView Item 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=""wrap_content""android:background=""@drawable/rowselector""&gt;&lt;ImageView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/musicicon""    android:layout_width=""wrap_content""    android:layout_height=""fill_parent""    android:src=""@drawable/musicicon""    android:paddingLeft=""3px""/&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/label""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""26px""    android:layout_marginLeft=""3px""    android:singleLine=""true""    android:ellipsize=""end""    android:focusable=""false""/&gt;</code></pre><p></p><p>and the rowselector.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_selected=""true""    android:drawable=""@color/orange"" /&gt;&lt;/selector&gt;</code></pre><p>and at last my OnItemClick is very short now:</p><pre><code>@Overridepublic void onItemClick(AdapterView&lt;?&gt; adaptview, View clickedview, int position,                long id) {            //TODO: ACTIONS            clickedview.setSelected(true);}</code></pre>","537865","","537865","","2011-02-10 20:40:24","2013-05-25 05:11:37","How to highlight ListView-Items","<android><highlight><listviewitem>","3","1","3","",""
"4412518","1","","","2010-12-10 19:25:22","0","107","<p>I am new to Android. I need to attach an image to an email. The image is stored locally. Is it possible? Thanks in advance.</p>","538277","","8117","","2012-07-13 15:59:16","2012-07-13 15:59:16","How to attach an image which is stored locally to an Email in android?","<android>","1","0","","",""
"4412588","1","4412959","","2010-12-10 19:33:30","2","1205","<p>If I have two applications loaded on an Android device, are there calls I can make in one that will delete the other one? I am looking for something to delete apps in a fashion similar to how I can launch an app from another.</p><p>I thought this may be possible through the Intent/Activity interactions but it doesn't seem possible. This seems like something that may not be allowed for obvious reasons but wanted to check anyways.</p><p>Follow up question, can an application remove itself?</p>","330013","","330013","","2010-12-10 19:39:15","2010-12-10 20:22:22","In Android, can you delete an application from another application?","<android>","2","1","","",""
"4412627","1","","","2010-12-10 19:40:16","0","196","<p>I have an app reading some RSS feeds from the web. My problem is: If I have greek language on my device, the app doesn't run (it opens the main screen, every button with text directs me to a new activity with text with no problem, but as I press the button for the rss, the phone shows a black screen). If I change it to english, the app runs as in the emulator. What's the problem with this? Can I not run apps if my language is greek?</p>","519526","","429063","","2010-12-10 20:13:34","2010-12-10 20:13:34","Problem With The Android Device Language","<android><internationalization>","0","7","0","",""
"4412711","1","4418180","","2010-12-10 19:50:34","1","1078","<p><strong>The problem:</strong> I have a tabbed android app and I'm losing the content in TabOne whenever I follow these (admittedly strange) steps:</p><ol><li>Change to another tab.</li><li>Switch orientation to landscape.</li><li>Switch orientation back to portrait.</li><li>Change back to TabOne.</li></ol><p><strong>Android App Description:</strong> I have a pretty bare-bones android app with three tabs that were built using <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">google's <code>TabLayout</code> tutorial</a>, we'll call them TabOne, TabTwo, and TabThree. Only TabOne has any content: a simple <code>EditText</code> view and <code>Button</code> that lets you add text to the body of TabOne. This is rigged up using a custom <code>ArrayAdapter</code>, which may have something to do with the strange behavior.</p><p>Note that <strong>this does not occur if I change orientation while remaining on TabOne</strong>. This is because I have implemented <code>OnSaveInstanceState()</code> and <code>OnRestoreInstanceState()</code> to save my list of data in my <code>TabOneActivity</code> class.</p>","426794","","829407","","2012-05-23 19:11:48","2012-10-17 15:44:43","Android App Losing State When Switching Tabs And Orientation","<android><tabs><orientation><state>","2","3","1","",""
"4412858","1","","","2010-12-10 20:09:14","1","705","<p>I am working on delivering PDF files that are generated on demand to users of mobile devices.  I am using ASP.NET MVC 2 and I generate the PDF using the Report Viewer local report export as PDF.</p><p>This gives me the raw byte[] of PDF content.</p><p>I then return it using:</p><p>return File( pdf , mimeType , ""FileName.pdf"" );</p><p>Note, I have tried it with and without the ""FileName.pdf"" default name for saving the file.</p><p>It works great in desktop browsers and iPhones.  I have tested with the WP 7 emulator and it seems like it would work if it could just read PDFs (it prompts for the proper file name to save it).</p><p>Android seems to be complaining, however.</p><p>I have tested on Droid-X and Droid devices and it always shows "" Download unsuccessful"" in the browser download results.  On Opera Mini it prompted to save the file (when using the return method that included the file name) and the PDF opened fine after it was saved on the device.</p><p>I can return PDF files that already exist on disk just fine with: File( ""~/filename.pdf"" , ""application/pdf"" ); so it seems to just be a problem with dynamic PDFs.</p><p>Has anyone dealt with this issue before?</p>","334040","","","","","2012-06-20 12:14:48","Dynamic PDFs and Android default browser","<c#><android>","1","3","1","",""
"4412868","1","5217211","","2010-12-10 20:10:43","3","5695","<p>I am working on and Android app that pulls a picture from an internet page (specifically xckd.com).  I have it working wonderfully using code of this basic form (see below)</p><pre><code>ImageView iv = new ImageView;    URL url = new URL(address);    InputStream content = (InputStream)url.getContent();    Drawable d = Drawable.createFromStream(content , ""src"");     iv.setImageDrawable(d)</code></pre><p>I noticed when I was viewing some of their older comics the image would not show (but I was scraping the other information from the page properly so I know the url is correct).   I determined that this result only occurs when the image is a .jpg file but works perfectly when it is a .png</p><p>I have Googled around plenty and I can't figure out why this is, is there a simple fix for this?</p>","324977","","","","","2011-03-07 07:58:02","Android: Getting Drawable from URL not working for .jpg, only works for .png","<android><url><png><jpeg><drawable>","1","3","3","",""
"4412922","1","4413612","","2010-12-10 20:16:22","1","883","<p>How can I create inline hyperlinks in a TextView while having different values for the link URL and link text?</p>","463304","","","","","2010-12-10 21:50:18","Inline hyperlinks in Android TextView","<android><hyperlink><textview>","1","0","0","",""
"4413023","1","4413290","","2010-12-10 20:29:52","2","6548","<p>I'm trying to encrypt a string on Android with AES. The symmetric key is determined previously with the Diffie-Hellman algorithm and seems to be ok (Key Length is 128 Bit, see below).<br>Nevertheless, I get a  <code>InvalidKeyException: ""Key length not 128/192/256 bits.</code>""</p><p>Code:</p><pre><code>KeyAgreement keyAgree = KeyAgreement.getInstance(""DH"", ""BC"");keyAgree.init(this.smartphonePrivKey);keyAgree.doPhase(serverPubKey, true);SecretKey key = keyAgree.generateSecret(""AES"");System.out.println(""Key Length: "" + key.getEncoded().length);System.out.println(""Key Algorithm: ""+ key.getAlgorithm());System.out.println(""Key Format: ""+ key.getFormat());byte[] encrypted = null;  Cipher cipher;  try {   cipher = Cipher.getInstance(""AES/ECB/PKCS5Padding"");   System.out.println(""Allowed Key Length: ""     + cipher.getMaxAllowedKeyLength(""AES""));   cipher.init(Cipher.ENCRYPT_MODE, key);   encrypted = cipher.doFinal(""YEAH"".getBytes(""UTF8""));  } catch (NoSuchAlgorithmException e) {   e.printStackTrace();  } catch (NoSuchPaddingException e) {   e.printStackTrace();  } catch (InvalidKeyException e) {   e.printStackTrace();  } catch (IllegalBlockSizeException e) {   e.printStackTrace();  } catch (BadPaddingException e) {   e.printStackTrace();  } catch (UnsupportedEncodingException e) {   e.printStackTrace();  }</code></pre><p>The above Code leads to the following output:<br><em>12-10 20:24:53.119: INFO/System.out(757): Key Length: 128</em><br><em>12-10 20:24:53.119: INFO/System.out(757): Key Algorithm: AES</em><br><em>12-10 20:24:53.119: INFO/System.out(757): Key Format: RAW</em><br><em>12-10 20:24:53.470: INFO/System.out(757): Allowed Key Length: 2147483647</em>  </p><p>After that, I get the ""InvalidKeyException: Key length not 128/192/256 bits."" But as you can see, the SecretKey has a length of 128 Bits!  </p><p>Any ideas?</p><p>Thanks</p>","502396","","750613","","2012-07-12 07:07:16","2012-07-12 18:55:00","AES encryption: InvalidKeyException: Key length not 128/192/256 bits","<android><encryption><aes><diffie-hellman>","1","0","","",""
"4413051","1","4414033","","2010-12-10 20:32:46","0","978","<p>I am working from an example provided by my professor which gets data from a weather forecast site and parses the XML file to show the weather conditions in a list.  My program is similar, but I want to retrieve information that is nested within several nodes, and I don't know how to get to it.  Here is the XML file I'm working from:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt; &lt;DirectionsResponse&gt;  &lt;status&gt;OK&lt;/status&gt;  &lt;route&gt;   &lt;summary&gt;S Street Viaduct&lt;/summary&gt;   &lt;leg&gt;    &lt;step&gt;     &lt;travel_mode&gt;DRIVING&lt;/travel_mode&gt;     &lt;start_location&gt;      &lt;lat&gt;40.7021400&lt;/lat&gt;      &lt;lng&gt;-74.0158200&lt;/lng&gt;     &lt;/start_location&gt;     &lt;end_location&gt;      &lt;lat&gt;40.7021400&lt;/lat&gt;      &lt;lng&gt;-74.0158200&lt;/lng&gt;     &lt;/end_location&gt;     &lt;polyline&gt;      &lt;points&gt;kslwFzewbM&lt;/points&gt;      &lt;levels&gt;B&lt;/levels&gt;     &lt;/polyline&gt;     &lt;duration&gt;      &lt;value&gt;0&lt;/value&gt;      &lt;text&gt;1 min&lt;/text&gt;     &lt;/duration&gt;     &lt;html_instructions&gt;Head &amp;lt;b&amp;gt;east&amp;lt;/b&amp;gt; on &amp;lt;b&amp;gt;S Street Viaduct&amp;lt;/b&amp;gt;&lt;/html_instructions&gt;     &lt;distance&gt;      &lt;value&gt;0&lt;/value&gt;      &lt;text&gt;1 ft&lt;/text&gt;     &lt;/distance&gt;    &lt;/step&gt;    &lt;duration&gt;     &lt;value&gt;0&lt;/value&gt;     &lt;text&gt;1 min&lt;/text&gt;    &lt;/duration&gt;    &lt;distance&gt;     &lt;value&gt;0&lt;/value&gt;     &lt;text&gt;1 ft&lt;/text&gt;    &lt;/distance&gt;    &lt;start_location&gt;     &lt;lat&gt;40.7021400&lt;/lat&gt;     &lt;lng&gt;-74.0158200&lt;/lng&gt;    &lt;/start_location&gt;    &lt;end_location&gt;     &lt;lat&gt;40.7021400&lt;/lat&gt;     &lt;lng&gt;-74.0158200&lt;/lng&gt;    &lt;/end_location&gt;    &lt;start_address&gt;S Street Viaduct, New York, NY 10004, USA&lt;/start_address&gt;    &lt;end_address&gt;S Street Viaduct, New York, NY 10004, USA&lt;/end_address&gt;   &lt;/leg&gt;   &lt;copyrights&gt;Map data ©2010 Google, Sanborn&lt;/copyrights&gt;   &lt;overview_polyline&gt;    &lt;points&gt;kslwFzewbM&lt;/points&gt;    &lt;levels&gt;B&lt;/levels&gt;   &lt;/overview_polyline&gt;  &lt;/route&gt; &lt;/DirectionsResponse&gt; </code></pre><p>I'm really only interested in retrieving the info in the ""html_instructions"" tag, but it is nested in the ""route"", ""leg"", and ""step"" tags.  I have seen several tutorials and questions on SO about parsing XML but couldn't seem to find a solution to this.  Any direction would be greatly appreciated!</p><p>Thanks.</p>","471791","","","","","2010-12-10 22:52:55","Parse XML & Retrieve Info Several layers of Nodes Deep Java/Android","<java><android><xml><parsing><nodes>","2","0","","",""
"4413054","1","","","2010-12-10 20:33:04","1","10374","<p>I have an activity where I want it to display results from a database using ListView.  The table has three columns: word, description, and category.  On the activity page, I have a list of categories being read from an array.  I want to set it up so that if you click on an item on the list (for example Cat1), the results returned from the cursor will be all words/descriptions with the category Cat1 in the DB.  Currently I simply have a Toast with that category's name appear when clicked.</p><p>As it is right now, the activity does not run properly.  I have read around on the web, and am not sure how to proceed.  Here is the code I have so far.  If anyone can help me, I would really appreciate it.</p><p>public class Categories extends ListActivity {    DataBaseHelper db = new DataBaseHelper(this);    private SQLiteDatabase data;    int position;</p><pre><code>private ListView list;private String[] categories = {    ""C1"", ""C2"", ""C3"", ""C4"",    ""C5"", ""C6"", ""C7"", ""C8"",    ""C9"", ""C10"", ""C11"", ""C12""};@Overridepublic void onCreate(Bundle icicle){    super.onCreate(icicle);    setContentView(R.layout.cat_list);    list = (ListView)findViewById(R.id.cat_listing);    list.setAdapter(new ArrayAdapter&lt;String&gt;(this,        R.layout.categories, categories));    list.setTextFilterEnabled(true);    Cursor cursor = data.rawQuery(""SELECT term, desc FROM words WHERE cat = '"" + categories[position] + ""'"", null);    startManagingCursor(cursor);    String columns[] = new String[] { ""term"", ""desc"" };    int[] to = new int[] { R.id.cat_term, R.id.cat_desc };    SimpleCursorAdapter myAdapter = new SimpleCursorAdapter(this, R.layout.cat_result, cursor, columns, to);    this.setListAdapter(myAdapter);    list.setOnItemClickListener(new OnItemClickListener(){        public void onItemClick(AdapterView&lt;?&gt; parent, View view,                int position, long id){            CharSequence text = categories[position];            Toast toast = Toast.makeText(getApplicationContext(),                    text, Toast.LENGTH_SHORT);            toast.show();        }    });}</code></pre><p>}</p>","529493","","","","","2012-01-03 02:30:06","Displaying Cursor Results from DB in ListView after OnItemClick","<android><database><listview><cursor>","2","0","","",""
"4413104","1","","","2010-12-10 20:39:10","0","463","<p>This is Android question.<br/>Does anyone know how I can get file names (as String) from the package and not from the resource folder?<br/>For example, if normal.xml is stored in <code>src/com.example.xml/normal.xml</code>, how can i get the name of the file as String?<br />Thank you!</p>","471473","","750613","","2012-07-12 07:05:29","2012-07-12 07:05:29","android how to get file names from package","<android><file><package>","2","0","","",""
"4413300","1","4414252","","2010-12-10 21:03:11","11","7679","<p>is there any way to change default buffer size on streaming <code>MediaPlayer</code>?</p>","538384","","750613","","2012-07-12 07:05:04","2013-03-26 18:12:20","change buffer size on MediaPlayer","<android>","4","0","2","",""
"4413305","1","4414267","","2010-12-10 21:03:51","0","259","<p>Here is my scenario: I have to write an android application which displays two tickers on one screen(e.g news ticker and stock ticker). Data for both the tickers come from separate URL's. I'm trying to come up with a efficient solution. So here is my approach so far <br></p><p>Create separate class to fetch data from URL's(news and ticker). These classes should be completely responsible for fetching the data from server as well as updating the data on the UI component which is defined in the Activity.<BR></p><p>So i guess, each of the class should have 2 private inner class (threads) one to fetch data from server and another to update the GUI. Once the fetch thread gets all the data, the display thread will start to paint it on the GUI component.</p><p>My question is <br></p><ol><li><p>Is this a correct approach? I think this might work, but i'm trying to find if there is a better way to do things, like using AsyncTask etc. need some expert advise here. </p></li><li><p>I do not want to pass the reference of GUI components(textView) from Activity to Thread class (trying to decouple), so I was thinking of passing instance of handler from<br>Activity to these classes. That way the inner thread class can post a message in handler and then in Activity i can get the message from handler to update the GUI component. Is it ok to pass the reference of handler to thread. Is this how it is supposed to be done?</p></li></ol><p>I'm completely ok with changing the above approach if there is a better way, so please let me know how would you tackle this problem. </p><p>Thanks</p>","260298","","","","","2010-12-10 23:44:32","Design question regarding multiple GUI component refresh scenario","<android>","1","0","","",""
"4413345","1","","","2010-12-10 21:08:41","0","371","<p>I'm a 20 year old Android developer, and i'm having some trouble publishing my application. The thing is that I want my application to work on every device screen. To do so I figured out I need to use the DIP class (<code>DPI independent pixels</code>) of the android packages. </p><p>The problem is I can't find them anywhere. I have looked for weeks new and it's driving me absolutely nuts. The one who can help me solve this problem I will pay good.</p>","538392","","750613","","2012-07-12 07:05:51","2012-07-12 07:06:06","How to get the Android developer classes (packages) in my AS3 project","<android><flash><actionscript-3><package>","1","3","","",""
"4413369","1","","","2010-12-10 21:12:48","1","459","<p>is it possible to intercept user opening sms message inbox. I would like to provide auth mechanism on that event so you can protect your sms inbox from being opened without permission.</p>","505160","","","","","2010-12-10 23:45:27","How to intercept opening sms message inbox?","<java><android>","3","0","","",""
"4413564","1","","","2010-12-10 21:41:52","0","1915","<p>It is a standard <code>MP4</code> exported from iTunes and it plays fine in <code>QuickTime</code> and on <code>iPhone</code>.</p><p><a href=""http://www.amzfamily.com/movies/c1008.mp4"" rel=""nofollow"">http://www.amzfamily.com/movies/c1008.mp4</a>I also tried <a href=""http://www.amzfamily.com/movies/c1008.m4v"" rel=""nofollow"">http://www.amzfamily.com/movies/c1008.m4v</a></p><p>I can't find any definitive information about what video formats Android devices support, only anecdotes from users in forums about problems.</p>","457832","","750613","","2012-07-12 07:04:38","2012-07-12 07:04:38","Why doesn't this video play on Android?","<android><video><mp4>","1","2","","2010-12-11 11:38:26",""
"4413652","1","4414412","","2010-12-10 21:57:05","1","3140","<p>Hi I am trying to draw a shape that has three rectangular shapes:1. solid color 2. gradient 3. white line How do I do that? When I try this, it does not work. The layout has the parent color.</p><pre><code>&lt;shape     xmlns:android=""http://schemas.android.com/apk/res/android""    android:shape=""rectangle""    android:height=""60px""    &gt;    &lt;shape         android:shape=""rectangle""         android:height=""30px""        &gt;        &lt;solid             android:color=""#ff297baf""             /&gt;    &lt;/shape&gt;    &lt;shape         android:shape=""rectangle""        android:height=""30px""        &gt;         &lt;gradient  android:type=""linear""  android:startColor=""#ff297baf""  android:endColor=""#ff16c0e3""  android:angle=""270""/&gt;     &lt;/shape&gt;    &lt;shape        android:shape=""rectangle""        android:height=""3px""        &gt;        &lt;solid             android:color=""#FFFFFFFF""            /&gt;    &lt;/shape&gt;&lt;/shape&gt;</code></pre><p>I am trying to make a gradient in 3 colors. Start with a solid color <code>#ff297baf</code>, at 60% start a gradient from <code>#ff297baf</code> to <code>#ff16c0e3</code> and add a while line at the end.</p>","538428","","750613","","2012-07-12 07:03:54","2012-07-12 07:03:54","nested shapes in android sdk","<android><sdk><shapes><monodroid>","1","3","1","",""
"4413828","1","4414304","","2010-12-10 22:22:24","1","3479","<p>I have a <code>Service</code> and I want it to update a widget on the homescreen each second. Therfore the Service listenes to an OnTimerEvent which is send by an <code>TimeController</code> each second. The <code>TimeController</code> is a singleton holding a handler which runs <code>mUpdateTimeTask</code>:</p><pre><code>public class TimeController {    private long startTime = -1;    // ... attributes ... listeners etc    private Runnable mUpdateTimeTask = new Runnable() {        public void run() {            TimeController.this.notify(new TimerUpdateEvent(this));            startTime += DateUtils.SECOND_IN_MILLIS;            mHandler.postAtTime(this, startTime);        }    };    public void startTimer() {        // if not already running        if (startTime == -1) {            startTime = SystemClock.uptimeMillis();            mHandler.removeCallbacks(mUpdateTimeTask);            mHandler.postDelayed(mUpdateTimeTask, 0);        }    };    // ...}</code></pre><p>This all works and the widget get's updated, but in Logcat I see:</p><pre><code>12-10 22:06:42.825: DEBUG/dalvikvm(1738): GC freed 17488 objects / 651080 bytes in 112ms12-10 22:06:44.035: DEBUG/dalvikvm(1738): GC freed 17479 objects / 650832 bytes in 172ms12-10 22:06:45.205: DEBUG/dalvikvm(1738): GC freed 17428 objects / 649744 bytes in 97ms12-10 22:06:46.315: DEBUG/dalvikvm(1738): GC freed 17463 objects / 650656 bytes in 86ms12-10 22:06:47.725: DEBUG/dalvikvm(1738): GC freed 17793 objects / 663872 bytes in 85ms12-10 22:06:48.985: DEBUG/dalvikvm(1738): GC freed 17026 objects / 633944 bytes in 176ms12-10 22:06:50.145: DEBUG/dalvikvm(1738): GC freed 17492 objects / 651352 bytes in 89ms12-10 22:06:51.674: DEBUG/dalvikvm(1738): GC freed 17435 objects / 650320 bytes in 105ms12-10 22:06:52.934: DEBUG/dalvikvm(1738): GC freed 17519 objects / 652584 bytes in 109ms12-10 22:06:54.234: DEBUG/dalvikvm(1738): GC freed 17487 objects / 650920 bytes in 90ms12-10 22:06:55.645: DEBUG/dalvikvm(1738): GC freed 17685 objects / 659448 bytes in 91ms</code></pre><p>And I don't like what I see... :-)</p><pre><code>public class MyService extends Service implements TimerUpdateListener {    @Override    public void onCreate() {        timeController = TimeController.getInstance();        timeController.addListener(this);        timeController.startTimer();        appWidgetManager = AppWidgetManager.getInstance(this);        remoteViews = new RemoteViews(this.getPackageName(), R.layout.widget_2x1);        projectWidget = new ComponentName(this, ProjectWidget.class);        super.onCreate();    }    @Override    public void onTimerUpdate(TimerUpdateEvent e) {        updateWidgetViews();    }    private void updateWidgetViews() {        // only update widgets if some exist        if (appWidgetManager.getAppWidgetIds(projectWidget).length &gt; 0) {            remoteViews.setTextViewText(R.id.time, MyDateUtils.timeLeftAsString(project.getInCurrentLevelSince()));            appWidgetManager.updateAppWidget(projectWidget, remoteViews);        }    }}</code></pre><p>If I comment out the <code>remoteViews.setTextViewText(...)</code> the GC messages do not appear. So how can I update the view without having such a huge memory leaking?</p><p>Thanks!</p>","386201","","","","","2010-12-10 23:53:23","android widget update from service - memory leak?","<android><service><timer><widget>","1","3","2","",""
"4413982","1","","","2010-12-10 22:44:50","-1","757","<p>I have several <code>*.xml</code> files, and I need to parse this data and display it as a list. Can anyone point me in the right direction of how to solve this problem? Thanks in advance for any help.</p>","538475","","121493","","2010-12-10 22:47:46","2010-12-10 23:23:59","Android ListView with XML Files?","<android><xml><listview>","1","2","","",""
"4414044","1","4414348","","2010-12-10 22:55:23","0","713","<p>I am trying to be able to view the source code of a webpage after being given a URL in order to parse the text for a certain string which represents and image url.</p><p>I found this post which is pretty much what I am after trying to do but can't get it working:</p><p><a href=""http://stackoverflow.com/questions/2423498/how-to-get-the-html-source-of-a-page-from-a-html-link-in-android"">Post</a></p><p>This is my code below.</p><pre><code>public String fetchImage() throws ClientProtocolException, IOException {        HttpClient client = new DefaultHttpClient();        HttpGet request = new HttpGet(""www.google.co.uk/images?q=songbird+oasis"");        HttpResponse response = client.execute(request);        String html = """";        InputStream in = response.getEntity().getContent();        BufferedReader reader = new BufferedReader(new InputStreamReader(in));        StringBuilder str = new StringBuilder();        String line = null;        while((line = reader.readLine()) != null)        {            str.append(line);        }        in.close();        html = str.toString();        return html;    }</code></pre><p>but for some reason it just does not work. It forces me to use a try catch statement in calling the method. Once this works I think it will simple from here using regex to find the string <code>""href=""/imgres?imgurl=........jpg""</code> to find the url of a jpg image to then be shown in an image view.</p><p>Please tell me if i'm going at this all wrong.</p>","400406","","","","","2010-12-11 00:04:07","Gain URL from google image search in android","<android><html><imageview>","1","1","","",""
"4414113","1","4414146","","2010-12-10 23:09:46","2","674","<p>Scenario:</p><pre><code>Activity ""A"" launches Service ""S"".</code></pre><p>Press 'Home'/'back' key to not to display ""A"".</p><p>Some time later ""S"" start intent Activity ""B""</p><pre><code>Intent intent = new Intent(context, MyDialog.class);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(intent);</code></pre><p><strong>Current behaviour:</strong> ""B"" shows up with ""A"" behind in the scene.</p><p><strong>What I want:</strong> ""B"" shows up without ""A"" benhind in the scene.</p><p>Note: Activity B is a Dialog Activity</p>","432056","","750613","","2012-07-12 06:52:36","2013-04-27 07:14:30","Android: How could a service start an Activity without old Activities in stack shown behind","<android><service><dialog><activity>","3","0","","",""
"4414168","1","4417211","","2010-12-10 23:21:52","2","4609","<p>I have the following snippet of code in the onCreate method of a class that extends Activity:</p><pre><code> ImageView view = (ImageView) findViewById(R.id.ImageView01);BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options();bmpFactoryOptions.inJustDecodeBounds = true;Bitmap bmp = BitmapFactory.decodeResource(getResources(),R.drawable.sample_landscape, bmpFactoryOptions);Display display = getWindowManager().getDefaultDisplay();int width = display.getWidth();int height = display.getHeight();Log.v(""IMAGEVIEWERMATRIX"", ""Display Width: "" + display.getWidth());Log.v(""IMAGEVIEWERMATRIX"", ""Display Height: "" + display.getHeight());Log.v(""IMAGEVIEWERMATRIX"", ""BMP Width: "" + bmpFactoryOptions.outWidth);Log.v(""IMAGEVIEWERMATRIX"", ""BMP Height: "" + bmpFactoryOptions.outHeight);if (bmpFactoryOptions.outWidth &gt; width || bmpFactoryOptions.outHeight &gt; height) {    float heightRatio = (float) height / (float) bmpFactoryOptions.outHeight;    float widthRatio = (float) width / (float) bmpFactoryOptions.outWidth;    // WHY    heightRatio = heightRatio / 1.5f;    widthRatio = widthRatio / 1.5f;    Log.v(""IMAGEVIEWERMATRIX"", ""heightRatio:"" + heightRatio);    Log.v(""IMAGEVIEWERMATRIX"", ""widthRatio: "" + widthRatio);    float scale = widthRatio;    if (heightRatio &lt; widthRatio) {        scale = heightRatio;    }    matrix.setScale(scale, scale);    Log.v(""IMAGEVIEWERMATRIX"", ""Scale: "" + scale);} else {    Log.v(""IMAGEVIEWERMATRIX"", ""NOTNOTNOT"");    matrix.setTranslate(1f, 1f);}Bitmap realBmp = BitmapFactory.decodeResource(getResources(),R.drawable.sample_landscape);view.setImageBitmap(realBmp);view.setImageMatrix(matrix);</code></pre><p>When I run it, the image appears on screen scaled to fit correctly.  My issue is that I have to adjust the scale by 1.5 in order for this to be correct.</p><pre><code>heightRatio = heightRatio / 1.5f;widthRatio = widthRatio / 1.5f;</code></pre><p>My intuition is that this has to do with the display density of the device but for the life of me, I can't wrap my head around why I would need to do this.</p><p>Here is the layout 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""&gt;&lt;ImageView android:id=""@+id/ImageView01"" android:scaleType=""matrix""     android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre>","319935","","","","","2010-12-11 14:35:34","Issue when scaling image using matrix in ImageView","<android><matrix><resize><imageview><scale>","1","0","1","",""
"4414171","1","4414191","","2010-12-10 23:22:40","42","34227","<p>I am trying to write an app that does something specific when it is brought back to the foreground after some amount of time. Is there a way to detect when an app is sent to the background or brought to the foreground?</p>","538498","","63550","","2014-02-07 19:50:20","2014-02-21 10:33:45","How to detect when an Android app goes to the background and come back to the foreground","<android><background><foreground>","13","0","27","",""
"4414202","1","4414258","","2010-12-10 23:28:16","0","1118","<p>i have a remote sql satabase, and i connect him by php with JSON.</p><p>I can get string and int data OK, but now i have a problem.... i have a datetime field on my SQL database, and i dont know how to get it with JSON into java.util.Date</p><p>this is the code i tryed, but it fails getting the Date correctly, it gives me an exception (<code>java.lang.ClassCastException: java.lang.String</code>)</p><p>code:</p><pre><code>JSONArray jArray = new JSONArray(result);                for(int i=0;i&lt;jArray.length();i++)                {                        JSONObject json_data = jArray.getJSONObject(i);                                                 positions.add(new Position(json_data.getString(""latitude""), json_data.getString(""longitude""), (Date)json_data.get(""timestamp"")));                 }</code></pre>","479886","","","","","2010-12-10 23:55:31","How can i parse from SQL datetime to JSON and finally to java.util.Date?","<sql><android><json><datetime>","2","1","1","",""
"4414272","1","4414306","","2010-12-10 23:46:29","0","3227","<p>i'm getting this exception when i try to parse a date that i get from a SQL database, the date is a datetime on the sql and i recive it as a String with JSON, and seeing the excepcion i think that the string i recived is like this:<code>2010-12-10 17:18:3600</code> </p><p>this is the exception i get:</p><pre><code>java.text.ParseException: Unparseable date: 2010-12-10 17:18:3600</code></pre><p>i use the next code to parse the date (i get it from google) but it gets the exception</p><p>How can i modify this code to get the parse working???? please guive me the answer with code, date parsing and using of simpledateformat it's very hard for me</p><pre><code> public void setPositiontime(String positiondate)      {             SimpleDateFormat FORMATTER = new SimpleDateFormat(""d MMM yyyy HH:mm"");            // pad the date if necessary            while (!positiondate.endsWith(""00"")){             positiondate += ""0"";            }            try {                this.positiondate = FORMATTER.parse(positiondate.trim());            } catch (ParseException e) {                throw new RuntimeException(e);            }</code></pre><p>i get the error on this line:  <code>this.positiondate = FORMATTER.parse(positiondate.trim());</code></p>","479886","","","","","2010-12-10 23:53:53","java.text.ParseException: Unparseable date: 2010-12-10 17:18:3600","<android><parsing><datetime>","1","2","","",""
"4414336","1","4414478","","2010-12-11 00:02:38","1","238","<p>Given a contact, or a contact ID, in android, how do I get the list of calls made to or from that contact?  Like the call log, but filtered to just one individual (with the possibility of multiple phone numbers, of course).</p>","82118","","","","","2010-12-11 00:34:01","Android: How do I find the list of calls made to a particular contact?","<android><contacts><phone>","1","0","","",""
"4414389","1","4417333","","2010-12-11 00:13:12","76","24356","<p>i have an array of strings in which the % symbol is used,proper format for using the ""%"" is &amp; # 3 7 ; . when i have a string in that array with multiple ""&#37;"" it gives me this error.</p><pre><code> Multiple annotations found at this line: - error: Multiple substitutions specified in non-positional format;did you mean to add the formatted=""false""    attribute? - error: Found tag &lt;/item&gt; where &lt;/string-array&gt; is expected</code></pre>","326423","","","","","2013-04-29 07:24:58","Android XML Percent Symbol","<android><xml>","7","2","24","",""
"4414413","1","4422908","","2010-12-11 00:19:28","1","1026","<p>I'm checking out the fingerpaint sample in Android SDK <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html</a></p><p>And it works fine but an issue I have is when I rotate the screen the drawable area gets cut off. Anyone know how I can fix this? Thanks a lot. </p>","427377","","","","","2012-07-12 06:51:53","Android fingerpaint sample question","<android>","1","2","","",""
"4414449","1","4414621","","2010-12-11 00:28:39","5","982","<p>I'm caching a user's authentication to whenever the Android Market Licensing ping server returns a GRANT_ACCESS pong.</p><p>Does anyone see any vulnerabilities with this strategy? I believe it is very strong, since I am obfuscating a key, and the only way to unobfuscate is to know the salt. Now, someone could conceivably open the apk and look for the salt, but this is not really the level of cracking I think is too important to worry about. </p><p>NEW: As you can see, device specific information is being added to the obfuscation technique. <pre><code>// Try to use more data here. ANDROID_ID is a single point of attack. String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID); obfuscator = new AESObfuscator(SALT, getPackageName(), deviceId); mChecker = new LicenseChecker(this, new ServerManagedPolicy(this, obfuscator), BASE64_PUBLIC_KEY ); </pre></code> Next the creation of the persisted data:</p><pre><code> public void allow() {   SharedPreferences settings = getSharedPreferences(PREFERENCES_EULA, 0);   SharedPreferences.Editor editor = settings.edit();   String uid = UUID.randomUUID().toString();   if(!settings.contains(ACCESS_KEY)) {     editor.putString(ACCESS_KEY,uid);            editor.commit();   }    if(!settings.contains(OBFU_ACCESS_KEY)) {     String obfu = obfuscator.obfuscate(uid);     editor.putString(OBFU_ACCESS_KEY,obfu);      editor.commit();   }</code></pre><p>Then, I used another method to check the state of the cached content:<code><pre>boolean isCachedLicense() {  SharedPreferences settings = getSharedPreferences(PREFERENCES_EULA, 0);  if(settings.contains(ACCESS_KEY) &amp;&amp; settings.contains(OBFU_ACCESS_KEY)) {    String accessKey = settings.getString(ACCESS_KEY, """");    String obAccessKey = settings.getString(OBFU_ACCESS_KEY, """");    try {      if(accessKey.equals(obfuscator.unobfuscate(obAccessKey))) {              return true;      } else {              return false;      }    } catch (ValidationException e) {       e.printStackTrace();       return false;    }  } else {       return false;  }} </pre></code></p><p>Finally, I check if isCachedLicense in the following locations of the LicenseCheckerCallback:@Override dontAllow, and @override applicationError. If isCachedLicense is true, then I let the user forward.</p><p>BTW, full source code is located at : <a href=""http://code.google.com/p/androidbest/"" rel=""nofollow"">http://code.google.com/p/androidbest/</a></p>","420259","","420259","","2010-12-11 17:20:22","2010-12-11 17:20:22","Vulnerabilities in caching of obfuscated key? Android Licensing","<android><security><hacking><exploit>","1","0","2","",""
"4414483","1","","","2010-12-11 00:35:13","1","2114","<p>I am quite new into Java and Android Apps, so , while this may be cake for others it gives me some headache .<br><br>The app should load , play a sound file , and close . And it works fine without the AdMob .<br><br>With the AdMob it starts , vibrates once ( it doesnt in the normal version ) , runs normally , and then gets stuck , vibrates 3 times , and closes throwing a "" Sorry! The application NAME ( process PROCESS.NAME ) has stopped unexpectedly . Please try again "" .</p><p>I`m on my second app , and my first AdMob integration.</p><p>The SDK instructions I followed : <a href=""http://www.admob.com/docs/AdMob_Android_SDK_Instructions.pdf"" rel=""nofollow"">http://www.admob.com/docs/AdMob_Android_SDK_Instructions.pdf</a></p><p>What I did :<br>- Registered<br>- Got the SDK <br>- Added the .jar<br>- Added the <strong>pub ID</strong> , <strong>AdMobActivity definition</strong> and <strong>Track Market Installs</strong> code from the SDK Instructions at the end of AndroidManifest.xml and edited the pub ID<br>- Added the internet permission<br>- Added ""ADMOB_ALLOW_LOCATION_FOR_ADS"" too<br>- Added ""AdMob AdView Attributes"" to attrs.xml ( I use Eclipse , so I first tried to add this to res/values/strings.xml , then made a new xml and added the code to it ) <br></p><p><br><br></p><p>If full code is needed I will edit this post. Any help is appreciated .<br>Thank you in advance<br>Chris<br><br><br>(LogCat throws two small errors without the AdMob files ( I //-ed the import and AdView ) )<br>(LogCat WITH AdMob throws this )<br></p><pre><code>12-11 14:50:00.266: ERROR/beep(284): started012-11 14:50:00.346: ERROR/AndroidRuntime(284): Uncaught handler: thread main exiting due to uncaught exception12-11 14:50:00.368: ERROR/AndroidRuntime(284): java.lang.RuntimeException: Unable to start activity ComponentInfo{seven.kitty.purr/seven.kitty.purr.KittyPurr}: java.lang.NullPointerException12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at android.os.Handler.dispatchMessage(Handler.java:99)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at android.os.Looper.loop(Looper.java:123)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at android.app.ActivityThread.main(ActivityThread.java:4363)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at java.lang.reflect.Method.invokeNative(Native Method)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at java.lang.reflect.Method.invoke(Method.java:521)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at dalvik.system.NativeStart.main(Native Method)12-11 14:50:00.368: ERROR/AndroidRuntime(284): Caused by: java.lang.NullPointerException12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at seven.kitty.purr.KittyPurr.onCreate(KittyPurr.java:20)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)12-11 14:50:00.368: ERROR/AndroidRuntime(284):     ... 11 more12-11 14:50:00.407: ERROR/dalvikvm(284): Unable to open stack trace file '/data/anr/traces.txt': Permission denied</code></pre><p><br><br>Editing with full .java and XML codes . I suck at Java, it's so diferent than AS , PHP , JavaScript and other web languages I usually use <br><br></p><p>KittyPurr.java</p><pre><code>package seven.kitty.purr;import android.app.Activity;import android.media.MediaPlayer;import android.media.MediaPlayer.OnCompletionListener;import android.os.Bundle;import android.util.Log;import android.widget.TextView;import com.admob.android.ads.AdManager;import com.admob.android.ads.AdView;public class KittyPurr extends Activity{  private MediaPlayer mMediaPlayer;  public void onCreate(Bundle icicle) {    super.onCreate(icicle);   playAudio();  }  private void playAudio () {    try {    mMediaPlayer = MediaPlayer.create(this, R.raw.purrr);    mMediaPlayer.setLooping(false);    Log.e(""beep"",""started0"");    mMediaPlayer.start();    AdView adView = (AdView)findViewById(R.id.ad);    adView.requestFreshAd();    mMediaPlayer.setOnCompletionListener(new OnCompletionListener() {            public void onCompletion(MediaPlayer arg0) {         finish();      }    });    } catch (Exception e) {    Log.e(""beep"", ""error: "" + e.getMessage(), e);    }  }  @Override  protected void onDestroy() {    super.onDestroy();    if (mMediaPlayer != null) {    mMediaPlayer.release();    mMediaPlayer = null;    }  }}</code></pre><p><br><br>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""    xmlns:myapp=""http://schemas.android.com/apk/res/seven.kitty.purr""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;com.admob.android.ads.AdViewandroid:id=""@+id/ad""android:layout_width=""fill_parent""android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre><p><br><br>attrs.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;declare-styleable name=""com.admob.android.ads.AdView""&gt;&lt;attr name=""backgroundColor"" format=""color"" /&gt;&lt;attr name=""primaryTextColor"" format=""color"" /&gt;&lt;attr name=""secondaryTextColor"" format=""color"" /&gt;&lt;attr name=""keywords"" format=""string"" /&gt;&lt;attr name=""refreshInterval"" format=""integer"" /&gt;&lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre>","534591","","534591","","2010-12-11 13:20:43","2013-01-25 07:06:38","Problems with AdMob integration into Android App","<android><sdk><admob><instructions>","2","1","","",""
"4414486","1","4550906","","2010-12-11 00:35:58","0","244","<p>I have a simple Gesture Detector that is passed all MotionEvents in my Views onTouchEvent() method, per this tutorial:</p><p><a href=""http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html"" rel=""nofollow"">http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html</a></p><p>A sample of my code, which draws a circle around the finger when it touches the screen:</p><pre><code>@Overridepublic boolean onTouchEvent(MotionEvent ev) {    // send the touch event to the gesture detector    if (mBuildupDetector.onTouchEvent(ev)) {        Log.d(LOG_TAG, ""onTouchEvent(): Gesture consumed."");    } else {        Log.d(LOG_TAG, ""onTouchEvent(): Gesture not consumed."");    }    switch (curAction) {        case MotionEvent.ACTION_DOWN: {                  drawCircle();            }    }}</code></pre><p>And then a private sub-class for the gesture detector:</p><pre><code>private class BuildupListener extends GestureDetector.SimpleOnGestureListener {    @Override    public boolean onDown(MotionEvent ev) {        Log.d(""BuildupListener"", ""onDown(): Triggered."");        return true;    }}</code></pre><p>So, when the user touches the screen, generating a motion event, I am getting a confimation that the gesture was indeed 'consumed', and I can change the diameter of the circle in the onDown method of the GestureDectector.  However, no logging is written out from onDown, even though it appears to be called and executed.</p><p>Am I missing something basic about logging and how logging can happen from inside private sub-classes, or gesture detectors?</p><p>Thanks,</p><p>Paul</p>","357801","","","","","2010-12-29 01:46:15","Android Debug Logging in Private Sub-Class/Gesture Detector","<android><logging><multi-touch><gesturedetector>","1","0","1","",""
"4414597","1","","","2010-12-11 01:03:52","0","54","<p>i want to call <code>makePayment();</code> I want to automatically run ......This is my code</p><pre><code>package com.musicdownloader;import com.fortumo.android.PaymentActivity;import com.musicdownloader.R;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;import android.view.View.OnClickListener;public class app extends PaymentActivity {       public void onCreate(Bundle savedInstanceState) {           makePayment();               super.onCreate(savedInstanceState);               setContentView(R.layout.main);               Button payButton = (Button) findViewById(R.id.Next);               payButton.setOnClickListener(new OnClickListener() {                   public void onClick(View v) {                           final EditText q = (EditText) findViewById(R.id.q);                            Intent i = new Intent(""android.intent.action.VIEW"", Uri.parse(""http://www.google.com/search?q="" +q.getText().toString()));                            startActivity(i);                       }               });       }       @Override       protected void onPaymentCanceled(String product) {               Toast.makeText(this, ""Payment canceled by user"", Toast.LENGTH_SHORT).show();       }       @Override       protected void onPaymentFailed(String product) {               Toast.makeText(this, ""Payment failed"", Toast.LENGTH_SHORT).show();       }       @Override       protected void onPaymentPending(long messageId, String product) {               Toast.makeText(this, ""Payment not confirmed"", Toast.LENGTH_SHORT).show();       }       @Override       protected void onPaymentSuccess(String product) {               Toast.makeText(this, ""Payment received"", Toast.LENGTH_SHORT).show();       }</code></pre><p>How to call it??Thank you</p>","514611","","750613","","2012-07-12 06:50:14","2012-07-12 06:50:14","Android call makePayment how","<java><android><payment>","1","2","","",""
"4414608","1","4415219","","2010-12-11 01:06:22","1","1137","<p>I'v been tinkering with Live Wallpapers today and wouldn't you know it, I just can't get it to work.</p><p>I decided to come up with the most simple live wallpaper possible and build from there but even that is going wrong! This is what my WallpaperService class consists of,</p><pre><code>    @Override    public Engine onCreateEngine() { return new SimpleEngine();    }    public class SimpleEngine extends Engine {        @Override        public void onSurfaceCreated(SurfaceHolder holder) {            super.onSurfaceCreated(holder);            Canvas c = holder.lockCanvas();            Paint paint = new Paint();            paint.setColor(Color.BLUE);            c.drawCircle(50, 50, 50, paint);        }    }</code></pre><p>All I wanted to test was if I could make a little circle appear on the screen, but when I go to set it as my wallpaper it just says ""Loading live wallpaper..."" and doesn't budge (but it doesn't freeze either). The code is getting called but I'm not sure whats going wrong.</p><p>Could someone point it out for me?</p>","451575","","19750","","2011-03-31 15:37:08","2011-03-31 15:37:08","Android Live Wallpaper Question","<java><android><live-wallpaper>","1","0","1","",""
"4414673","1","4415113","","2010-12-11 01:23:48","7","2738","<p>I would like to calculate the color depending on a percentage value:</p><pre><code>float percentage = x/total;int color;if (percentage &gt;= 0.95) {  color = Color.GREEN;} else if (percentage &lt;= 0.5) {  color = Color.RED;} else {  // color = getColor(Color.Green, Color.RED, percentage);}</code></pre><p>How can I calculate that last thing? It would be OK if yellow appears at 50%.</p><p>I tried this:</p><pre><code>private int getColor(int c0, int c1, float p) {    int a = ave(Color.alpha(c0), Color.alpha(c1), p);    int r = ave(Color.red(c0), Color.red(c1), p);    int g = ave(Color.green(c0), Color.green(c1), p);    int b = ave(Color.blue(c0), Color.blue(c1), p);    return Color.argb(a, r, g, b);}private int ave(int src, int dst, float p) {    return src + java.lang.Math.round(p * (dst - src));}</code></pre><p>Well this works, but I would like the colors at around 50% being more lightend as I use them on a grey background.. how can I accomplish that?</p><p>Thanks!</p><p><strong>UPDATE</strong>I tried to convert to YUV like it was suggested in the comments. But I still have the same problem that at 50% it's to dark.Additional in this solution I have at &lt;5% now white as color. If I do not calculate <code>float y = ave(...);</code>, but just take <code>float y = c0.y</code> it's a little better, but at &lt;20% I have then cyan color ... I'm not so much into color-formats :-/Maybe I'm doing something wrong in the calculation? The constants are taken from Wikipedia</p><pre><code>public class ColorUtils {    private static class Yuv {        public float y;        public float u;        public float v;        public Yuv(int c) {            int r = Color.red(c);            int g = Color.green(c);            int b = Color.blue(c);            this.y = 0.299f * r + 0.587f * g + 0.114f * b;            this.u = (b - y) * 0.493f;            this.v = (r - y) * 0.877f;        }    }    public static int getColor(int color0, int color1, float p) {        Yuv c0 = new Yuv(color0);        Yuv c1 = new Yuv(color1);        float y = ave(c0.y, c1.y, p);        float u = ave(c0.u, c1.u, p);        float v = ave(c0.v, c1.v, p);        int b = (int) (y + u / 0.493f);        int r = (int) (y + v / 0.877f);        int g = (int) (1.7f * y - 0.509f * r - 0.194f * b);        return Color.rgb(r, g, b);    }    private static float ave(float src, float dst, float p) {        return src + Math.round(p * (dst - src));    }}</code></pre>","386201","","386201","","2010-12-11 03:29:12","2013-04-23 16:04:18","android color between two colors, based on percentage?","<java><android><colors>","5","2","7","",""
"4414722","1","4414846","","2010-12-11 01:39:47","0","254","<p>I always used the standard emulator when testing and thought it was about time to see what it looked like in a higher res/density setting. I ran my application using WVGA854 which has a density of 240 (rather than the 160 I usually used). The result is my application sitting as its old size in the center of the screen. I don't specifically hardcode the application size anywhere that would produce this (except for background images, but there are other things like x,y positions that are still limited by the old size). What gives? I move over the high res images into the correct folders but it still appears to be forcing my app to a smaller size? The background below is set to 854 width in the HDPI (and MDPI folder) but it is still cutting it off? Using a surfaceView to draw the bitmaps.</p><p><img src=""http://i.stack.imgur.com/Z3Xqj.png"" alt=""alt text""></p>","437414","","","","","2010-12-11 02:18:13","Android large-sized emulator produces regular size application in center of screen","<android><graphics><emulator><resolution>","1","0","","",""
"4414737","1","","","2010-12-11 01:45:25","0","627","<p>I am using the following splash screen code with an onTouchEvent method.  I am getting ANR's and do not know what to do. The app works perfectly, except occasionally it locks up with a Sorry, Activity xxx is not responding.  Any ideas?</p><pre><code>   _splashTime = 5000 ; // approx 5 seconds   public boolean onTouchEvent(MotionEvent event) {    if (event.getAction() == MotionEvent.ACTION_DOWN) {        _active = false;    }    return true;   }  Thread splashTread = new Thread() {  @Override  public void run() {    try {        int waited = 0;        while(_active &amp;&amp; (waited &lt; _splashTime ))         {            sleep( _waitsecs );            if  ( _active ) {                waited += _waitsecs ;            }        }    }     catch(InterruptedException e) {        // do nothing with catch    }     finally {        start_program();        finish();    }} };splashTread.start();</code></pre>","411203","","","","","2010-12-11 04:29:48","Android Splash Screen causing ANR","<android><multithreading>","2","1","","",""
"4414758","1","","","2010-12-11 01:50:41","0","396","<p>How do I make application context available to all classes in application in the app?My supporting classes need to be able to access it in order to access resourses.</p>","537215","","","","","2010-12-11 02:22:39","Android: How do I make application context available to all classes in application in the app?","<android><resources><context>","1","0","1","",""
"4414813","1","","","2010-12-11 02:09:19","1","377","<p>I am playing with an ap that has 2 webviews set up within a <code>tabhost/tabwidget</code> layout, my problem is that i don't know how to make them navigate back through page history, at least for both of them. I ca do it for the first webview (<code>webview1</code>) but i don't know how to do it for the second one in my second tab.  </p>","538573","","750613","","2012-07-12 06:47:39","2012-07-12 06:47:39","Back button with multiple (2) webviews","<android><button><webview><back>","0","1","","",""
"4414819","1","4414889","","2010-12-11 02:11:34","9","6583","<p>I've been learning Android for about two weeks now (expert in as2/3).</p><p>I have created a simple <code>LinearLayout1, which contains an</code>ImageView`, containing a png of a vinyl record (just a circular disc basically)</p><p>I have set up this <code>ImageView</code> to be rotated when the user drags a finger on it, like scratching a record.</p><p>My code seems to be working (not sure if its the best way but it works).  The problem is when the <code>ImageView</code> is rotated it pushes other views around. I have determined this is because my round image is really a square with transparent corners.  It is these corners that are pushing other views around, and causing the record to push away from the left side of the screen if I have the <code>ImageView</code> left justified.</p><p>There are a few attempts to solve this online, but none of them seem to be quite what I need and some are wrapped in examples so robust I can't discern what to take from it at my beginning level.</p><p>If anyone could shed some light on what I can do so solve this that would be great.  I realize a simple answer may not exist, but keep in mind I am a Java noob and keep it as simple as you can!  Many thanks in advance for any help!</p><p>also if anyone can tell me why I need to subtract 50 from the rotation to make the record move under the exact spot the user touches, that would be helpful as well!  see this in the method updateRotation().</p><p>Here is my xml markup:</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/baseView""    android:background=""#FFFFFFFF""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ImageView        android:id=""@+id/turntable""        android:src=""@drawable/turntable""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_weight=""1""/&gt;&lt;/LinearLayout&gt;</code></pre><p>and here is my java code:</p><pre><code>package com.codingfiend.android.turntable;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Matrix;import android.os.Bundle;import android.view.MotionEvent;import android.view.View;import android.view.Window;import android.widget.ImageView;import android.widget.TextView;public class Turntable extends Activity{    View baseView;    ImageView turntable;    TextView bottomText;    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.main);        baseView = (View)findViewById(R.id.baseView);        turntable = (ImageView)findViewById(R.id.turntable);        turntable.setOnTouchListener(onTableTouched);    }    public android.view.View.OnTouchListener onTableTouched = new android.view.View.OnTouchListener()    {        public boolean onTouch(View v, MotionEvent evt)        {            double r = Math.atan2(evt.getX() - turntable.getWidth() / 2, turntable.getHeight() / 2 - evt.getY());            int rotation = (int) Math.toDegrees(r);            if (evt.getAction() == MotionEvent.ACTION_DOWN)            {                //            }            if (evt.getAction() == MotionEvent.ACTION_MOVE)            {                updateRotation(rotation);            }            if (evt.getAction() == MotionEvent.ACTION_UP)            {                //            }            return true;        }    };    private void updateRotation(double rot)    {        float newRot = new Float(rot);        Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.turntable);        Matrix matrix = new Matrix();        matrix.postRotate(newRot - 50);        Bitmap redrawnBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);        turntable.setImageBitmap(redrawnBitmap);    }}</code></pre><p><strong>EDIT</strong></p><p>This is turning out to be an irritating problem.  There has got to be a way to rotate an image that is as big or bigger than the screen without it getting scaled so the whole image stays on screen.  Why can't part of the rotating image go off screen?  Very frustrating.  I tried wrapping the <strong>ImageView</strong> into a <strong>FrameView</strong>, which partially helped.  Now I can add other views that won't be affected, but I still can't have my disc big enough because it isn't allowed to pass the screen borders when it rotates.   I don't get  why.  I haven't checked out extending <strong>ImageView</strong> yet.  Any other thoughts would still be appreciated!</p>","538576","","592025","","2012-07-19 10:02:34","2012-12-12 10:12:41","Android - Rotating an ImageView with finger moves other views around","<android><imageview><rotation>","2","1","8","",""
"4414839","1","4416821","","2010-12-11 02:16:32","7","5421","<p>I try to load a remote image from a server and thanks to a lot of code examples on stackoverflow I have a solution which works in 2 out of 3 images. I don't really know what the problem is with the third picture and sometimes when letting the code run in the debugger the picture is loading. Also if I load the problem picture first the other two pictures are sometimes not loaded.</p><p>Here is the code:</p><pre><code>public static Drawable getPictureFromURL(Context ctx, String url, final int REQUIRED_SIZE) throws NullPointerException {    //Decode image size    BitmapFactory.Options o = new BitmapFactory.Options();    int scale = 1;    if (o.outWidth &gt; REQUIRED_SIZE) {        scale = (int) Math.pow(2, (int) Math.round(Math.log(REQUIRED_SIZE / (double) Math.max(o.outHeight, o.outWidth)) / Math.log(0.5)));    }    Log.i(Prototype.TAG, ""scale: ""+scale);     //Decode with inSampleSize    BitmapFactory.Options o2 = new BitmapFactory.Options();    o2.inSampleSize = scale;    Bitmap bmp;    try {        bmp = BitmapFactory.decodeStream((InputStream) Tools.fetch(url), null, o2);        if(bmp!=null)            return new BitmapDrawable(ctx.getResources(), bmp);        else            return null;    } catch (Exception e) {        Log.e(Prototype.TAG, ""Exception while decoding stream"", e);        return null;    }}</code></pre><p>During debugging I found out that o.outWidth is -1 which indicates an error, but no Exception is thrown, so I can't really tell what went wrong. The InputStream always returned a valid value, and I know that the picture exists on the server.</p><p>Best wishes,Daniel</p>","538581","","538581","","2010-12-14 03:23:33","2010-12-14 03:23:33","BitmapFactory.decodeStream returns null without exception","<android><bitmapfactory>","1","0","4","",""
"4414867","1","4414888","","2010-12-11 02:25:24","2","160","<p>Ok I have a question for the mobile developers out there. </p><p>Is there any other way to distribute and have people download your apps with out going through the manufacturers website store ( <code>iPhone , windows 7 phone store , android store etc</code> ) .</p><p>I don't feel like paying <code>Microsoft $100</code> a year to distribute apps I plan on giving out for free</p>","534538","","750613","","2012-07-12 06:47:13","2012-07-12 06:47:13","Mobile Development Distribution","<iphone><android><blackberry><windows-mobile><mobile>","4","3","","2010-12-11 11:34:50",""
"4414896","1","","","2010-12-11 02:37:47","0","60","<p>You mentioned deploying an app with the basic app first via the market and then sending the database.</p><p>Recently, my copydatabase method starting crashing when trying to load a 80,000 row database.  But when I push the database to the emulator, it works fine.  However, I can't push it to the phone directory since it's ""protected"".</p><p>I would like to know if you have more information about this, that is, pushing the app via the market and then a separate install for the database.</p><p>Thank you!! </p>","538591","","47550","","2010-12-11 02:46:46","2010-12-11 02:46:46","Bigger databases","<android>","0","2","","",""
"4414915","1","4414931","","2010-12-11 02:45:09","0","1172","<p>Something seems to have happened to my development environment.  All of the drop downs in the manifest editor have changed to ""Browse"" buttons that open up a ""Resouce Chooser"" window.  </p><p>For example:</p><p>If I open the manifest editor and switch to the Permissions tab, when I add a ""Uses Permission"" the right panel displays a Browse button next to the Name field rather than a drop down that lists all of the available permissions.</p><p>Can anyone tell me what happened or how to switch it back? </p>","494249","","","","","2010-12-11 02:51:46","Android Manifest Editor (Eclipse)","<android><eclipse>","1","0","","",""
"4414929","1","","","2010-12-11 02:51:38","0","1556","<p>Here is my layout XML. I am adding more rows in a table dynamically. </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""            xmlns:myapp=""http://schemas.android.com/apk/res/com.tweets""            android:id=""@+id/screen""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:orientation=""vertical""            android:background=""#FFFFFF""&gt;    &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:id=""@+id/main""                 android:background=""#FFFFFF""&gt;        &lt;TableRow android:id=""@+id/TableRow01""                  android:layout_width=""wrap_content""                  android:layout_height=""wrap_content""&gt;            &lt;TextView android:id=""@+id/TLocView01""                      android:layout_width=""wrap_content""                      android:layout_height=""wrap_content""                      android:textSize=""15px""                      android:textStyle=""bold""                      android:textColor=""#000000""                      android:text=""FatWallet Tweets:""&gt;            &lt;/TextView&gt;        &lt;/TableRow&gt;   &lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre><p>I want to implement paging with scrollview. If user tries to scroll backward or forward then i want to make previous page and next page requests.  How to do that? Any hint will be appreciated. Thanks. </p>","352263","","264541","","2012-05-01 14:33:14","2012-05-01 14:33:14","Android Scrollview : How to detect begin and end of scrollview","<android><scrollview><paging>","1","0","1","",""
"4415096","1","4415220","","2010-12-11 03:50:39","2","268","<p>I have a adView in my application UI i don't want to display it when there is  no ads to display.</p><p>How can i know whether my application have ads to display?</p><p>this is my layout </p><pre><code>&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:myapp=""http://schemas.android.com/apk/res/measurements.areaconvertor""    android:id=""@+id/root_layout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;        &lt;com.admob.android.ads.AdView            android:id=""@+id/ad""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            myapp:backgroundColor=""#000000""            myapp:primaryTextColor=""#FFFFFF""            myapp:secondaryTextColor=""#CCCCCC""/&gt;&lt;FrameLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;    &lt;ImageView                .................</code></pre>","482604","","114066","","2010-12-11 09:07:54","2012-04-21 12:48:48","How can i know whether I have adds to show, which I get from admob server?","<android><admob>","2","0","0","",""
"4415187","1","","","2010-12-11 04:22:32","7","5443","<p>I need to draw the pie chart manually. How to do this with the help of Canvas or other ways?</p>","538642","","229044","","2010-12-11 05:45:16","2012-02-01 06:36:21","How to draw Pie chart manually in Android?","<android>","1","0","","",""
"4415206","1","","","2010-12-11 04:29:40","1","1040","<p>i have a initial layout loaded properly. </p><p>now that i want to add contents to the widget. they are retrieved from a webservice.</p><p>hence i am using table layout which i created in updateService method inside appwidget provider.</p><p>how to add this table layout into the widget? remoteview did not help :(</p>","238798","","","","","2013-08-27 06:41:04","Android: How to add a dynamic table layout to the widget?","<android><android-widget>","2","2","","",""
"4415224","1","4415250","","2010-12-11 04:38:19","0","627","<p>Am I able to use titanium to build a mobile web app so that it can run on something like m.website.com and also have mobile versions of the app so it runs on android etc.</p><p>Thanks,Faisal</p>","117691","","","","","2014-04-02 09:42:18","Can I use titanium to build a web app and mobile apps?","<android><titanium>","3","0","","",""
"4415241","1","4415324","","2010-12-11 04:43:06","4","7355","<p>I'm trying to go to the settings screen found at -</p><pre><code>android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS</code></pre><p>From an entry in my preferences activity but am having no luck. At the moment, pressing the entry just refreshes the same screen as I was on.</p><p>My preferences.xml looks like this:</p><pre><code>&lt;Preference         android:title=""@string/my_location_settings""&gt;    &lt;intent android:action=""android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS""&gt;    &lt;/intent&gt; &lt;/Preference&gt;</code></pre><p>And my manifest entry looks like this:</p><pre><code>&lt;activity android:name="".Preferences""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>What am I doing wrong?</p><p>logcat:</p><pre><code>12-11 15:53:34.170: INFO/ActivityManager(173): Starting activity: Intent { act=android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS cmp=com.my.app/.Preferences }12-11 15:53:34.400: INFO/ActivityManager(173): Displayed activity com.my.app/.Preferences: 229 ms (total 229 ms)</code></pre><p>Manifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>    </p><pre><code>    &lt;activity android:name="".ViewActivity"" 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="".MyPageOneActivity""&gt;    &lt;/activity&gt;    &lt;activity android:name="".MyPageTwoActivity""&gt;    &lt;/activity&gt;    &lt;activity android:name="".MyPageThreeActivity""&gt;    &lt;/activity&gt;    &lt;activity android:name="".Preferences""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.my.app.PREFERENCES"" /&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=""4"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.STORAGE"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt;</code></pre><p>Preferences.java (sorry about the lack of formatting):</p><pre><code>  package com.my.app;import android.os.Bundle;import android.preference.PreferenceActivity;public class Preferences extends PreferenceActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.preferences);    }}</code></pre><p>and preferences.xml:</p><pre><code>&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;EditTextPreference     android:title=""Address 1""    android:key=""customURLOne""     android:summary=""Enter a new address for 1""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference     android:title=""Address 2""    android:key=""customURLTwo""     android:summary=""Enter a new address for 2""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference     android:title=""Address 3""    android:key=""customURLThree""     android:summary=""Enter a new address for 3""&gt;&lt;/EditTextPreference&gt; &lt;Preference android:title=""@string/my_location_settings""&gt;    &lt;intent android:action=""android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS""&gt;    &lt;/intent&gt; &lt;/Preference&gt;</code></pre><p></p>","496625","","128421","","2012-08-29 04:51:44","2013-06-05 15:05:36","starting an activity from preferences.xml","<android><activity><manifest><preferences>","1","7","2","",""
"4415281","1","4415982","","2010-12-11 04:55:33","4","4787","<p>iam running a project that part of it requires to read a fingerprint. The platform we use is an Android phone (2.2). </p><p>Is there a fingerprint reader availble for this platform? (micro USB, power supply issues, drivers etc.) </p>","538626","","21234","","2011-05-15 13:18:15","2011-05-15 13:18:15","device for fingerprint scanner in android?","<android><identity><fingerprint><biometrics><image-scanner>","2","0","5","",""
"4415321","1","","","2010-12-11 05:11:11","1","367","<p>I'm brand spanking new to Android. I'm trying to develop an app that mutes the phone depending on the location. I think I got a rudimentary GPS working, but that is not my problem</p><p>I'm initiating a voice call to the device (using DDMS in Eclipse), and though it shows that it is ringing, I do not hear any ringtone.</p><p>The settings in the emulated device for ringtones only has a ringtone called 'Silent'?? What's wrong?</p><p>I just want the phone to ring when it gets a call, but even Google does not seem to have the answer to this simple question.</p><p>Please help. Very very confused :-(</p><p>(I'm using Eclipse Helios, Android 2.2 and Win7 x64, if that is of any relevance)</p>","538666","","","","","2010-12-11 12:38:01","Enabling ringtones in Android","<android><eclipse><android-emulator>","1","0","","",""
"4415326","1","4429929","","2010-12-11 05:13:15","0","772","<p>I am  starting the Timertask in Oncreate of an Activity. The timer task listens to the mic input and determines the the sound frequency. whenever the frequency is above certain range, i need to display the Dialogbox with the message. The following code looks good to me, but the DIalog box does not popup. Any suggestion would be appreciated</p><pre><code>    Context mContext = getApplicationContext();    System.err.println(""Inside Dialog"");    Dialog dialog = new Dialog(mContext);    dialog.setContentView(R.layout.entryofferdialog);    dialog.setTitle(""This is my custom dialog box"");    dialog.setCancelable(true);    // set up text    TextView text = (TextView) dialog.findViewById(R.id.TextView01);    text.setText("":LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL"");    // set up button    Button button = (Button) dialog.findViewById(R.id.Button01);    button.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            finish();        }    });    // now that the dialog is set up, it's time to show it    dialog.show();}</code></pre>","516712","","","","","2011-11-10 05:14:40","Dialog box in Timer task","<android>","2","2","","",""
"4415357","1","4425909","","2010-12-11 05:28:44","2","780","<p>I know I can extend an Android view and have seen the Notepad example of doing this.  I was wondering if it is possible in addition to add new custom attributes for the view that would parse properly in the XML declarations of the custom view.  I'm a bit of a novice at XML technology.</p><p>I read <a href=""http://developer.android.com/guide/topics/ui/custom-components.html"" rel=""nofollow"">here</a> that I can somehow add custom attributes in the custom view's constructor, but there is no detail given and no example shown.</p><p>Ideally I would also like to be able to extend the ADT visual layout previewer/editor to support the custom views (rendering them with my custom code and having the custom properties show up in the context menu, etc.)</p><p>I would love to be able to do this but am not sure it's feasible or even possible.  I read that XML schema may or may not be extensible:  <a href=""http://stackoverflow.com/questions/1585959/extend-an-xml-schema"">""extend"" an xml schema</a></p><p>If this scenario isn't directly supported, does someone know where to find the Android schema so I might be able to modify it directly?</p>","403455","","403455","","2010-12-11 05:51:19","2011-12-06 19:35:39","Android: Is it Possible to Add Custom Attributes to Extended Views?","<android><xml><schema><adt>","2","0","","",""
"4415440","1","4417952","","2010-12-11 05:57:51","0","786","<p>I'm just starting to go through tutorials for writing Android apps.  My first app is hopefully going to be very simple, but I am having a little trouble with the next step.  I have my main GUI working, which is a simple <code>LinearLayout</code> with several Buttons arranged vertically.  When I click on the Connect button, I want a PopupWindow to appear, with the following information:</p><pre><code>TextView: ""Enter IP Address""EditText: &lt;ip address should get entered here&gt;Button:   ""OK"" --&gt; connects to a PC listening for requests</code></pre><p>The problem is, when the PopupWindow is created, I can barely make out any of the text in the TextView, but it's definitely there.  More strangely, I can't see the EditText or the Button.  It's almost as if the PopupWindow is fading into view, but gets frozen partway.</p><p>I used the code from <a href=""http://stackoverflow.com/questions/1967863/is-there-a-simple-example-of-the-popupwindow-class-using-android-v2-0"">this answer on SO</a> for getting the PopupWindow to (kind of) work.</p><p>Once the PopupWindow (kind of) displays, my app is frozen because it's obscuring the main GUI at that point.</p><p>I have also added calls to showAsDropDown() and dismiss(), and when I do this the PopupWindow definitely disappears because I regain responsiveness in my main GUI.</p><p>Can anyone explain what's going on here?</p><p>Here's what I am talking about regarding the barely-visible TextView:</p><p><img src=""http://i.stack.imgur.com/GRiNp.png"" alt=""alt text""></p>","214071","","995926","","2012-05-22 08:05:10","2012-05-22 08:05:10","Having trouble with PopupWindow","<android><popupwindow><android-2.2-froyo>","1","2","","",""
"4415462","1","","","2010-12-11 06:04:55","2","2816","<p>Why jquery mobile framework is slow performance in android2.2 OS</p>","498011","","","","","2011-09-15 15:30:40","Jquery mobile framework in android OS","<jquery><android><mobile>","3","2","","",""
"4415478","1","4704607","","2010-12-11 06:11:48","0","1641","<p>I am trying to ask the user for confirmation twice before I do something irreversible to the database. The problem is that the outer click handler does not wait for the inner click handler. Once the Yes button is clicked on the first dialog, the 2nd dialog is displayed briefly, but the outer handler executes and completes nonetheless, ultimately destroying both dialogs.</p><pre><code>new AlertDialog.Builder(ActivityMain.this).setMessage(  ""Are you sure?"").setPositiveButton(""Yes"",    new DialogInterface.OnClickListener() {      public void onClick(DialogInterface arg0, int arg1) {    new AlertDialog.Builder(ActivityMain.this).setMessage(      ""Are you really sure?"").setPositiveButton(""Yes"",    new DialogInterface.OnClickListener() {      public void onClick(DialogInterface arg0, int arg1) {    ....</code></pre><p>Why is that?</p>","58880","","","","","2012-12-09 13:59:10","Android nested AlertDialog - is this possible?","<android><nested><alertdialog>","2","0","","",""
"4415499","1","","","2010-12-11 06:19:35","0","52","<p>In the beginning stages of Java/Android programming, I am trying to learn the different views and so forth. I have a starter project with a button and a textView in a scrollView. When you click the button, I have it go fetch some HTML and I start to parse out what I want from the HTML. The function that I am passing my HTML to is going through some of the function. As far as I can tell the application isn't crashing it just isn't doing what I thought it would do. Any help would be greatly appreciated. </p><p>Here is the code of the function:</p><pre><code>public void getLeagues(String d){    TextView tv = (TextView)findViewById(R.id.tvData);    String[]tmpArray;    String[]tmpArray2;    String temp;    String[]games = new String[5];    String[][]teams = new String[5][2];    //String temp2;    tmpArray = d.split(""following live games:"");    // tmpArray should be holding 2 strings    // tmpArray should have the data that were looking for    temp = tmpArray[1];    tmpArray = temp.split(""Game"");    // tmpArray should have a couple of strings    // tmpArray is currently holding some junk in the 0 spot    for(int i=1; i &lt; tmpArray.length; i++) {        tmpArray2 = tmpArray[i].split(""&lt;/u&gt;"");        temp = tmpArray2[0];        tmpArray2 = temp.split(""&lt;u&gt;"");        temp = tmpArray2[1];        // Lets add this game        games[i-1] = temp;        tv.append(temp + ""\n"");        // Lets get the teams for this game        tmpArray2 = tmpArray[i].split(""mygamepageredtext\""&gt;"");        if (tmpArray2.length &gt; 1){              for(int x=1; x &lt; tmpArray2.length; x++ ){                temp = tmpArray2[x];                tmpArray2 = temp.split(""&lt;/a&gt;"");                if(tmpArray2.length &gt; 1){                    temp = tmpArray2[0];                    teams[i-1][x-1] = temp;                    tv.append(temp + ""\n"");                 }            }        } else {            teams[i-1][0] = ""No Teams Found!"";            tv.append(""No Teams Found!\n"");        }    }    tv.append(""In Get Leagues"");    for(int i=0; i &lt; games.length; i++){        tv.append(games[i]);        for(int x=0; x &lt; teams[i].length; x++){            tv.append(teams[i][x]);        }    }}</code></pre>","538689","","","","","2010-12-11 06:19:35","Function doesn't seem to finish however app doesn't appear to crash","<java><android><android-emulator>","0","5","1","",""
"4415528","1","4420394","","2010-12-11 06:29:40","6","12508","<p>I have a TextView in a layout whos background is a Selector. And the TextView's text is set to Spanned from HTML.Then I set the TextView with the LinkMovementMethod.</p><p>Now when I tap on the TextView, the click event is not sent to its parent layout to trigger the selector.</p><p>How should this be solved?Thanks!</p>","428022","","","","","2013-09-23 12:56:47","How to pass the onClick event to its parent on Android?","<android><events><onclick><textview>","2","0","5","",""
"4415656","1","4416174","","2010-12-11 07:06:12","0","127","<p>In my search module I am using SQLite database. Sometimes I'm searching more than two values. So I am using <code>AND</code> condition and sometimes searching only one value. These two cases I need to implement in a single query. Please help me.</p><p>This is the query:</p><pre><code>Cursor dbcur = myDB.rawQuery(""select * from ""+dbtable+"" where Status='""+item+""'AND ball_court='""+ball+""'AND Tovendor='""+vendor+""'"", null);</code></pre><p>Sometimes I am searching <code>status</code> and <code>ball_court</code>, <code>tovendor</code> and sometimes I am searching <code>status</code> only. How to solve this problem?</p>","533787","","1128737","","2012-01-14 11:38:39","2012-01-14 11:38:39","How to solve all in one query?","<android>","2","1","","",""
"4415935","1","","","2010-12-11 08:42:20","2","880","<p>I have problem with cursor adapter, i have custom adapter in which there is image,text,check box, all works fine but as an when i scroll list with 30 item some images disarrange and text show fine. </p><p>what is the problem, i have to fix any property or change implementation all time my image come from cursor which fetch from databases.</p><p>code is :</p><pre><code>@Override        public View getView(int position, View convertView, ViewGroup parent) {            return super.getView(position, convertView, parent);        }        @Override        public void bindView(View view, Context context, final Cursor cursor) {            Image = (ImageView) view.findViewById(R.id.CoverArtImage);            byte[] theByteArray = cursor.getBlob(4);            if (theByteArray != null) {                Bitmap bitmap = BitmapFactory.decodeByteArray(theByteArray, 0,                        theByteArray.length);                Image.setImageBitmap(bitmap);                bitmap = null;                theByteArray = null;            }            tText = (TextView) view.findViewById(R.id.TrackTextView);            tText.setText(cursor.getString(2));            aText = (TextView) view.findViewById(R.id.ArtistTextView);            aText.setText(cursor.getString(3));            aText = (TextView) view.findViewById(R.id.AlbumTextView);            aText.setText(cursor.getString(1));            dateText = (TextView) view.findViewById(R.id.DateTimeTextView);            dateText.setText(cursor.getString(5));            deletecheckBox.setTag(cursor.getString(0));            deletecheckBox.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                    CheckBox chk = (CheckBox) v;                    if (chk.isChecked()) {                        deleteId.add(chk.getTag().toString());                        // System.out.println(""Chaked......"" + chk.getTag());                    } else {                        deleteId.remove(chk.getTag().toString());                        // System.out.println(""UnChaked......"" + chk.getTag());                    }                }            });        }        @Override        public View newView(Context context, final Cursor cursor,                ViewGroup parent) {            final View view = mInflater.inflate(R.layout.histrory_row, parent,                    false);            view.setOnClickListener(HistoryDetails.this);            view.setTag(cursor.getString(0));            deletecheckBox = (CheckBox) view.findViewById(R.id.DeleteCheckbox);            bindView(view, context, cursor);            return view;        }</code></pre><p>Thanks</p>","412907","","412907","","2010-12-11 14:12:20","2010-12-11 14:12:20","Cursor adapter in android Fill wrong image when scroll the list","<android><listview><cursor><adapter>","0","2","1","",""
"4415949","1","4416352","","2010-12-11 08:49:28","0","1942","<p>I am creating a Login Application in Android, I've done pushing the database into the emulator. When I add database using the application I made, the emulator stops working and stop responding. What should I do?</p><pre><code>package com.android.sms.privacy;import java.util.Arrays;import java.util.Locale;import com.android.sms.privacy.DatabaseHelper;import android.app.Activity;import android.widget.EditText;import android.app.ProgressDialog;import android.os.Bundle;import android.widget.Button;import android.view.View;import android.content.ContentValues;import android.content.Intent;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.util.Log;import android.widget.Toast;public class SMS extends Activity {//public static final String DEBUG_TAG = ""FullDatabase Log"";    public static final int DB_version = 2;    //public static final String DB_name = ""User.db"";    public static final String TABLE_NAME = ""login"";    //public static final String TABLE_NAME = ""tbl_temp"";    //public static final String DB_name = ""User_temp"";    public static final String DBNAME = ""login"";    public DatabaseHelper database_helper;    public SQLiteDatabase database;    public SQLiteDatabase database_rd;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.createaccount);    Toast.makeText(this,""Before Bundled"",    Toast.LENGTH_SHORT).show();   createDataBase();   //LogIn login = new LogIn();   Button submit = (Button)findViewById(R.id.Button02);   Toast.makeText(this,""after Bundled"",    Toast.LENGTH_SHORT).show();    submit.setOnClickListener(new View.OnClickListener()    {                    @Override                    public void onClick(View v) {                            // TODO Auto-generated method stub                           Welcome createaccount = new Welcome();                           Toast.makeText(createaccount.getApplicationContext(), ""In Helper executing onCreate1()"",                          Toast.LENGTH_SHORT).show();                            String[] success = insertRecords();                            if(success[0].equalsIgnoreCase(""1""))                            {                             setContentView(R.layout.menu);                           }                    }            });    //database.close();    }  // protected String[] insertRecords() { Toast.makeText(this,""In insertrecords"", Toast.LENGTH_SHORT).show();     //database.openDatabase(DB_name,database.create(factory),     //ACCESSIBILITY_SERVICE);     final EditText username = (EditText)findViewById(R.id.username);     final EditText password = (EditText)findViewById(R.id.password);     Long newUserID = 0l;     String user  = username.getText().toString();     String userpass  = password.getText().toString();     ContentValues values = new ContentValues();     values.put(""username"",user);     values.put(""password"",userpass);      //StringBuilder info = new StringBuilder();     String[] info = new String[10];     database.beginTransaction();     try     {     Toast.makeText(this,""Before calling inserting values"",     Toast.LENGTH_SHORT).show();     newUserID = database.insertOrThrow(TABLE_NAME, null, values);     Toast.makeText(this,""After calling inserting values"",     Toast.LENGTH_SHORT).show();     info[0] = newUserID.toString();     info[1] = user;     info[2] = userpass;     System.out.println(newUserID);     Toast.makeText(this, newUserID.toString(),     Toast.LENGTH_SHORT).show();     Cursor c = database_rd.query(TABLE_NAME, null, null, null, null,     null,null);     LogCursorInfo(c);     c.close();     }     catch(Exception e)     {     //Transaction failed;     e.printStackTrace();     }     finally     {     database.endTransaction();     database.close();     }     return info;     }  private void LogCursorInfo(Cursor c) { // TODO Auto-generated method stub Log.i(DEBUG_TAG, ""*** Cursor Begin *** "" + "" Results:"" +    c.getCount() + "" Columns: "" + c.getColumnCount());                    // Print column names                    String rowHeaders = ""|| "";                    for (int i = 0; i &lt; c.getColumnCount(); i++) {                            rowHeaders = rowHeaders.concat(c.getColumnName(i) + "" || "");                    }                    Log.i(DEBUG_TAG, ""COLUMNS "" + rowHeaders);                    //Integer rows = c.getCount();                    //Toast.makeText(this, rows.toString(), Toast.LENGTH_SHORT).show();                    // Print records                    c.moveToFirst();                    while (c.isAfterLast() == false) {                            String rowResults = ""|| "";                            for (int i = 0; i &lt; c.getColumnCount(); i++) {                                    rowResults = rowResults.concat(c.getString(i) + "" || "");                            }                            Log.i(DEBUG_TAG, ""Row "" + c.getPosition() + "": "" + rowResults);                            Toast.makeText(this, rowResults.toString(),    Toast.LENGTH_SHORT).show();                            //Toast.makeText(this, ""In LogCursorInfo"",                            c.moveToNext();                    }                    Log.i(DEBUG_TAG, ""*** Cursor End ***"");            }        void createDataBase()        {         if(Arrays.binarySearch(databaseList(), DBNAME)&gt;=0)            {                    deleteDatabase(DBNAME);            }            database_helper = new            DatabaseHelper(this.getApplicationContext());            //database_helper.onCreate(database);            database = database_helper.getWritableDatabase();            database.setLocale(Locale.getDefault()); // Set the local            database.setLockingEnabled(true); // SQLiteDatabase is made thread-safe by using locks around critical sections.            database_rd = database_helper.getReadableDatabase();            Toast.makeText(this, ""created database"",    Toast.LENGTH_SHORT).show();            /*            database =    openOrCreateDatabase(DB_name,SQLiteDatabase.CREATE_IF_NECESSARY,    null);            database.setLocale(Locale.getDefault()); // Set the local            database.setLockingEnabled(true); // SQLiteDatabase is made    thread-safe by using locks around critical sections.            database.setVersion(1);            database.execSQL(CREATE_USER_TABLE);            */             }  }</code></pre><p>The application stops responding in this point:</p><pre><code>submit.setOnClickListener(new View.OnClickListener()    {                    @Override                    public void onClick(View v) {                            // TODO Auto-generated method stub                           Welcome createaccount = new Welcome();                           Toast.makeText(createaccount.getApplicationContext(), ""In Helper executing onCreate1()"",                          Toast.LENGTH_SHORT).show();                            String[] success = insertRecords();                            if(success[0].equalsIgnoreCase(""1""))                            {                                setContentView(R.layout.menu);                           }                    }            }); </code></pre>","516160","","516160","","2010-12-11 09:08:44","2010-12-11 10:50:56","Login Application in Android","<java><android><eclipse><sqlite><android-emulator>","1","4","","",""
"4415954","1","4416389","","2010-12-11 08:52:30","6","6257","<p>Is there any elegant way (not just <code>if (""fileExt"".compareTo("".mp3"")) {MIME_TYPE = ""audio/*""}</code>) to learn programatically the MIME type that should be put into an intent, with which I have to open the file?</p><p>Thanks!</p>","481828","","","","","2010-12-11 11:00:44","How to tell what's the MIME type according to the file?","<android><file><types><android-intent><mime>","2","0","2","",""
"4415967","1","","","2010-12-11 08:58:33","1","271","<p>I wrote this code to try threads on Android, but it doesn't work. </p><pre><code>   @Override   public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Thread t = new Thread() {            @Override public void run() {                            int i = 0;                while(true) {                                 i += 5;                                 if(i == 1000000)                                       break;                            }            }        };    t.run();   }</code></pre><p>I have some GUI and when thread works (i &lt; 1000000), GUI freezes. But when thread is done (i == 1000000) everything works fine. What's wrong?</p><p>// Sorry for my english</p>","538759","","","","","2010-12-11 08:59:23","Why this thread doesn't work?","<android><multithreading>","1","1","","",""
"4415998","1","","","2010-12-11 09:09:47","1","977","<p>this is my coding for flip the string sequentially in animation view.</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.ViewGroup;import android.view.animation.AnimationUtils;import android.widget.Button;import android.widget.ViewFlipper;public class mukesh extends Activity {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""};ViewFlipper flipper;@Overridepublic void onCreate(Bundle icicle) {super.onCreate(icicle);setContentView(R.layout.main);flipper=(ViewFlipper)findViewById(R.id.details);flipper.setInAnimation(AnimationUtils.loadAnimation(this,R.anim.push_left_in));flipper.setOutAnimation(AnimationUtils.loadAnimation(this,R.anim.push_left_out));for (String item : items) {Button btn=new Button(this);btn.setText(item);flipper.addView(btn,new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT));}flipper.setFlipInterval(2000);flipper.startFlipping();}} </code></pre><p>but ""R.anim.push_left_in"" this line shows the error.R.anim cannot be resolved .whats problem. how can we solve it </p>","543019","","21234","","2010-12-11 11:18:25","2010-12-11 12:55:50","android viewflipper using animation","<android><view>","1","0","","",""
"4416045","1","4416076","","2010-12-11 09:24:54","4","1227","<p>I have some code which is working in iphone and i want to make same application in android.i must use php webservice. using soap library.i want to use following webservice <a href=""http://www.medihand.org/freechoicedrivers/soap/members.php"" rel=""nofollow"">http://www.medihand.org/freechoicedrivers/soap/members.php</a></p><p>it is wsdl code here</p><p>------------   </p><p>and i used android code which i put here</p><p>public class start extends Activity {</p><p>private static final String SOAP_ACTION = ""urn:members#syncMemberDetails"";</p><pre><code> private static final String METHOD_NAME = ""syncMemberDetails""; private static final String NAMESPACE = ""http://schemas.xmlsoap.org/wsdl/""; // !!!!! IMPORTANT!!!!! THE URL OF THE CoLDFUSION WEBSERVER NOT LOCALHOST BECAUSE LOCALHOST IS THE ANDROID EMULATOR !!!!! private static final String URL = ""http://www.medihand.org/freechoicedrivers/soap/members.php""; //String sample[] ={""milan"",""pratik""};  TextView tv; String s=""""; @Override public void onCreate(Bundle icicle) {     super.onCreate(icicle);     setContentView(R.layout.main);  /*   s = "" &lt;?xml version=\""1.0\"" encoding=\""UTF-8\"" ?&gt;\n"" +        ""&lt;SOAP-ENV:Envelope\n""+        "" SOAP-ENV:encodingStyle=\""http://schemas.xmlsoap.org/soap/encoding/\""\n""+       "" xmlns:SOAP-ENV=\""http://schemas.xmlsoap.org/soap/envelope/\""\n""+       "" xmlns:SOAP-ENC=\""http://schemas.xmlsoap.org/soap/encoding/\""\n""+       "" xmlns:xsd=\""http://www.w3.org/2001/XMLSchema\""\n""+       "" xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\""&gt;\n""+       ""  &lt;SOAP-ENV:Body&gt;\n""+       ""    &lt;syncMemberDetails&gt;\n""+       ""      &lt;values xsi:type=\""xsd:Array\""&gt;\n""+       ""        &lt;item&gt;\n""+       ""          &lt;username xsi:type=\""xsd:string\""&gt;test&lt;/username&gt;\n""+       ""          &lt;password xsi:type=\""xsd:string\""&gt;test&lt;/password&gt;\n""+       ""          &lt;dates xsi:type=\""xsd:Array\""&gt;\n""+       ""            &lt;item&gt;\n""+       ""              &lt;year xsi:type=\""xsd:int\""&gt;2010&lt;/year&gt;\n""+       ""              &lt;month xsi:type=\""xsd:int\""&gt;12&lt;/month&gt;\n""+       ""              &lt;day xsi:type=\""xsd:int\""&gt;%30&lt;/day&gt;\n""+       ""              &lt;sync xsi:type=\""xsd:int\""&gt;(null)&lt;/sync&gt;\n""+       ""              &lt;times xsi:type=\""xsd:Array\""&gt;\n""+       ""                &lt;item&gt;\n""+       ""                  &lt;start xsi:type=\""xsd:int\""&gt;0&lt;/start&gt;\n""+       ""                  &lt;finish xsi:type=\""xsd:int\""&gt;0&lt;/finish&gt;\n""+       ""                  &lt;sync xsi:type=\""xsd:int\""&gt;0&lt;/sync&gt;\n""+       ""                  &lt;timestamp xsi:type=\""xsd:date\""&gt;2010-11-10 18:07:44 GMT&lt;/timestamp&gt;\n""+       ""                &lt;/item&gt;\n""+       ""              &lt;/times&gt;\n""+       ""            &lt;/item&gt;\n""+       ""            &lt;item&gt;\n""+       ""    &lt;year xsi:type=\""xsd:int\""&gt;2010&lt;/year&gt;""+       ""    &lt;month xsi:type=\""xsd:int\""&gt;12&lt;/month&gt;""+       ""    &lt;day xsi:type=\""xsd:int\""&gt;21&lt;/day&gt;""+       ""    &lt;sync xsi:type=\""xsd:int\""&gt;0&lt;/sync&gt;""+       ""    &lt;times xsi:type=\""xsd:Array\""&gt;""+       ""   &lt;/times&gt;""+       ""   &lt;/item&gt;""+       ""          &lt;/dates&gt;\n""+       ""        &lt;/item&gt;\n""+       ""      &lt;/values&gt;\n""+       ""    &lt;/syncMemberDetails&gt;\n""+       ""  &lt;/SOAP-ENV:Body&gt;\n""+       ""&lt;/SOAP-ENV:Envelope&gt;"";*/     tv = (TextView) findViewById(R.id.title);  SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);  Request.addProperty(""?????"", ""array value"");     SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);     envelope.setOutputSoapObject(Request);     AndroidHttpTransport aht = new AndroidHttpTransport (URL);                         try {      aht.call(SOAP_ACTION, envelope);    SoapPrimitive resultstring = (SoapPrimitive) envelope.getResponse();     Toast.makeText(this, String.valueOf(resultstring), 5000).show();     } catch(Exception E) {           tv.setText(""ERROR:"" + E.getClass().getName() + "": "" + E.getMessage());     }</code></pre><p>}}</p><p>what i have to write in request.addProperty(????,""value"") </p><p>in dotnew web service i used tag where ? here....so any one know plz tell me how can i access this php webservice</p><p>i also put iphone code which is already running </p>","452611","","","","","2011-01-06 14:15:42","how can i used php webservice in android applcation","<android>","1","0","2","",""
"4416058","1","","","2010-12-11 09:28:23","3","4721","<p>I'm a newbie and just start to learn Google Android right now</p><p>So I learn some code after I googled, but I don't know why it can't run well as wished.These program consists of two java files, AlarmService.java which contains an activity named AlarmService, and AlarmService_Service.java which contains a service named AlarmService_Service. Btw, I put it in the package com.AlarmService</p><p>Here where I created the intent in AlarmService activity (in AlarmService.java):</p><blockquote>  <p>Intent intent = new Intent(AlarmService.this, AlarmService_Service.class);</p>    <p>mAlarmSender = PendingIntent.getService(AlarmService.this, 0,intent, 0);</p>    <p>Button button = (Button)findViewById(R.id.start_alarm);  button.setOnClickListener(mStartAlarmListener);</p></blockquote><p>And the code in AlarmService_Service is quite long, but anyway I also made a Toast to prompt me a text to ensure if this service is functioning or not.</p><p>It looks like the program failed to load AlarmService_Service. Nothing happen when I clicked the button, not even the Toast, and I saw this message in LogCat:</p><blockquote>  <p>Unable to start service Intent {flg=0x4 cmp=com.AlarmService/.AlarmService_Service (has extras) }: not found</p></blockquote><p>Honestly, I'm not familiar with Android so I keep wondering what is wrong with this code.Did I miss something? Or is it because that it couldnot find AlarmService_Service.class?</p><p>Thank you for your big help.</p>","538768","","149206","","2010-12-11 09:36:20","2010-12-11 10:32:34","Unable to start service Intent in my Android program, what's wrong?","<android><android-emulator><android-intent>","2","0","","",""
"4416059","1","4416096","","2010-12-11 09:28:33","2","4677","<p>Has anyone migrated a an application using Java AWT library to run on Android?  How do you do this?  I am using these packages.</p><pre><code> java.awt.AWTException; java.awt.Robot; java.awt.Rectangle; java.awt.Toolkit; java.awt.image.BufferedImage; java.io.*; javax.imageio.ImageIO;</code></pre>","505580","","57695","","2010-12-11 11:04:58","2012-02-28 12:40:13","how to download some java jar library files","<java><android>","2","5","1","",""
"4416061","1","4416087","","2010-12-11 09:30:13","1","673","<p>I think I suffer from a coma, or is something fishy going on?</p><p>I'm using Adwhirl &amp; Admob in my app. Since Admob only serve an ad every 100 request I will turn 85 before I earn my first dollar. So, I decided to add adsense in the soup.</p><p>How on earth do I do that? I can read everywhere how to set it up but it is impossible to get my hands on GoogleAdView.jar smoewhere. If I nicely sign up for an account (as told) i get redirected to admob. Thank you but i already have my admob account.</p><p>So, are adsense for mobiles put to death? </p>","498112","","","","","2010-12-11 09:38:14","android, how to start with adsense","<android><adsense>","1","0","","",""
"4416066","1","","","2010-12-11 09:31:27","1","1969","<p>how to make a rounder corners for image view in android ??</p>","508377","","734687","","2012-02-05 16:09:50","2012-02-05 16:09:50","how to make rounded corners for image in android ?","<android>","2","0","","",""
"4416131","1","","","2010-12-11 09:51:40","0","1827","<p>how to scroll the images in android layout when i run that program and when i click the  image in the scroll view it get zoom.</p>","538626","","538626","","2010-12-11 10:07:09","2010-12-11 12:45:30","how to scroll the image in android layout?","<android><layout><scroll>","2","0","0","",""
"4416137","1","","","2010-12-11 09:52:49","0","539","<p>move the pin to front when we click on pin in map please suggest any solution to do this</p>","489752","","","","","2010-12-11 15:08:17","how to move pin front to view in map?","<android><android-mapview>","1","0","","",""
"4416141","1","","","2010-12-11 09:53:08","2","3957","<p>I am now programming a program that collects sensor data, e.g. acclerometer values for a whole day. </p><p>Current I just use an Activity and run the activity for a whole day (I turn off screen auto-black), and don't make any shortmessages or phone calls during the day. </p><p>I've heard I can make this kind of long running data collector in background using Service. But after I've checked the pedometer at <a href=""http://code.google.com/p/pedometer/"" rel=""nofollow"">http://code.google.com/p/pedometer/</a>. I found that, when the screen blacks out, the pedometer does not work. (But An application like predometer should work in any case as long as the power is on.)</p><p>Although I don't care about the power problem of always sensing acclerometers, <strong>I do want to black out the screen to save the power in screen to record more acclerometer data points</strong>. </p><p>I am thinking about two ways:</p><p>1.Using an Service, however, as the pedometer application showed. When the screen blacks out, the service seems stoped working too! Maybe the code has bugs. </p><p>2.My application is still an Activity. But I change the scrren light into 0 or totally black to save power. </p><p>My question is that: for 1) does a Service have the abality to be always running even when the screen blacks out for a long time; For 2, how to change the screen light?</p><p>Thanks!</p>","183828","","","","","2014-03-01 17:54:01","A background sensor data collector in Android","<android><service><background>","3","0","5","",""
"4416228","1","4416235","","2010-12-11 10:12:53","5","3219","<p>Is there an Android API analogous to java.awt.Robot, i.e. an API allowing to take screenshots?</p>","505580","","600500","","2011-07-05 00:17:59","2011-07-05 00:17:59","Android API like java.awt.Robot","<java><android>","3","1","","",""
"4416229","1","4416302","","2010-12-11 10:14:10","0","1206","<p>My project is create application on android. It can get a location(latitude,longitude) via GPS.After that I want to send a location to a server or web server to collect for calculate a distance which are draw on my own map(may be make from Flash) on a website.I knows an android have apache, but I don't really know in detail about server, web server, apache.So, I want to know how to send a location from my application to server.Anyone can help me or suggest me? </p><p>Appreciate,Daisy</p><p>PS. I'm a newbie.</p>","538788","","538788","","2010-12-11 11:10:05","2010-12-11 11:10:05","How to send a location on android app to server?","<android><apache><location><latitude-longitude>","2","0","","",""
"4416279","1","4416295","","2010-12-11 10:27:42","3","4410","<p>I am developing android app i am using alert dialog box how can alert message color</p><pre><code> AlertDialog.Builder builder = new AlertDialog.Builder(getContext());              builder.setMessage(""...........congratulations..........."");                   builder.setCancelable(false)                .setPositiveButton(""Move Next Level"",                        new DialogInterface.OnClickListener() {                 public void onClick(DialogInterface dialog, int id)                                     {                                    }                                });                AlertDialog alert = builder.create();               alert.setTitle(""."");               alert.setIcon(R.drawable.newmovw);                      alert.show();   </code></pre><p>Display message, text how can apply color in android. Please forward some solution. Thanks in advance.</p><p>forward some screenshot :</p><p><a href=""http://www.freeimagehosting.net/uploads/a2ae787c70.jpg"" rel=""nofollow"">http://www.freeimagehosting.net/uploads/a2ae787c70.jpg</a></p>","254790","","254790","","2010-12-11 11:30:21","2010-12-11 11:30:21","how to apply color in text message in alert dialog box in android","<android><text><colors><alertdialog>","1","5","3","",""
"4416299","1","4416786","","2010-12-11 10:35:05","2","3649","<p>I should want the scrollview scroll, but not the image in its background.</p>","312025","","114066","","2010-12-11 12:42:40","2010-12-11 12:52:31","How to put an fix image background for ScrollView?","<android><layout>","2","0","1","",""
"4416320","1","","","2010-12-11 10:41:13","-1","291","<p>move the pin to back by clicking other pin and any where in map .please suggest or send me how to do.if any code possible please send me </p>","489752","","","","","2011-10-07 08:52:00","how to move pin back of view in map?","<android><android-mapview>","1","0","","2014-02-25 11:08:13",""
"4416362","1","4416407","","2010-12-11 10:54:48","0","392","<p>I'm trying to create an endgame activity for my Hangman game for android and i'm having some trouble committing values OTHER than strings.</p><p>Here is my main activity:</p><pre><code>package com.assignment.hangman;import android.app.Activity;public class HangmanActivity extends Activity {    public static final String GAME_PREFERENCES = ""Game Preferences"";    public static final String GAME_LOGIC = ""Game Logic"";    public static final String GAME_LOGIC_GUESS = ""Guessed letter"";    public static final String GAME_LOGIC_SCORE_STRING = ""Unknow score"";    public static final boolean GAME_LOGIC_WIN_LOOSE = false;}</code></pre><p>I get the sharedprefs like this:</p><pre><code>mGameSettings = getSharedPreferences(""GAME_PREFERENCES"", Context.MODE_PRIVATE);</code></pre><p>And this is where something goes wrong when committing the changes to the editor:</p><pre><code>public void finishGame() {        //Commit different game variables so they can be used in the end game activity          Editor editor = mGameSettings.edit();        editor.putString(GAME_LOGIC_SCORE_STRING, (tries + "" of "" + numberOfLives + "" used""));        if (tries != numberOfLives){            editor.putBoolean(""GAME_LOGIC_WIN_LOOSE"", true);        }        editor.commit();        // Launch end game Activity        startActivity(new Intent(HangmanGameActivity.this, HangmanEndActivity.class));    }</code></pre><p>And after changing activity i refetch the values like this:</p><pre><code>        if (mGameSettings.contains(""GAME_LOGIC_WIN_LOOSE"")) {        Log.i(GAME_DEBUG, ""Succes"");        boolean winLoose = mGameSettings.getBoolean(""GAME_LOGIC_WIN_LOOSE"", false);        if (winLoose) {            winLooseView.setText(R.string.you_win);        } else {            winLooseView.setText(R.string.you_loose);    }    }</code></pre><p>But somehow only the String is being committed correctly. I guess the boolean value reverts to the default value of false. </p><p>Could someone help me shed some light on this?</p>","535199","","","","","2010-12-11 11:05:43","Having problems saving boolean and int to sharedPrefs","<android><boolean><int><saving><sharedpreferences>","1","0","","",""
"4416412","1","","","2010-12-11 11:07:22","8","6334","<p>My application is a timer with alarm type app.When the timer expires i would like to bring the app's main activity back into view, if the user has navigated away, but the app is still running.</p><p>I show where i would like to place the necessary code:</p><pre><code>   public class MyCount extends CountDownTimer {        public MyCount(long millisInFuture, long countDownInterval) {          super(millisInFuture, countDownInterval);        }        public void onFinish() {         /** code here to bring the app back to the front / top of stack, in its current state */         timeDisplay.setText(""Expired.!"");         ReminderFlashingScreen.setVisibility(View.GONE);         statustab.setBackgroundResource(R.drawable.redtab);         seeker.setProgress(0);         reset.setBackgroundResource(R.drawable.resetbtnoff);         playExpiredAlarm();          alarmAnimation.start();         flasher.setVisibility(View.VISIBLE);         StopAlarmButtonAnimation.start();         StopAlarmButton.setVisibility(View.VISIBLE);         expired = true;        }        public void onTick(long millisUntilFinished) {            remindertimepref = prefs.getString(""reminderTime"", ""&lt;unset&gt;"");            remindtime = Integer.parseInt(remindertimepref.trim());            timeDisplay.setText(formatTime(millisUntilFinished));            seeker.setProgress((int) (millisUntilFinished / 1000 / 60 ) + 1);            if (used == true){                reminder_time = ((int) (millisUntilFinished / 1000));                if (reminder_time == remindtime){                    reminderalarm();                    used = false;                    }                }          }    }</code></pre>","515080","","","","","2014-03-28 03:37:02","Bring application back to front","<android>","3","7","1","",""
"4416421","1","4417305","","2010-12-11 11:10:44","1","1059","<p>I'm thinking of buy an android phone, but I'm a little bit scared about the security and privacy because in my palm I had in contacts and calendar a lot of private information. First I thought it could be solved by trying to sync without google, but in the last time I get a lot of information of security holes in android-apps to that I can't be sure that the phone self isn't compromised. I don't mean criminal apps, I mean criminal websites or apps with installed in background. </p><p>So my idea was to encrypt all entries [Update4]( only the description and text based field will be encrypted, not the time )[/Update4] of the calendar and contacts. This means writing an app, where I can define a security level for each record. Than I can set which entries should be decrypted and which not. So if I'm surfing in the www I can encrypted all and it will be save. Even if I sync with google I can go this way (Update: So google only has the encrypted data). After that I decrypt the records.Of course this is sometimes inconvenient, but I fear security is always inconvenient. [Update2] To make it clear, the data wont be decrypted on the fly, so if the data are encrypted and I open the calendar app I only will the the time and an encrypted description.[/Update2]</p><p>[Update3] What I don't want to do is to hack the android-system, meaning to root the phone or install a special firmware. Furthermore I don't want to invest weeks for development, so programming a new PIM-app is not an option. I simply want to take every record from the calender/contact database and encrypt the critical data. As far as I know there is an api to read and write such data. [/Update3]</p><p>So my questions are</p><ol><li><p>Is this possible to implement?</p></li><li><p>Can I test it with the emulator or is the calendar and    contacts app not part of the emulator?</p></li></ol><p>Thanks Niels</p><p>PS: Reading <a href=""http://stackoverflow.com/questions/2023557/when-will-android-have-a-public-calendar-api"">this</a> there is no public api to calendar, so it can't work :-(</p>","432115","","432115","","2010-12-12 10:24:16","2010-12-12 10:24:16","Secure Android with cryptography","<android><android-emulator>","4","4","","",""
"4416499","1","4416729","","2010-12-11 11:32:24","0","504","<p>i done one program in android using xml parsing but there is an error please slove this problem and explain how to use the xml parsing in android </p><pre><code>                 String response = rc.getResponse();          Log.e(""Response "", response);              SAXParserFactory spf = SAXParserFactory.newInstance();              SAXParser sp = spf.newSAXParser();              XMLReader xr = sp.getXMLReader();              LoginHandler myLoginHandler = new LoginHandler();              xr.parse(retrieveInputStream( response));              xr.parse(new InputSource(rc.openStream()));</code></pre>","745367","","","","","2010-12-11 13:51:55","how to do sax xml parsing in android","<android><xml><parsing>","1","1","","",""
"4416630","1","4417309","","2010-12-11 12:12:42","0","479","<p>I would like to use the android standard user interface for the alarm clock in my code similar to the way the preferences edit interface can be used.   Is this possible?</p>","538847","","","","","2010-12-11 15:01:51","can i get access in my code to the alarm clock interface","<android>","1","3","","",""
"4416639","1","4416773","","2010-12-11 12:16:12","5","5204","<p>I am going to make a PTT project on Android. Could you tell me how deep Android supports Voice and Multimedia API (such as RTP,RTSP,VoIP) for developers?</p>","538843","","213269","","2010-12-11 13:06:55","2011-04-03 20:53:13","Does android support APIs for implementing RTP,RTSP for VoIP and PTT Project?","<android><voip><multimedia><rtsp><rtp>","2","0","0","",""
"4416699","1","","","2010-12-11 12:32:29","0","1159","<p>I'm looking for a complete example for uploading an image + some text fields from Android to a WCF service. I've been searching for days without finding any useful examples. What I need is the code for <strong>both</strong> the <strong>client</strong> and <strong>server</strong>.</p><p>I've been able to make it work with JSON and Base64 encoding the image as a string, but this is way too slow with images around 500KB. What I'm looking for has to be efficient. Probably using a stream.</p><p>Can anyone please give me a complete sample code? I've seen a lot of snippets on each side, but not a complete sample. From getting the image from a path on the phone to posting it to the server and consuming it on the server in C#? How to get the image as a bytearray on the server and the text into string variables?</p><p>Thanks for listening.</p>","538859","","","","","2010-12-11 18:46:33","Upload image from Android to WCF service","<android><wcf>","1","2","","",""
"4416777","1","4420362","","2010-12-11 12:50:49","0","946","<p>Im playing around with Java server clientfrom android phone HTC Desire to my PC's winXp/win7.It came to me that sending an image.jpg will be visible for anyonewho will sniff my packages in the air.</p><p>I was thinking of rebuilding my code for any of the sftp, ftps, ssl or whatever any other secure encrypting.This was harder then i thought since i cant find a clear grep of the concept.  Every tutor i find is ether for pc or androidnot pc to android </p><p>Maybe and easy and good way is to zip it and cryp it and use the<br>normal FileOutputStream. </p><p>what you think pips any thoughts? </p>","538837","","213269","","2010-12-11 12:57:08","2010-12-12 04:04:55","Android secure server client connection","<android><encryption><ssl><client-server>","1","0","1","",""
"4416798","1","","","2010-12-11 12:55:56","1","8119","<p>I have a java web service (soap) which i want to use with an android client for that am using ksoap.</p><p>My web service gives an answer which look like this : </p><pre><code>&lt;S:Envelope xmlns:S=""http://schemas.xmlsoap.org/soap/envelope/""&gt;    &lt;S:Body&gt;        &lt;ns2:listealbumResponse xmlns:ns2=""http://ws/""&gt;            &lt;return xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""ns2:album""&gt;                &lt;annee&gt;2008&lt;/annee&gt;                &lt;id&gt;6&lt;/id&gt;                &lt;titre&gt;Ninja Tuna&lt;/titre&gt;            &lt;/return&gt;            &lt;return xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""ns2:album""&gt;                &lt;annee&gt;2008&lt;/annee&gt;                &lt;id&gt;10&lt;/id&gt;                &lt;titre&gt;Fine Music, Vol. 1&lt;/titre&gt;            &lt;/return&gt;            &lt;return xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""ns2:album""&gt;                &lt;annee&gt;2004&lt;/annee&gt;                &lt;id&gt;14&lt;/id&gt;                &lt;titre&gt;Bob Acri&lt;/titre&gt;            &lt;/return&gt;            &lt;return xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:type=""ns2:album""&gt;                &lt;annee&gt;2009&lt;/annee&gt;                &lt;id&gt;54&lt;/id&gt;                &lt;titre&gt;Rated R&lt;/titre&gt;            &lt;/return&gt;        &lt;/ns2:listealbumResponse&gt;    &lt;/S:Body&gt;&lt;/S:Envelope&gt;</code></pre><p><em><strong>wich is a list of object</em></strong></p><p>To call my web service  i use this code :</p><pre><code>try{        SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);        envelope.dotNet = false;        envelope.setOutputSoapObject(Request);        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);        androidHttpTransport.call(SOAP_ACTION, envelope);        SoapObject result = (SoapObject)envelope.getResponse();</code></pre><p>When i tested my response ""result"" it's got only one object , how could i get all the list and parse it?</p>","538876","","21234","","2011-01-31 09:56:55","2012-11-04 11:56:39","Ksoap on android-- get a list response from a java web service","<java><android><web-services><list><android-ksoap2>","3","0","0","",""
"4416806","1","","","2010-12-11 12:57:50","0","1034","<p>I'm using <a href=""http://code.google.com/p/google-api-java-client/"" rel=""nofollow"">Google Data API</a> to connect Picasa from Android. To retrieve the pictures and the metadata it works great, but I get an IllegalArgumentException on parsing the response of an PATCH (relative to original). The header is ""text/html"" although the ouput of the parseAsString-method delivers a perfect xml-string. Is that a bug or do I need to create my own Parser for ""text/html""?</p><p>I also wouldn't mind updating with the PUT-method, does anyone have a good example how to do that with Java?</p><p>Here the exception:</p><pre><code>Uncaught handler: thread main exiting due to uncaught exception java.lang.IllegalArgumentException: No parser defined for Content-Type: text/html; charset=UTF-8 at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:277) at com.unimelb.pt3.external.google.api.Entry.executePatchRelativeToOriginal(Entry.java:95) at com.unimelb.pt3.external.google.api.PhotoEntry.executePatchRelativeToOriginal(PhotoEntry.java:67) at com.unimelb.pt3.Picasa.updatePicture(Picasa.java:135) at com.unimelb.pt3.Tools.updatePictureOnPicasa(Tools.java:209) at com.unimelb.pt3.ui.WaterfallView.onDraw(WaterfallView.java:145) at android.view.View.draw(View.java:6535) at android.view.ViewGroup.drawChild(ViewGroup.java:1531) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.ViewGroup.drawChild(ViewGroup.java:1529) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.View.draw(View.java:6538) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1531) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.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>Here the code in the Entry:</p><pre><code>Entry executePatchRelativeToOriginal(HttpTransport transport, Entry original)  throws IOException {      HttpRequest request = transport.buildPatchRequest();      request.setUrl(getEditLink());      request.headers.ifMatch = etag;      AtomPatchRelativeToOriginalContent content =          new AtomPatchRelativeToOriginalContent();      content.namespaceDictionary = Util.NAMESPACE_DICTIONARY;      content.originalEntry = original;      content.patchedEntry = this;      request.content = content;      Log.i(Prototype.TAG, request.url.toString());      HttpResponse response = request.execute();      // Log.i(Prototype.TAG, response.parseAsString());      return response.parseAs(getClass());}</code></pre><p>Here the relevant code from the main Activity:</p><pre><code>public void updatePicture(String url, String description, String[] tags) throws IOException {    PhotoEntry photo = photos.get(url);    PhotoEntry patched = photo.clone();    patched.summary = description;    String keywords = """";    for(int i=0; i&lt;tags.length; i++) {        keywords += tags[i] + ((i==tags.length-1) ? """" : "", "");    }    patched.mediaGroup.keywords = keywords;    photo = patched.executePatchRelativeToOriginal(transport, photo);}private HttpTransport setUpTransport() {    HttpTransport transport = GoogleTransport.create();    GoogleHeaders headers = (GoogleHeaders) transport.defaultHeaders;    headers.setApplicationName(""google-picasaatomsample-1.0"");    headers.gdataVersion = ""2"";    AtomParser parser = new AtomParser();    parser.namespaceDictionary = Util.NAMESPACE_DICTIONARY;    transport.addParser(parser);    return transport;}</code></pre><p><strong>EDIT:</strong>I added to the setUpTransport method the following lines:</p><pre><code>   XmlHttpParser p2 = new XmlHttpParser();   p2.contentType = ""text/html"";   p2.namespaceDictionary = Util.NAMESPACE_DICTIONARY;   transport.addParser(p2); </code></pre><p>That leads to another IllegalArgumentException with that log:</p><pre><code> Uncaught handler: thread main exiting due to uncaught exception java.lang.IllegalArgumentException: expected start of XML element, but got something else (event type 4)     at com.google.api.client.xml.Xml.parseElementInternal(Xml.java:180)     at com.google.api.client.xml.Xml.parseElement(Xml.java:152)     at com.google.api.client.xml.XmlHttpParser.parse(XmlHttpParser.java:73)     at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:280)     at com.unimelb.pt3.external.google.api.Entry.executePatchRelativeToOriginal(Entry.java:95)     at com.unimelb.pt3.external.google.api.PhotoEntry.executePatchRelativeToOriginal(PhotoEntry.java:67)     at com.unimelb.pt3.Picasa.updatePicture(Picasa.java:130)     at com.unimelb.pt3.Tools.updatePictureOnPicasa(Tools.java:209)     at com.unimelb.pt3.ui.WaterfallView.onDraw(WaterfallView.java:145)     at android.view.View.draw(View.java:6535)     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:158)     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>","538581","","538581","","2010-12-12 01:52:21","2012-03-12 13:17:00","Updating metadata on Picasa using Google Data API for Java","<android><picasa><google-api-java-client>","1","1","","",""
"4416975","1","4417323","","2010-12-11 13:38:51","0","196","<p>i need some good advice for my code. here is what i want to do.</p><p>i have an activity that has some views that can be selected by user. assumed that the user selected a view, i want to deselect this view automatically after, let's say, 5 seconds. I do this by a thread.</p><p>when the user selects the view, i call... </p><pre><code>Deselector deselect = new Deselector(mp.getDuration(), clickedview);deselect.start();   </code></pre><p>...in the activity.</p><p>the deselector class:</p><pre><code>class Deselector extends Thread{int millis=0;View view = null;Deselector(int millis, View view){    this.millis = millis;    this.view = view ; }@Overridepublic void run() {    // TODO Auto-generated method stub    try {        this.sleep(millis);        view.setSelected(false);    } catch (InterruptedException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }}}</code></pre><p>my program crashes and logkitty says</p><blockquote>  <p>12-11 14:29:37.457: ERROR/AndroidRuntime(3263): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</p></blockquote><p>how to do it right?</p><p>thanks in advance</p><p>m.d.</p>","537865","","","","","2010-12-11 16:12:59","How to deselect view after a certain time without freezing activity","<android><multithreading><gui><view>","2","0","","",""
"4416987","1","","","2010-12-11 13:40:40","1","3365","<p>I've been trying to call a method from another class. </p><p>I have 2 classes. Timer.class and DecisionMaking.class. The Timer class is suppose to call a method (I just used a toast for now) from DecisionMaking.class once the timer is onFinish(). There is no error in my codes but when the timer finish counting, the method was not called and the emulator ask to Force Close. Both of the classes are in the same package. Is there anything that I'm missing?</p><p><strong>Timer.class</strong></p><pre><code>public class Timer extends Activity{  TextView timeDisplay;  MyCount timer;  int length = 10000;  long startTime;  long timeRemaining;  DecisionMaking decisionmaking;  /** Called when the activity is first created. */  public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.main);     timeDisplay = (TextView) findViewById(R.id.timer);     timer = new MyCount(length, 1000);     timer.start(); } public class MyCount extends CountDownTimer {public MyCount(long millisInFuture, long countDownInterval) {           super(millisInFuture, countDownInterval);    }    public void onFinish() {      DecisionMaking decisionmaking = new DecisionMaking();       decisionmaking.sendSms();     timer.start();    }    public void onTick(long millisUntilFinished) {       timeDisplay.setText(""Time:"" + millisUntilFinished / 1000);    }  }</code></pre><p>}</p><p><strong>DecisionMaking.class</strong></p><pre><code>public class DecisionMaking extends Timer{   public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);      sendSms();    }    public boolean sendSms() {     Calendar cal = Calendar.getInstance();         Date d = cal.getTime();         int hour = d.getHours();     if (hour &gt; 0 &amp;&amp; hour &lt; 6)        return false;     else        {        //Call SMS class here, remove toast        Toast.makeText(getBaseContext(), ""SMS sent."", Toast.LENGTH_SHORT).show();        return true;     } }}</code></pre>","538889","","121971","","2010-12-11 13:55:57","2010-12-11 13:55:57","How to call method from another class in Android?","<android>","1","2","0","",""
"4417019","1","4417328","","2010-12-11 13:48:53","4","2843","<p>Is there any way to get programmatically the user selection after </p><pre><code>startActivityForResult(Intent.createChooser(fileIntent, ""Open file using...""), APP_PICKED);</code></pre><p>or</p><pre><code>startActivity(Intent.createChooser(fileIntent, ""Open file using...""));</code></pre><p>I do not want to start the selected application - I only want to know which one is it?</p><p>Thanks!</p>","481828","","","","","2012-10-11 02:13:15","How to get the user selection from startActivityForResult(Intent.createChooser(fileIntent, ""Open file using...""), APP_PICKED);?","<android><android-intent><selection>","1","0","2","",""
"4417091","1","4417173","","2010-12-11 14:02:07","0","121","<p>I have successfully stored bitmap in sdcard/Pictures folder in android 2.X , using following code</p><pre><code>File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);File file = new File(path, ""pic""+index+"".jpg"");</code></pre><p>now, i want to retrieve all the images stored in that folder with out specifying name of the file.</p>","405383","","405383","","2010-12-11 14:07:26","2010-12-11 14:25:17","access bitmaps from speficied folder in android","<android><file>","1","0","","",""
"4417185","1","4417471","","2010-12-11 14:27:26","1","823","<p>HI, <BR>I am writing an Android application where I need to display Image Captured through Camera.I am using Android 2.1 I tested in emulator. I am trying to capture the image  , but how to display the captured Image on Screen.<br>Can anyone help me in sorting out this issue.</p><p><br>Thanks in Advance.</p>","429501","","","","","2010-12-11 15:44:15","How to display image captured using Camera in Android","<android>","1","0","","",""
"4417285","1","","","2010-12-11 14:54:20","1","95","<p>is there any event generated on opening applications in Android.</p><p>Scenario:</p><p>User opens app list -> opens application &lt;&lt; EVENT GENERATED >> -> user application view</p><p>If such event exists, could you register for it?</p><p>tnx.</p>","505160","","","","","2010-12-11 15:56:34","Is there event generated on openning application?","<android>","1","0","","",""
"4417287","1","","","2010-12-11 14:55:11","1","455","<p>I've an Activity with a vertical linearlayout containing images, buttons, listview and adwhirllayout. All have for their height wrap_content and the listview has weight=""1"" to force it to use all remaining space. This works fine as long as the adwhirl doesn't show an ad. Once it does, the linearlayout redraws and the listview's height becomes 0! Also when the listview is showing items. These disappear. The adwhirl is as big as the remainingSomeone an idea what's wrong?</p>","503659","","","","","2010-12-11 15:05:30","AdWhirl eats up all space of listview","<android><listview><android-linearlayout><adwhirl>","1","0","","",""
"4417295","1","","","2010-12-11 14:57:40","1","914","<p>I'm trying to integrate some Facebook stuff (posting on your own ""wall"") in my TabView.The problem I'm facing is that while I do not have the Facebook app installed, I get a Webview showing the login and posting. It shows nicely, except for the buttons at the bottom. If I scroll down to see the buttons, they just go a little bit lower.</p><p>The layout of the tab:</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:paddingBottom=""40dip""&gt; &lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@+id/Test_Facebook_Layout""&gt;      &lt;Button android:id=""@+id/facebookButton""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""Login to facebook""/&gt; &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>Got all the code (except the parts I changed and will post below) from <a href=""http://stackoverflow.com/questions/2953146/android-java-post-simple-text-to-facebook-wall"">here</a>.</p><pre><code>    public void onClick(View v){    if (v == facebookButton)    {        facebookClient = new Facebook(""myAwesomeKey"");        facebookClient.authorize(this, new String[] {""publish_stream"", ""read_stream"", ""offline_access""}, this);    }} public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //http://stackoverflow.com/questions/2953146/android-java-post-simple-text-to-facebook-wall    setContentView(R.layout.detailsfacebooktab);    facebookButton = (Button)this.findViewById(R.id.facebookButton);    facebookButton.setOnClickListener(this);}</code></pre><p>What would be nice is either a) Getting the WebView to not fill my screen or b) Keep the buttons from scrolling away.</p><p>EDIT: Because a picture says more than a thousend words, here's three thousand words.(if it isn't clear, Picture 1 shows the initial view, Picture 2 shows my scrolling down, Picture 3 shows the buttons getting away)</p><p><img src=""http://i.stack.imgur.com/XQhug.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/Q3mTw.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/0RPI5.png"" alt=""alt text""></p><p>For the moment I found a c) Getting the buttons a bit higher.The problem is the user can still scroll the WebView, enlarging the View and scrolling the buttons back down again.</p><p>I edited these values in <code>com.facebook.android.fbDialog.java</code> to show the buttons a bit more.</p><pre><code>static final float[] DIMENSIONS_LANDSCAPE = {440, 260};static final float[] DIMENSIONS_PORTRAIT = {280, 380};</code></pre><p>Because this does not completely solve my problem, I've edited my OP instead of posting my own ""answer"".</p><p>Thank you,</p><p>iarwain01</p>","525144","","525144","","2010-12-11 23:14:44","2010-12-11 23:51:16","Webview in Facebook SDK","<android><facebook><webview><scroll>","1","0","","",""
"4417312","1","4418194","","2010-12-11 15:02:15","0","920","<p>I have made an app that you puss a button and hear a ringtone!How can i add an option to save it to your device as a ringtone,if you like?thanks</p>","519526","","","","","2010-12-11 18:16:54","Save mp3 file as ringtone","<android>","1","0","1","",""
"4417418","1","4417443","","2010-12-11 15:32:00","1","2351","<p>Whenever I turn the device sideways, everything in my app also turns and becomes distorted. How do I lock it into vertical?</p>","498680","","","","","2010-12-11 15:55:20","How do you prevent the android screen from being turned sideways?","<android><screen-orientation>","4","0","2","",""
"4417450","1","4417462","","2010-12-11 15:40:35","4","6098","<p>are there any sources of templates for layouts?</p><p>I need some typical layouts to start.</p>","505160","","","","","2012-10-30 11:06:46","Android layout templates?","<android>","1","0","1","",""
"4417526","1","4557321","","2010-12-11 15:58:33","7","12823","<p>After looking into 3D game programming, it quickly became evident why a physics engine could be extremely useful.What physics engines are supported by and viable on Android?Any other advice regarding them would be nice.</p><p>Thanks</p>","450153","","","","","2013-11-06 08:17:13","android physics engine","<android><physics-engine>","5","0","4","2013-11-09 15:30:49",""
"4417534","1","","","2010-12-11 16:01:15","2","1212","<p>I've implemented the below code to fill my listview with various images if available and it works but the problem is when other elements on screen are touched or you scroll fast images shift around. Any help would be much appreciated...</p><pre><code>import java.lang.ref.WeakReference;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Color;import android.graphics.drawable.ColorDrawable;import android.graphics.drawable.Drawable;import android.os.AsyncTask;import android.view.View;import android.widget.ImageView;import android.widget.TableLayout;public class ImageDownloader {    public void download(String url, ImageView imageView, TableLayout imageTable) {        if (cancelPotentialDownload(url, imageView)) {        BitmapDownloaderTask task = new BitmapDownloaderTask(imageView, imageTable);        DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);        imageView.setImageDrawable(downloadedDrawable);        task.execute(url);        }    }    class BitmapDownloaderTask extends AsyncTask&lt;String, Void, Bitmap&gt; {        String url;        private final WeakReference&lt;ImageView&gt; imageViewReference;        private final WeakReference&lt;TableLayout&gt; imageTableReference;        public BitmapDownloaderTask(ImageView imageView, TableLayout imageTable) {            imageViewReference = new WeakReference&lt;ImageView&gt;(imageView);            imageTableReference = new WeakReference&lt;TableLayout&gt;(imageTable);        }          @Override          protected Bitmap doInBackground(String... params) {                 BitmapFactory.Options o = new BitmapFactory.Options();                  o.inJustDecodeBounds = true;                  BitmapFactory.decodeFile(params[0], o);                  final int REQUIRED_SIZE=70;                  //Find the correct scale value. It should be the power of 2.                  int width_tmp=o.outWidth, height_tmp=o.outHeight;                  int scale=4;                  while(true){                      if(width_tmp/2&lt;REQUIRED_SIZE || height_tmp/2&lt;REQUIRED_SIZE)                          break;                      width_tmp/=2;                      height_tmp/=2;                      scale++;                  }                  //Decode with inSampleSize                  BitmapFactory.Options o2 = new BitmapFactory.Options();                  o2.inSampleSize=scale;                         return BitmapFactory.decodeFile(params[0], o2);          }          @Override          protected void onPostExecute(Bitmap result) {                if (isCancelled()) {                    result = null;                }                if (imageViewReference != null) {                    ImageView imageView = imageViewReference.get();                    TableLayout imageTable = imageTableReference.get();                    BitmapDownloaderTask bitmapDownloaderTask = ImageDownloader.getBitmapDownloaderTask(imageView);                    // Change bitmap only if this process is still associated with it                    if (this == bitmapDownloaderTask) {                          imageView.setImageBitmap(result);                          imageView.setVisibility(View.VISIBLE);                          imageTable.setVisibility(View.VISIBLE);                    }                              }            }    }    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 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;    }}</code></pre>","427377","","","","","2011-04-11 13:41:43","Android listview images shift around","<android><listview>","2","0","","",""
"4417552","1","4418041","","2010-12-11 16:06:03","0","494","<p>I am having a problem with setting an ImageView image to an image which has been fetched from a URL. Here is the method used to turn the URL into a Drawable object:</p><pre><code>private Drawable LoadImage(String url){            try            {                InputStream is = (InputStream) new URL(url).getContent();                Drawable d = Drawable.createFromStream(is, ""src"");                return d;            }catch (Exception e) {                System.out.println(""Exc=""+e);                return null;            }    }</code></pre><p>Here is the code to call the method:</p><pre><code>Drawable drawable = LoadImage(""www.myurl.com/image.jpg"");imageView.setImageDrawable(drawable); //here is where I think it goes wrong</code></pre><p>It gives me a Null Pointer Exception but when I display the drawable.toString() variable in a text view I get something like this:</p><pre><code>android.graphics.drawable.BitMapDrawable@43e5bb18</code></pre><p>So it shows it's not returning null and fails when it tries to draw it. Am I missing something in the manifest or is there something wrong with my code?</p>","400406","","","","","2010-12-11 17:42:57","Null Pointer Exception when Drawing an image","<android><url><imageview><drawable>","1","10","","",""
"4417620","1","","","2010-12-11 16:20:32","2","688","<p>I am developing a SoundBoard application. From my application when I set any ogg file as default ringtone. They stop playing once while ringing. I tried Adding ANDROID_LOOP metadata set to true. But it sets the sound to play in loop forever in my soundboard. Is there any alternate way to loop ogg while ringing? Thanks.</p>","527053","","","","","2010-12-11 16:20:32","Android: Ogg Files Not Looping while set as Ringtone","<android><infinite-loop><ogg>","0","0","","",""
"4417652","1","4417676","","2010-12-11 16:27:42","0","425","<p>when I add image for button in android using setBackgroundResource mthe height of the image changes ,, how can i maintian the original height of of the image on the button ??</p>","508377","","","","","2010-12-11 16:32:15","how to maintain the orginal size of image of button in android?","<android>","1","0","","",""
"4417816","1","4417885","","2010-12-11 17:01:46","4","2123","<p>I've been looking around, and haven't been able to find a solution to this particular issue.  Forgive me if this is a newbie mistake, I'm fresh out of school so I'm reading as many books as I can to get caught up on mobile device programming.</p><p><strong>The Goal:</strong>Transmit data from a PC based socket server to an Android based client wirelessly (802.11 b/g), which will then process said data for output to the user.</p><p><strong>The Problem:</strong>A large amount of erroneous garbage data is being received in the input stream buffers on the Android phone.</p><p><strong>The Procedure:</strong>I've written and/or modified three different pieces of code.  First is the server side program running on my laptop.  The original source code can be found here: beej.us/guide/bgnet/examples/server.c (thanks to Beej for his source code!).  I've modified it to remove warnings/errors, and added my own continuous data input loop for testing purposes.  Here is the modified code:</p><pre><code>    /* A simple server in the internet domain using TCP   The port number is passed as an argument */#include &lt;unistd.h&gt;#include &lt;stdlib.h&gt;#include &lt;stdio.h&gt;#include &lt;string.h&gt;#include &lt;sys/types.h&gt; #include &lt;sys/socket.h&gt;#include &lt;netinet/in.h&gt;void error(char *msg){    perror(msg);    exit(1);}int main(int argc, char *argv[]){     int sockfd, newsockfd, portno;  //, clilen;     //Modified this fromt he original author's code, as     //the function is looking for clilen to be of type     //socklen_t, not int     socklen_t clilen;     char buffer[256];     struct sockaddr_in serv_addr, cli_addr;     int n;     if (argc &lt; 2)      {         fprintf(stderr,""ERROR, no port provided\n"");         exit(1);     }     sockfd = socket(AF_INET, SOCK_STREAM, 0);     if (sockfd &lt; 0)         error(""ERROR opening socket"");     bzero((char *) &amp;serv_addr, sizeof(serv_addr));     portno = atoi(argv[1]);     serv_addr.sin_family = AF_INET;     serv_addr.sin_addr.s_addr = INADDR_ANY;     serv_addr.sin_port = htons(portno);     if (bind(sockfd, (struct sockaddr *) &amp;serv_addr,              sizeof(serv_addr)) &lt; 0)               error(""ERROR on binding"");     //Added this for some clarity      printf(""Starting to listen on the socket now..\n"");     listen(sockfd,5);     clilen = sizeof(cli_addr);     newsockfd = accept(sockfd,                  (struct sockaddr *) &amp;cli_addr,                  &amp;clilen);     //Let me know a socket connection has been established     printf(""Socket established!\n"");     if (newsockfd &lt; 0)           error(""ERROR on accept"");     bzero(buffer,256);     //Don't want this socket to block and read, only to write      //Modified from the original author     //n = read(newsockfd,buffer,255);     //if (n &lt; 0) error(""ERROR reading from socket"");     //printf(""Here is the message: %s\n"",buffer);     //n = write(newsockfd,""Hello, socket!"",18);     const int SIZE_OF_STRING = 30;     char string[SIZE_OF_STRING];     int i = 0;     for (i = 0; i &lt; SIZE_OF_STRING; ++i)     {         string[i] = '\0';     }     //Ask input from the user until the word ""quit"" is seen     //then close the socket      while (!strstr(string, ""quit""))     {        printf(""Please enter something to send to the phone.\n"");        scanf(""%s"", string);        strcat(string, ""\n"");        n = write(newsockfd, string, sizeof(string));        if (n &lt; 0) error(""ERROR writing to socket"");     }     printf(""\n\nexiting..\n"");     close(newsockfd);     close(sockfd);     return 0; }</code></pre><p>And here is the Android code:</p><pre><code>public class SmartSawLineDrawSocketThread extends Thread {    private Handler smartSawMainThreadCommunicationHandle_;    private Socket smartSawSocketHandle_;    private InputStream smartSawSocketInputStreamHandle_;    private BufferedReader smartSawSocketInputBuffer_;    private InputStreamReader smartSawSocketInputStreamReader_;    private boolean threadRunning_ = false;    private boolean isConnected_;    private char buffer[] = new char[50];    //Grab the thread's communication handle for use with sending messages to the UI    //Thread    public SmartSawLineDrawSocketThread(Handler handle)    {        smartSawMainThreadCommunicationHandle_ = handle;        threadRunning_ = true;        isConnected_ = false;    }    //Attempt a connection to the host    public int SmartSawLineDrawSocketThreadConnect(String hostIP, String hostPort)    {        int rval = 0;        Log.i(""info"", ""hostIP = "" + hostIP);        Log.i(""info"", ""hostPort = "" + Integer.parseInt(hostPort.trim()));        try         {            smartSawSocketHandle_ = new Socket(hostIP.trim(), Integer.parseInt(hostPort.trim()));            if (rval == 0)            {                smartSawSocketInputBuffer_ = new BufferedReader(new InputStreamReader(smartSawSocketHandle_.getInputStream()));                smartSawSocketInputStreamReader_ = new InputStreamReader(smartSawSocketHandle_.getInputStream());                if (smartSawSocketInputBuffer_ != null)                {                    isConnected_ = true;                }                else                {                    Log.e(""error"", ""Input buffer pointer was null!"");                }            }        }         catch (UnknownHostException e)         {            rval = 1;            Log.i(""info"", ""unknown host message e when connecting:"" + e);            e.printStackTrace();            isConnected_ = false;        }        catch (IOException e)         {            rval = 2;            Log.i(""info"", ""unknown IOException e when connecting:"" + e);            e.printStackTrace();            isConnected_ = false;        }        catch (SecurityException e)        {            rval = 3;            Log.i(""info"", ""Need to set a security setting somewhere"");        }        Log.i(""info"", ""Rval returned with "" + rval);            return rval;    }    //Disconnect from the server    public void SmartSawLineDrawSocketThreadDisconnect()    {        try         {            smartSawSocketHandle_.close();            isConnected_ = false;        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    //Once the thread has started running, make sure we're connected, and start    //trying to listen for messages    @Override     public void run()    {        Log.i(""info"", ""Made it into the run() loop of the thread."");        while (threadRunning_)        {            if (isConnected_ == true)            {                try                {                    if (smartSawSocketInputStreamReader_.ready() == true)                    //(smartSawSocketInputBuffer_.ready() == true)                    {                        int numread = 0;                        numread = smartSawSocketInputStreamReader_.read(buffer);                        Log.i(""info"", ""amount of characters read in: "" + numread);                        Message mainThreadMessage_ = Message.obtain();                        Bundle mainThreadDataBundle_ = new Bundle();                        mainThreadDataBundle_.putString(""Zero"", new String(buffer)); //smartSawSocketInputBuffer_.readLine());                        mainThreadMessage_.setData(mainThreadDataBundle_);                        mainThreadMessage_.setTarget(smartSawMainThreadCommunicationHandle_);                        mainThreadMessage_.sendToTarget();                        Log.i(""info"", ""Received a string! Sent this to main thread: "" + mainThreadDataBundle_.getString(""Zero""));                    }                }                catch (IOException e)                {                    Log.i(""info"",""IO Exception in thread main loop, e was: "" + e);                }            }        }    } }</code></pre><p><strong>Homework and Tests:</strong>I can successfully transmit one string, but everything after that is unintelligible garbage in the PC-Android connection.  Wanting to do my homework first, I wanted to eliminate the server side code.  I took Beej's client side code (beej.us/guide/bgnet/examples/client.c) and modified it to just be a good listener.  I was able to transmit several strings to the client on a PC-PC based TCP connection.  I redirected the client's output to a file, and opened it under a hex editor.  Lo and behold, there was no erroneous data to be found.  I tested this with a laptop connected to an 802.11b/g router being the server, and with a hard wired desktop being the client.  I've eliminated hardware issues, and test code issues on the server side.  It MUST be somewhere in how I'm implementing the Android client side code.  I also tried the automated BufferedReader class to do my input, as well as manually handling the input with an InputStreamReader class.  Both receive the same garbage output after the first string.  This leads me to believe it's somewhere in the socket's input stream, but how would I fix that?  Does anybody have any suggestions?</p><p>Here is the code for the PC based client side test:</p><pre><code>/*** client.c -- a stream socket client demo*/#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;#include &lt;unistd.h&gt;#include &lt;errno.h&gt;#include &lt;string.h&gt;#include &lt;netdb.h&gt;#include &lt;sys/types.h&gt;#include &lt;netinet/in.h&gt;#include &lt;sys/socket.h&gt;#include &lt;arpa/inet.h&gt;#define PORT ""27015"" // the port client will be connecting to #define MAXDATASIZE 100 // max number of bytes we can get at once // get sockaddr, IPv4 or IPv6:void *get_in_addr(struct sockaddr *sa){    if (sa-&gt;sa_family == AF_INET) {        return &amp;(((struct sockaddr_in*)sa)-&gt;sin_addr);    }    return &amp;(((struct sockaddr_in6*)sa)-&gt;sin6_addr);}int main(int argc, char *argv[]){    int sockfd, numbytes;      char buf[MAXDATASIZE];    struct addrinfo hints, *servinfo, *p;    int rv;    char s[INET6_ADDRSTRLEN];    if (argc != 2) {        fprintf(stderr,""usage: client hostname\n"");        exit(1);    }    memset(&amp;hints, 0, sizeof hints);    hints.ai_family = AF_UNSPEC;    hints.ai_socktype = SOCK_STREAM;    if ((rv = getaddrinfo(argv[1], PORT, &amp;hints, &amp;servinfo)) != 0) {        fprintf(stderr, ""getaddrinfo: %s\n"", gai_strerror(rv));        return 1;    }    // loop through all the results and connect to the first we can    for(p = servinfo; p != NULL; p = p-&gt;ai_next) {        if ((sockfd = socket(p-&gt;ai_family, p-&gt;ai_socktype,                p-&gt;ai_protocol)) == -1) {            perror(""client: socket"");            continue;        }        if (connect(sockfd, p-&gt;ai_addr, p-&gt;ai_addrlen) == -1) {            close(sockfd);            perror(""client: connect"");            continue;        }        break;    }    if (p == NULL) {        fprintf(stderr, ""client: failed to connect\n"");        return 2;    }    inet_ntop(p-&gt;ai_family, get_in_addr((struct sockaddr *)p-&gt;ai_addr),            s, sizeof s);    printf(""client: connecting to %s\n"", s);    freeaddrinfo(servinfo); // all done with this structure    //Modified from the original to spit out all strings transmitted from the server, then close the socket    //when finished.    while (!strstr(buf, ""close""))    {        numbytes = recv(sockfd, buf, MAXDATASIZE-1, 0);        if (numbytes)        {            printf(""Received: \n"");            printf(""%s"", buf);            printf(""\n"");        }    }    if ((numbytes = recv(sockfd, buf, MAXDATASIZE-1, 0)) == -1) {        perror(""recv"");        exit(1);    }    buf[numbytes] = '\0';    printf(""client: received '%s'\n"",buf);    close(sockfd);    return 0;} </code></pre><p>Thanks for the help!Moscro</p>","537454","","","","","2010-12-11 20:14:28","Garbage data transmitted in WiFi TCP connection from desktop to Android","<java><android><c>","1","2","1","",""
"4418002","1","","","2010-12-11 17:35:22","0","591","<p>I'm trying to change ListPreference value on swipe in my main activity, but I can't find solution.</p><p>The code is:</p><pre><code>private class GestureListener extends SimpleOnGestureListener {    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)  {        if(e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                      // Right to left            Toast.makeText(getBaseContext(), ""Fling left"", Toast.LENGTH_SHORT).show();             final ListPreference lp= (ListPreference)findPreference(""camURL"");            lp.setValue(""http://193.198.###.###"");        }  else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {            // Left to right                        Toast.makeText(getBaseContext(), ""Fling right"", Toast.LENGTH_SHORT).show();                     final ListPreference lp= (ListPreference)findPreference(""camURL"");            lp.setValue(""http://193.198.###.###"");        }        return false;    }}</code></pre><p>I don't know why this isn't working.</p><p>Any idea is welcome! </p>","539026","","","","","2010-12-11 17:35:22","Android - How to change listPreference value on swipe","<android><swipe><listpreference><onfling>","0","3","","",""
"4418018","1","4418630","","2010-12-11 17:38:12","0","687","<p>I have a problem recieving notifications from LocationManager after a set period of time:</p><pre><code>    locationManager = (LocationManager)getSystemService(LOCATION_SERVICE);    if(useGPS) {        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 999999,                 999999, locationListener);</code></pre><p>In emulator my location listener's onLocationChanged method gets called whenever I send a fix via emulator control (i.e. every other second)So, the question is - is this because the way I'm testing on emulator, or LocationManager doesn't respect params? </p><p>Thanks</p>","94892","","","","","2011-03-23 14:26:09","Android: LocationManager.requestLocationUpdates doesn't respect params","<android><android-emulator><gps>","1","0","","",""
"4418052","1","4418602","","2010-12-11 17:44:54","0","2220","<p><BR>I am writing an Android application where I need to display Image Captured through Camera.I am using Android 2.1 I tested in emulator. I am trying to capture the image  , but how to display the captured Image on Screen.<br>My activity is as follows:</p><pre><code>public class ImageCaptureActivity extends Activity {                /** Called when the activity is first created. */                   @Override                    public void onCreate(Bundle savedInstanceState) {                    super.onCreate(savedInstanceState);                    setContentView(R.layout.main);                    Uri mImageCaptureUri = Uri.fromFile(new File(                            ""/sdcard/gift2.JPG""));                    Intent intent = new Intent(                            ""android.media.action.IMAGE_CAPTURE"");                    intent.putExtra(                            android.provider.MediaStore.EXTRA_OUTPUT,                            mImageCaptureUri);                    startActivityForResult(intent, 0);                }                protected void onActivityResult(int requestCode,                        int resultCode, Intent data) {                    if (requestCode == 0                            &amp;&amp; resultCode == Activity.RESULT_OK) {                        Toast.makeText(getBaseContext(), ""ImageCaptured"",                                Toast.LENGTH_LONG).show();                        Uri chosenImageUri = data.getData();                        Bitmap mBitmap = null;                        try {                            mBitmap = Media.getBitmap(                                    this.getContentResolver(),                                    chosenImageUri);                        } catch (FileNotFoundException e) {                            // TODO Auto-generated catch block                            e.printStackTrace();                        } catch (IOException e) {                            // TODO Auto-generated catch block                            e.printStackTrace();                        }                        ImageView img = new ImageView(this);                        img.setImageBitmap(mBitmap);                        setContentView(img);                    }                }</code></pre><p>When I execute this class . After capturing image  through camera and clicking  ""ok"" I am getting null pointer exception at  the statement ""Uri chosenImageUri = data.getData();"" <br>Can anyone help me in sorting out this issue.</p><p><br>Thanks in Advance.</p>","429501","","72746","","2011-08-15 10:29:37","2014-03-18 10:26:33","How to solve DATA null issue that occured when capturing image through camera","<android>","4","3","","",""
"4418115","1","","","2010-12-11 17:58:08","9","3367","<p>I'm using a WebView to display a web page which contains some Flash content which basically works pretty well.The big problem is, that the Flash content seems not to consider the WebView's boundings: The Flash content is displayed even if the WebView is too small to show the complete page and the Flash content is not inside the WebView's boundings. Moreover this Flash content overlays other (native) layout elements that are displayed next to the WebView.To me, it seems, that the Flash content is rendered in (special) z-Layer, that overlays all other layout elements.</p><p>Tested with: Android 2.2 and Flash 10.1.</p><p>Is this a known bug in Adobes Flash player 10.1?</p>","516472","","516472","","2010-12-11 18:13:17","2013-01-15 19:37:39","Android: Flash content breaks WebView boundings and overlaps native layout elements","<android><flash><webview>","4","0","4","",""
"4418189","1","","","2010-12-11 18:15:30","1","157","<p>I want to get the details repeatbly as long as the touchscreen is touched. I used onLongClick but it gets only a view without the event and it only occures once.Please help me to get this details.</p>","539060","","","","","2010-12-11 18:24:39","Intercepting data from a longClick event in Androied SDK","<android><events>","1","0","","",""
"4418217","1","5252073","","2010-12-11 18:23:18","1","2245","<p>Having an issue with CheckedTextView that I can't seem to find a solution. I'm not even entirely sure what's happening.</p><p>I have a custom ListView whose rows contain TextViews and a CheckedTextView. </p><p>row.xml</p><pre><code>&lt;CheckedTextView     android:layout_height=""wrap_content""    android:layout_width=""fill_parent""     android:id=""@+id/title""    android:text=""Name""     android:gravity=""center_vertical""    android:paddingRight=""6dip""    android:typeface=""sans""     android:checkMark=""?android:attr/textCheckMark""    android:textSize=""16sp""     android:textStyle=""bold""/&gt;</code></pre><p>MyAdapterView.java</p><pre><code>public class RuleAdapterView extends LinearLayout{       private CheckedTextView title;    ...    title = (CheckedTextView)v.findViewById(R.id.title);    title.setText(entry.getName());    title.setChecked(entry.isActive());    // setup a listener for the checkbox    title.setOnClickListener(new View.OnClickListener() {        public void onClick(View v)        {            ((CheckedTextView) v).toggle();        }    });}</code></pre><p>And in the main XML file I set the ListView to <code>android:choiceMode=""multipleChoice""</code>.</p><p>So what I want is for the ListView rows to be long and short clickable and for the CheckedTextView to be separate click execution. This works with the exception of the text part of the CheckedTextView. Whenever either the CheckedTextView is pressed, the text 'flickers'. I did it slowly to figure out exactly what was going on. When you press down on the CheckTextView, the white text either disappears or toggles black (possibly inverts?) and when you release, the text reappears and the checkmark toggles. There is no 'flicker' effect when the ListView is pressed. </p><p>Any ideas on what's going on here? </p><p>Thanks</p>","450780","","","","","2011-06-06 13:41:25","Android ListView CheckedTextView Blinking","<android><android-listview><checkedtextview>","2","2","","",""
"4418242","1","4467912","","2010-12-11 18:29:01","0","688","<p>How to resolve null pointer exception that occurred when I try to use <code>Intent.putExtra()</code> in calling camera activity.</p><pre><code>public class ImageCaptureActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);setContentView(R.layout.main);Uri mImageCaptureUri = Uri.fromFile(new File(""/sdcard/gift2.JPG""));Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE"");intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, mImageCaptureUri);startActivityForResult(intent, 0);}protected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (requestCode == 0 &amp;&amp; resultCode == Activity.RESULT_OK) {  &lt;br&gt;             Toast.makeText(getBaseContext(), ""ImageCaptured"",Toast.LENGTH_LONG).show();      Uri chosenImageUri = data.getData();     Bitmap mBitmap = null;     try {    mBitmap = Media.getBitmap(this.getContentResolver(),chosenImageUri);    } catch (FileNotFoundException e) {     // TODO Auto-generated catch block e.printStackTrace();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}     ImageView img = new ImageView(this);           img.setImageBitmap(mBitmap);    setContentView(img);   }   }   }   </code></pre><p>When I execute this class . After capturing image through camera and clicking ""ok"" I am getting null pointer exception at the statement </p><p><code>""Uri chosenImageUri = data.getData();</code>"" </p>","429501","","68805","","2011-12-12 06:35:45","2013-08-30 13:33:15","How to resolve null pointer exception during camera capture in Android","<android>","2","2","","",""
"4418243","1","4418251","","2010-12-11 18:29:03","0","221","<p>theres a guy in my job that connects to a socket thru C using structs of bytes. How can i do the same in Android/Java. I know i can add more info, but i think i need a few answers to develop more into the right point.</p><p>Thanks in advance</p>","2443607","","","","","2010-12-11 18:45:43","Sockets & Windows Service","<java><android><sockets><windows-services><byte>","1","0","","",""
"4418255","1","4419476","","2010-12-11 18:31:07","5","3372","<p>I want to drag n drop the text view on image in android 2.X</p><p>please , look at this image below.<img src=""http://i.stack.imgur.com/IXaQA.png"" alt=""alt text""></p><p>Here, ""Blue"" color represents the ViewGrop , ""White"" is ImageView and the image is set on the ImageView.the text written ""Fashion"" is a TextView.This is how i have implement the structure. Now i want to allow the user to select the TextView and drag it to any part of the image and then drop it over the image at desired position.</p><p>As of now for a reference i tried to refer the following url but whenever i use TextView instead of Button things are getting abnormal.</p><p><a href=""http://techdroid.kbeanie.com/2010/04/simple-drag-n-drop-on-android.html#comment-form"">link text</a></p><p>Can anyone give me the road map or example to get it done ?</p>","405383","","405383","","2010-12-11 20:08:20","2010-12-11 23:24:45","drag n drop textview in android","<android><drag-and-drop>","1","2","5","",""
"4418280","1","4528899","","2010-12-11 18:34:53","0","345","<p>i have this app that i developed and it works great on the simulator with no errors what so ever. but the moment i try to run the same on the phone for testing, the app crashes stating filenotfoundexception. it says the file /res/drawable/divider_horizontal.9.png is missing. but actually speaking, i have never referenced that file through my code. i believe its a system/os file that is unavailable. i have a custom list view, i guess its the divider there...could somebody please suggest what is wrong here. i believe this is a similar issue discussed here..but i am unable to make any sense out of it</p><p><a href=""http://code.google.com/p/transdroid/issues/detail?id=14"" rel=""nofollow"">http://code.google.com/p/transdroid/issues/detail?id=14</a></p><p>the listview.xml 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:layout_height=""wrap_content"" android:gravity=""left|center""    android:layout_width=""wrap_content"" android:paddingBottom=""5px""    android:paddingTop=""5px"" android:paddingLeft=""5px"" &gt;    &lt;ImageView android:id=""@+id/linkImage"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" android:layout_marginRight=""6dip""        android:src=""@drawable/icon"" /&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""0dip"" android:layout_weight=""1""        android:layout_height=""fill_parent""&gt;        &lt;TextView android:id=""@+id/firstLineView""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:gravity=""center"" android:textColor=""#FFFF00"" android:text=""first line title""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/secondLineView""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:text=""second line title"" android:layout_marginLeft=""10px"" android:gravity=""center""            android:textColor=""#0099CC""&gt;&lt;/TextView&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>the main xml file that calls the listview.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;LinearLayout android:orientation=""horizontal""            android:layout_width=""fill_parent"" android:layout_height=""40px""&gt;            &lt;Button android:id=""@+id/todayButton"" android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" android:text=""Today""                android:textSize=""12sp"" android:gravity=""center""                android:layout_weight=""1"" /&gt;            &lt;Button android:id=""@+id/tomorrowButton"" android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" android:text=""Tomorrow""                android:textSize=""12sp"" android:layout_weight=""1"" /&gt;            &lt;Button android:id=""@+id/WeekButton"" android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" android:text=""Future""                android:textSize=""12sp"" android:layout_weight=""1"" /&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout android:id=""@+id/listLayout""            android:orientation=""vertical"" android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;            &lt;ListView android:id=""@+id/ListView01"" android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" /&gt;            &lt;TextView android:id=""@id/android:empty""                android:layout_width=""fill_parent"" android:layout_height=""fill_parent""                android:text=""No Results"" /&gt;        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;&lt;/FrameLayout&gt;</code></pre><p>and the code for the same is </p><pre><code> private class EfficientAdapter extends BaseAdapter{        private LayoutInflater mInflater;        private String eventTitleArray[];private String eventDateArray[];    private String eventImageLinkArray[];    public EfficientAdapter(Context context,String[] eventTitleArray,String[] eventDateArray, String[] eventImageLinkArray){        mInflater = LayoutInflater.from(context);        this.eventDateArray=eventDateArray;        this.eventTitleArray=eventTitleArray;        this.eventImageLinkArray =eventImageLinkArray;    }    public int getCount(){        //return XmlParser.todayEvents.size()-1;        return this.eventDateArray.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){            convertView = mInflater.inflate(R.layout.listview,null);        holder = new ViewHolder();        holder.firstLine = (TextView) convertView.findViewById(R.id.firstLineView);        holder.secondLine = (TextView) convertView.findViewById(R.id.secondLineView);        holder.imageView = (ImageView) convertView.findViewById(R.id.linkImage);        //holder.checkbox = (CheckBox) convertView.findViewById(R.id.star);        holder.firstLine.setFocusable(false);        holder.secondLine.setFocusable(false);        holder.imageView.setFocusable(false);        //holder.checkbox.setFocusable(false);        convertView.setTag(holder);    }else{        holder = (ViewHolder) convertView.getTag();    }    Log.i(tag, ""Creating the list"");    holder.firstLine.setText(this.eventTitleArray[position]);    holder.secondLine.setText(this.eventDateArray[position]);    Bitmap bitmap;    try {        bitmap = BitmapFactory.decodeStream((InputStream)new URL(""http://edu/images/heinz7.jpg"").getContent());    } catch (MalformedURLException e1) {        // TODO Auto-generated catch block        e1.printStackTrace();    } catch (Exception e1) {        // TODO Auto-generated catch block        bitmap = BitmapFactory.decodeFile(""assets/heinz7.jpg"");//decodeFile(getResources().getAssets().open(""icon.png""));        e1.printStackTrace();    }    try {        try{            bitmap = BitmapFactory.decodeStream((InputStream)new URL(this.eventImageLinkArray[position]).getContent());}        catch(Exception e){            bitmap = BitmapFactory.decodeStream((InputStream)new URL(""http://eventur.sis.pitt.edu/images/heinz7.jpg"").getContent());        }        int width = 0;        int height =0;        int newWidth = 50;        int newHeight = 40;        try{            width = bitmap.getWidth();            height = bitmap.getHeight();        }        catch(Exception e){            width = 50;            height = 40;        }        float scaleWidth = ((float)newWidth)/width;        float scaleHeight = ((float)newHeight)/height;        Matrix mat = new Matrix();        mat.postScale(scaleWidth, scaleHeight);        try{            Bitmap newBitmap = Bitmap.createBitmap(bitmap,0,0,width,height,mat,true);            BitmapDrawable bmd = new BitmapDrawable(newBitmap);            holder.imageView.setImageDrawable(bmd);            holder.imageView.setScaleType(ScaleType.CENTER);        }        catch(Exception e){        }    } catch (MalformedURLException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    return convertView;}class ViewHolder{    TextView firstLine;    TextView secondLine;    ImageView imageView;    //CheckBox checkbox;}</code></pre><p>The stack trace</p><pre><code>12-12 22:55:25.022: ERROR/AndroidRuntime(11069): Uncaught handler: thread main exiting due to uncaught exception12-12 22:55:25.212: ERROR/AndroidRuntime(11069): android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.LayoutInflater.createView(LayoutInflater.java:512)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at com.eventur.MainActivity$EfficientAdapter.getView(MainActivity.java:566)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.AbsListView.obtainView(AbsListView.java:1274)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.ListView.makeAndAddView(ListView.java:1661)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.ListView.fillDown(ListView.java:610)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.ListView.fillFromTop(ListView.java:673)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.ListView.layoutChildren(ListView.java:1519)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.View.layout(View.java:6156)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.View.layout(View.java:6156)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.View.layout(View.java:6156)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.View.layout(View.java:6156)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.View.layout(View.java:6156)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.View.layout(View.java:6156)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.View.layout(View.java:6156)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.ViewRoot.performTraversals(ViewRoot.java:950)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1529)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.os.Handler.dispatchMessage(Handler.java:99)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.os.Looper.loop(Looper.java:123)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.app.ActivityThread.main(ActivityThread.java:3977)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at java.lang.reflect.Method.invokeNative(Native Method)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at java.lang.reflect.Method.invoke(Method.java:521)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at dalvik.system.NativeStart.main(Native Method)12-12 22:55:25.212: ERROR/AndroidRuntime(11069): Caused by: java.lang.reflect.InvocationTargetException12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.ImageView.&lt;init&gt;(ImageView.java:128)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at java.lang.reflect.Constructor.constructNative(Native Method)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.view.LayoutInflater.createView(LayoutInflater.java:499)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     ... 42 more12-12 22:55:25.212: ERROR/AndroidRuntime(11069): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/divider_horizontal_dark.9.png from drawable resource ID #0x7f02000112-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.content.res.Resources.loadDrawable(Resources.java:1643)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.content.res.TypedArray.getDrawable(TypedArray.java:548)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.widget.ImageView.&lt;init&gt;(ImageView.java:138)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     ... 46 more12-12 22:55:25.212: ERROR/AndroidRuntime(11069): Caused by: java.io.FileNotFoundException: res/drawable/divider_horizontal_dark.9.png12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.content.res.AssetManager.openNonAssetNative(Native Method)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.content.res.AssetManager.openNonAsset(AssetManager.java:417)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     at android.content.res.Resources.loadDrawable(Resources.java:1636)12-12 22:55:25.212: ERROR/AndroidRuntime(11069):     ... 48 more</code></pre>","377337","","377337","","2011-01-21 13:53:05","2011-01-21 13:53:05","android app running on phone issue","<android><listview>","1","4","","",""
"4418297","1","4419026","","2010-12-11 18:39:14","1","774","<p>I am writing an Android app. One of the activities is a ListActivity, so when the person selects an item in the list I would like the text value of that item to be stored in the Intent/Bundle so that the next activity knows that value. My code looks something like this:</p><pre><code>lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView parent, View view,            int position, long id) {            Intent intent = new Intent(view.getContext(), FavoriteEditFromDest.class);            intent.putExtra(""com.example.myapp.Name"", ((TextView) view).getText());            startActivity(intent);        }      });    }</code></pre><p>The onCreate method for the activity that is to be started looks like this:</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.favorite_dest_edit);            // nameB is a global string variable defined above.        nameB = savedInstanceState.getString(""com.example.myapp.Name"");    }</code></pre><p>When I click an item from the list in the ListActivity, it begins to execute the onCreate code, but when it gets to the line that tries to retrieve the string value I get a force close dialog.</p><p>I don't have much experience passing information with a Bundle, so I would appreciate any and all help!</p>","535590","","","","","2010-12-11 23:57:55","Why does my Android activity force close when I try to access info I put in the bundle?","<java><android><android-intent><bundle>","3","0","","",""
"4418344","1","4481665","","2010-12-11 18:50:36","5","3104","<p>My app uses LocationListener to keep track of the current location. So long as the GPS Provider is providing regular fixes this works well. However, I want my app to alert the user if the location is no longer reliable because the fix is no longer current. I have therefore used a timeCheckHandler to call getLastKnownLocation every few seconds.</p><p>My problem is that even when accurate fixes are being received frequently the time returned by applying getTime() to the location returned by getLastKnownLocation is generally older than the current time returned by System.currentTimeMillis(), often by about 20 seconds.</p><p>I have investigated the problem further by adding code to onLocationChanged(arg0) to log the time of the fix (arg0.getTime()) and the current time (System.currentTimeMillis()). Again I see a difference of about 20 seconds.</p><p>The code currently reads as follows:</p><pre><code>    public void onLocationChanged(Location arg0) {    mapview.handleLocationChanged(mapview, arg0.getLatitude(), arg0.getLongitude(), arg0.getBearing(), arg0.getAccuracy(), ""GPS fix"");    addDebugNote(""Fix received at time: ""+Long.toString(arg0.getTime()/1000)+"" Now: ""+Long.toString((System.currentTimeMillis())/1000));}</code></pre><p>and typical output to my Debug file reads:</p><pre><code>Fix received at time: 1292091908 Now: 1292091928</code></pre><p>Why should I be seeing this difference between the fix time and the current system time?</p><p>Do I have to accept that a difference of around 20 seconds is normal?</p>","250845","","","","","2010-12-19 04:57:55","Android problem finding out how recent latest GPS fix is","<android><time><gps><gps-time>","2","0","0","",""
"4418351","1","","","2010-12-11 18:52:53","4","3195","<p>I'm trying to move between one Activity to another based upon some user input.</p><p>I'm trying to use:</p><pre><code>String myClass = ""some_user_input.class""Intent myIntent = new Intent(getApplicationContext(), myClass);startActivity(myIntent);</code></pre><p>...to move from one activity to another.</p><p>I can do this ok where I reference my new activity directly in the hard code and don't try to compile it from text, (i.e. classA.class), however I want to be able to build my Intent by passing it some string compiled by the user.</p><p>For example if the user inputs B in an edittext, I want to go to <code>classB.class</code>If the user inputs Z, I want to go to <code>classZ.class</code>.</p><p>Is there any way I can compile the class I want to go to using strings which I then convert to a class?</p><p>Thanks in advance!</p>","539074","","1288","","2011-05-14 14:10:24","2011-05-14 14:17:04","converting a string to a class","<java><android><string><class>","1","2","3","",""
"4418354","1","4418662","","2010-12-11 18:54:38","0","151","<p>Let's say a BroadcastReceiver is declared in the manifest. It has run through onReceive() once and is the only component in the hosting process. What if another Intent is broadcast, is a new process spawn every time, or would the old one be reused if it hasn't been killed?</p><p>In other words: Is the onReceive()-method only run through ONCE for each receiver object?</p>","474326","","","","","2010-12-11 19:59:19","Can inactive Broadcast Receivers be reused?","<android><process><broadcastreceiver><spawn>","1","0","","",""
"4418365","1","","","2010-12-11 18:57:16","0","511","<p>I have a app I'm making with an AsyncTask. The result of the task needs to be assigned to a variable in the base app class. I currently have:</p><pre><code>    protected void onPostExecute(int[][]... end) {        MainVar=end[0];    }</code></pre><p>but this doesn't transfer the data. I'm guessing I'm going about this wrong, but I wasn't sure how to do it reading the docs, so how should this be done?</p>","266578","","","","","2011-04-19 07:45:22","android async task","<android>","1","2","","",""
"4418463","1","4418563","","2010-12-11 19:17:24","0","97","<p>Ive tried deleting the project and importing it again, cleaning it up but it still says there's an error.</p><p>Its an android project and the little red ""X"" is on the highest directory and non of the sub directories.</p>","531928","","","","","2010-12-11 19:38:39","Eclipse keeps saying theres an error","<android><eclipse><eclipse-plugin>","1","3","","",""
"4418496","1","5729423","","2010-12-11 19:26:16","0","696","<p>I am new to android development and I was confused in how to implement a simple color around touch area when using a dialog. I tried using the TouchPaint.java sample from Android.com/references but could not get the methods to work Dialog.</p><p>Please help me with links or code snippets. I wanna color the area around a touch in a Dialog screen and make it redraw itself in the next touch event.</p>","539101","","","","","2011-04-20 11:25:11","Android Java color touch area on touch event in Dialog","<java><android><android-widget><touch>","1","0","1","",""
"4418530","1","4419657","","2010-12-11 19:33:00","5","1132","<p>Is there any definition that states which standard class libraries are supported on Android?</p><p>Let's assume we build a jar library and compile it using JavaSE.This library will maybe used by a JavaSE server application and/or on a JSP Server.</p><p>Are there any means to know beforehand if Androids dex will be able to compile this Library into Dalvik bytecode?Other means than Trial&amp;Error i mean :).</p>","360592","","360592","","2010-12-11 22:13:31","2010-12-11 23:45:51","How compatible is the Java implementation of Android exactly?","<java><android>","2","0","2","",""
"4418555","1","5123174","","2010-12-11 19:36:44","7","4267","<p>Can't seem to find the following information although I'm pretty sure this should be possible:I'm running an Android emulator on a machine A. I'm developing on another machine B in which I'm using Eclipse. </p><p>Now when I switch to the DDMS perspective in Eclipse, I want the emulator from machine A to show up in the devices tab. </p><p>The reason is, that the emulator is quite slow and it looks like running development and emulator on different machines might be a solution.</p><p>Since the emulator runs on a specific port, I'm pretty sure I just need to figure out how to tell eclipse where to look for emulators.</p><p>Thanks for any tips</p>","117243","","117243","","2012-11-04 17:13:27","2013-09-04 22:52:35","Connect Eclipse to Android emulator on a different machine","<android><eclipse><networking>","6","0","2","",""
"4418700","1","","","2010-12-11 20:10:44","3","3232","<p>I want to create a custom view <code>TestView</code> class for which I can create object via <code>new TestView()</code>.A new view class however needs a AttributeSet object. From where do I get that AttributeSet and what does it have to include?</p>","25282","","","","","2010-12-20 08:51:47","Creating custom view","<android><android-ui>","2","0","4","",""
"4418704","1","4419551","","2010-12-11 20:12:34","0","1002","<p>I am creating a preference menu and would like to launch a browser (with a specific url) when a particular preference is clicked on. I know this can be done, but I cant seem to get it to work right now.</p><p>Any ideas?</p><p>Thanks</p>######SOLUTION<p>So after my brain fart disappeared, this is what i did:</p><pre><code>getPreferenceManager()   .findPreference(""my_preference_key"")   .setOnPreferenceClickListener(      new Preferences.OnPreferenceClickListener() {    @Override    public boolean onPreferenceClick(Preference preference) {        Intent intent = new Intent(Intent.ACTION_VIEW);        intent.setData(Uri.parse(""http://some_url_here""));        startActivity(intent);        return true;    }});</code></pre>","354607","","354607","","2010-12-11 20:28:03","2010-12-11 23:26:47","How to launch browser when a preference is selected","<android><preferences>","2","0","1","",""
"4418730","1","4419056","","2010-12-11 20:18:47","3","631","<p>I have an application that tries to be a good samaritan, basically when any services starts that needs to interact with the network.  I am checking to see if the device has connectivity:</p><p><strong>hasConnectivity Method</strong></p><pre><code>private boolean hasConnectivity() {    NetworkInfo info = mConnectivity.getActiveNetworkInfo();    boolean connected = false;    int netType = -1;     int netSubtype = -1;     if (info == null) {        Log.w(sTag, ""network info is null"");        notifyUser(MyIntent.ACTION_VIEW_ALL, ""There is no network connectivity."", false);    } else if (!mConnectivity.getBackgroundDataSetting()) {        Log.w(sTag, ""background data setting is not enabled"");        notifyUser(MyIntent.ACTION_VIEW_ALL, ""background data setting is disabled"", false);    } else {        netType = info.getType();        netSubtype = info.getSubtype();        if (netType == ConnectivityManager.TYPE_WIFI) {            connected = info.isConnected();        } else if (netType == ConnectivityManager.TYPE_MOBILE                   &amp;&amp; netSubtype == TelephonyManager.NETWORK_TYPE_UMTS                   &amp;&amp; !mTelephonyManager.isNetworkRoaming()                  ) {             connected = info.isConnected();        } else if (info.isRoaming()) {            notifyUser(MyIntent.ACTION_VIEW_ALL, ""Currently Roaming skipping check."", false);        } else if (info.isAvailable()) {            connected = info.isConnected();        } else {            notifyUser(MyIntent.ACTION_VIEW_ALL, ""..There is no network connectivity."", false);        }       }       return connected;} </code></pre><p>When this method returns false I know that I don't have a connection because the user is on the phone or 3g and wifi is not available</p><p>What is the best way to know when Connectivity is available with out pulling the network stats with a timer periodically?</p><p>Is there an Intent action that I can observe with a broadcast receiver that will announce a change with connectivity?</p><p>Thanks for any help, I will keep searching the docs for some clue on what to do next.</p>","505865","","","","","2010-12-11 21:30:20","Know when network connectivity returns","<android>","1","0","1","",""
"4418764","1","","","2010-12-11 20:24:40","2","5183","<p>I'm writing an Android video game that supports multiplayer. There is a dedicated server running which the androids connect to when the multiplayer button is clicked by opening a socket(this works fine). The server basically just acts as a matchmaking system. </p><p>When a client hosts a game, the server adds that client to the list of hosts. Other clients may choose to view this list and then subsequently connect to that host. This is where the problem is. The server is supposed to keep track of the ip/port of hosts, and then other clients are supposed to use this information to open a socket with the host and then the game starts. I'm trying to get the host to send its own IP address to server for other clients to use later. </p><p>I have tried many methods so far. One is: </p><pre><code>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()) {                    return inetAddress.getHostAddress().toString();                }            }        }    } catch (SocketException ex) {    }</code></pre><p>This returns 10.0.2.15, which is obviously useless for other clients.</p><p>The other method I've tried is this: </p><pre><code>String hostName = InetAddress.getLocalHost().getHostName();        InetAddress addrs[] = InetAddress.getAllByName(hostName);        for (InetAddress addr: addrs) {            System.out.println (""addr.getHostAddress() = "" + addr.getHostAddress());            System.out.println (""addr.getHostName() = "" + addr.getHostName());            System.out.println (""addr.isAnyLocalAddress() = "" + addr.isAnyLocalAddress());            System.out.println (""addr.isLinkLocalAddress() = "" + addr.isLinkLocalAddress());            System.out.println (""addr.isLoopbackAddress() = "" + addr.isLoopbackAddress());            System.out.println (""addr.isMulticastAddress() = "" + addr.isMulticastAddress());            System.out.println (""addr.isSiteLocalAddress() = "" + addr.isSiteLocalAddress());            System.out.println ("""");            if (!addr.isLoopbackAddress()){// &amp;&amp; addr.isSiteLocalAddress()) {                myIP = addr.getHostAddress();            }</code></pre><p>This returns the ip address that I'm looking for when I run it as a java application, but when I run it as an android application, it doesn't work. The last if condition is somehow not satisfied and myIP ends up being null. Note that I have included the permissions: android.permission.INTERNET, android.permission.ACCESS_WIFI_STATE, android.permission.ACCESS_COARSE_LOCATION, android.permission.ACCESS_NETWORK_STATE. </p><p>Can anybody help me?</p>","539131","","1059446","","2012-11-20 20:39:42","2012-11-20 20:39:42","Android IP address with java","<java><android><networking>","3","1","2","",""
"4418808","1","","","2010-12-11 20:32:05","4","2909","<p>I keep wanting to use VitualBox for Mobile App Development, but I can't seem to get the emulator to run fast enough inside the already-emulated 32-bit machine.</p><p>Is there any way around this?</p><p>Now while it doesn't seem to me like there is an answer to this question, I figured I'd ask it anyway.</p><p>P.S. I have a 64-bit machine.</p>","18149","","","","","2011-02-16 17:53:37","Using VirtualBox for Mobile App Development?","<android><mobile><android-emulator><virtualbox>","2","5","1","",""
"4418822","1","","","2010-12-11 20:36:04","-2","120","<p>I am new to programming.I'm creating a simple app which will handle my Button click event.I have added the button using xml and linked it to the program, but the app force closes immediately after I run it.</p><p>Here is the code:</p><pre><code>public class Sparkling extends Activity implements OnClickListener {    Button b;    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        b=(Button)findViewById(R.id.Button1);        b.setOnClickListener(this);    }    @Override    public void onClick(View v)     {        //actions....    }}</code></pre>","539138","","964135","","2011-12-12 23:55:34","2011-12-12 23:55:34","Force Close when i run this application","<android>","2","1","","",""
"4418836","1","","","2010-12-11 20:39:40","1","719","<p>I am new to android. I would like to ask you some question.</p><p>When I calling new activity from main activity by commands</p><pre><code>Intent myIntent = new Intent(v.getContext(), PolarView.class);//startActivityForResult(myIntent, 0);startActivityForResult(myIntent, 0);finish();</code></pre><p>then in new activity I can't do any actions, e.g. such as button click</p><p>Both</p><pre><code>Button btnSeven = (Button) this.findViewById(R.id.btn7);    btnSeven.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            InputStr = InputStr + ""7"";        InputViewField.setText(InputStr);        }    });}</code></pre><p>and</p><pre><code>public void btn7_click(View v) {        InputStr = InputStr + ""7"";        InputViewField.setText(InputStr);}</code></pre><p>having defined android:onClick=""btn7_click"" in activity`s layoutwhere InputViewField is EditText object</p><p>In the first case new activity does not start, in the second case when I press this button, aplication crashes.</p><p>could you please help me?</p><p>Here is some last peace of logcat after change </p><pre><code>StartActivityForResult()</code></pre><p>to</p><pre><code>StartActivity()</code></pre><p>Logcat:</p><pre><code>D/MediaScanner(  153): opendir /system/media/ failed, errno: 2D/MediaScanner(  153):  prescan time: 25225msD/MediaScanner(  153):     scan time: 162msD/MediaScanner(  153): postscan time: 48msD/dalvikvm(  109): GC freed 1920 objects / 95640 bytes in 160msD/MediaScanner(  153):    total time: 25435msD/MediaScannerService(  153): done scanning volume internalD/MediaScannerService(  153): start scanning volume externalD/dalvikvm(   52): GREF has increased to 301I/ActivityManager(   52): Starting activity: Intent { cmp=complex.ComplexCalc/.PolarView }I/ActivityManager(   52): Displayed activity complex.ComplexCalc/.PolarView: 1414 ms (total 1414 ms)V/MediaScanner(  153): pruneDeadThumbnailFiles... android.database.sqlite.SQLiteCursor@43bc30b8V/MediaScanner(  153): /pruneDeadThumbnailFiles... android.database.sqlite.SQLiteCursor@43bc30b8D/MediaScanner(  153):  prescan time: 1509msD/MediaScanner(  153):     scan time: 405msD/MediaScanner(  153): postscan time: 323msD/MediaScanner(  153):    total time: 2237msD/MediaScannerService(  153): done scanning volume externalD/AndroidRuntime(  223): Shutting down VMW/dalvikvm(  223): threadid=3: thread exiting with uncaught exception (group=0x4001b188)E/AndroidRuntime(  223): Uncaught handler: thread main exiting due to uncaught exceptionD/dalvikvm(  223): GC freed 3456 objects / 221888 bytes in 153msE/AndroidRuntime(  223): java.lang.IllegalStateException: Could not execute method of the activityE/AndroidRuntime(  223):    at android.view.View$1.onClick(View.java:2031)E/AndroidRuntime(  223):    at android.view.View.performClick(View.java:2364)E/AndroidRuntime(  223):    at android.view.View.onTouchEvent(View.java:4179)E/AndroidRuntime(  223):    at android.widget.TextView.onTouchEvent(TextView.java:6541)E/AndroidRuntime(  223):    at android.view.View.dispatchTouchEvent(View.java:3709)E/AndroidRuntime(  223):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(  223):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(  223):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(  223):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(  223):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(  223):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(  223):    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)E/AndroidRuntime(  223):    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)E/AndroidRuntime(  223):    at android.app.Activity.dispatchTouchEvent(Activity.java:2061)E/AndroidRuntime(  223):    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)E/AndroidRuntime(  223):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)E/AndroidRuntime(  223):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  223):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  223):    at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime(  223):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  223):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  223):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(  223):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(  223):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  223): Caused by: java.lang.reflect.InvocationTargetExceptionE/AndroidRuntime(  223):    at complex.ComplexCalc.PolarView.btn7_click(PolarView.java:266)E/AndroidRuntime(  223):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  223):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  223):    at android.view.View$1.onClick(View.java:2026)E/AndroidRuntime(  223):    ... 23 moreE/AndroidRuntime(  223): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime(  223):    ... 27 moreI/Process (   52): Sending signal. PID: 223 SIG: 3I/dalvikvm(  223): threadid=7: reacting to signal 3I/dalvikvm(  223): Wrote stack trace to '/data/anr/traces.txt'I/ARMAssembler(   52): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x46eae8:0x46eba4] in 1562593 nsI/ARMAssembler(   52): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x46eba8:0x46ed70] in 1903198 nsI/Process (  223): Sending signal. PID: 223 SIG: 9I/ActivityManager(   52): Process complex.ComplexCalc (pid 223) has died.I/WindowManager(   52): WIN DEATH: Window{43cc3920 complex.ComplexCalc/complex.ComplexCalc.PolarView paused=false}E/gralloc (   52): [unregister] handle 0x481778 still locked (state=40000001)I/UsageStats(   52): Unexpected resume of com.android.launcher while already resumed in complex.ComplexCalcW/InputManagerService(   52): Got RemoteException sending setActive(false) notification to pid 223 uid 10024</code></pre>","539086","","845334","","2013-09-11 10:16:38","2013-09-11 10:16:38","I can`t do any action on new activity","<android>","1","5","","",""
"4418845","1","4418862","","2010-12-11 20:41:37","0","651","<p>I received an email from Google Android Market Support stating :-</p><blockquote>  <p>Market will support filtering based on screen sizes and densities, as well as on GL texture compression formats. Filtering is based on <code>&lt;compatible-screens&gt;</code> and <code>&lt;uses-gl-texture&gt;</code> elements in an app’s manifest.</p></blockquote><p>However I don't see <code>&lt;compatible-screens&gt;</code> or <code>&lt;uses-gl-texture&gt;</code> in the documentation.  Are these new features, or is it a typo for <code>&lt;supports-screens&gt;</code> and <code>&lt;uses-feature android:glEsVersion=""..."" /&gt;</code>?</p>","164234","","","","","2010-12-11 20:45:06","What is <compatible-screens> and <uses-gl-texture> in Android Market filtering?","<android><google-play>","1","0","","",""
"4418915","1","4419065","","2010-12-11 20:58:27","1","72","<p>i have 2 android projects in eclipse, one is the main application, the other one is a widget for the home screen. I'd like to open the main application when the user clicks the widget. However, when i create an Intent with an Activity from the main application, i get a ""NoClassDefFoundError"" during runtime. </p><p>The Widget compiles fine, as i've added the main application to the build path. Does anyone konw how i can compile an android widget so i can reference classes of the main app?</p><p>thanks!</p>","539144","","","","","2010-12-11 21:32:00","Compile Android appwidget","<java><android><eclipse>","1","0","1","",""
"4418937","1","4419150","","2010-12-11 21:04:33","1","2296","<p>I want to put some shortcuts or buttons at bottom of every screen/activity. I understand we can do that by using framelayout/ relativelayout, tab widget etc. </p><p>Since, I need it for every activity, do I need to write XML layout for every activity and the button actions again &amp; again? Is it possible to refer a layout and actions on button click etc so that same code redundancy?</p>","481314","","244296","","2010-12-11 21:16:06","2010-12-11 21:51:15","Common buttons or tabs at bottom for every activity","<android><layout><tabs>","1","2","4","",""
"4419169","1","4744203","","2010-12-11 21:56:12","0","574","<p>I have a list. When you click on element, it becomes selected, and should be expanded vertically to displat some more data.</p><p>I am trying to accomplish this by adding to each element's layout ""Details"" view which is hidden by dafault and is set to VISIBLE onClick.</p><p>The only problem that the height of element isn't changed. If I try to it like this:</p><pre><code>                    holder.line_view                        .setLayoutParams(new LinearLayout.LayoutParams(                                LayoutParams.FILL_PARENT, dip(                                        convertView.getContext(), 30)));</code></pre><p>then I get unknown exception.Just </p><pre><code>holder.details_pane.setVisibility(View.VISIBLE);</code></pre><p>doesn't work, the size isn't changed.</p><p><strong>Please advise.</strong></p><hr><p>Layout:</p><pre><code>&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""vertical""android:id=""@+id/line_view""&gt;&lt;TextView    android:id=""@+id/desc""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""Description"" /&gt;&lt;TextView    android:text=""LALALA""    android:id=""@+id/detailed_desc""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt;</code></pre><p></p><p>In adapter I try:</p><pre><code> @Override            public View getView(int position, View convertView, ViewGroup parent) {...switch (getItemViewType(position)) {case TYPE_ITEM_EXPANDED:                    holder.details_pane.setVisibility(View.VISIBLE);...case TYPE_ITEM_NORMAL:                    holder.details_pane.setVisibility(View.GONE);                }</code></pre>","240736","","750613","","2012-07-12 07:13:39","2012-07-12 07:13:39","Dynamically update list element hieght in ListView","<android><listview><android-layout>","2","0","1","",""
"4419185","1","4419669","","2010-12-11 21:59:40","0","3724","<p>In my app I have a broadcast receiver that turns on GPS upon receiving a set string of text. In the onLocationChanged method, I want to pass the GPS data and a value from my shared preferences to a thread in a string.<br>I have the thread writing to log and can see all the GPS values in the string but the last value from my shared preferences is just showing up as 'prefPhoneNum' which I initialised the string to at the beginning of the receiver class. I have the same code to read the prefPhoneNum from shared preferences in the main class and it works there, can anyone see what I might be doing wrong?</p><pre><code>public class SmsReceiver extends BroadcastReceiver implements LocationListener{     LocationManager lm;     LocationListener loc;     public SharedPreferences sharedpreferences;         public static final String US = ""usersettings"";     public String prefPhoneNum = ""prefPhoneNum"";    @Override    public void onReceive(Context context, Intent intent)     {            sharedpreferences = context.getSharedPreferences(US, Context.MODE_PRIVATE);        prefPhoneNum = sharedpreferences.getString(""prefPhoneNum"" , """");        lm = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);        loc = new SmsReceiver();        //---get the SMS message passed in---        Bundle bundle = intent.getExtras();           SmsMessage[] msgs = null;        String str = """";         if (bundle != null)        {            //---retrieve the SMS message received---            Object[] pdus = (Object[]) bundle.get(""pdus"");            msgs = new SmsMessage[pdus.length];                        for (int i=0; i&lt;msgs.length; i++)            {                msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                str += msgs[i].getMessageBody().toString() + ""\n"";                    }              Toast.makeText(context, str, Toast.LENGTH_SHORT).show();     //Display SMS            if ((msgs[0].getMessageBody().toString().equals(""Enable"")) ||                    (msgs[0].getMessageBody().toString().equals(""enable"")))            {                             enableGPS();            }                else {  /* Do Nothing*/ }        }                  }    public void enableGPS() {        //new CountDownTimer(10000, 1000) {       //10 seconds        new CountDownTimer(300000, 1000) {      //300 secs = 5 mins            public void onTick(long millisUntilFinished)             {               lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, loc);              }            public void onFinish()             {                                  lm.removeUpdates(loc);                   }       }.start();              }        @Override    public void onLocationChanged(Location location) {      String s = """";         s += location.getLatitude()  + ""\n"";         s += location.getLongitude() + ""\n"";         s += location.getAltitude()  + ""\n"";         s += location.getAccuracy()  + ""\n"" + prefPhoneNum;         Thread cThread = new Thread(new SocketsClient(s));         cThread.start();   }    @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>Here is the logcat for when the application shuts -   </p><pre><code>D/LocationManager( 3912): requestLocationUpdates: provider = gps, listener = accel.working.TrackGPS@4628bce0  D/GpsLocationProvider(   96): setMinTime 0  D/GpsLocationProvider(   96): startNavigating  D/GpsLocationProvider(   96): TTFF: 3227  D/AndroidRuntime( 3912): Shutting down VM  W/dalvikvm( 3912): threadid=1: thread exiting with uncaught exception (group=0x400259f8)  E/AndroidRuntime( 3912): FATAL EXCEPTION: main  E/AndroidRuntime( 3912): java.lang.NullPointerException  E/AndroidRuntime( 3912):    at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:146)  E/AndroidRuntime( 3912):    at accel.working.TrackGPS.onLocationChanged(TrackGPS.java:63)  E/AndroidRuntime( 3912):    at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:191)  E/AndroidRuntime( 3912):    at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:124)  E/AndroidRuntime( 3912):    at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:140)  E/AndroidRuntime( 3912):    at android.os.Handler.dispatchMessage(Handler.java:99)  E/AndroidRuntime( 3912):    at android.os.Looper.loop(Looper.java:144)  E/AndroidRuntime( 3912):    at android.app.ActivityThread.main(ActivityThread.java:4937)  E/AndroidRuntime( 3912):    at java.lang.reflect.Method.invokeNative(Native Method)  E/AndroidRuntime( 3912):    at java.lang.reflect.Method.invoke(Method.java:521)  E/AndroidRuntime( 3912):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)  E/AndroidRuntime( 3912):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)  E/AndroidRuntime( 3912):    at dalvik.system.NativeStart.main(Native Method)  </code></pre>","506929","","375874","","2010-12-29 06:51:00","2010-12-29 06:51:00","BroadcastReceiver not reading stored value from SharedPreferences","<android><broadcastreceiver><sharedpreferences>","1","0","1","",""
"4419264","1","","","2010-12-11 22:14:32","3","4535","<p>I have created a simple Spinner binding it to a SimpleCursorAdapter.  I'm populating the SimpleCursorAdapter with a list of towns from a content provider.</p><p>When I go to save the users selection I'm planning on saving the row id that is being populated into my <code>SimpleCursorAdapter.</code></p><p>I'm using the following code to get the ID.</p><pre><code>townSpinner.getSelectedItemId();</code></pre><p>What I can not figure out is how best to set the selection when I pull back up the saved item.</p><p>The following code works but it only sets selection by position number.</p><pre><code>townSpinner.setSelection(2);</code></pre><p>Should I just create a loop to determine the correct position value based on Id?</p><pre><code>long cityId = Long.parseLong(cursor.getString(CityQuery.CITY_ID));             for (int i = 0; i &lt; citySpinner.getCount(); i++) {                            long itemIdAtPosition2 = citySpinner.getItemIdAtPosition(i);              if (itemIdAtPosition2 == cityId) {               citySpinner.setSelection(i);               break;        }}</code></pre><p>Thanks</p><p>Zach</p>","181564","","550966","","2011-08-31 09:39:17","2011-08-31 09:39:17","How to set spinner selection by id not position","<android>","1","2","","",""
"4419318","1","4419331","","2010-12-11 22:26:59","0","272","<p>I have an android app that is getting fairly large and complex now, and it seems to have intermittent performance problems. One time I will run the app and it's fine, another time it will struggle when switching views. </p><p>How can I detect the causes of the performance problem using debugging tools so that I may correct it?</p>","353674","","244296","","2010-12-13 13:45:50","2010-12-13 13:45:50","Detect causes of performance problems?","<android><performance><debugging>","2","0","","",""
"4419472","1","4419782","","2010-12-11 23:07:16","1","1171","<p>I've got a question about setting alarms in the AlarmManager. I found something in the docs I didn't understand (see below). I'd like to set 10 alarms which trigger the ringer mode alternately silent and normal, all with a different trigger time. Now the device goes asleep, and becomes active again after all 10 alarms are outdated. Does the AlarmManager then immediately broadcast an alarm? Would it be only the 10th (what about the ringer mode)?</p><blockquote>  <p>Alarm intents are delivered with a  data extra of type int called  Intent.EXTRA_ALARM_COUNT that  indicates how many past alarm events  have been accumulated into this intent  broadcast. Recurring alarms that have  gone undelivered because the phone was  asleep may have a count greater than  one when delivered.</p></blockquote>","474326","","474326","","2010-12-12 00:39:20","2013-08-08 16:35:27","How are past alarms delivered by the AlarmManager?","<android><alarm><alarmmanager><outdated>","2","0","4","",""
"4419731","1","","","2010-12-12 00:10:51","0","867","<p>I've been trying to figure out how to cut a drawable in my resources to make another drawable.</p><p>I have a large drawable containing all of the tiles I'm going to use to create a game map on the phone. I would like it if I could use ClipDrawable to select the tile I want as opposed to manually doing it on photoshop.</p><p>(This is my first program so I'm not very good at this yet)Here is what I could get it to do so far but I have 50 different types of tile so I think it would be easier to crop them all out of the same image.</p><pre><code> protected void onDraw(Canvas canvas) {     for(int i = 0; i &lt; Tiles.length; i++){      if(Tiles[i].isVisible()){      /* Make the sprite draw itself to the canvas */      if(Tiles[i].Render == 0){          this.tile4.setBounds(Tiles[i].mySpritePos.x, Tiles[i].mySpritePos.y,                  Tiles[i].mySpritePos.x + 26, Tiles[i].mySpritePos.y + 26);          this.tile4.draw(canvas);      }      if(Tiles[i].Render == 1){          this.tile1.setBounds(Tiles[i].mySpritePos.x, Tiles[i].mySpritePos.y,                  Tiles[i].mySpritePos.x + 26, Tiles[i].mySpritePos.y + 26);          this.tile1.draw(canvas);      }      }}     }</code></pre><p>Thanks!</p>","539250","","","","","2012-07-12 07:12:48","Help using android ClipDrawable","<android><eclipse><drawable>","1","0","","",""
"4419915","1","4419966","","2010-12-12 01:07:49","44","4772","<p>This question is about trying to understand the security risks involved in implementing oauth on a mobile platform like Android. Assumption here is that we have an Android application that has the consumer key/secret embedded in the code.</p><p>Assuming a consumer secret has been compromised, and a hacker has gotten a hold of it, what are the consequences of this ?</p><p><strong>Compromised Consumer Secret assumptions</strong><br>Am I correct in stating that a compromised consumer secret as such has no effect on the user's security, or any data stored at the OAuth enabled provider that the user was interacting with. The data itself is not compromised and cannot be retrieved by the hacker. </p><p>The hacker would need to get a hold of a valid user access token, and that's a lot harder to get.</p><p><strong>What could a hacker do with a compromised consumer secret ?</strong><br>Am I also correct in stating the following : </p><ul><li>The hacker can setup/publish anapplication that imitates my app. </li><li>The hacker can attract users that will gothrough the OAuth flow, retrieving anaccess token via the hackers OAuthdance (using the compromised consumerkey/secret). </li><li>The user might thinkhe's dealing with my app, as he willsee a familiar name (consumer key)during the authorization process.</li><li>When a consumer issues a request viathe hacker, the hacker can easilyintercept the access token, andcombined with the consumer secret cannow sign requests on my behalf togain access to my resources.</li></ul><p><strong>End-user impact</strong><br>In the assumption that </p><ul><li>a hacker has setup an application /site using my consumer secret </li><li>one of my users was tricked into authorizingaccess to that application / site</li></ul><p>The following might happen :</p><ul><li>the end-user may being noticing that something fishy is going on, and inform the service provider (ex: Google) about the malicious app  </li><li>the service provider can then revoke the consumer key/secret</li></ul><p><strong>OAuth consumer (my application) impact :</strong><br>My app (containing the consumer secret) would need to be updated, as otherwise all my clients would not be able to authorize my application do to requests on their behalf anymore (as my consumer secret would no longer be valid).</p><p><strong>Delegating all OAuth traffic</strong><br>Although it would be possible to delegate a lot of the OAuth interactions via an intermediate webserver (doing the OAuth dance and sending the access token to the user), one would have to proxy all service interactions also, as the consumer key/secret is required for signing each request. Is this the only way to keep the consumer key/secret outside of the mobile app, and stored in a more secure place on the intermediate webserver ?</p><p><strong>Alternatives</strong><br>Are there alternatives for this proxy-ing ? Is it possible to store the consumer secret at the intermediate webserver, and have some kind of mechanism that the Android application (published in the market and properly signed), can do a secure request to the intermediate webserver to fetch the consumer secret and store it internally in the app ? Can a mechanism be implemented that the intermediate webserver ""knows"" that this is an official android app that is requesting to fetch the consumer secret, and that the intermediate webserver will only handout the consumer secret to that particular android app ?</p>","492410","","492410","","2010-12-16 15:41:21","2010-12-16 18:20:23","How to keep the OAuth consumer secret safe, and how to react when it's compromised?","<android><security><oauth>","1","0","20","",""
"4419941","1","","","2010-12-12 01:22:21","6","2815","<p>When scrolling my listview with images. The images will disappear then reappear a second or two later. Any help on the matter would be appreciated! </p><p>This is in my getView which calls the below code:</p><pre><code>        image_main.setImageBitmap(null);        if (curr == 0 &amp;&amp; image != null) {            list_image.setVisibility(View.VISIBLE);            image_preference = preferences.getString(""image_preferences"", ""false"");            time_right.setVisibility(View.GONE);            if (image_preference.equals(""false"")) {                   ImageDownloader imgDwn = new ImageDownloader();                 imgDwn.download(image, image_main, image_table);            }</code></pre><p>My code:</p><pre><code>public class ImageDownloader {    public void download(String url, ImageView imageView, TableLayout imageTable) {        if (cancelPotentialDownload(url, imageView)) {        BitmapDownloaderTask task = new BitmapDownloaderTask(imageView, imageTable);        DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);        imageView.setImageDrawable(downloadedDrawable);        task.execute(url);        }    }    class BitmapDownloaderTask extends AsyncTask&lt;String, Void, Bitmap&gt; {        String url;        private final WeakReference&lt;ImageView&gt; imageViewReference;        private final WeakReference&lt;TableLayout&gt; imageTableReference;        public BitmapDownloaderTask(ImageView imageView, TableLayout imageTable) {            imageViewReference = new WeakReference&lt;ImageView&gt;(imageView);            imageTableReference = new WeakReference&lt;TableLayout&gt;(imageTable);        }          @Override          protected Bitmap doInBackground(String... params) {                 BitmapFactory.Options o = new BitmapFactory.Options();                  o.inJustDecodeBounds = true;                  BitmapFactory.decodeFile(params[0], o);                  final int REQUIRED_SIZE=70;                  //Find the correct scale value. It should be the power of 2.                  int width_tmp=o.outWidth, height_tmp=o.outHeight;                  int scale=4;                  while(true){                      if(width_tmp/2&lt;REQUIRED_SIZE || height_tmp/2&lt;REQUIRED_SIZE)                          break;                      width_tmp/=2;                      height_tmp/=2;                      scale++;                  }                  //Decode with inSampleSize                  BitmapFactory.Options o2 = new BitmapFactory.Options();                  o2.inSampleSize=scale;                         return BitmapFactory.decodeFile(params[0], o2);          }          @Override          protected void onPostExecute(Bitmap result) {                if (isCancelled()) {                    result = null;                }                if (imageViewReference != null) {                    ImageView imageView = imageViewReference.get();                    TableLayout imageTable = imageTableReference.get();                    BitmapDownloaderTask bitmapDownloaderTask = ImageDownloader.getBitmapDownloaderTask(imageView);                    // Change bitmap only if this process is still associated with it                    if (this == bitmapDownloaderTask) {                          imageView.setImageBitmap(result);                          imageView.setVisibility(View.VISIBLE);                          imageTable.setVisibility(View.VISIBLE);                    }                              }            }    }    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 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;    }}</code></pre>","427377","","","","","2014-01-29 16:07:45","Android listview images disappear when scrolling","<android><listview>","2","0","","",""
"4419997","1","4420030","","2010-12-12 01:42:24","1","797","<p>I need a linked list of custom objects when trying to bundle it I do not see a putObjectLinkedList method is there an easy way of doing this or must implement the Parcable interface in my custom object?</p>","188810","","","","","2010-12-12 02:02:26","How do I pass a Linked List of custom objects between activities in an android application?","<java><android>","1","0","","",""
"4420003","1","","","2010-12-12 01:43:42","4","7474","<p>I'm creating an Android app which creates a text file with JSON objects and writes it to Internal Storage.  I have the following code to do that:</p><pre><code>JSONObject myJSON = new JSONObject();//Set the JSON object with website, length and Id (time-stamp)try {    myJSON.put(""Length"", trim)    .put(""Website"", data)    .put(""Id"", tx);} catch (JSONException e1) {    e1.printStackTrace();}//Convert JSON object to a string and add a commaString myJSONString = myJSON.toString();myJSONString += "", "";try {     FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_APPEND);     fos.write(myJSONString.getBytes());     fos.close();     //Log.d(TAG, ""Written to file"");} catch (Exception e) {    Log.d(TAG, ""cought"");    e.printStackTrace();}</code></pre><p>Now I get a text file which looks like so:</p><pre><code>{""Id"":""20101211T155146"",""Length"":10}, {""Id"":""20101211T155155"",""Length"":10},{""Id"":""20101211T155203"",""Length"":10}, {""Id"":""20101211T155252"",""Length"":10}, </code></pre><p>I'd like to now collect that data in the JSON file.  (The app needs to write, store and retrieve the JSON.  The problem is when I go to parse the JSON objects from the file using:</p><pre><code>String x = """";InputStream is = this.getResources().openRawResource(R.raw.pwh);byte [] buffer = new byte[is.available()];while (is.read(buffer) != -1);String jsontext = new String(buffer);JSONArray entries = new JSONArray(jsontext);x = ""JSON parsed.\nThere are ["" + entries.length() + ""]\n\n"";int i;for (i=0;i&lt;entries.length();i++){    JSONObject post = entries.getJSONObject(i);    x += ""------------\n"";    x += ""Id:"" + post.getString(""Id"") + ""\n"";    x += ""Length:"" + post.getString(""Length"") + ""\n\n"";}</code></pre><p>It throws an error.  I got that from a great tutorial at: <a href=""http://www.ibm.com/developerworks/web/library/x-andbene1/?ca=drs-#author1"" rel=""nofollow"">http://www.ibm.com/developerworks/web/library/x-andbene1/?ca=drs-#author1</a>In that example, the code is expecting brackets around the whole file and no comma after the last object.  So I would need:</p><pre><code>[{""Id"":""20101211T155146"",""Length"":10}, {""Id"":""20101211T155155"",""Length"":10},{""Id"":""20101211T155203"",""Length"":10}, {""Id"":""20101211T155252"",""Length"":10}]</code></pre><p>But I write those JSON lines one at time in my code; How can I manipulate the JSON text file to get it in the expected format?</p><p><strong>UPDATE:</strong></p><p>The problem is still that if the user writes the JSON array to the file and then comes back and it again, you get TWO JSON arrays in that file.  Like so:</p><pre><code>[     {          ""phonenumber"": ""15555215554"",          ""time"": ""20110113T173835"",          ""username"": ""edit username"",          ""email"": "" edit email"",          ""password"": ""edit password""     }][     {          ""phonenumber"": ""15555215554"",          ""time"": ""20110113T173900"",          ""username"": ""edit username"",          ""email"": "" edit email"",          ""password"": ""edit password""     },     {          ""phonenumber"": ""15555215554"",          ""time"": ""20110113T173900"",          ""username"": ""edit username"",          ""email"": "" edit email"",          ""password"": ""edit password""     }]</code></pre><p>How can I read the first Array, add the second and then re-write to the file with both arrays merged into one?</p>","351272","","750613","","2012-07-12 07:11:41","2012-07-12 07:12:07","Android Internal Storage, how to properly parse a JSON text file","<android><json>","2","0","2","",""
"4420017","1","4420133","","2010-12-12 01:49:05","2","941","<p>I currently have a custom listview in Android that I generate by overriding the getView method of ArrayAdapter. It works perfectly. However, in certain cases I need to ""skip"" an item in the list. I tried returning null, but that just gives a nullpointer error. So my question is, what can I return in getView, so that no new item is added to the list?</p>","312499","","","","","2013-06-30 08:36:24","Skip a getView in Android","<android><listview>","2","0","","",""
"4420146","1","4420189","","2010-12-12 02:31:08","1","822","<p>The main activity is specified in AndroidManifest.xml with:</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>But I don't know how to dynamically specify the first activity according code logic.</p>","180284","","","","","2013-07-04 21:17:28","Dynamically Specify the First Activity","<android>","3","0","","",""
"4420240","1","4420312","","2010-12-12 03:10:29","1","3190","<p>my problem is a little bit tricky to describe.</p><p>I have a separated resources folder in my project (and in the apk-file).  </p><pre><code>String path = ""/resources/instruments/data/bongo/audio/bong1.wav"";  </code></pre><p>I can already use it with</p><pre><code>url = StreamHelper.class.getClassLoader().getResource( path );url.openStream();</code></pre><p>but actually I want to load the file into the SoundPool.I tried it this way:  </p><pre><code>SoundPool soundPool = new SoundPool(  5, AudioManager.STREAM_MUSIC, 0 );  soundPool.load ( path, 1 );</code></pre><p>... but i always get an error information: ""error loading /resourc...""</p><p><a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.6_r2/android/media/SoundPool.java#SoundPool.load%28java.lang.String%2Cint%29"" rel=""nofollow""> load(String path, int )</a>On this link I've seen that I need the correct path for File</p><pre><code>File file = new File( path );if( file.exists() )      //always false but i thing if it would be true soundPool.load should work too</code></pre><p>Now my question: how has the path to be that it works. Or is there any other idea for my problem (p.e. with the AssetManager) ?</p><p>Btw. I know that there are special Android ways to get resources like R.id.View ... but in my case it would be not easy to handle.</p><p>Thanks!</p>","539318","","157882","","2010-12-12 03:42:57","2010-12-17 01:30:17","new File ( path ) always says that there is no file","<java><android><file><path><soundpool>","2","0","","",""
"4420263","1","4420292","","2010-12-12 03:23:27","1","2516","<p>Is there any AirPrint(-like) SDK for Android devices? The objective is to let Android apps to print to AirPrint-ready (or similar technology) printers, <em>without</em> the need of any PC/equipment between the Android device and the printer. Thanks!</p>","88597","","172881","","2010-12-12 03:31:04","2010-12-13 04:48:06","AirPrint-like SDK for Android?","<android><printing><airprint>","1","1","1","",""
"4420310","1","4420330","","2010-12-12 03:41:09","10","7335","<p>I noticed that </p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {</code></pre><p>only gets called once.  I need this to get called every time the menu is displayed because I add/remove items from the menu depending on the application state.</p><p>is this possible?</p>","248521","","","","","2012-10-02 15:27:28","onCreateOptionsMenu(Menu menu) only gets called once during the lifecycle of an Activity","<android>","3","0","3","",""
"4420361","1","","","2010-12-12 04:04:54","3","128","<p>I have an activity that has possibly many different states.  </p><p><strong>For example</strong></p><ul><li>no internet </li><li>no license </li><li>logged in </li><li>not logged in </li><li>pending </li><li>error </li><li>restricted</li><li>deprecated</li></ul><p>At the moment I have <code>if statements</code> that determine the appropriate state of the application and enable or disable views as required.  I was thinking that some sore of STATE pattern might be better.</p><p>Can someone give me some idea of how I might do this with an Activity like this?  Or in this case is an if statement like this a better option as the views are tightly coupled to the Activity anyway.</p>","248521","","248521","","2010-12-12 07:04:02","2013-05-06 10:48:50","Managing an Activity with many states","<android>","2","1","1","",""
"4420495","1","4421600","","2010-12-12 05:12:37","1","7004","<p>Here is a my broadcast receiver.</p><pre><code>public class SmsReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context ctx, Intent intent) {            Log.d(DEBUG_TAG, SmsReceiver.class.getSimpleName()+ "" action: "" + intent.getAction());            // here is codes for sending intent to my running service     }  }</code></pre><p>here is broadcast receiver and service nodes in my manifest xml file.</p><pre><code>&lt;service android:name="".SMSGatewayService"" /&gt;&lt;receiver android:name="".SmsReceiver""&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>How can i send intent from broadcast receiver to my running service.thanks in advance.</p>","489744","","489744","","2010-12-12 05:19:58","2010-12-12 12:23:28","Sending an intent from broadcast receiver to a running service in android","<android><service><android-intent><broadcastreceiver>","1","0","2","",""
"4420550","1","","","2010-12-12 05:40:39","7","3624","<p>I want to know if it is possible to calculate a 100 meter distance around a given point with a known latitude and longitude. I have some coordinates in a MySQL database and want to know if a specific coordinate lies in 100 meter range from a given point. </p><p>I am using the Android platform. I know only one coordinate (Longitude and Latitude) where I am standing (current location) and I want to set the distance range (say 100 meters). </p><p>I have more coordinates saved in the database and want to calculate if the other points saved in the database are in 100 meter range from my current location or not. I don't know if I can use GIS database in my application. </p>","367121","","9314","","2011-07-31 21:09:40","2011-07-31 21:09:40","Calculate 100 meter distance when the latitude and longitude is a known point","<android><mysql><geocoding><distance>","2","2","6","",""
"4420727","1","4421117","","2010-12-12 07:40:20","4","2902","<p>This is my problem...:</p><p>In my activity I have an ImageView and a Button. I want the Button to perform an action ONLY when the ImageView displays a certain drawable. And yes, this means that the ImageView is animating between various drawables that is coded such that it does not interrupt with what I want done.</p><p>This was my brilliant solution:</p><pre><code>ImageView imgview = (ImageView)findViewById(R.id.imgviewsid);Resources res = getResources();Drawable acertaindrawable = res.getDrawable(R.drawable.thecertaindrawable);Drawable variabledrawable = imgview.getDrawable();    if (variabledrawable == acertaindrawable)    {            //does something    }</code></pre><p>Surprisingly, it didn't work. And I've narrowed it down to the fault of the line ""if (variabledrawable == acertaindrawable)"". While Eclipse does not blatantly report errors that Android cannot recognise if two drawables are the same, I've tested the other areas of the code and all seem to work fine.</p><p>Kind souls out there, please do help me! If there isn't a solution I'd love to know of a workaround as well!  Thanks in advance!</p>","539397","","","","","2012-06-03 16:52:00","drawable == drawable?","<java><android><button><imageview><drawable>","5","0","3","",""
"4420814","1","","","2010-12-12 08:15:34","0","605","<p>I will make livewallpaer.For new android user, I want to offer shortcut for livewallpaper selection.In api, only image can set wallpaper.I cannot find livewallpaper set api.So, in activity, I want to do this thing.<br><br>1. set livewallpaper directly. or<br>2. show livewallpaper select activity(my device call com.android.wallpaper.livepicker/.LiveWallpaperListActivity )</p><p>.LiveWallpaperListActivity cannot call outside.android.intent.action.SET_WALLPAPER show chooser.</p><p>just show picture for how to set livewallpaper?</p><p>do you have some idea?</p>","539410","","","","","2012-04-05 12:55:31","make shortcut for livewallpaper select activity","<android>","1","0","","",""
"4420873","1","4420936","","2010-12-12 08:42:11","0","1203","<pre><code>make ARCH=arm msm_defconfigmake ARCH=arm CROSS_COMPILE=$SOURCE_FOLDER/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- zImage -j4</code></pre><p>I would like to build android kernel, and I did find some tutorial on that. and I found the command above, I want to know how this command work? So if someone can explain it or give me some references on this, that will be better.</p><p>Thanks in advance !</p>","140899","","","","","2010-12-12 09:03:20","can someone explain to me this command (make ARCH)?","<android><linux><build><make>","2","0","","",""
"4421136","1","4422107","","2010-12-12 10:05:43","5","765","<p>For understanding how strong data should be secured on an Android device I want to understand which attacks are possible. I started to write down my knowledge and hope that I get corrections, where I'm wrong or where I'm missing something. I first assume that Google don't be evil, so will ignores attacks from google themselves.</p><p>Each application is signed and runs under his own user-id, so an app can only reads data which belongs to him, except the app creates a public storage. Furthermore app which are sign with the same key can share data. If an application want to get special rights like reading or writing to calendar or contacts the user must accept it.</p><p>So by default it's a secure design. Unfortunately every system can have security issues, so that the system become corrupted. On Desktop-Systems regular updates are common practice. On the android it depends on the vendor and is except the Nexus mostly bad. So it could be that there are security holes open for a long period.</p><p>So how could an android phone be attacked?</p><ol><li><p>Google can delete and install apps silently (<a href=""http://jon.oberheide.org/blog/2010/06/25/remote-kill-and-install-on-google-android/"" rel=""nofollow"">Link</a>). If someone hacks this mechanism, an attacker can install arbitrary apps on a device. Unsure if this app has automatically all rights it wants to have. This doesn't happens till now, but it's possible. You can only protect your phone by checking regularly all installed apps and there rights. This mechanism can be misused by a hacker.</p></li><li><p>Malicious applications can do a lot evil things, but if you don't give every app the rights the apps wanted and think a little bit, you can protect your phone.</p></li><li><p>Some security holes in the browser or the system allows an app to get root-access. In this case the app can do everything it wanted. I don't know any protection against this. As far as I know android has such security holes, so this is the most dangerous issue.</p></li></ol><p>So in summary the only secure protection of data seems to be encryption. Depending on how secure your data must be with a default key or an individual key (in other words a password).</p>","432115","","432115","","2010-12-13 07:46:47","2010-12-13 07:46:47","What are possible security issues in Android","<android><security>","2","5","","2013-10-14 13:05:44",""
"4421255","1","","","2010-12-12 10:40:26","0","1368","<p>Yesterday I programmed an own digital clock. I used the google blog: <a href=""http://android-developers.blogspot.com/2007/11/stitch-in-time.html"" rel=""nofollow"">http://android-developers.blogspot.com/2007/11/stitch-in-time.html</a> for help.</p><p>The following code is the resulat. </p><p>My question. Is it a efficient way, to update the handle by SystemClock.uptimeMillis()? I thought it would be better to habe something like a listener for change on time.</p><p>Second question. Is it effienc for the processor to use DateFormat.getTimeInstance() command to get the time? I use it because I don't know how to calculate the actual time from System.currentTimeMillis().</p><pre><code>public class TextClock extends Activity {    private TextView mTimeLabel;    private Handler mHandler = new Handler();    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            mTimeLabel = (TextView) findViewById(R.id.timeLabel);    }    private Runnable mUpdateTimeTask = new Runnable() {               public void run() {                   String currentTimeString = DateFormat.getTimeInstance().format(new Date());                   String currentDateString = DateFormat.getDateInstance().format(new Date());                   mTimeLabel.setText(currentDateString + ""\n"" + currentTimeString);                   mHandler.postAtTime(this, (SystemClock.uptimeMillis() + 1000));               }            };        @Override            protected void onStart()            {                    super.onPause();            mHandler.removeCallbacks(mUpdateTimeTask);            mHandler.postDelayed(mUpdateTimeTask, 100);            }            @Override            protected void onPause()            {                    super.onPause();                    mHandler.removeCallbacks(mUpdateTimeTask);            }} </code></pre><p>Thank you for your comments.</p><p>Felix</p>","529756","","180538","","2010-12-13 00:26:33","2010-12-13 03:09:50","Own digital clock with data und time. efficiently","<android><handler><clock>","1","2","0","",""
"4421262","1","","","2010-12-12 10:41:34","20","13256","<p>I have taken a fresh install of Eclipse and all the latest Android tools and want to use Proguard on existing project, but for now I have created a new blank one.I have added a <code>proguard.cfg</code> file to my projectadded <code>proguard.config=proguard.cfg</code> to my <code>default.properties</code></p><p>Now when I try to export I get the following error</p><pre><code>[2010-12-12 10:36:35 - ApplicationTest] Proguard returned with error code 1. See console[2010-12-12 10:36:35 - ApplicationTest] 'C:\Program' is not recognized as an internal or external command,[2010-12-12 10:36:35 - ApplicationTest] operable program or batch file.[2010-12-12 10:36:35 - ApplicationTest] '-jar' is not recognized as an internal or external command,[2010-12-12 10:36:35 - ApplicationTest] operable program or batch file.</code></pre><p>I know it means there is a filepath setup incorrectly, question is where the heck is as I have looked through the general properties and project properties and can't see any reference to proguard or obfuscation so am stuck on what to change</p><p>Any help appreciated.</p>","507991","","1318946","","2013-08-01 04:57:09","2014-02-18 20:17:29","Using Proguard for Android in Eclipse got Error","<android><eclipse><proguard>","7","2","2","",""
"4421527","1","","","2010-12-12 12:06:32","16","7199","<p>is it possible to start the ""application info"" screen (menu -> settings -> applications -> manage applications -> select any application) from another app?</p><p>thx, kopi</p>","434175","","","","","2013-09-18 13:50:56","start android application info screen","<android>","4","0","4","",""
"4421566","1","4421649","","2010-12-12 12:18:20","1","351","<p><strong>Morning, I would love help with my specific code but if you're busy any information on using putExtra and retrieveRow would also be a great help.</strong></p><p>I'm working on a little android project and i've come across the first instance where i need to pass data from one activity to another, unfortunately my knowlede is lacking. I've tried looking at the android notepad example but i'm getting pretty mixed up so i'm hoping someone can explain to me using my own code. </p><p>Here's what i'm trying to do.. I have an onItemClick listener for a listview i've populated from a sqlite database, when it's selected i want to pass the row _id along with the contents of another column for that row (the BUDGET_AMOUNT) to another class. So I think i need something like below but as you can see by all the questionmarks i'm really confused about how to implement what i need.</p><pre><code>// add an onclicklistener for when an item on the list is pressed        incomeView.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id)                {                Cursor c = ???.retrieveRow(id);                Intent keypadIntent = new Intent(view.getContext(), Keypad.class);                keypadIntent.putExtra(???._ID, id);//put extra needs work                keypadIntent.putExtra(???.BUDGET_AMOUNT, c.getFloat(                        c.getColumnIndexOrThrow(???.BUDGET_AMOUNT)));                startActivityForResult (keypadIntent, ???);                }            });</code></pre><p>The code above is from my Budget.java class, which i've uploaded <a href=""http://pastebin.com/zSsCV5ng"" rel=""nofollow"">here</a>. I also have a class called <a href=""http://pastebin.com/fFiWUGtR"" rel=""nofollow"">Data.java</a> which extends SQLiteOpenHelper and a class called <a href=""http://pastebin.com/hN9b8E8j"" rel=""nofollow"">DatabaseConstants</a> which just has a whole bunch of string variables for categories and queries. Thanks for taking the time to have a look or offer advice.</p>","523874","","523874","","2010-12-12 14:03:47","2010-12-12 14:03:47","I need help understanding putExtra and retrieve a row id?","<java><android><cursor><android-intent><listener>","1","1","","",""
"4421709","1","4421918","","2010-12-12 12:45:25","5","1218","<p>On Android, I would like to create a button that contains some other Views. For example, something like this:</p><pre><code>+---------------------------+| Hello world!    +-------+ ||                 | image | || Some more info  +-------+ |+---------------------------+</code></pre><p>But I'd like it to be more flexible than this specific example. Ideally, the button would simply be able to contain a ViewGroup, so that I could implement its layout in a separate XML file. However, because Button extends View, but not ViewGroup, this doesn't seem possible.</p><p>Is there any way to achieve this using standard Android components, or do I have to resort to writing a custom button class?</p><hr><p>As requested, some example XML that does the trick:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""vertical""    android:focusable=""true""    android:clickable=""true""    android:background=""@android:drawable/btn_default""&gt;    &lt;TextView        android:id=""@+id/name""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""@android:color/primary_text_light""/&gt;    &lt;TextView        android:id=""@+id/additional_line_1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""@android:color/primary_text_light""/&gt;    &lt;TextView        android:id=""@+id/additional_line_2""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""@android:color/primary_text_light""/&gt;&lt;/LinearLayout&gt;</code></pre><p>I had to set the colour on the TextViews explicitly, otherwise they would be nearly unreadable (they're white by default). I dug up the identifier from the SDK: <code>.../platforms/android-7/data/res/values/public.xml</code>. Strangely, <code>primary_text_light</code> gives black text, whereas <code>primary_text_dark</code> results in white...</p>","14637","","14637","","2010-12-13 08:46:29","2010-12-13 08:46:29","How to create a Button that contains multiple Views?","<android><button><view><viewgroup>","3","6","2","",""
"4421740","1","4421940","","2010-12-12 12:52:32","2","1535","<p>I've created an <code>AutoCompleteTextView</code> to search through a list of course titles (obtained from an sqlite db) and what I want to do is, when the user clicks on a title from the drop-down menu, the whole information from the database about his selection appears in a text view created below the <code>AutoCompleteTextView</code>.</p><p>I am pretty new to programming, especially for android and I would really appreciate it if someone could explain me how exactly to use <code>setOnItemClickListener</code> to call an instance in the database in the <code>TextView</code> below.</p><p>The code for the layout (R.layout.main_courses) 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=""5dp""&gt;&lt;AutoCompleteTextView  android:id=""@+id/autocomplete_course""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:hint=""Search for a course""/&gt;&lt;TextView android:id=""@+id/text""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/autocomplete_course""    android:hint=""Information about the course will appear here"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>and the code for the AutoCompleteTextView I've written so far is:</p><pre><code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_courses);    DataBase db = new DataBase(this.getApplicationContext()); db.openDataBase(); ArrayList&lt;String&gt; aCourses = db.getCoursesArr(); db.close(); AutoCompleteTextView search = (AutoCompleteTextView) findViewById(R.id.autocomplete_course); ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_courses, aCourses); search.setAdapter(adapter);}</code></pre>","539538","","119895","","2010-12-12 13:18:54","2010-12-12 13:44:26","Android AutoCompleteTextView onClick problem","<android><autocompletetextview>","1","0","","",""
"4421865","1","4421886","","2010-12-12 13:24:02","1","799","<p>I want to layout my views in the following way: <code>[Button] [SomeView] [Button]</code>. I want to set specific sizes for buttons (in mm), and then have the <code>SomeView</code> fill the remaining space between them.</p><p>How to achieve this?</p>","6533","","","","","2010-12-12 13:28:02","How to make a View to fill the space between two views?","<android><android-layout>","1","0","1","",""
"4421937","1","4422115","","2010-12-12 13:42:51","3","1853","<p>Hey. I am developing an application using the Twitter4j api. In order to allow the application and get an access token, I launch the browser with the callback parameters which I had set in the manifest file.</p><pre><code>&lt;data android:scheme=""scheme"" android:host=""authenticatorapp""&gt;&lt;/data&gt; </code></pre><p>After allowing the application, the browser calls the following and fails with a not found message.        scheme://authenticatorapp?oauth_token=n5vd99dfnmnf...</p><p>I tried it both on the emulator and the device. In the emulator, LogCat gives me this : </p><p>12-12 15:04:05.743: ERROR/browser(230): onReceivedError -10 scheme://authenticatorapp?oauth_token=Jj...M&amp;oauth_verifier=3ZfuY... The protocol is not supported.</p><p>-- The manifest file : </p><p>    </p><pre><code>    &lt;activity android:name="".AuthenticatorApp""        android:launchMode=""singleInstance""        &gt;        &lt;intent-filter&gt;                     &lt;category 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;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;data android:scheme=""scheme"" android:host=""authenticatorapp""&gt;&lt;/data&gt;                                        &lt;/intent-filter&gt;                &lt;/activity&gt;    &lt;!-- Broadcast Receiver that will process AppWidget updates --&gt;    &lt;receiver android:name="".ZaytungWidget"" android:label=""@string/widget_name""&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/tweet_metadata"" /&gt;    &lt;/receiver&gt;    &lt;!-- Service to perform web API queries --&gt;    &lt;service android:name="".ZaytungWidget$UpdateService"" /&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""4"" /&gt;    &lt;uses-permission android:name=""android.permission.WRITE_SETTINGS"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    </code></pre><p> </p>","494659","","494659","","2010-12-13 15:26:59","2010-12-13 15:26:59","Oauth Callback not found after allowing the app on Twitter","<android><url><twitter><callback><oauth>","3","0","1","",""
"4421945","1","4423582","","2010-12-12 13:46:06","3","1572","<p>I want to make a new window in an activity. like a popup window. I saw the source code of the Email application shipped with android OS and found this</p><pre><code>import com.android.internal.policy.PolicyManagerWindow w = PolicyManager.makeNewWindow(mContext);</code></pre><p>But I can't find such a class in the SDK.Any idea?</p>","294339","","","","","2013-01-08 05:53:02","How to make a window in an activity?","<android>","3","0","","",""
"4421960","1","","","2010-12-12 13:52:13","1","299","<p>I want to mark several different co-ordinates on my map overlay using the same marker but in different colours.</p><p>If I override getMarker() on the overlay item, I need to return a drawable. This means I have to replace all the pixels one-by-one in the bitmap to change the color.</p><p>I'd like to override the draw() method of the ItemizedOverlay so that I can change the colors in the bitmap just by specifying a new paint to the canvas.drawBitmap() call. However, here I don't seem to be able to access the x,y coordinates of where to draw.</p><p>What would be the recommended methods to override to achieve what I want?</p>","472428","","","","","2010-12-12 13:52:13","Different colour bitmaps for android map overlay","<android>","0","0","","",""
"4422166","1","","","2010-12-12 14:38:00","6","3359","<p>I'm trying to create a search suggestion content provider, and I need to to return its results as a cursor (for the contentprovider API of query).The thing is, my data isnt saved in a SQLite database but in an array.I need to create a cursor object which binds to an array, but I havnt seen any sample that does that.</p><p>Does anyone know whats the simplest way to bind a cursor to an array?Thanks.</p>","406682","","","","","2010-12-12 16:14:15","Create a cursor to point to an array","<android><cursor><android-contentprovider>","1","0","1","",""
"4422255","1","4422471","","2010-12-12 14:59:32","0","949","<p>In my Android application I want to post something to facebook.I've played around A LOT with the facebook SDK and I can post to the wall, populate the dialog with a predefined string.</p><p>But right now I can't make it post directly to the ""feed"" or ""stream"". Right now the user can change the text that will be published to the wall. When the application has asked for the permission to post to the stream I want it to post it directly without that the user can change what it will say.</p><p>How do I do this?</p><p>Right now I have a class that implements DialogListener and the important code inside it looks like this:</p><p><code>Bundle parameters = new Bundle();</code></p><p><code>parameters.putString(""message"", ""this is a test"");</code></p><p><code>facebook.dialog(HighScoreActivity.this, ""feed"", parameters, this);</code></p>","525016","","","","","2010-12-12 15:52:11","Post directly to facebook stream/wall with Androids Facebook SDK!","<android><facebook><api>","1","0","","",""
"4422265","1","4422292","","2010-12-12 15:02:15","2","2342","<p>I am customizing the look of a HORIZONTAL ProgressBar in Android and I have to use three different images, one for the background, one for the secondaryProgress, and one for progress.</p><p>My guess would be that the background has to be an actual full bar image for progress to fill in, something like a grey bar image that matches the dimensions of the ProgressBar view layout-width and height?</p><p>What about the others?</p>","487840","","","","","2010-12-12 15:08:49","What should the images look like for a ProgressDrawable layer-list?","<android><image><progress-bar>","1","0","5","",""
"4422347","1","","","2010-12-12 15:21:51","0","365","<p>I have over 5000 overlay items that I'd like to potentially display on my map.</p><p>What I need is a way of adding only the ones that are relevant to the current location and zoom level. And obviously adding or removing items as the map area or zoom changes.</p><p>Is there any way of handling this without attempting to add them all at once?</p>","472428","","","","","2011-03-07 12:47:13","Limiting the number of map overlays depending on the zoom level","<android>","1","1","1","",""
"4422410","1","4435473","","2010-12-12 15:39:31","12","17446","<p>I'd like to know if there is a way to know if the content provider of callings has changed. I mean, if I make a call, or I answer a call, it returns a ""flag"" that a new log has been added to the call log, or the place where Android store informations about callings.</p><p>Because, when I make a call, Android stores the number, the contact name (if exists), the hour of the calling, the duration, ..., all in the content provider. So is there a way to capture this ""flag"" that says the content provider of callings is bigger, I mean, that a new data has been inserted on the content provider CallLog.Calls.</p><p>So, I still have a lot of doubts related to this issue. I don't know where to register the content observer. My intention is, when something changes in the CallLog content provider, the insert method of the code will be used. </p><p>I mean, the code won't do anything unless new data has been added to the CallLog content provider. If some data has been added to the CallLog content provider, then the code will query the new data, and then will insert. I wanna do this, because without a content observer the application was inserting data in the database that was already inserted every time I run the application, got it?</p><p>So here is my code. If someone could tell me where to put <code>registerContentObserver()</code> and everything else that is needed.</p><pre><code>public class RatedCalls extends ListActivity {    private SQLiteDatabase db;    private CallDataHelper dh = null;    StringBuilder sb = new StringBuilder();    OpenHelper openHelper = new OpenHelper(RatedCalls.this);    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Cursor cursor = getContentResolver().query(                android.provider.CallLog.Calls.CONTENT_URI, null, null, null,                android.provider.CallLog.Calls.DATE + "" DESC "");        dh = new CallDataHelper(this);        db = openHelper.getWritableDatabase();        startManagingCursor(cursor);        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 dateId = cursor.getColumnIndex(android.provider.CallLog.Calls.DATE);        int numTypeId = cursor.getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE);        Date dt = new Date();        int hours = dt.getHours();        int minutes = dt.getMinutes();        int seconds = dt.getSeconds();        String currTime = hours + "":"" + minutes + "":"" + seconds;        ArrayList&lt;String&gt; callList = new ArrayList&lt;String&gt;();        if (cursor.moveToFirst()) {            do {                String contactNumber = cursor.getString(numberColumnId);                String contactName = cursor.getString(contactNameId);                String duration = cursor.getString(durationId);                String callDate = DateFormat.getDateInstance().format(dateId);                String numType = cursor.getString(numTypeId);                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"", callDate);                values.put(""current_time"", currTime);                values.put(""cont"", 1);                this.db.insert(CallDataHelper.TABLE_NAME, null, values);                Toast.makeText(getBaseContext(), ""Inserted!"", Toast.LENGTH_LONG);                callList.add(""Contact Number: "" + contactNumber                        + ""\nContact Name: "" + contactName + ""\nDuration: ""                        + duration + ""\nDate: "" + callDate);            } while (cursor.moveToNext());        }        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listitem, callList));        ListView lv = getListView();        lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {                Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show();            }        });    }}</code></pre>","399459","","356895","","2012-08-16 09:29:01","2014-02-12 11:13:56","How to implement a ContentObserver for call logs","<android><android-contentprovider><calllog>","1","0","12","",""
"4422428","1","4422593","","2010-12-12 15:43:48","1","402","<p>Is it safe to send the Android Market public key in raw base64 form across the internet?  What problems could I encounter if I did this?</p>","248521","","","","","2010-12-12 16:18:02","Sending Android market public key across the internet","<android>","1","0","","",""
"4422434","1","4422811","","2010-12-12 15:44:49","3","2194","<p>I'm using the youtube api to query by keyword for videos. The result has to be playable on Android Youtube App, but sometimes i'm getting an error that the video is not available on mobile devices.</p><p>Is there a parameter / option to search for videos that are playable on mobile devices?</p>","478605","","","","","2010-12-12 17:05:10","Youtube API: Search videos playable on mobile devices","<java><android><api><youtube>","1","0","2","",""
"4422448","1","4423023","","2010-12-12 15:46:08","0","5684","<p>I have an Arduino microcontroller that I will be using <a href=""http://www.sureelectronics.net/goods.php?id=402"" rel=""nofollow"">this Bluetooth module with</a>. My eventual goal is get the Arduino to be able to speak to my Android phone over Bluetooth. By speak I mean send it data and receive data. </p><p>The hardware of this I understand. I will be able to hook this Bluetooth module up and make it a function as I want. The only part I would not know how to do is read the data in. </p>","539643","","63550","","2010-12-12 23:26:26","2011-04-04 03:33:30","How to read data on Android phone sent from Bluetooth UART device connected to microcontroller?","<android><arduino>","1","0","","",""
"4422449","1","4422784","","2010-12-12 15:46:24","1","97","<p>Here is my scenario:</p><p>1) in my activity, user pushes Authorize button.</p><p>2) app opens WebView, in which Twitter page is loaded and user is asked to enter login and password and press Allow button. (oAuth implementation, Twitter requires it in order to integrate your app with Twitter)</p><p>3) Remote server passes Intent with Token and Secret back to my Activity, and my Activity then gets control back.</p><p><strong>My Problem:</strong></p><p>When starting this activity, through Intent, RowID variable is passed. This value I save in onSavedInstanceState when activity is pausing or when screen orientation is changed. In step 3, when my activity receives control back I loose this RowID variable. I can see why, basically activity is doing onResume and receiving intent from Twitter where there is no mention of RowID. <strong>So, how can I save my RowID value and retrieve it when activity is resumed?</strong> I could save it to Preferences, but is that right thing to do?</p><p>Any suggestions,Thanks.</p>","507153","","","","","2010-12-12 17:00:20","onSaveInstanceState problem while making oAuth request","<android><twitter><oauth><state>","1","0","","",""
"4422473","1","","","2010-12-12 15:52:32","5","6946","<p>I want to convert the type <code>Editable</code> from an android <code>EditText</code> to the type integer to do maths operations on a user input number</p><p>I tried the following:</p><pre><code>int x=(int)R2.getText().toString();</code></pre><p>but it gives me an error of cannot convert a string to int.</p>","539489","","603744","","2011-06-13 05:58:17","2013-07-17 11:22:47","Converting from Editable to int in android","<android>","5","0","1","",""
"4422643","1","","","2010-12-12 16:29:53","1","1320","<p>I am working on a very simple RSS reader for Android as a learning experience.  I decided to use the XmlPullParser for parsing the feeds as it is quite simple and has an acceptable level of efficiency (for my needs).  I am getting an error while trying to parse my test feed (rss.slashdot.org/slashdot/slashdot) that I can't seem to resolve despite scouring the web for answers.  The error (from eclipse) is:</p><pre><code>START_TAG &lt;image&gt;@2:1252 in java.io.InputStreamReader@43e7a488START_TAG (empty) &lt;{http://www.w3.org/2005/Atom}atom10:link rel='self' type='application/rss+xml' href='http://rss.slashdot.org/Slashdot/slashdot'&gt;@2:1517 in java.io.InputStreamReader@43e7a488DEBUG/JRSS(313): java.net.MalformedURLException: Protocol not found:</code></pre><p>The file in question is:</p><pre><code>&lt;image&gt;    ...&lt;/image&gt;&lt;atom10:link xmlns:atom10=""http://www.w3.org/2005/Atom"" rel=""self"" type=""application/rss+xml"" href=""http://rss.slashdot.org/Slashdot/slashdot"" /&gt;&lt;feedburner:info uri=""slashdot/slashdot"" /&gt;&lt;atom10:link xmlns:atom10=""http://www.w3.org/2005/Atom"" rel=""hub"" href=""http://pubsubhubbub.appspot.com/"" /&gt;    ...</code></pre><p>so the error appears to occur at the feedburner tag.</p><p>finally, my code is:</p><pre><code>public class XmlHelper{    private XmlPullParserFactory factory;    private XmlPullParser xpp;    private final int START_TAG = XmlPullParser.START_TAG;    // Debugging Tag    private final String TAG = ""JRSS"";    // for channels and items    private final String TITLE = ""title"";    private final String LINK = ""link"";    private final String DESCRIPTION = ""description"";    private final String PUBDATE = ""pubDate"";    // element keys for channel    private final String LANGUAGE = ""language"";    private final String IMAGE = ""image"";    private final String ITEM = ""item"";    // for items    private final String AUTHOR = ""author"";    // for images    private final String URL = ""url"";    private final String WIDTH = ""width"";    private final String HEIGHT = ""height"";    public XmlHelper(Context context)    {        try    {        factory = XmlPullParserFactory.newInstance();    }    catch (XmlPullParserException e)    {        Log.d(TAG, e.toString());    }        factory.setNamespaceAware(true);    }    public Channel addFeed(URL url) throws XmlPullParserException, IOException    {               Channel c = new Channel();        c.items = new ArrayList&lt;Item&gt;();        xpp = factory.newPullParser();        xpp.setInput(url.openStream(), null);        // move past rss element        xpp.nextTag();        // move past channel element        xpp.nextTag();        while(xpp.nextTag() == START_TAG)        {            Log.d(TAG, xpp.getPositionDescription());            if(xpp.getName().equals(TITLE))                c.title = xpp.nextText();            else if(xpp.getName().equals(LINK))                c.url = new URL(xpp.nextText());            else if(xpp.getName().equals(DESCRIPTION))                c.description = xpp.nextText();            else if(xpp.getName().equals(LANGUAGE))                c.language = xpp.nextText();            else if(xpp.getName().equals(ITEM))            {                Item i = parseItem(xpp);                c.items.add(i);            }            else if(xpp.getName().equals(IMAGE))            {                parseImage(xpp);            }            else                xpp.nextText();        }        return c;    }    public Item parseItem(XmlPullParser xpp) throws MalformedURLException, XmlPullParserException, IOException    {    Item i = new Item();    while(xpp.nextTag() == START_TAG)    {            // do nothing for now        xpp.nextText();    }        return i;    }    private void parseImage(XmlPullParser xpp) throws XmlPullParserException, IOException    {        // do nothing for now        while(xpp.nextTag() == START_TAG)        {            xpp.nextText();        }    }</code></pre><p>I don't really know if there is a way to just ignore this (because at this point I don't care about the feedburner tag) or if there is some feature of the parser that I can set to make this work, or if I'm going about this the wrong way.  Any help / advice / guidance would be appreciated.</p>","539648","","","","","2011-02-13 22:27:16","Android Pull Parsing RSS feeds troubles","<android><rss><xmlpullparser>","1","0","","",""
"4422788","1","4435468","","2010-12-12 17:00:54","0","1739","<p>I'm trying to implement a ContentObserver for CallLog.Calls content provider. I mean, If I make a call, or receive a call, etc, the observer must notify me that the CallLog.Calls content provider has changed. But the onchange method only returns false, even with the observers registered, and notified. Maybe I'm doing something wrong.</p><p>This is my code. It's an Activity.</p><pre><code>package com.psyhclo;public class RatedCalls extends ListActivity {private static final String LOG_TAG = ""RatedCallsObserver"";private Handler handler = new Handler();private RatedCallsContentObserver callsObserver = null;private SQLiteDatabase db;private CallDataHelper dh = null;StringBuilder sb = new StringBuilder();OpenHelper openHelper = new OpenHelper(RatedCalls.this);class RatedCallsContentObserver extends ContentObserver {    public RatedCallsContentObserver(Handler h) {        super(h);    }    public void onChange(boolean selfChange) {        Log.d(LOG_TAG, ""RatedCallsContentObserver.onChange( "" + selfChange                + "")"");    }}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    registerContentObservers();    fillList(); }@Overridepublic void onStart() {    super.onStart();    registerContentObservers();}@Overridepublic void onStop() {    super.onStop();    unregisterContentObservers();}private void fillList() {    Cursor cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null, null, null,            android.provider.CallLog.Calls.DATE + "" DESC "");    cursor.setNotificationUri(getBaseContext().getContentResolver(),            android.provider.CallLog.Calls.CONTENT_URI);    dh = new CallDataHelper(this);    db = openHelper.getWritableDatabase();    startManagingCursor(cursor);    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 dateId = cursor.getColumnIndex(android.provider.CallLog.Calls.DATE);    int numTypeId = cursor            .getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE);    // int contactIdColumnId =    // cursor.getColumnIndex(android.provider.ContactsContract.RawContacts.CONTACT_ID);    Date dt = new Date();    int hours = dt.getHours();    int minutes = dt.getMinutes();    int seconds = dt.getSeconds();    String currTime = hours + "":"" + minutes + "":"" + seconds;    ArrayList&lt;String&gt; callList = new ArrayList&lt;String&gt;();    if (cursor.moveToFirst()) {        do {            String contactNumber = cursor.getString(numberColumnId);            String contactName = cursor.getString(contactNameId);            String duration = cursor.getString(durationId);            String callDate = DateFormat.getDateInstance().format(dateId);            String numType = cursor.getString(numTypeId);            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"", callDate);            values.put(""current_time"", currTime);            values.put(""cont"", 1);            getBaseContext().getContentResolver().notifyChange(                    android.provider.CallLog.Calls.CONTENT_URI, null);            this.db.insert(CallDataHelper.TABLE_NAME, null, values);            Toast.makeText(getBaseContext(), ""Inserted!"", Toast.LENGTH_LONG);            callList.add(""Contact Number: "" + contactNumber                    + ""\nContact Name: "" + contactName + ""\nDuration: ""                    + duration + ""\nDate: "" + callDate);        } while (cursor.moveToNext());    }    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listitem,            callList));    ListView lv = getListView();    lv.setTextFilterEnabled(true);    lv.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; parent, View view,                int position, long id) {            Toast.makeText(getApplicationContext(),                    ((TextView) view).getText(), Toast.LENGTH_SHORT).show();        }    });}private void registerContentObservers() {    ContentResolver cr = getContentResolver();    callsObserver = new RatedCallsContentObserver(handler);    cr.registerContentObserver(android.provider.CallLog.Calls.CONTENT_URI,            true, callsObserver);}private void unregisterContentObservers() {    ContentResolver cr = getContentResolver();    if (callsObserver != null) { // just paranoia        cr.unregisterContentObserver(callsObserver);        callsObserver = null;    }}}</code></pre>","399459","","135152","","2011-07-05 17:51:45","2011-07-05 17:51:45","Android ContentObserver onChange() only returns false","<android><android-contentprovider><calllog><android-context>","1","0","","",""
"4422818","1","5001954","","2010-12-12 17:06:33","0","578","<p>I'm using InetAddress.getByName(params[0]).isReachable(300000) todetermine if my NAS is alive.By measuring the time before and after the above methode I found outthat the timeout has a maximum of about 3 min. 10 seconds, even if Iset the timeout to 600000 (about 10 minutes).</p><p>Am I doing something wrong? Or is there a better way to implement suchfunction?</p><p>regards,Thomas</p>","539701","","","","","2011-02-15 09:40:28","Android - Maximum Timeout for InetAddress isReachable()","<java><android><timeout><ip>","1","0","1","",""
"4422846","1","4422860","","2010-12-12 17:13:45","0","860","<p>Does anybody know where I can look for an configuration error? I'm getting this error message as soon as I'm trying to compile and to include ProGuard in my project (using the recently released Android SDK). Looking at the mentioned file of the error message it's a file by Google and I don't see any errors there. Any idea? Thx.</p><pre><code>   ant release    ...    BUILD FAILED    C:\ [...] \Android SDK\tools\ant\main_rules.xml:430: Expecting class path separator ';' before 'SDK\platforms\android-8\android.jar' in argument number 1</code></pre>","331556","","","","","2010-12-12 17:20:34","Android ant problem (for using ProGuard)","<android><ant><proguard>","2","0","","",""
"4422866","1","4459454","","2010-12-12 17:17:37","0","8770","<p>I wanted to create an app that drops an incoming call based on some settings, that seems to be impossible on Android 1.6. So I decided to write an app that changes the Ringer to mute when the call would've been dropped. The thing is that when I call getSystemService(Context.AUDIO_SERVICE) I get an exception.</p><p>These are my classes:</p><p>CallReceiver</p><pre><code>public class CallReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        MyPhoneStateListener phoneListener = new MyPhoneStateListener();        TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);        telephony.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE);          }}</code></pre><p>MyPhoneStateListener</p><pre><code>public class MyPhoneStateListener extends PhoneStateListener {    public void onCallStateChanged(int state, String incomingNumber){        if (state == TelephonyManager.CALL_STATE_RINGING)        {            Log.d(""DEBUG"", ""RINGING"");            (new TMLService()).ManageIncomingCall(incomingNumber);        }    }}</code></pre><p>And there is a class called TMLService that extends Service which contains this method</p><pre><code>public void ManageIncomingCall(String incomingNumber)  {    super.onCreate();    AudioManager audioManage = (AudioManager)getSystemService(Context.AUDIO_SERVICE);    audioManage.setRingerMode(AudioManager.RINGER_MODE_SILENT);}</code></pre><p>Like I said, when I call AudioManager audioManage = (AudioManager)getSystemService(Context.AUDIO_SERVICE); the application stops and this is what I get in the LogCat:</p><pre><code>D/DEBUG   (  356): RINGINGD/AndroidRuntime(  356): Shutting down VMW/dalvikvm(  356): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)E/AndroidRuntime(  356): Uncaught handler: thread main exiting due to uncaught exceptionD/CallNotifier(  103): RINGING... (new)E/AndroidRuntime(  356): java.lang.NullPointerExceptionE/AndroidRuntime(  356):    at android.content.ContextWrapper.getSystemService(ContextWrapper.java:335)E/AndroidRuntime(  356):    at tml.v1.Service.TMLService.ManageIncomingCall(TMLService.java:94)E/AndroidRuntime(  356):    at tml.v1.Service.MyPhoneStateListener.onCallStateChanged(MyPhoneStateListener.java:14)E/AndroidRuntime(  356):    at android.telephony.PhoneStateListener$2.handleMessage(PhoneStateListener.java:298)E/AndroidRuntime(  356):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  356):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  356):    at android.app.ActivityThread.main(ActivityThread.java:4203)E/AndroidRuntime(  356):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  356):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  356):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)E/AndroidRuntime(  356):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)E/AndroidRuntime(  356):    at dalvik.system.NativeStart.main(Native Method)D/CallNotifier(  103): onNewRingingConnection(): incoming</code></pre>","304461","","304461","","2010-12-12 18:27:37","2010-12-16 10:23:41","Exception on getSystemService(Context.AUDIO_SERVICE)","<android><android-service>","5","0","1","",""
"4423179","1","4431219","","2010-12-12 18:19:38","2","610","<p>Hi: Has someone experience with object persistence on Android by using <a href=""http://code.google.com/p/ektorp/"" rel=""nofollow"">ektorp</a> and CouchDB? Including the 'Simple Logging Facade for Java (SLF4J)' <a href=""http://www.slf4j.org/android/"" rel=""nofollow"">jar</a> is necessary to try this out.</p><p>I tried to get it running but I still get a 'java.lang.ExceptionInInitializerError' because of 'ERROR/AndroidRuntime(2573): Caused by: java.lang.NoClassDefFoundError: org.ektorp.impl.StdCouchDbInstance$1'.</p>","281535","","","","","2010-12-13 16:50:51","Android object persistance: Ektorp and CouchDB","<android><couchdb><object-persistence>","1","0","","",""
"4423426","1","4423450","","2010-12-12 19:07:15","1","3126","<p>i found this problem some time ago, but i solve it using this: getString(), or this: getResources().getString()</p><p>but now, for this case, it doesn't works, i think it's because i need to get the string values on a NON ANDROID ACTIVITY CLASS. I need the resource values on a remote connection class, that doesn't extends any kind of activity or service.</p><p>how i can acces to the variables from my strings.xml on this normal class?</p><p>this is the code where i get the error (it gets an integer, and not the string value)</p><pre><code>String a =R.string.totalpermission;</code></pre>","479886","","","","","2010-12-15 22:47:16","Problems accessing my strings.xml items… i got numbers and not the string value","<android><string>","3","0","","",""
"4423436","1","4423456","","2010-12-12 19:09:33","3","1905","<p>I´ve created a costum view, and on the onDrawMethod i´ve started to draw some things.A few rects,lines, and a text. </p><pre><code>  canvas.drawText(""Hello"",150,150, paint);</code></pre><p>Now, I want to change this text, after an OnTouchEvent. </p><p>My problem is, that I don´t know, how to remove the old text.At the moment my second text, which is shown after the TouchEvent,is just overlapping my old text. Should I redraw my hole view with the new text?</p>","539776","","881229","","2014-01-31 03:47:16","2014-01-31 03:47:16","Android Canvas Drawing Text and Change Text afterwards","<android><text><android-canvas><draw>","1","0","","",""
"4423597","1","","","2010-12-12 19:40:12","1","1564","<p>How to get real north and magnetic north with getOrientation function?</p><p>getOrientation function returns float[3] with bearing, pitch and roll in second parameter...How I can calculate real north from these values?</p><p>Thank you</p>","68282","","","","","2011-06-23 14:41:32","How to get real north and magnetic north with getOrientation function","<android><orientation>","2","0","1","",""
"4423599","1","4423771","","2010-12-12 19:40:33","0","2348","<p>I have balloon popups showing in Android MapView when a user tap:s on specific points on the map. Depending on where the user taps the balloon does not always fit insize the MapView. I solve this now by using MapController.animateTo to always have the tapped point in center. However, this is not the way I prefer it to be. I would like to animate the MapView only so much that the balloon layout fits inside MapView.</p><p>Any tips on how this can be solved?</p>","274426","","","","","2010-12-12 20:11:38","Fit ballon overlay in mapview","<android><android-mapview><balloon>","1","0","","",""
"4423671","1","4423705","","2010-12-12 19:53:54","18","16276","<p>I am new in java development! May someone tell me... according to which logic <code>super.onDestroy();</code> in destructors goes on top? for example:</p><pre><code>protected void onDestroy() {            super.onDestroy();    releaseMediaPlayer();}</code></pre><p>and not</p><pre><code>protected void onDestroy() {            releaseMediaPlayer();    super.onDestroy();}</code></pre><p>like c++, obj-c, pascal, etc ??</p>","491827","","556337","","2012-08-01 13:13:30","2012-08-01 13:13:30","Why super.onDestroy() in java - Android goes on top in destructors?","<java><android><ordering><destroy>","2","0","3","",""
"4423744","1","","","2010-12-12 20:07:18","1","567","<p>Hello i have been searching around for an answer to this and failed to find anything that helps solve the problem.</p><p>Using the gluUnproject function that i found elsewhere (sorry i lost the link but i will paste code below :-( ) i have been trying to get the gl coords of the mouse clicked position 5 units into the screen. glUnproject expects a winZ of between 0.0 and 1.0. </p><p>If i pass in 0.0f it works as expected and returns the point on the near plane and if i pass in 1.0f it also works correctly by returning the point on the far clipping plane.If however i put any value other that 0.0 or 1.0 (i,e 0.5) the results do not appear correct. Its always far too small a value to represent the correct coordinates. i expect a value around about -1.5 for example but gluUnproject returns -0.3) Has anyone else experienced this problem as its taken me a good few days to debug :-( ?</p><p>Thanks in advance, i have pasted some of my code below:</p><pre>private static final float[] _tempGluUnProjectData = new float[40];private static final int     _temp_m   = 0;private static final int     _temp_A   = 16;private static final int     _temp_in  = 32;private static final int     _temp_out = 36;public static int gluUnProject(float winx, float winy, float winz,float model[], int offsetM,float proj[], int offsetP,int viewport[], int offsetV,float[] xyz, int offset){   /* Transformation matrices *///   float[] m = new float[16], A = new float[16];//   float[] in = new float[4], out = new float[4];   /* Normalize between -1 and 1 */   _tempGluUnProjectData[_temp_in]   = (winx - viewport[offsetV]) *2f / viewport[offsetV+2] - 1.0f;   _tempGluUnProjectData[_temp_in+1] = (winy - viewport[offsetV+1]) *2f / viewport[offsetV+3] - 1.0f;   _tempGluUnProjectData[_temp_in+2] = 2f * winz - 1.0f;   _tempGluUnProjectData[_temp_in+3] = 1.0f;   /* Get the inverse */   android.opengl.Matrix.multiplyMM(_tempGluUnProjectData, _temp_A,proj, offsetP, model, offsetM);   android.opengl.Matrix.invertM(_tempGluUnProjectData, _temp_m,_tempGluUnProjectData, _temp_A);   android.opengl.Matrix.multiplyMV(_tempGluUnProjectData, _temp_out,        _tempGluUnProjectData, _temp_m,        _tempGluUnProjectData, _temp_in);   if (_tempGluUnProjectData[_temp_out+3] == 0.0)      return GL10.GL_FALSE;   xyz[offset]  =  _tempGluUnProjectData[_temp_out  ] /_tempGluUnProjectData[_temp_out+3];   xyz[offset+1] = _tempGluUnProjectData[_temp_out+1] /_tempGluUnProjectData[_temp_out+3];   xyz[offset+2] = _tempGluUnProjectData[_temp_out+2] /_tempGluUnProjectData[_temp_out+3];   return GL10.GL_TRUE;}// My own function calling gluUnprojectpublic int FindTileIndexUnderPoint(float startX, float startY){ int viewport[] = new int[] {0, 0, m_viewportWidth, m_viewportHeight}; Vector4 rayStart = new Vector4(-1.5f, 1.0f, 0.0f); if (m_gl == null) {  return -2; } gluUnProject(startX, (float)viewport[3] - startY, 0.5f, m_cameraMatrix.Vals().array(), 0, m_projectionMatrix.Vals().array(), 0, viewport, 0, rayStart.Vals(), 0); // The screens orientation is at 0 so we are looking straight down the -z Vector4 rayEnd = new Vector4(rayStart.x(), rayStart.y(), rayStart.z() + 1000.0f); // Ray to AABB tests for (int i = 0; i  </pre><p>The camera and projection matrix are definatly correct as they are the values passed into gl.glLoadMatrixf to set up my scene. At the moment the code i currently have has camera as just identity matrix.</p><p>Even though i have found a workaround for now (because i know i'm only looking down -z axis) i would really like to get the unproject working correctly.My depth buffer is setup as 1.0f near and 10.0f far but i have tried different values and the results are always incorrect.</p><p>Big thanks to anyone who can point me in the right direction as i'm pulling my hair out (and i don't suit the bold look!) :-)</p>","539808","","","","","2010-12-12 20:07:18","[android]gluUnproject fails with values between 0.0f and 1.0f","<android>","0","0","","",""
"4423982","1","","","2010-12-12 20:57:07","8","1995","<p>In Android sources I see such strings:</p><pre><code>&lt;string name=""app_name"" msgid=""8095131950334945205""&gt;""Calculadora""&lt;/string&gt;</code></pre><p>Notice the 'msgid', this indicates existence of some tool to manage strings translation. What the tool is it?</p>","62192","","","","","2011-06-29 20:46:16","How can I use msgid during Android strings localization?","<android><localization>","1","1","2","",""
"4424050","1","4834919","","2010-12-12 21:13:55","3","3101","<p>I'm using an intent-filter to listen to changes in PHONE_STATE</p><pre><code>    &lt;!-- Listen for phone status changes --&gt;    &lt;receiver android:name="".IncomingCallReciever""&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>... and can easily detect an incoming call</p><pre><code>       intent != null     &amp;&amp; intent.getAction().equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)    &amp;&amp; intent.hasExtra(TelephonyManager.EXTRA_STATE)    &amp;&amp; intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_RINGING)</code></pre><p>... but how can I determine if it is line 1 or line 2 that is ringing? </p><p>My application needs to react ONLY when the user is currently on a phone call and another call is coming in. </p>","215166","","215166","","2010-12-13 02:22:36","2011-01-29 03:13:16","How can I determine if there is a call ringing on ""line 2"" (e.g. call waiting)","<android>","1","0","3","",""
"4424115","1","4426949","","2010-12-12 21:23:41","2","258","<p>Simple question, obscure answer: <strong>Would it be possible to run <a href=""https://github.com/jashkenas/ruby-processing"" rel=""nofollow"">ruby-processing</a></strong> ( a port of <a href=""http://processing.org"" rel=""nofollow"">Processing</a> which runs on Jruby which runs on Java VM) <strong>on the Android OS</strong>. Has anyone tried this before?</p>","311941","","","","","2010-12-13 08:36:31","Ruby-processing on Android","<android><ruby><jruby><processing>","2","0","2","",""
"4424200","1","4424226","","2010-12-12 21:40:56","0","1234","<p>First off, I am not trying to write to the SDCard. I want to write some information to a file that persists between uses of the app. It is essentially a file to hold favorites of the particular user. Here is what the code looks like:</p><pre><code>try {            File file = new File(""favorites.txt"");            if (file.exists()) {                Log.d(TAG, ""File does exist."");                fis = new FileInputStream(file);                br = new BufferedReader(new InputStreamReader(fis));            }            else {                Log.d(TAG, ""File does not exist."");                return favDests;            }        } catch (FileNotFoundException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        }</code></pre><p>When running this code, we always get the ""File does not exist."" message in our DDMS log.</p><p>We have also tried the following code to no avail:</p><pre><code>try {            File file = new File(GoLincoln.FAV_DEST_FILE);            fis = new FileInputStream(file);            br = new BufferedReader(new InputStreamReader(fis));        } catch (FileNotFoundException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        }</code></pre><p>It is this second portion of code that results in the FileNotFoundException.</p><p>I have read multiple tutorials on writing and reading files on Android and I believe I am following them pretty closely, so I am not sure why this code doesn't work successfully. I appreciate any help!</p>","535590","","","","","2010-12-12 22:27:26","Why do I get FileNotFoundException when I create and try to write to file on Android emulator?","<java><android><file-io><android-emulator><filenotfoundexception>","2","1","","",""
"4424252","1","","","2010-12-12 21:49:26","1","246","<p>I have several Frame-to-Frame XML Animations that use the android:duration to set the speed.  All work well.</p><p>Is it possible to use a variable for this so I can change the values per user needs in code (using API 1.6).</p><p>The Frame Animation is less cumbersome than coding animation (and I already have 20 of them so I'd prefer a clever variable approach in XML).</p><p>Thanks</p>","382200","","","","","2011-05-19 17:55:50","Can I Make A Duration Variable In Frame to Frame Animation xml?","<android><android-animation>","1","0","1","",""
"4424256","1","4675057","","2010-12-12 21:50:37","7","682","<p>I asked a question previously about what shows up in the IntentChooser when I send an Intent with ACTION_SEND and MIME type ""image/png"".  The problem is that some phones come with a default messaging app that is not showing up in the list, mine included (myTouch 4G) as well as a user that I speak with over email (using an HTC EVO).  If I choose a Send or Share option from the built in gallery app or another application on the same image I'm saving and attempting to send directly from my app, Messages shows up in the list.  From my app it does not.  Other phones don't have this problem, so it's clearly a platform specific thing.  But that doesn't mean I should just ignore the problem.</p><p>So, I go to troubleshooting the issue.  I register one of the activities in my app to receive the the same type of intent, and then hit a breakpoint to analyze the Intent object being sent from the two different ways of sending it.</p><p>The problem is, the intent I'm sending and the intent being sent from Gallery or AndroZip (where Messages does show up in the chooser) seem to be the same.  They both have the same action, same categories, same flags, same mime type.  What else can I inspect on the Intent from Gallery or AndroZip to tell if there's some more information I can add to my Intent to get the default messaging app to show up in the chooser in cases where it is not? </p>","53501","","","","","2011-01-13 09:36:13","Debugging Intents","<java><android><android-intent>","3","1","4","",""
"4424262","1","4424349","","2010-12-12 21:51:17","0","594","<p>I'm writing an app with alarm functionality, i.e. it will have to continue running while the device goes into standby. Apparently, this is not the case. How can I achieve that?</p><p>It would be even better if I could prevent the device from going into standby at all - can I do that?</p>","539510","","","","","2010-12-12 22:06:37","Android: Disabling or at least ignoring standby","<android><standby>","2","1","1","",""
"4424415","1","4424513","","2010-12-12 22:18:26","0","1065","<p>How can I fire a method instead of an Activity in my code?</p><p>I want to use the <code>AddProximityAlert()</code> method from the <code>LocationManager</code> but it needs an Intent to work and I don't want to call another activity since the method I want to fire is in the same <code>Activity</code> from where I'm using <code>AddProximityAlert()</code></p><p>Goes like this:</p><pre><code>public clase onCreate(){......LocationManager LM; // already initializedLM.addProximityAlert(lat,long,radio,expiration,INTENT) &lt;--- This INTENT needs to call myMethod()}public void MyMethod(){.......}</code></pre><p>I have several hours trying to find a solution for this, and all I find is for calling another activity, please be as much specific, even if I have to do something with the <code>manifest.xml</code> because I haven't used intents before.</p><p>Thanks</p>","539878","","670834","","2011-07-20 10:26:56","2011-07-20 10:26:56","Calling a method instead of an activity using an Intent - android developers","<android>","1","0","","",""
"4424423","1","4425044","","2010-12-12 22:20:36","0","667","<p>I have a website loaded in WebView on Android 1.6 and I want to get the HTML-Code of a Site which was generated when the user hits Submit. The parameter get submitted by GET, if that's important.<br>Then I want to change the HTML-Code and show it to the user, without showing the real Answer-page first.</p><p>Maybe I could use onFormResubmission() from WebViewClient? But I really have no idea how.</p><p>Thanks for the help!</p>","276473","","","","","2010-12-13 00:51:16","Android: WebView: Change HTML requested by Submit (GET)","<java><android><form-submit><android-webview>","1","0","","",""
"4424425","1","4427429","","2010-12-12 22:21:14","10","7344","<p>I can't get the HttpParams-stuff from the Android-API working.</p><p>I just wan't to send some simple Parameters with my Postrequest. Everything is working fine, except for the parameters. The code to set the parameters to the postrequest:</p><pre><code>HttpParams params = new BasicHttpParams();params.setParameter(""password"", ""secret"");params.setParameter(""name"", ""testuser"");postRequest.setParams(params);</code></pre><p>It seems that this code isn't adding any parameter at all, as the server always answer, that my request is missing the ""name""-parameter.</p><p>An example of what is actually working as expected:</p><pre><code>ArrayList&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;();postParameters.add(new BasicNameValuePair(""name"", ""testuser""));postParameters.add(new BasicNameValuePair(""password"", ""secret""));UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(postParameters);postRequest.setEntity(formEntity);</code></pre><p>But I would like to use a version of the first example, as it is easier to read and understand.</p><p>Any hint is really appreciated!</p>","539884","","","","","2010-12-13 09:32:35","Can't get HttpParams working with Postrequest","<android><http><android-internet>","1","1","1","",""
"4424473","1","","","2010-12-12 22:30:59","2","124","<p>In my xml-layout I have a text aligned to the bottom of an imageview with align_bottm.</p><p>This causes overlaps, if there is too much text above it. How it is possible to</p><p>a) align the text to an element if there is enough spaceand b) put it below the other texts if there is not enough space to align with the imageview?</p><p>Especiially in xml.</p><p>Thanks,best regards</p>","472355","","","","","2010-12-12 22:30:59","Align an item bottom to another only if enough space available / no overlaps","<android>","0","0","","",""
"4424492","1","5112050","","2010-12-12 22:35:03","5","8244","<p>Okey, I've done all the business, followed all the steps, but still can't get it to work.The simple Example app that comes with the Facebook SDK, is working on the emulator and on devices with android 1.5.So my guess is the single login thing.</p><p>If I'm right then I should generate a key hash and I've been told that the right debug keystore is placed under </p><blockquote>  <p>C:\Users\xxx.android\debug.keystore</p></blockquote><p>so I followed the tutorial.</p><p>Downloaded OpenSSL from google.code and in the terminal I write something like:</p><blockquote>  <p>""C:\Program Files\Java\jdk1.6.0_22\bin\keytool.exe"" -exportcert -alias  androiddebugkey -keystore  ""C:\Users\JoeZ.android\debug.keystore""|""C:\Users\xxx\Downloads\openssl-0.9.8k_X64\bin\openssl.exe""  sha1  -binary|""C:\Users\xxx\Downloads\openssl-0.9.8k_X64\bin\openssl.exe"" base64</p></blockquote><p>and I get a nice key which I inserted into the Android Key Hash box in facebook, I've tried both with or without the = sign after the output but nothing seems to work.</p><p>I just get invalid_key when I try to sign into the Example application.I even tried a signed application but it did not work.And if I'm not mistaken the only thing to write in the Example application is my APP_ID, right?</p><p>I'm having the exact same problem with my own application that I'm developing. So please can anybody help me?</p>","525016","","55093","","2012-01-09 11:06:08","2013-06-19 11:45:25","Facebook SDK for Android - Example app won't work","<android><facebook>","3","0","12","",""
"4424536","1","4424553","","2010-12-12 22:43:33","0","1062","<p>I have an activity which performs a bunch of SQLite inserts as its very last act before starting another activity which relies on the just-inserted data.</p><p>I have just moved all the db stuff into an AsyncTask...and, yep, you guessed it, the new activity is being called before the previous one's inserts have completed.</p><p>Now, I'm happy with the speed of my db operations, but, how do I make my app wait for the AsyncTask to finish before starting the next activity?</p><p>I was thinkig about starting it fromonPostExecute, but that feels wrong, although I don't know why it would be if it is.</p><p>Currently all I intend to do in pre/postExecute is show a default dialog...but, that's obviously also failing because the next activity is starting as soon as the asyncTask is started :)</p><p>No need for AsyncTask usage here, or is there just a simple way to say ""woah, boy, wait a sec!""? :)</p>","442912","","","","","2010-12-12 22:47:25","Android AsyncTask - Start Next Activit From onPostExecute - Bad Idea?","<android><android-asynctask>","1","0","1","",""
"4424544","1","4424970","","2010-12-12 22:44:48","24","15423","<p>I'm looking for the log file(s) that are made by logcat.  Where are they typically stored?</p>","107083","","","","","2012-04-05 12:38:06","Where are Android logcat files stored?","<android><logcat>","3","0","7","",""
"4424723","1","4424799","","2010-12-12 23:26:33","5","4098","<p>I have a simple appwidget and I want to update it when an action occurs in an activity (in the same app). in onUpdate(), I immediately update the widget, which works fine. In my activity, I call the same static update method in my appwidget that is called in onUpdate() to update the views. the widget is not updated.</p><p>I can trace the code right into the AppWidgetManager.updateAppWidget() method, and all this good, but the widget does not update.</p><p>The only possible difference I can see is that the context object passed into my static update method is different, when it's called from the context of an activity vs. the context of a appwidget's onUpdate() method. however, there are lots of examples on the web of this so I expect it should work.</p>","337455","","1280410","","2012-05-03 14:29:02","2012-05-03 14:29:02","android appwidget won't update from activity","<android><appwidget>","2","0","4","",""
"4424756","1","4453484","","2010-12-12 23:36:56","4","2405","<p>I have a DecimalFormat object which I'm using to format all of my double values to a set number of digits (let's say 2) when I'm displaying them. I would like it to normally format to 2 decimal places, but I always want at least one significant digit. For example, if my value is 0.2 then my formatter spits out 0.20 and that's great. However, if my value is 0.000034 my formatter will spit out 0.00 and I would prefer my formatter spit out 0.00003.</p><p>The number formatters in Objective-C do this very simply, I can just set a max number of digits I want to show at 2 and the minimum number of significant digits at 1 and it produces my desired output, but how can I do it in Java?</p><p>I appreciate any help anyone can offer me.</p><p>Kyle</p><p>Edit: I'm interested in rounding the values so 0.000037 displays as 0.00004.</p>","539680","","539680","","2010-12-14 18:53:40","2010-12-15 18:26:15","Format double to at least one significant digit in Java/Android","<java><android><formatting><significant-digits>","2","0","2","",""
"4424882","1","4479025","","2010-12-13 00:08:01","1","171","<p>I have recently published my second app on the Android Market. I've gotten a few e-mails about the app crashing on open, and all users were using the Motorola Backflip. It seems to work fine on all other devices. The app shows the background image, but crashes right after that.Is there something different I have to do when coding for that device?</p><p>The strange thing is that it is very similar to my first app, which seems to work just fine for them. The major difference is that my second app is a paid app, and uses Android Licence Verification. My implementation should catch any license errors though, and I've tested this on my device. </p><p>Users have uninstalled and reinstalled the app without success. I'm stumped. The other thing they're reporting is that the icon doesn't even show properly, but rather is a gear in a box, which makes me think that something goes awry very early in the installation process. </p>","434035","","23897","","2010-12-13 00:12:35","2012-10-22 10:58:22","App crashing on open on Motorola Backflip only","<android><crash><motorola>","2","2","","",""
"4424909","1","4424944","","2010-12-13 00:12:40","0","677","<p>I am basically trying to get information from an sqlite db in another class. I've done this without any problems inside the onCreate method, but when I try to use it inside an onClickListener which is inside that onCreate I cannot find the right context to use. My code is as follows:</p><pre><code>private AutoCompleteTextView search;private Button showInfoButton;private TextView courseInfo;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main_courses);    final Context baseContext = getBaseContext();    courseInfo = (TextView) this.findViewById(R.id.text);    DataBase db = new DataBase(this.getApplicationContext());    db.openDataBase();    final ArrayList&lt;String&gt; aCourses = db.getCoursesArr();    db.close();    search = (AutoCompleteTextView) findViewById(R.id.autocomplete_course);    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_courses, aCourses);    search.setAdapter(adapter);    showInfoButton = (Button) this.findViewById(R.id.show_info_button);    showInfoButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            if (aCourses.toString().contains(search.getText()) == false ) {                courseInfo.setText(""Please select a course from the drop-down menu and click on the \""Show course information\"" button"");            }            else{                String selectedCourse = search.toString();                DataBase db1 = new DataBase(baseContext);                db1.openDataBase();                ArrayList&lt;String&gt; courseAttributes = db1.getCourseAttributes();                ArrayList&lt;String&gt; attributeValues = db1.getAttributeValues(selectedCourse);                db1.close();                String courseInformation = """";                for (int i=0; i &lt; courseAttributes.size(); i++){                    courseInformation = courseInformation + courseAttributes.get(i) + "": "" + attributeValues.get(i) + System.getProperty(""line.separator"");                }                courseInfo.setText(courseInformation);            }        }    });}</code></pre><p>the problem comes with</p><pre><code>DataBase db1 = new DataBase(baseContext);</code></pre><p>I've tried changing it to</p><pre><code>DataBase db = new DataBase(this.getApplicationContext());</code></pre><p>and</p><pre><code>DataBase db = new DataBase(null);</code></pre><p>and every way I try it, the program does run, but when it get's in the else case it throws an error and shuts down. Could anyone tell me what context should I use in order to make it run?</p>","539538","","","","","2010-12-13 00:20:57","Android: Using the right context inside a method to get an sqlite db","<android><sqlite><onclick><context>","1","1","","",""
"4424938","1","4776351","","2010-12-13 00:19:25","4","17402","<p>I have an Android form that needs to update itself based on certain selections. The form is currently made up of 2 Spinners (A and B). Spinner B not created until Spinner A's selection is made. After the selection is made B will be displayed to the view and it's contents dynamically filled based on A's selection. Here is my code:</p><pre><code>public class MyForm extends Activity {       private final int SEL_ACTIVATE = 0;    private final int SEL_DEACTIVATE = 1;    private static final String[] actionList = {""Activate"", ""Deactivate"" };    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        table = (TableLayout) findViewById(R.id.table);        showListA(table);    }    public void showListA(View v)    {                rowAction = new TableRow(this);        Spinner spinner = new Spinner(this);        spinner.setPrompt(""Select..."");        spinner.setOnItemSelectedListener(            new OnItemSelectedListener()             {                public void onItemSelected(AdapterView&lt;?&gt; parent, View v, int position, long id)                 {                    switch (position)                    {                    case SEL_ACTIVATE:                    case SEL_DEACTIVATE:                        showListB(v);                        break;                    }                }                public void onNothingSelected(AdapterView&lt;?&gt; arg0)                 {                    // TODO Auto-generated method stub                }        });        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt; (this, android.R.layout.simple_spinner_item, actionList);        adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);        spinner.setAdapter(adapter);        rowAction.addView(tvAction);        rowAction.addView(spinner);        table.addView(rowAction, new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));    }    ...}</code></pre><p>This code works correctly. When either ""Activate"" or ""Deactivate"" are selected from the list, <code>showListB()</code> executes which is very similar to <code>showListA()</code> in how it creates a new row which contains Label and Spinner.</p><p>The problem is that, by default, ""Activate"" is shown in the Spinner which executes <code>showListB()</code> and right off the bat, the second part of the form is created based on the ""Activate"" option. The only workaround that I can come up with is to add a third field to the Spinner like so:</p><pre><code>private static final String[] actionList = {""None"", ""Activate"", ""Deactivate"" };...switch (position){case SEL_NONE:    break;case SEL_ACTIVATE:case SEL_DEACTIVATE:    showListB(v);    break;}</code></pre><p>This works... but I don't want a third option in the list. I just want it to, by default, be blank or show some sort of 'prompt' text that is not an option in the list once it is pressed. Is this possible?</p><p>Thanks</p><p>EDIT:</p><p>xml content:</p><pre><code>&lt;Spinner    android:id=""@+id/spinnerAction""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;  </code></pre>","450780","","450780","","2010-12-13 05:14:35","2013-04-11 16:30:26","Android Spinner - How to default list selection to none","<android><spinner><listeners>","5","0","","2013-03-10 01:00:57",""
"4424940","1","4914104","","2010-12-13 00:19:49","2","436","<p>I am trying to make a tile game that has 6 tiles in each row.  The tiles are a fixed size, 80x80 and fit snuggly on a 480x854 screen (since 6*80=480).  I am trying to make sure that my application works for other densities/sizes, but the logic is confusing to me.  What is the best way that I can be sure I handle other densities correctly?  I've read <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a> entirely, but am still confused.  Even if I scale images for different densities, can't I still run into the problem that the screen won't have enough pixels to support my ""6 tiles in a row""? As an example, let's say the device was 320x480, but also high density.  No scaling would be done, and my 480px wouldn't fit on the 320px screen.  I am trying to not hardcode for pixels, but don't see another option.  Any input appreciated.  </p>","469106","","1140748","","2012-05-06 16:17:06","2012-05-06 16:17:06","Android Image Sizing","<android>","2","0","","",""
"4425127","1","4532521","","2010-12-13 01:15:57","2","4386","<p>Here's the issue.  I do this to get the device list:</p><pre><code>./adb devices</code></pre><p>And I get this:</p><pre><code>List of devices attached </code></pre><p>with no returned devices.  If I run the emulator, that shows on the above list, but still no physical device.</p><p>I am using a Samsung Galaxy S Fasciate (Verizon model) on a MacBook running OS 10.5.</p><p>I am connecting through a powered USB hub as was advised on a different message board (I can find the source if anyone's interested).  This also does not work when I connect directly.</p><p>According to the Mac System Profiler, the device is plugged in:</p><pre><code>SAMSUNG_Android:Product ID: 0x681cVendor ID:  0x04e8  (Samsung Electronics Co., Ltd.)Version:    2.23Serial Number:  I500874368c4Speed:  Up to 480 Mb/secManufacturer:   SAMSUNGLocation ID:    0xfd140000Current Available (mA): 500Current Required (mA):  96</code></pre><p>I am able to mount the SD drive and have even successfully used two different apps that tether an internet connection via the USB cable, so I can safely assume that the computer can properly interact with the device.</p><p>Yet for some reason, it does not show up as a device that I can debug.</p><p>(And yes, I've turned on ""USB Debugging"" on the phone - and even tried restarting the phone.)</p><p>I would greatly appreciate any help with this.</p>","107083","","","","","2013-05-23 20:36:39","Android Galaxy S Phone - ADB Debug Bridge Trouble on Mac OSX","<android><debugging><adb>","4","0","","",""
"4425155","1","","","2010-12-13 01:22:51","2","3925","<p>We are trying to play a video stream on the Android platform, with nosuccess.Using the VideoView, we are able to play youtube mobile videos (e.g.this url works just fine:rtsp://v3.cache7.c.youtube.com/CjYLENy73wIaLQnMYzt2FtQmqxMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoYI6vr52RlLW1Sww=/0/0/0/video.3gp)</p><p>However, we need to play a stream (from a given RTSP url), over whichwe have no control.The RTSP server delivers RTP/TCP/AVP packets interleaved over RTSP.RTSP itself is supported via HTTP tunnelling over port 80.The video format is MPEG4-Part2 (H.263).Moreover, the rtsp url can be used one time only; built with a key-string every time. On a desktop system, quicktime could play thestream, VLC could not.</p><p>Is it possible to play back such a stream on an Android devicesomehow?</p><p>I read googling around that the builtin (openCore?) RTP stack onlysupports RTP over UDP, not TCP. Is this (still) true?Can I somehow bypass this problem?</p><p>Thanks!Turi András </p>","539992","","","","","2013-02-27 19:01:15","playing RTP/TCP/AVP video stream on Android","<android><tcp><video-streaming><rtp>","3","1","2","",""
"4425332","1","4425391","","2010-12-13 02:14:16","3","2320","<p>I am running Android Emulator on OS X and trying to use AudioRecord to take a sample of audio and determine the frequency using an FFT jar (for a tuning app).</p><p>I am having difficulty with using the phone to debug (http://stackoverflow.com/questions/4425127/android-galaxy-s-phone-adb-debug-bridge-trouble-on-mac-osx) so I want to use the emulator.</p><p>When I take a sample of audio from the emulator it appears to contain random values.  I would assume that it's recording something, but I'm not sure if it's coming from my computer's microphone.  Can anybody confirm what these values might be coming from and if it's possible to use the emulator to record.</p><p>I am initializing the AudioRecord object like this:</p><pre><code> int frequency = 8000; int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO; int audioEncoding = AudioFormat.ENCODING_PCM_16BIT; try {        // Create a new AudioRecord object to record the audio.        int bufferSize = AudioRecord.getMinBufferSize(frequency,channelConfiguration,audioEncoding);        AudioRecord audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,                                                   frequency, channelConfiguration,                                                   audioEncoding, bufferSize); ...</code></pre>","107083","","","","","2014-01-15 23:56:32","Can Android Emulator pick up audio?","<android><debugging><audiorecord>","2","0","","",""
"4425425","1","4426542","","2010-12-13 02:42:46","3","2245","<p>I have a graphic designer that helps me with UI development. We start with me taking screenshots of my current UI using my Nexus One (800x485). Then he overlays new art over the old screenshots in Photoshop and creates transparent PNGs. Then I take that, plug it in my app and to my dismay these images appear big and blurry (about 35% larger). When I check images these are created at 72 dpi so I really have no idea why this is happening. Any ideas?</p>","135946","","1140748","","2012-05-06 16:16:13","2012-05-06 16:16:13","Android - graphics are big and blurry","<android><graphics>","2","0","","",""
"4425432","1","","","2010-12-13 02:44:47","1","820","<p>I have this content observer that is watching on the Call Log:</p><pre><code>public class monitorCallLog extends ContentObserver{    private static final String TAG = ""monitorCallLog"";    public monitorCallLog(Handler handler) {        super(handler);        // TODO Auto-generated constructor stub    }    @Override    public boolean deliverSelfNotifications() {         return false;     }    @Override    public void onChange(boolean selfChange){        Log.v(TAG, ""[onChange] *** ENTER ***"");        super.onChange(selfChange);        // Code goes in here to handle the job of tracking....        Log.v(TAG, ""[onChange] *** LEAVE ***"");    }}</code></pre><p>Now... how can I determine the nature of the change on this URI <code>content://call_log/calls</code>?</p><p>I want to check on it if a deletion has occurred on the said URI... but there is no way of knowing...this seems to apply on a query/delete/insert/update on said URI that triggers the <code>onChange</code> method....</p><p>any tips/suggestions?</p>","206367","","","","","2011-06-14 23:42:25","Determine the ContentObserver","<android><contentobserver>","1","0","","",""
"4425509","1","","","2010-12-13 03:03:18","3","2478","<p>I have studied the android bluetooth example. <br>What I'm confused is that other devices has sent a connection request, and the server is just blocked so long without accepted if previous connection exsited. <p>Is it possible for an android device which can perform a server socket and accept many connections rather than just one connection? Is there any reason might cause the server which is blocked by accept(), for example, incorrect UUID, or something like that?</p><p>I do the operation as follows, </p><ol><li>For first connection, create the server socket and wait for the connection</li><li>client B send the connection request</li><li>server socket accept</li><li>process the i/o stream</li><li>use the same serversocket to wait for the connection again (I don't close the serversocket)</li><li>client C send the connection request</li><li>server socket is blocked, blocked, blocked, rather than accepted...</li></ol><p>Because the first connection is successful, and I don't change the UUID on second connection. So I think the UUID is not the key. When first connection is established, server socket will wait for another connection. Sadly, it just waits and blocked, not accepts as first connection. </p><pre><code>public void run() {    if (D) Log.d(TAG, ""BEGIN ServerSocketThread"" + this);    BluetoothSocket socket = null;    while(true) {        try {            Log.i(TAG, ""[ServerSocketThread] Enter while loop"");            socket = mmServerSocket.accept();                                                 Log.i(TAG, ""[ServerSocketThread] Got client socket"");                            } catch (IOException e) {            Log.e(TAG, ""accept() failed"", e);            break;        }        if (socket!=null) {            synchronized (BluetoothConnService.this) {                                       Log.i(TAG, ""[ServerSocketThread] ""+socket.getRemoteDevice()+"" is connected."");                ConnectedThread tmpThread = new ConnectedThread(socket);                 tmpThread.start();                break;            }        }    }       BluetoothConnService.this.startSession();}</code></pre><p>It is a part of the server socket thread. Whenever I want to make a second connection, the logcat shows it will stop after the log ""<strong>[ServerSocketThread] Enter while loop.</strong>"" It seems the operation is blocked on <strong>accept()</strong>, but the serversocket didn't throws the IOException for <strong>mmServerSocket.accept()</strong>.<p>I have no idea why the socket neither be accepted nor throws exception, just blocked there, if I want to make a second connection. I'm appreciated if any possible reason or any suggestion.</p><p>Here is some catlog when I run the application. I hope it is helpful for identify the problem.</p><h2>Part A : It is a successful connection and a first connection</h2><pre><code>12-12 22:42:05.358: DEBUG/BluetoothSppPort(889): Creating a BluetoothSpp proxy object12-12 22:42:05.378: DEBUG/BluetoothSppService(122): createPort called!12-12 22:42:05.378: DEBUG/BluetoothSppService(122): createPort checking uuid12-12 22:42:05.388: DEBUG/BluetoothSppService(122): createPort UUID=00001101-0000-1000-8000-00805f9b34fb auth=true encrypt=true12-12 22:42:05.388: DEBUG/BluetoothSppService(122): createPort enforcing bluetooth perm12-12 22:42:05.388: DEBUG/BluetoothSppService(122): createPort creating a jbtlspp object12-12 22:42:05.388: DEBUG/BluetoothSppService(122): createPort checking if the btl spp object is valid12-12 22:42:05.388: DEBUG/BluetoothSppService(122): createPort try to create an spp container12-12 22:42:05.388: DEBUG/BluetoothSppService(122): createPort try to create security params12-12 22:42:05.388: DEBUG/BluetoothSppService(122): createPort Set Security L212-12 22:42:05.388: DEBUG/BluetoothSppService(122): createPort spp port create12-12 22:42:05.418: DEBUG/JBtlSpp(122): create: Entered12-12 22:42:05.418: DEBUG/JBtlSpp(122): Calling NativeJBtlSpp_Create12-12 22:42:05.418: DEBUG/JBtlSppNative(122): NativeJBtlSpp_Create: Entered12-12 22:42:05.418: DEBUG/JBtlSppNative(122): NativeJBtlSpp_Create: Calling BTL_SPP_Remote_Create12-12 22:42:05.598: DEBUG/JBtlSppNative(122): NativeJBtlSpp_Create: BTL_SPP_Remote_Create returned 0, context:f12-12 22:42:05.598: DEBUG/JBtlSppNative(122): NativeJBtlSpp_Create: Setting context value in jContext out parm12-12 22:42:05.598: DEBUG/JBtlSppNative(122): NativeJBtlSpp_Create: Calling Java setValue(0xf) in context's class12-12 22:42:05.598: DEBUG/JBtlProfileContext(122): setValue: setValue called, value:1512-12 22:42:05.598: DEBUG/JBtlSppNative(122): create_spp_port_data: will use context struct 0 for the port 1512-12 22:42:05.608: DEBUG/JBtlSppNative(122): create_spp_port_data: spp port context 0 added12-12 22:42:05.608: DEBUG/JBtlSppNative(122): NativeJBtlSpp_Create:Exiting Successfully12-12 22:42:05.778: DEBUG/JBtlSpp(122): After NativeJBtlSpp_Create, status=SUCCESS, Context = 1512-12 22:42:05.778: DEBUG/JBtlRbtlServices(122): addUser: Entered, userRefCount = 112-12 22:42:05.778: DEBUG/BluetoothSppService(122): port create returned status SUCCESS12-12 22:42:05.778: DEBUG/JBtlSpp(122): enable: Entered12-12 22:42:05.778: DEBUG/JBtlSpp(122): enable: UUID=00001101-0000-1000-8000-00805f9b34fb12-12 22:42:05.778: DEBUG/JBtlSppNative(122): NativeJBtlSpp_Enable: Entered12-12 22:42:05.978: DEBUG/JBtlSppNative(122): NativeJBtlSpp_Enable: BTL_SPP_Enable returned 012-12 22:42:05.978: DEBUG/JBtlSppNative(122): NativeJBtlSpp_Enable:Exiting12-12 22:42:05.978: DEBUG/JBtlSpp(122): After NativeJBtlSpp_Enable, status=SUCCESS12-12 22:42:05.978: DEBUG/JBtlSpp(122): enable: Exiting12-12 22:42:05.978: DEBUG/BluetoothSppService(122): port enable returned status SUCCESS12-12 22:42:57.678: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_OPEN_IND: Entered12-12 22:42:57.678: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_OPEN_IND: Exiting12-12 22:42:57.678: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_OPEN: Entered12-12 22:42:57.678: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_OPEN: status: 0 context:1512-12 22:42:57.708: DEBUG/JBtlSpp(122): nativeCb_open: Entered from 00:10:60:56:83:2812-12 22:42:57.718: DEBUG/JBtlSpp(122): nativeCb_open: Calling callback12-12 22:42:57.718: DEBUG/BluetoothSppService(122): connected called!12-12 22:42:57.718: DEBUG/BluetoothSocket(889): SppPort connected()12-12 22:42:57.718: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_OPEN: Exiting12-12 22:42:57.718: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_MODEM_STATUS_IND: Entered12-12 22:42:57.718: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_MODEM_STATUS_IND: Exiting</code></pre><h2>Part B : It is second connection, and it lets the serversocket blocked without accepted.</h2><p>It looks like that it didn't run the <em>BluetoothSppService</em> like part A. But <em>BluetoothSppService</em> is lower layer on andorid framework, therefore I don't know how to handle.</p><pre><code>12-12 22:43:29.158: DEBUG/(122): signal_BTEVENT_LINK_CONNECT_IND: Entered12-12 22:43:29.168: DEBUG/(122): signal_BTEVENT_LINK_CONNECT_IND: context: 1, errCode: 012-12 22:43:29.168: DEBUG/(122): signal_BTEVENT_LINK_CONNECT_IND: Calling Java Link Connect Indication callback12-12 22:43:29.178: DEBUG/JBtlBmg(122): nativeLinkConnectInd12-12 22:43:29.218: DEBUG/BluetoothService(122): Callback - linkConnectInd, btErrCode = NO_ERROR, bdAddr = C0:E4:22:18:ED:C112-12 22:43:29.258: DEBUG/JBtlBmg(122): getKnownDeviceInfo: Entered12-12 22:43:29.258: DEBUG/JBtlBmg(122): getKnownDeviceInfo: Calling NativeJBtlBmg_GetKnownDeviceInfo12-12 22:43:29.258: DEBUG/(122): NativeJBtlBmg_GetKnownDeviceInfo: Entered12-12 22:43:29.258: DEBUG/(122): NativeJBtlBmg_GetKnownDeviceInfo: Calling BTL_BMG_GetKnownDeviceInfo12-12 22:43:29.268: DEBUG/JBtlBmgJniKnownDeviceInfo(122): setValues: Entered12-12 22:43:29.268: DEBUG/(122): NativeJBtlBmg_GetKnownDeviceInfo:Exiting12-12 22:43:29.268: DEBUG/JBtlBmg(122): getKnownDeviceInfo: After NativeJBtlBmg_GetKnownDeviceInfo, status=SUCCESS12-12 22:43:29.278: DEBUG/JBtlBmg(122): getKnownDeviceInfo: Exiting12-12 22:43:29.278: DEBUG/BluetoothService(122): onRemoteDeviceConnected, device C0:E4:22:18:ED:C1 is Paired12-12 22:43:29.278: DEBUG/BluetoothService(122): Sending ACTION_ACL_CONNECTED intent, address = C0:E4:22:18:ED:C112-12 22:43:29.278: DEBUG/BluetoothA2dpService(122): Received intent with action: android.bluetooth.device.action.ACL_CONNECTED12-12 22:43:29.298: DEBUG/(122): signal_BTEVENT_LINK_CONNECT_IND: Exiting12-12 22:43:29.988: DEBUG/(122): signal_BTEVENT_LINK_DISCONNECT: Entered12-12 22:43:29.988: DEBUG/(122): signal_BTEVENT_LINK_DISCONNECT: context: 1, errCode: 1912-12 22:43:29.988: DEBUG/(122): signal_BTEVENT_LINK_DISCONNECT: Calling Java Link Disconnect callback12-12 22:43:29.988: DEBUG/JBtlBmg(122): nativeLinkDisconnect12-12 22:43:29.998: DEBUG/BluetoothService(122): Callback - linkDisconnect, btErrCode = USER_TERMINATED, bdAddr = C0:E4:22:18:ED:C1, status = NO_ERROR12-12 22:43:30.018: DEBUG/BluetoothService(122): Sending ACTION_ACL_DISCONNECTED intent, address = C0:E4:22:18:ED:C1</code></pre><h2>Part C: If I disconnted the previous existed connection, it will run as follows. And then run the part A. So I can establish a conntion again.</h2><p>Creating a <em>BluetoothSpp</em> proxy object, and perform <em>BluetoothSppService</em>.</p><pre><code>12-12 22:45:45.758: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_MODEM_STATUS_IND: Entered12-12 22:45:45.758: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_MODEM_STATUS_IND: Exiting12-12 22:45:45.788: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_CLOSE_IND: Entered12-12 22:45:45.788: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_CLOSE_IND: Exiting12-12 22:45:45.798: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_CLOSED: Entered12-12 22:45:45.798: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_CLOSED: status: 0 context:1512-12 22:45:45.798: DEBUG/JBtlSpp(122): nativeCb_closed: Entered12-12 22:45:45.798: DEBUG/BluetoothSppService(122): close called!12-12 22:45:45.798: DEBUG/JBtlSppNative(122): signal_SPP_EVENT_CLOSED: Exiting12-12 22:45:46.158: DEBUG/JBtlSppNative(122): NativeJBtlSpp_ReadNative:Exiting with 1</code></pre><p>It seems the logcat should like part A, the conntion can be established. I doubted the reason why the server socket was blocked without accept is that these operations are handled by the lower level of android platform. But I don't know how to get or how to perform this service, such as <em>BluetoothSppService</em>, <em>JBtlSppNative</em>, <em>JBtlBmg</em>, etc.</p><p>Do you have any experience with that?<br>If yes, I'm appreciated if you can share with me. Or give me some hints or suggestions about how to let the device can accept another connection if pervious connection has existed.</p>","540044","","1253312","","2013-06-15 01:47:36","2013-09-18 05:20:39","Android Bluetooth Server socket will be blocked on accept() if it processes more than one conntion","<android><bluetooth><serversocket>","1","0","","",""
"4425523","1","","","2010-12-13 03:07:07","2","1264","<p>So I'm developing an photo editing application for Android and I was just wondering if anybody knows what kind of scaling algorithm (bicubic/bilinear interpolation, etc.) is used by the Bitmap.createScaledBitmap(...) method because developer.android.com does not give any information concerning this.<a href=""http://developer.android.com/reference/android/graphics/Bitmap.html#createScaledBitmap%28android.graphics.Bitmap,%20int,%20int,%20boolean%29"" rel=""nofollow"">A link to the documentation of the method</a></p>","540047","","","","","2011-01-11 03:59:07","Scaling Bitmap with Android","<android><image><scale><interpolation>","1","0","","",""
"4425526","1","4811245","","2010-12-13 03:07:48","7","4747","<p>I need to run two instances of AudioTrack at the same time.  They must run separately because I'm playing them at different, variable sample rates.  I found that if I run them in the same thread, they ""take turns"".  I'm running them each in their own thread, but the audio is stuttering.</p><p>Any ideas on making two instances play nice?  If not, any tips on mixing two short buffers into one, even if I want to play them at different sample rates.</p>","537002","","","","","2011-03-07 16:56:04","Android: Mixing multiple AudioTrack instances?","<java><android><sample><mixer><rate>","1","0","3","",""
"4425584","1","4425624","","2010-12-13 03:27:02","23","12666","<p>I was wondering if someone had some experience with an ad service for android other than admob. I'm doing way better with iAds so is there another service I could use for my android app that would give revenue comparable it iAds? Anyone have some experiences with other services they can share?</p>","462440","","881229","","2014-01-26 16:32:11","2014-01-26 16:32:11","admob alternatives","<android><admob>","10","0","29","2013-03-06 14:03:08",""
"4425596","1","","","2010-12-13 03:29:10","3","1147","<p>My goal is to turn a WebView into a Bitmap so I can add it to a homescreen widget. I have gotten WebView.capturePicture() to work fine; however, I cannot get the WebView to render without setting it as the content layout or similar. As this is an app widget I won't be able to set it as a view.</p><p>Is it possible to render a WebView and save it to a bitmap without setting it as the content view?</p>","317862","","","","","2011-05-27 14:35:24","Drawing offscreen WebView and capturePicture issues","<android><bitmap><webview>","0","3","","",""
"4425660","1","4425742","","2010-12-13 03:46:20","5","17822","<p>I have this:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    TextView debugView = (TextView)findViewById(R.id.debugView);    for(int i=0;i&lt;100;i++) {        try {            Thread.sleep(100);        } catch (InterruptedException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        debugView.setText(Integer.toString(i));    }}</code></pre><p>I would expect it to update the text view each time through the loop so I would get:1, 2, 3, ... 99</p><p>Instead the app does nothing for 10 seconds and then outputs: 99</p><p>I am guessing that I need the TextView to refresh during the loop.  I am new to Android development.  Can somebody please tell me if this is the best way to accomplish this?</p><p>My eventually goal is to be able to process audio samples to build a guitar tuner.  I am trying to simply verify visually that the app is responding to external audio and I want to update a TextView to demonstrate that.  Please advise if there is a better way to do this.</p>","107083","","","","","2011-03-16 12:50:45","How to refresh a TextView while looping in Android?","<android><textview>","3","1","3","",""
"4425691","1","","","2010-12-13 03:54:20","-2","166","<p>In my opinion, if you want to learn android, you must know OS, Network, OPP and Design Pattern well, that 's enough, about you??</p>","398650","","","","","2010-12-13 03:59:34","Which needs to learn Android?","<java><android>","1","2","","2010-12-13 04:33:03",""
"4425711","1","","","2010-12-13 03:59:22","1","718","<p>Can i use my iPhone for android application development testing?</p>","540068","","","","","2010-12-13 04:30:39","using iPhone as android application development, testing phone","<iphone><android>","4","3","","",""
"4425776","1","","","2010-12-13 04:16:41","1","964","<p>I am trying to perform matrix multiplication which involves two dimensional double arrays. I followed an article on the SUN website but still couldn't get it right.  Here's a brief description of my problem and the way I handled it:</p><p>I've two 2-dimensional double arrays which I am passing to JNI from my java function.  I passed these arrays as JObectArray.  In my JNI function, I created two local arrays of type double and copied the JObjectArrays in these local arrays.  I then performed matrix multiplication and stored the result in another local array called result.Now I want to return this result array back to Java function but I don't know how to do this.<br>Can someone please help me out with my query?</p><p>Here's my code:</p><pre><code>JNIEXPORT jobjectArray JNICALL Java_prj_anyapp_JNIForMFCC_compute(JNIEnv *env, jclass jClass, jint Am, jint Bm, jint Bn, jobjectArray A, jobjectArray B){    jobjectArray retC;    int i,j,k;    double sum;    int localAm, localBm, localBn;    localAm = Am;    localBm = Bm;    localBn = Bn;    double localArrayCopyB[localBm][localBn];           double localArrayCopyA[localAm][localBm];    double localArrayCopyC[localAm][localBn];    for(i=0; i&lt;localAm; i++) {        jdoubleArray oneDimA=         (jdoubleArray)(*env)-&gt;GetObjectArrayElement(env,A, i);        jint *elementA = (*env)-&gt;GetIntArrayElements(env,oneDimA, 0);        for(j=0; j&lt;localBm; j++) {            localArrayCopyA[i][j]= elementA[j];        }    for(i=0; i&lt;localBm; i++) {        jdoubleArray oneDimB=         (jdoubleArray)(*env)-&gt;GetObjectArrayElement(env,B, i);        jint *elementB = (*env)-&gt;GetIntArrayElements(env,oneDimB, 0);        for(j=0; j&lt;localBn; j++) {            localArrayCopyB[i][j]= elementB[j];        }    }        for(i=0; i&lt;localAm; i++){            for(j=0; j&lt;localBm; j++){                for(k=0; k&lt;localBn; k++){                    sum += localArrayCopyA[i][k] * localArrayCopyB[k][j];                }                localArrayCopyC[i][j] = sum;            }        }    }       }</code></pre>","495184","","9686","","2013-06-17 16:27:55","2013-06-17 16:27:55","How to populate values in a 2d array in JNI and return it as an object array?","<android><jni>","0","2","","",""
"4425813","1","","","2010-12-13 04:26:11","3","274","<p>As of now , I know 2 methods to interact with database ,<br>using openOrCreateDatabase() or extending SQLiteOpenHelper class !<br>Which is better to use and why ?</p>","207646","","236247","","2011-06-25 15:31:33","2011-06-25 15:31:33","Which is better way to communicate with database in Android and Why?","<android>","2","0","3","",""
"4425908","1","","","2010-12-13 04:54:56","0","1558","<p>I am using Progress Dialog to show progress while loading web page, but sometimes it does not work properly. Progress Dialog never get dismissed though page is loaded.</p><p>I have added Progress Bar like this</p><pre><code>public boolean shouldOverrideUrlLoading(WebView view, String url) {    //Added progress dialog}public void onPageFinished(WebView view, String url) {    if(progressdialog.isShowing())       progressdialog.dismiss(); //Dismissed the progress, but sometimes never dismiss it}</code></pre>","528965","","212275","","2010-12-18 08:03:32","2010-12-18 08:03:32","Android Progress Bar is not dismissed","<android>","2","2","","",""
"4425940","1","","","2010-12-13 05:04:19","3","3043","<p>Is it possible to create your own permissions using the <code>&lt;uses-permission&gt;</code> tag?</p><p>Like this</p><pre><code>&lt;uses-permission android:name=""com.android.myapp.INSTALL_LICENSE""&gt;&lt;/uses-permission&gt;</code></pre><p>Where <code>com.android.myapp</code> is the name of my package and <code>INSTALL_LICENSE</code> is the permission that users must accept</p><p>In addition I would like to budle a whole lot of existing permissions into this one permission so client would only need to declare a single permission and they would get the INTERNET, PHONE_STATE and other permissions.</p>","248521","","248521","","2010-12-13 06:30:42","2014-02-06 19:07:20","Creating your own permissions","<android>","3","2","","",""
"4425956","1","4427430","","2010-12-13 05:08:01","0","1498","<p>How should <code>List&lt;MyClass&gt;</code> be properly passed from the main activity to a secondary activity?</p><p>From what I understand, there are two ways to bundle data: <code>Parceling</code> and <code>Serializing</code>. What are the pros and cons to each?</p><p>Thanks</p>","450780","","","","","2010-12-13 09:32:54","Android - When bundling List<MyClass> use Parceling or Serializing?","<android><bundle><serializable><parcelable><parcel>","3","0","","",""
"4426015","1","","","2010-12-13 05:21:43","4","4582","<p>Say I have multiple .apk files. Is it possible to combine all these into one .apk file for the convenience of the end user? </p>","540062","","","","","2011-09-16 08:37:54","Is it possible to install multiple android applications in one APK file?","<android>","2","2","2","",""
"4426070","1","4433986","","2010-12-13 05:32:22","1","1146","<p>I am creating an iPhone / Android tower-defense type game were the enemy units must follow a predetermined path, which will be the same for the iPhone and Android versions. I had initially thought cubic bezier curves or a b-spline would be the way to go, however I haven't found a straightforward way to generate the paths and describe them.</p><p>Is this the right approach, and if so are there any tools to generate the path graphically and determine the coordinates of the control points, etc?</p><p>The path also needs to be smoothed (i.e. not a collection of line segments).</p>","474005","","474005","","2010-12-13 19:05:36","2011-06-11 23:24:00","How to create a smooth path for characters to follow in 2D game","<iphone><android><bezier><spline>","3","0","1","",""
"4426190","1","4439079","","2010-12-13 06:02:23","0","575","<p>I'm trying to add a file in my data directory on my sdcard to the mediastore content provider. However, I fear that I may have a java education issue on my hands. MediaScannerConnectionClient is purportedly a nested class of MediaScannerConnection, but this syntax won't compile.</p><p>Here is the link to the MediaScannerConnection API: <a href=""http://developer.android.com/reference/android/media/MediaScannerConnection.html"" rel=""nofollow"">http://developer.android.com/reference/android/media/MediaScannerConnection.html</a></p><p>What would be the appropriate way to reference scanner?</p><p>Thanks!</p><pre><code>final String filename = (new File(img.uri.toString())).getAbsolutePath().substring(6);        final MediaScannerConnection scanner = new MediaScannerConnection(this,                new MediaScannerConnectionClient() {                    public void onMediaScannerConnected() {                        MediaScannerConnection.this.scanFile(filename, null /*mimeType*/);                    }                    public void onScanCompleted(String path, Uri uri) {                         MediaScannerConnection.this.disconnect();                    }            });        scanner.connect();</code></pre>","210920","","","","","2010-12-14 12:20:44","MediaScannerConnection, this syntax won't compile","<java><android>","1","2","1","",""
"4426236","1","4426423","","2010-12-13 06:12:15","0","718","<p>I have searched for an answer to this, and it is probably a beginner question.  I am a beginning android programmer and have created my longest code source to date.  Approximately 550 lines in one activity.  </p><p>I have built this app as a trial/limited version of a full app that I am creating.  The difference between the two builds are 5 lines of code.  </p><p>Is there a way to clone the first app with a different package name?  I can copy and paste the source in the workspace, and this creates another source with the same package name.  </p><p>There has to be a faster way than creating a new project and copying and pasting all the code, recreating all the images and icons.  Or I would think there was.</p>","440968","","","","","2010-12-13 06:51:18","Clone app with different package name","<android><namespaces><clone><package>","2","0","1","",""
"4426325","1","","","2010-12-13 06:30:45","2","1497","<p>I want to play a sound of a particular frequency in android based on user input, somewhat similar to guitar application. Can anyone tell me how to do that? Do i need to have all freq sounds in the res\raw folder?</p>","540154","","","","","2010-12-13 16:21:04","Playing sound of a particular frequency in android","<android><soundpool><javasound>","3","0","1","",""
"4426350","1","4426383","","2010-12-13 06:36:43","3","884","<p>I have developed an Android application and had it tested on emulator as well as device. I want to export the .apk file to the client for review. I used the Application manifest file to export the unsigned apk and sent it, but that's not getting installed on his phone.</p><p>I have read multiple questions over here but din't get anything in specific to resolve my issue. I'm very new to this platform. </p><p>Can anybody please help me in this regard?</p><p>Thanx in advance.</p>","227943","","","","","2012-11-16 18:34:40","Send the .apk file to client for review","<android><export><apk>","3","0","","",""
"4426408","1","4590890","","2010-12-13 06:49:15","3","695","<p>i am developing one app using opengl surface view ,how can implemented please forward some example  android apps using open gl surface </p><p>thanks in advance </p><p>narasimha</p>","254790","","178060","","2010-12-13 16:23:24","2011-01-04 05:24:15","example of opengl surface apps in android","<android><opengl-es><surfaceview>","1","2","3","",""
"4426464","1","","","2010-12-13 07:00:59","3","938","<p>I have a dashboard section in my android application where once a user clicks on a button, a preogressDialog is show (""Please Wait"") and the next activity loads up. But when i click the android device bacj button, the progress bar is still showing up. I used dismiss() but to no use. Any help is appreciated.</p><pre><code>progressDialog.setMessage(""Please wait..."");progressDialog.setIndeterminate(true);progressDialog.setCancelable(true);progressDialog.show();browseCategories();protected void browseCategories() {        Log.i(MY_DEBUG_TAG, ""Bow!"");        Intent c = new Intent(this, CategoryListActivity.class);    c.putExtra(""user"", u);    startActivity(c);}</code></pre>","396543","","","","","2013-09-08 12:25:21","Android Progress bar not hiding","<android>","2","0","2","2014-03-27 20:14:23",""
"4426553","1","4458130","","2010-12-13 07:18:36","3","851","<p>On the Android platform, how would I separate the rendering from the logic?I can get a basic custom thread class doing the drawing but what I don't get is where to put the logic update.Doing some research, I think it would be best to use two different threads one for each, rendering and logic updating.All I can think of atm is to updatelogic with the onDraw in the same thread.Any pointers to tutorials or some insight on the matter would be much appreciated, thanks.</p>","507007","","","","","2010-12-16 06:42:19","Android render and logic threads","<java><android><multithreading>","1","3","0","",""
"4426616","1","4887135","","2010-12-13 07:30:15","13","1328","<p>I'm curious if anyone has done any performance testing on querying a <code>ContentProvider</code> via <code>ContentResolver</code> vs querying a <code>SQLiteDatabase</code> object in the same process. I'm guessing that a <code>ContentResolver</code> query passes back a Cursor that communicates with the database through a Binder (Android IPC). This means that if I read the contents of 100 records through the <code>Cursor</code> that would result 100 Binder method calls. Are my guesses correct and if so would that be significantly slower than accessing the database in the same process?</p>","215266","","844882","","2012-10-15 17:24:01","2012-10-15 17:24:01","Android ContentProvider Performance","<android><performance><sqlite><ipc>","1","1","7","",""
"4426638","1","","","2010-12-13 07:33:34","0","573","<p>How to kill a running CTS instance.Suppose one CTS instance is running on a terminal and if we abruptly close that terminal, that CTS instance will not be closed and when we try to start CTS again in a fresh terminal,we get this error[CTS_ERROR >>> Error: CTS is being used at the moment. No more than one CTS instance is allowed simultaneously] so how to go to CTS Host this time or kill this running instance. </p>","540205","","549521","","2012-07-25 22:45:25","2012-07-25 22:45:25","Regarding CTS Error","<android><cts><android-cts>","1","1","","",""
"4426690","1","4427393","","2010-12-13 07:41:26","0","508","<p>I am adding tabbar in doInBackground method  get exception  in android can any body tell how to add give example my code is below</p><pre><code>package com.inquest;import java.util.ArrayList;//import com.inquest.LoginActivity.FetchTask;import android.app.Activity;import android.app.AlertDialog;import android.app.ProgressDialog;import android.app.TabActivity;import android.content.Context;import android.content.DialogInterface;import android.content.Intent;import android.content.res.Resources;import android.graphics.Typeface;import android.os.AsyncTask;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;import android.view.Gravity;import android.widget.Button;import android.widget.RelativeLayout;import android.widget.TabHost;import android.widget.TabWidget;import android.widget.TextView;import android.widget.TabHost.TabSpec;//TabActivity public class HelloTabWidget extends TabActivity {  int width =40;    int height =49; //private TabHost tabHost; TextView txthome; TextView txtstock; TextView txtcitn; TextView txtmyquest; Button btn; //private ProgressDialog pd = null;     private ProgressDialog dlg;     private Object data = null;     String strusername="""";    String strPassWord="""";    String questGroupId="""";    String userid="""";    String systemuserid="""";    String providerid="""";    private ProgressDialog dialog;  public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.tab);  new TabTask(HelloTabWidget.this).execute(null); } public class TabTask extends AsyncTask&lt;Void, Void,Void&gt;  {      private ProgressDialog dlg;           private Context ctx;      public TabTask(Context context) {          ctx = context;      }      @Override      protected void onPreExecute() {          super.onPreExecute();          dlg = new ProgressDialog(HelloTabWidget.this);          dlg.setMessage(""Loading...."");          dlg.show();     }   @Override  protected Void doInBackground(Void... params) {   try      {       Resources res = getResources();       TabHost.TabSpec spec;       TabHost tabHost=getTabHost();       TabWidget tabWidget = tabHost.getTabWidget();       //TabHost tabHost=(TabHost)this.findViewById(R.)       //TabHost tabHost =  (TabHost)this.findViewById(R.id.)       // tabHost.setBackgroundResource(R.color.gray1);    //tabWidget.setBackgroundResource(R.color.gray1);       //tabWidget.setBackgroundDrawable(res.getDrawable(R.drawable.quest_tab_bar_icon));       //tabWidget.setBackgroundColor(R.color.gray1);       //tabWidget.setBackgroundDrawable(getResources().getDrawable(R.drawable.tabbar));       Typeface myTypeface = Typeface.createFromAsset(ctx.getAssets(),""verdanab.TTF"");       Typeface myTypeface1 = Typeface.createFromAsset(ctx.getAssets(),""verdana.TTF"");       Intent homeintent;          // Create an Intent to launch an Activity for the tab (to be reused)        homeintent = new Intent();        Bundle bundle=getIntent().getExtras();        String strusername=bundle.get(""strUserName"").toString();        String strPassWord=bundle.get(""strPassword"").toString();        String questGroupId=bundle.get(""questGroupId"").toString();        String userid=bundle.get(""userid"").toString();        String systemuserid=bundle.get(""systemuserid"").toString();        String providerid=bundle.get(""providerid"").toString();         Log.d(""home activity username"", strusername);        Log.d(""home activity password"", strPassWord);        Log.d(""home activityquestGroupId"",questGroupId);           homeintent.setClass(ctx, HomeActivityGroup.class);          homeintent.putExtra(""strUserName"", strusername);         homeintent.putExtra(""strPassWord"",strPassWord );         homeintent.putExtra(""questGroupId"",questGroupId);         homeintent.putExtra(""userid"",userid);         homeintent.putExtra(""systemuserid"", systemuserid);         homeintent.putExtra(""checking"", ""one"");          spec = tabHost.newTabSpec(""home"").setIndicator(""Home"",res.getDrawable(R.drawable.home_tab_bar_icon)).setContent(homeintent);       tabHost.addTab(spec);        //homeintent = new Intent().setClass(this,ThemeSearchActivity.class);        homeintent = new Intent().setClass(ctx,StockActivity.class);       homeintent.putExtra(""strUserName"", strusername);       homeintent.putExtra(""strPassWord"",strPassWord );       homeintent.putExtra(""questGroupId"",questGroupId);       homeintent.putExtra(""userid"",userid);       homeintent.putExtra(""systemuserid"", systemuserid);       homeintent.putExtra(""providerid"", providerid);         spec = tabHost.newTabSpec(""stock"").setIndicator(""Stock"",res.getDrawable(R.drawable.stocks_tab_bar_icon)).setContent(homeintent);       tabHost.addTab(spec);       homeintent = new Intent().setClass(ctx,ArticleActivity.class);           spec = tabHost.newTabSpec(""citn"").setIndicator(""CITN"",res.getDrawable(R.drawable.citn_tabbar_icon)).setContent(homeintent);       tabHost.addTab(spec);       homeintent = new Intent().setClass(ctx, MyCompaniesActivity.class);        spec = tabHost.newTabSpec(""myquest"").setIndicator(""My Quest"",res.getDrawable(R.drawable.quest_tab_bar_icon)).setContent(homeintent);       tabHost.addTab(spec);       for (int i =0; i &lt; tabWidget.getChildCount(); i++) {         //tabWidget.getChildAt(i).setBackgroundColor(R.color.black);          tabWidget.getChildAt(i).getLayoutParams().height = height;      tabWidget.getChildAt(i).getLayoutParams().width = width;      RelativeLayout relLayout = (RelativeLayout)tabWidget.getChildAt(i);       TextView tv = (TextView)relLayout.getChildAt(1);       tv.setTextSize(10.0f);      //tv.setCompoundDrawablesWithIntrinsicBounds(0, 1, 0, 0);     tv.setTypeface(myTypeface1);                      }      }             catch (Exception e) {       // TODO: handle exception              e.printStackTrace();      }         return null;             //return parservalue;       } }   }</code></pre>","426344","","","","","2011-01-18 12:47:21","adding tabbar in doInBackground method get exception in android","<android>","1","1","","",""
"4426694","1","","","2010-12-13 07:41:47","2","1015","<p>when i run the ddms tool in the tools directory i got this error""failed to get the adb version:cannot run program adb;create process error=2;the system cannot find file specified""</p><p>how can i solve this problem</p>","543019","","168868","","2012-01-30 13:50:27","2012-04-05 12:29:52","android ddms tool error specified","<android><android-emulator><ddms>","4","0","","",""
"4426779","1","","","2010-12-13 07:52:55","3","771","<p>I am using loadDataWithBaseURL() to display the contents on WebView.I need to refresh my WebView on clicking next button, please help me out in this concern.</p><p>Here is my sample code</p><pre><code>public class screen extends Activity    {    WebView browser;     public void onCreate(Bundle savedInstanceState)       {       super.onCreate(savedInstanceState);       setContentView(R.layout.temp);       browser = (WebView)findViewById(R.id.WebView01);       browser.loadDataWithBaseURL("""", ""&lt;HTML&gt;&lt;BODY&gt;Here we are&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;"", ""text/html"", Encoding.UTF_8.toString(),"""");      next.setOnClickListener(new View.OnClickListener()          {            public void onClick(View view)             {                screen.this.browser.loadDataWithBaseURL("""", ""&lt;HTML&gt;&lt;BODY&gt;Here I am&lt;/BODY&gt;&lt;/HTML&gt;"", ""text/html"", Encoding.UTF_8.toString(),"""");          }      });    } }</code></pre>","494714","","1045074","","2012-11-09 04:59:41","2012-11-09 04:59:41","How to refresh WebView when we are using loadDataWithBaseURL?","<android><webview><refresh>","0","0","","",""
"4426818","1","4427113","","2010-12-13 07:59:28","0","97","<p>my app wants to update pictures on the web on a regular basis. This doesn't require UI feedback, so I just start a new Thread and let it run. The problem is, that this update-method may be called before the previous one has been finished. How can I make sure that the second call doesn't start a new thread but is queued and automatically started when the previous one finished? Are handlers the right solution here as well?</p><p>Here the code:</p><pre><code>public static void updatePictureOnPicasa(final PictureEntry pe) {    new Thread() {        public void run() {            try {                if(pe.isUpdated())                    picasa.updatePicture(pe.getUrl(), pe.getDescription(), pe                        .getTags());            } catch (Exception e) {                Log.e(Prototype.TAG, ""Unable to update picture on Picasa ""                        + pe.getUrl());            }        }    }.start();}</code></pre>","538581","","","","","2010-12-13 08:49:33","Queuing threads in Android","<android><multithreading>","1","0","","",""
"4426843","1","4429735","","2010-12-13 08:04:04","7","7305","<p>Hi what is the  the standard method new to Android 2.2 and an ad hoc method for older OS versions,  for sending crash report.</p>","487219","","","","","2012-04-03 09:57:27","Android Crash Report","<android>","3","1","3","2012-07-11 11:54:26",""
"4426891","1","","","2010-12-13 08:11:34","0","1251","<p>I have an appwidget, and onupdate i call this method:</p><pre><code>String asd=loadStringValue(""asd"");public static String loadStringValue(String sName) {            //try {                SharedPreferences settings = mycontext.getSharedPreferences(saved_pref_file, 0);                return settings.getString(sName,"""");            //} catch (Exception ex) {  return """";      }        }</code></pre><p>the probleme is: i get a nullexception sometimes, and a crash. What is the probleme here? </p>","472537","","","","","2010-12-15 00:17:56","android appwidget/sharedpreferences crash","<android><sharedpreferences>","3","0","","",""
"4426930","1","","","2010-12-13 08:19:42","0","883","<p>I am trying to execute 2.2 test suite, until this point it stopped with the following error:</p><blockquote>  <p>......</p>    <p>android.content.res.cts.ResourcesTest#testGetAssets...(pass)  android.content.res.cts.ResourcesTest#testGetSystem...(pass)  android.content.res.cts.ResourcesTest#testGetLayout...(pass)  android.content.res.cts.ResourcesTest#testGetBoolean...(pass)  android.content.res.cts.ResourcesTest#testgetFraction...(pass)  android.content.res.cts.ResourcesTest#testParseBundleExtras...(pass)</p>    <p>CTS_INFO >>> Max ADB operations  reached. Restarting ADB...</p>    <p>CTS_INFO >>> Restarting device ...  04:09:28 E/DeviceMonitor: Sending jdwp  tracking request failed!  Device(BABABEEFBABABEEF) disconnected  Test stopped.</p></blockquote><p>I check the result testResult.xml it shows a number of tests not yet executed:</p><blockquote>  <p>Tests Passed 652 </p>    <p>Tests Failed 10 Tests</p>    <p>Timed out 64</p>    <p>Tests Not Executed 23114</p></blockquote><p>What is the reason the test stopped half way like this?</p>","540165","","","","","2010-12-13 08:45:37","cts execution stopped half-way","<android>","1","0","","",""
"4427187","1","4427233","","2010-12-13 09:02:08","0","1277","<p>I want to know the Query to check whether the particular Record in the DataBase already exists or not for my application.</p><p>I have made one function for these, but it is not working properly.</p><pre><code>public boolean ifExisting(String name) {    Cursor c = db.rawQuery(""SELECT * FROM "" + TABLE_NAME + ""WHERE"" + ""name"" + ""="" + name, null);    if(c.getCount() == 0)     return false; else     return true;}</code></pre><p>This is the place where I need to perform the function of checking for the Duplication Process.</p><pre><code>if(dh.ifExisting(dataVector.get(position)) == true) {} else {dh.insert(dataVector.get(position));} </code></pre><p>Can anybody please help me.</p><p>Thanks,david</p>","422859","","180538","","2010-12-13 09:06:26","2010-12-13 09:10:07","Select query to check the existing record in the SQLite Database in android","<android><sqlite><select><duplication>","3","2","","",""
"4427238","1","4427432","","2010-12-13 09:09:53","13","9988","<p>I just Obfuscated my Android code using proguard and then decompiled it.  There are a number of strings I would really like to hide from prying eyes.  When I decompiled my code the strings were there for everyone to see...and change.  One of the strings is a URL to my licensing server and they could in effect change the url to point to a fake server (as I will be releasing the server code to the public).  What is the best way of hiding this sort of information?</p><p>Also, I noticed that the R class strings are all random numbers but I can't find the R class in the decompiled code.  Where is it?</p><p><strong>Foe example</strong> I see: <code>new SimpleCursorAdapter(localActivity, 2130903058, localCursor, arrayOfString, arrayOfInt);</code></p><p>2130903058 is a layout file but what is it referencing?  The number means nothing unless it is pointing to some sort of address.</p>","248521","","248521","","2010-12-13 09:30:02","2013-07-02 06:54:04","hiding strings in Obfuscated code","<java><android><proguard>","4","1","4","",""
"4427278","1","4428263","","2010-12-13 09:14:55","3","9492","<p>I have this RelativeView with 3 radiobuttons on top. I want to change the bottom part of the view when the user clicks on one of the buttons.</p><p>The blue part is the place i want to load different Views in.<img src=""http://i.stack.imgur.com/gVLnD.png"" alt=""alt text""></p><pre><code>@Overridepublic void onCheckedChanged(RadioGroup group, int checkedId) {    if (checkedId == iVerzekeringen){        layout.removeView(body);   // THIS PART IS        layout.addView(testview);  // NOT WORKING    }    else if (checkedId == iPersoonlijk){    }    else if (checkedId == iNotities){    }}</code></pre><p>How can i load different Views into the blue part?</p>","517460","","517460","","2010-12-13 09:27:43","2010-12-13 11:29:44","Dynamically change view inside view in Android","<android><view><dynamic>","2","2","1","",""
"4427322","1","4427645","","2010-12-13 09:19:37","0","692","<p>I want to have a common bottom bar in Android. If any of the button is clicked then it should open up the new activity with bottom bar still at the bottom. Is there any way to achieve this? I have tried having a superclass with 4 buttons at the bottom and then opening new activity on click event but I do not know why the bottom bar is not displayed and also is this is the proper approach?</p>","261566","","","","","2010-12-14 10:24:22","Bottom bar in Android with different layout above?","<android><button>","1","0","1","",""
"4427344","1","","","2010-12-13 09:22:07","1","366","<p>I'm trying to install SDK but I'm having no luck.</p><p>First of all, I kept getting the following error:</p><blockquote>  <p>Failed to fetch URL  <a href=""https://dl-ssl.google.com/android/repository/repository.xml"" rel=""nofollow"">https://dl-ssl.google.com/android/repository/repository.xml</a>,  reason: dl-ssl.google.co.uk</p></blockquote><p>I therefore closed that window down and went into Settings to tick the box ""Force https://... sources to be fetched using http://</p><p>But then I got a very similar error which complained about the http:// URL</p><p>I'm beginning to think it has something to do with the fact that I have McAfee installed on my PC. The problem is, this is a work PC and I can't disable the antivirus. Is there an alternative method of installing sdk on my PC?</p><p>Many thanks :)</p>","540298","","","","","2010-12-13 12:28:54","How can I install Android SDK with antivirus turned on?","<android><sdk>","2","0","","",""
"4427487","1","4427535","","2010-12-13 09:40:16","17","12617","<p>I am trying to access textalertapp.com via HTTP Post request from my android application. But I am getting Unknown host error. Can anybody help me solve this issue. </p><pre><code>12-13 01:30:16.058: WARN/System.err(473): java.net.UnknownHostException: textalertapp.com    12-13 01:30:16.088: WARN/System.err(473):     at java.net.InetAddress.lookupHostByName(InetAddress.java:513)    12-13 01:30:16.088: WARN/System.err(473):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)    12-13 01:30:16.088: WARN/System.err(473):     at java.net.InetAddress.getAllByName(InetAddress.java:242)    12-13 01:30:16.088: WARN/System.err(473):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)    12-13 01:30:16.099: WARN/System.err(473):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)    12-13 01:30:16.099: WARN/System.err(473):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)    12-13 01:30:16.099: WARN/System.err(473):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)    12-13 01:30:16.108: WARN/System.err(473):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)    12-13 01:30:16.118: WARN/System.err(473):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)    12-13 01:30:16.118: WARN/System.err(473):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)    12-13 01:30:16.118: WARN/System.err(473):     at com.textalert.alertCollection.getAlerts(alertCollection.java:46)    12-13 01:30:16.118: WARN/System.err(473):     at com.textalert.alertsList$1.run(alertsList.java:81)    12-13 01:30:16.128: WARN/System.err(473):     at java.lang.Thread.run(Thread.java:1096)</code></pre><p>Code is </p><pre><code> HttpClient client = new DefaultHttpClient();                String postURL = ""http://textalertapp.com/androidCode/?api=AlertManager&amp;method=getAlerts"";                HttpPost post = new HttpPost(postURL);                 List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();                params.add(new BasicNameValuePair(""user"", ""kris""));                params.add(new BasicNameValuePair(""pass"", ""xyz""));                UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8);                post.setEntity(ent);                HttpResponse responsePOST = client.execute(post);                  HttpEntity resEntity = responsePOST.getEntity();                  if (resEntity != null) {                        Log.i(""RESPONSE"",EntityUtils.toString(resEntity));                }</code></pre>","340002","","340002","","2010-12-13 09:47:47","2011-03-29 23:31:03","Java unknown host exception","<java><android><android-emulator>","3","1","1","",""
"4427509","1","","","2010-12-13 09:43:25","0","3033","<p>I have listview collection that show id and name in Android. I following example from <a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow"">this</a> resource site.</p><p>But actually that example only display name. I wish similar like checkboxlist in ASP.NET that contain property text and value. So the text to show name and value store id. When user select one item, I could retrieve id by viewtext.</p><p>My question is how do I set id and name in same viewtext item? I wish could pass the id to another layout.</p><p>I know that possible using multi viewtext then set invisible of viewtext using map. How that could be waste memory. </p><p>Thank.</p>","473962","","","","","2010-12-14 17:38:26","Set, get text and value in listitem view in Android","<android><listview><textview>","2","0","","",""
"4427515","1","","","2010-12-13 09:44:17","2","8535","<p>Is there an example code, or a tutorial on how to use the Thread.setDefaultUncaughtExceptionHandler method? Basically I'm trying to display a custom alert dialog, whenever an exception is thrown, in my application. Is it possible to do this? I know it's a little bit tricky to display something on the screen, if the exception is thrown in the ui thread but I don't know any work around for this.</p><p>Best Regards,</p><p>Gratzi</p>","460611","","","","","2012-01-16 08:09:41","Using Global Exception Handling on android","<android>","2","5","4","",""
"4427574","1","","","2010-12-13 09:51:23","6","20314","<p>I want to display contacts in list view and add actions on all contacts , like on click on a particular contact it should display the phone number , mail id and delete of the particular contact...</p><pre><code>import android.app.ListActivity;import android.content.ContentResolver;import android.database.Cursor;import android.os.Bundle;import android.provider.ContactsContract;import android.view.Menu;import android.view.View;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;public class CPDemo1 extends ListActivity {    @SuppressWarnings(""unchecked"") public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);     String str[]=    {""datta"",""vivek"",""Nagesh sir"",""shiv""};     String name;         ContentResolver cr = getContentResolver();        Cursor cursor = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);        int nameIdx = cursor.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME);        if (cursor.moveToFirst())         do {         int x = 0;         name = cursor.getString(nameIdx);         str[x]= name;                 x++;          ArrayAdapter arr = new ArrayAdapter(this, android.R.layout.simple_list_item_1,str);          setListAdapter(arr); } while(cursor.moveToNext());        }</code></pre>","540310","","1023597","","2012-08-12 10:09:56","2013-08-01 02:00:48","Android. to display contacts as list view","<android><listview><android-contacts><listactivity>","3","2","4","",""
"4427608","1","4428288","","2010-12-13 09:55:07","40","46265","<p>I need to pass a resource ID to a method in one of my classes. It needs to use both the id that the reference points to and also it needs the string. How should I best achieve this?</p><p>For example:</p><pre><code>R.drawable.icon</code></pre><p>I need to get the integer ID of this, but I also need access to the string ""icon"".</p><p>It would be preferable if all I had to pass to the method is the ""icon"" string.</p>","353674","","","","","2013-11-29 16:01:19","Android, getting resource ID from string?","<android><resources>","7","2","11","",""
"4427789","1","4429661","","2010-12-13 10:15:47","0","882","<p>I'm having an issue with my layout being displayed in portrait/landscape mode.  Basically, the hierarchy of my layout goes like this:  Main (Workspace view) -> TextView + Listview (w/ BaseAdapter) -> Listview Item.</p><p>My issue is, if I'm starting out in portrait mode my items display correctly as they should.  But then if I rotate the device, what happens is my entire layout gets shifted over about half a screen (i.e. when I switch, about half of the left side of the View is completely black, and it thinks my true ""left edge"" is in the middle of the screen - I can see the items which are supposed to be aligned left in the middle).  On the flip side of this, if I begin in landscape mode and switch to portrait mode, half of the right side of the screen is completely black and the ""right edge"" is in the middle and I can see my rightmost items ending there.</p><p>Here is the layout I'm working with...First my View within the Workspace (Listview uses a BaseAdapter):</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/tvMainChannel""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:gravity=""center""        android:text=""Disconnected""        android:textColor=""#FFFFFF""        android:singleLine=""true""/&gt;    &lt;ListView android:id=""@android:id/list""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre><p>And here is my individual listview items which are inflated into the above ListView (in horizontal arrangement, each item should display from left to right: Image, Text, Image):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    android:orientation=""horizontal""&gt;    &lt;ImageView android:id=""@+id/images""        android:layout_height=""30dp""        android:layout_width=""wrap_content""        android:paddingLeft=""5px""        android:paddingRight=""5px""        android:layout_alignParentLeft=""true""/&gt;    &lt;ImageView android:id=""@+id/images_ping""        android:layout_height=""30dp""        android:layout_width=""wrap_content""        android:paddingLeft=""5px""        android:paddingRight=""5px""        android:layout_alignParentRight=""true""/&gt;    &lt;TextView android:id=""@+id/text""        android:layout_height=""30dp""        android:layout_width=""wrap_content""        android:gravity=""center_vertical""        android:text=""Username""        android:textColor=""#FFFFFF""        android:layout_toRightOf=""@+id/images""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>I've tried switching things around between Linear and Relative, but I've gotten no where...kind of at a loss as to what might be the cause of this.</p><p>Any insight is much appreciated.</p><p>Thanks!</p><p><strong>EDIT:</strong> For a little more clarification, this is my main.xml file which uses Workspace:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.test.MultiView xmlns:app=""http://schemas.android.com/apk/res/com.test""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/mvMain""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    app:default_screen=""0""&gt;    &lt;include android:id=""@+id/main_rtb"" layout=""@layout/main_rtb"" /&gt;    &lt;include android:id=""@+id/main_listview"" layout=""@layout/main_listview"" /&gt;&lt;/com.test.MultiView&gt;</code></pre>","535476","","535476","","2010-12-13 20:47:40","2010-12-14 09:36:18","Having an issue with layout cutoff/offset in my view","<android><android-layout>","1","0","","",""
"4427792","1","","","2010-12-13 10:16:14","3","575","<p>I have developed an android application which takes a picture, calls a web services and sends both documents (the picture and web service response) with <code>ACTION_SEND_MULTIPLE</code> intent. This action requires the data to be passed as an <code>ArrayList&lt;? extends Parcelable&gt;</code>; Therefore the application stores the data in temporary files and creates two <code>Uri</code> objects from these files. The main drawback is that the application cannot delete these temporary files since it is not possible to determine if the called activity handled the data.</p><p>Is it possible to send data (<code>byte[]</code> data type) with an <code>ACTION_SEND</code> or <code>ACTION_SEND_MULTIPLE</code> without creating temporary files?</p><p>Thanks</p>","432589","","","","","2010-12-13 10:32:41","Sending byte[] data to an activity without creating a file","<android><android-intent><attachment>","1","0","1","",""
"4427933","1","4492408","","2010-12-13 10:35:53","1","626","<p>Okay, first, I'm a noob at android programming.  I have taken some Java, but I'm still learning (aren't we all).I'm trying to take the source code form <a href=""http://www.ibm.com/developerworks/xml/library/x-android/"" rel=""nofollow"">here</a> and have it read an RSS feed correctly.  Currently I have 2 problems.  I'll just state the first one and then post another post for the second.<br>One the RSS feed is displayed on my device, it doesn't include all of the details (description).  When I load the feed through my browser I notice that some of the quotation marks and apostrophes are turned into &quot; and &#39;.  For some reason this stops the parser from correctly parsing it.  Any help would be greatly appreciated.</p>","522983","","","","","2010-12-20 17:59:31","Some Quotes and apostrophes don't parse correctly","<android><xml-parsing>","2","4","","",""
"4427939","1","4428477","","2010-12-13 10:36:19","-1","1532","<p>Can anyone explain what this method of PowerManager.Wakelock is for?</p><p><a href=""http://developer.android.com/reference/android/os/PowerManager.WakeLock.html#setReferenceCounted%28boolean%29"" rel=""nofollow"" title=""setReferenceCounted"">setReferenceCounted</a></p><p>""Wake locks are reference counted by default."" - why?</p>","474326","","","","","2010-12-13 11:46:34","Wakelock Reference Count","<android><reference><android-wake-lock><wakelock>","1","2","1","",""
"4427947","1","","","2010-12-13 10:38:06","1","384","<p>I have put in place the ServerManagedPolicy and am noticing some strange things.(I have yet to publish the update)</p><p>So on a phone that has already purchased my application I have installed the new APK.It all works good, however I then wanted to attempt testing when out of signal etc.So I turn airplane mode on, and I instantly get the not licenced messaged.</p><p>The other account is not in my test account list.Is this happening because I have not published the application so the VT,GT &amp; GR results that are coming back are tiny or have I done something wrong ?</p>","507991","","","","","2010-12-13 10:50:44","ServerManagedPolicy issues","<android><licensing>","1","0","","",""
"4428002","1","4428147","","2010-12-13 10:45:38","0","420","<p>what is the purpose of gesture in android??? touchscreen mobile in android how they implement  sliding .when finger just touch the screen how the images are scrolled ?? anybody can explain pls </p>","538626","","","","","2010-12-13 18:41:24","what is the purpose of gesture in android?","<android>","2","2","","",""
"4428022","1","4461871","","2010-12-13 10:48:35","3","6192","<p>I converted one jquery script into Android app , Now i want to add admob into it , is this possible ???</p>","144882","","","","","2013-04-22 10:32:59","Admob implementation in Phonegap for Android app","<android><phonegap><admob>","2","1","1","",""
"4428277","1","4428297","","2010-12-13 11:20:10","0","3033","<p>How the web push-notification is implemented in Android? Any sample source code or tutorial please.</p>","274107","","","","","2012-03-04 00:40:14","Android SDK web-push-notification?","<android><push><push-notification>","1","1","","",""
"4428321","1","","","2010-12-13 11:24:40","0","221","<p>I've been implementing the Android market Licensing in my app and it looks like everything works.  At present, however, when the chec kfails, I'l displaying a Toast message and calling moveTaskToBack().</p><p>This is obviously not an acceptable way to close the app, since the user can simply open it again and carry on as before.</p><p>What would be the best way to actually kill the app after the Toast has displayed?</p>","398293","","","","","2011-06-14 03:40:41","Killing an app that fails the License check","<android>","1","0","","",""
"4428404","1","","","2010-12-13 11:36:05","1","2394","<p>I have login page from login if user click login button. It will go to tabactivity in tab activity I have four tab home,stock etc. From tabactivity I am calling activity group for nested activity. From activity group I am calling homeactivity from home I am loading tab bar and calling webservices and parsing value and load the home activity in home tab. It take time How to avoid black screen can anybody give example. I have tried lot but it's not working if any body know give code.In second activity I am loading tab bar up to tab loaded and calling webservices. I have to show some splash screen.</p><p>I am adding tabbar in <code>doInBackground</code> method, is it correct?</p><pre><code>import java.util.ArrayList;//import com.inquest.LoginActivity.FetchTask;import android.app.Activity;import android.app.AlertDialog;import android.app.ProgressDialog;import android.app.TabActivity;import android.content.Context;import android.content.DialogInterface;import android.content.Intent;import android.content.res.Resources;import android.graphics.Typeface;import android.os.AsyncTask;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;import android.view.Gravity;import android.view.Window;import android.widget.Button;import android.widget.RelativeLayout;import android.widget.TabHost;import android.widget.TabWidget;import android.widget.TextView;import android.widget.TabHost.TabSpec;//TabActivity public class HelloTabWidget extends TabActivity {     int width =40;       int height =49;    //private TabHost tabHost;    TextView txthome;    TextView txtstock;    TextView txtcitn;    TextView txtmyquest;    Button btn;    //private ProgressDialog pd = null;     private ProgressDialog dlg;     private Object data = null;     String strusername="""";    String strPassWord="""";    String questGroupId="""";    String userid="""";    String systemuserid="""";    String providerid="""";    private ProgressDialog dialog;  public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);        setProgressBarIndeterminateVisibility(true);    setContentView(R.layout.tab);     new TabTask(HelloTabWidget.this).execute(null); //} } public class TabTask extends AsyncTask&lt;Void, Void,Void&gt;  {         private ProgressDialog dlg;           private Context ctx;         public TabTask(Context context) {             ctx = context;         }         @Override         protected void onPreExecute() {             super.onPreExecute();             dlg = new ProgressDialog(HelloTabWidget.this);             dlg.setMessage(""Loading...."");             dlg.show();        }         @Override        protected Void doInBackground(Void... params) {            // TODO Auto-generated method stub            try            {                 TabHost.TabSpec spec;                 TabHost tabHost=getTabHost();                 TabWidget tabWidget = tabHost.getTabWidget();                Resources res = getResources();                                                    Typeface myTypeface = Typeface.createFromAsset(ctx.getAssets(),""verdanab.TTF"");                Typeface myTypeface1 = Typeface.createFromAsset(ctx.getAssets(),""verdana.TTF"");                Intent homeintent;                   // Create an Intent to launch an Activity for the tab (to be reused)                 homeintent = new Intent();                 Bundle bundle=getIntent().getExtras();                 String strusername=bundle.get(""strUserName"").toString();                 String strPassWord=bundle.get(""strPassword"").toString();                 String questGroupId=bundle.get(""questGroupId"").toString();                 String userid=bundle.get(""userid"").toString();                 String systemuserid=bundle.get(""systemuserid"").toString();                 String providerid=bundle.get(""providerid"").toString();                  Log.d(""home activity username"", strusername);                 Log.d(""home activity password"", strPassWord);                 Log.d(""home activityquestGroupId"",questGroupId);                    homeintent.setClass(ctx, HomeActivityGroup.class);                   homeintent.putExtra(""strUserName"", strusername);                  homeintent.putExtra(""strPassWord"",strPassWord );                  homeintent.putExtra(""questGroupId"",questGroupId);                  homeintent.putExtra(""userid"",userid);                  homeintent.putExtra(""systemuserid"", systemuserid);                  homeintent.putExtra(""checking"", ""one"");                   spec = tabHost.newTabSpec(""home"").setIndicator(""Home"",res.getDrawable(R.drawable.home_tab_bar_icon)).setContent(homeintent);                tabHost.addTab(spec);                 //homeintent = new Intent().setClass(this,ThemeSearchActivity.class);                 homeintent = new Intent().setClass(ctx,StockActivity.class);                homeintent.putExtra(""strUserName"", strusername);                homeintent.putExtra(""strPassWord"",strPassWord );                homeintent.putExtra(""questGroupId"",questGroupId);                homeintent.putExtra(""userid"",userid);                homeintent.putExtra(""systemuserid"", systemuserid);                homeintent.putExtra(""providerid"", providerid);                  spec = tabHost.newTabSpec(""stock"").setIndicator(""Stock"",res.getDrawable(R.drawable.stocks_tab_bar_icon)).setContent(homeintent);                tabHost.addTab(spec);                homeintent = new Intent().setClass(ctx,ArticleActivity.class);                    spec = tabHost.newTabSpec(""citn"").setIndicator(""CITN"",res.getDrawable(R.drawable.citn_tabbar_icon)).setContent(homeintent);                tabHost.addTab(spec);                homeintent = new Intent().setClass(ctx, MyCompaniesActivity.class);                 spec = tabHost.newTabSpec(""myquest"").setIndicator(""My Quest"",res.getDrawable(R.drawable.quest_tab_bar_icon)).setContent(homeintent);                tabHost.addTab(spec);                for (int i =0; i &lt; tabWidget.getChildCount(); i++) {                     //tabWidget.getChildAt(i).setBackgroundColor(R.color.black);                      tabWidget.getChildAt(i).getLayoutParams().height = height;               tabWidget.getChildAt(i).getLayoutParams().width = width;               RelativeLayout relLayout = (RelativeLayout)tabWidget.getChildAt(i);                TextView tv = (TextView)relLayout.getChildAt(1);                tv.setTextSize(10.0f);               //tv.setCompoundDrawablesWithIntrinsicBounds(0, 1, 0, 0);              tv.setTypeface(myTypeface1);                      }            }                catch (Exception e) {                // TODO: handle exception                    e.printStackTrace();            }            return null;        }    }   }</code></pre>","426344","","759866","","2013-11-10 18:44:18","2014-01-10 11:36:10","display black screen from going one activity to another activity for few mins","<android>","4","2","","",""
"4428420","1","4428478","","2010-12-13 11:38:06","0","866","<p>I need to create Marquee in Android  using only java code without using xml? Please provide me with resources to program in Android using only Java code without using xml.</p>","540405","","","","","2010-12-13 11:46:43","How to create marquee in Android using only java code without xml","<android>","2","1","","",""
"4428468","1","4428499","","2010-12-13 11:44:43","1","843","<p>I have seen a new native force close dialog with a new button ""Send report"" on several apps.  </p><p><img src=""http://i.stack.imgur.com/YG3PB.png"" alt=""alt text""></p><p>How can I get it for my app?</p>","433718","","433718","","2010-12-13 11:53:32","2011-02-08 00:18:11","Native bug reporting in Android extendng force close dialog?","<android><unhandled-exception><bug-reporting>","2","0","","",""
"4428528","1","4428631","","2010-12-13 11:53:10","0","783","<p>I am developing a simple application for Android, and have just tried to switch to using an asynctask to to the FTP call and XML parsing that the app requires (it's a weather app FYI).</p><p>Unfortunately I started to notice very odd behaviour in my app. I debugged, and discovered to my horror that the code within the doInBackground() method was executing out of order!</p><p>The code below is simplified (catch statements rolled up ect) for brevity, however none of the essentials are changed. The asynctask is called in onResume(), and it then makes a call to the ftp server, downloads the file, and then parses it. What is occurring (which I can see very clearly via the debug statements you can see below), is that the parsing call is being made before the file download is complete. So, in terms of the debug statements, the order is often:</p><ol><li>Before get file</li><li>Before parse file</li><li>After parse file with error (as the file has not downloaded yet!)</li><li>After get file</li></ol><p>I am more than happy to provide more code (all of it if need be!), and answer any questions anyone might have.</p><pre><code>    @Override    public void onResume()    {       if(!inOnResume)       {          inOnResume = true;          super.onResume();          File file = new File(getFilesDir(), selectedCity);          new GetBOMWeatherData().execute(file);       }    }    private class GetBOMWeatherData extends AsyncTask&lt;File, Void, Void&gt;    {        boolean fileDownloaded = false;        @Override        protected void onPreExecute()        {            showDialog(PROGRESS_KEY);            super.onPreExecute();        }        @Override        protected Void doInBackground(File... params)        {            FileOutputStream fos = null;            try            {                fos = new FileOutputStream(params[0]);            }            catch (FileNotFoundException e)            {                Log.e(""ApiException"", ""There was an error opening the file output stream."", e);                cancel(false);            }            try            {                Log.d(""Before get file"", ""Before get file"");                DataRetriever.getPageContent(selectedCity, fos);                Log.d(""After get file"", ""After get file"");                fileDownloaded = true;            }            catch (ApiException e)            {                Log.d(""After get file with error"", ""After get file with error"");                Log.e(""ApiException"", ""There was an error opening the file output stream."", e);                cancel(false);            }            finally            {                Log.d(""After get file finally"", ""After get file finally"");            }            try            {                Log.d(""Before parse file"", ""Before parse file"");                forecasts = parseXML(selectedCity);                Log.d(""After parse file"", ""After parse file"");                lastDownloaded.put(selectedCity, new Date());            }            catch (FactoryConfigurationError e)            {                Log.d(""After parse file with error"", ""After parse file with error"");                Log.e(""XMLParsingException"", ""There was an error in the factory configuration."", e);                cancel(false);            }            finally            {                Log.d(""After parse file finally"", ""After parse file finally"");            }            return null;        }        @Override        protected void onPostExecute(Void file)        {            inOnResume = false;            super.onPostExecute(file);            dismissDialog(PROGRESS_KEY);            updateView();        }        @Override        protected void onCancelled()        {            super.onCancelled();            showDialog(FAILURE_KEY);        }    }</code></pre><p>Edit: the reason I descovered that it was executing out of order was that odd errors started to occur. If I run everything in the main UI thread it works, however as soon as I put it all in an asynctask I get XML parse errors. The issue appears to be that the file is not fully downloaded when my app tries to parse it.</p>","454725","","454725","","2010-12-15 11:13:22","2011-10-29 19:35:06","Potential bug in android's asynctask","<android><android-asynctask>","2","4","1","",""
"4428600","1","4429698","","2010-12-13 12:03:37","1","5443","<p>I have created a shared preference for a boolean value and for a string value. The boolean value is gotten in another activity. But for the string I am only getting default value.</p><h2>Home.class</h2><pre><code>    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);    SharedPreferences.Editor spe = prefs.edit();    spe.putBoolean(""flag"", true);     spe.putString(""user"", ""hello"");    spe.commit(); </code></pre><h2>welcome.class</h2><pre><code>      SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);    boolean flag= prefs.getBoolean(""flag"", false);     String user=prefs.getString(""user"",""Nothing"");        TextView tv = new TextView(this);      tv.setText(""Flag : ""+flag+("" User : ""+user);</code></pre><p>For 'user', only 'Nothing' is displaying. Where should I correct my code?</p>","523058","","823470","","2013-11-29 07:24:02","2014-01-28 17:40:58","Android: string value is not getting in Shared Preference","<android><sharedpreferences>","1","0","0","",""
"4428630","1","4953310","","2010-12-13 12:06:41","0","846","<p>Some users of our app are reporting that ringtones fail to load as expected.  I've included a typical logcat output from one of these users below.  It seems that the request for the default ringtone is returning null (""Failed to open ringtone content://settings/system/ringtone"").  I've asked these users to change ringtones, and sometimes this resolves the issue, but in other cases (HTC Hero in both the ones I know of) changing the ringtone does not fix the problem.  I have been unable to reproduce this problem on any of our test devices.  Any thoughts as to what might cause this, how to debug, or how to resolve?</p><pre><code>D/Ringtone(  743): create mAudioD/MediaPlayer(  743): setDataSource(44, 0, 576460752303423487) pid = 743E/Mp3HwPlayer(   56): ID:24, new Mp3HwPlayerE/MediaPlayerService(   56): getPlayerType(): Has ID3 info, size = 1024E/MediaPlayerService(   56): getPlayerType(): Input buffer is MPA formatE/Mp3HwPlayer(   56): ID:24, destory Mp3HwPlayerD/MediaPlayerService(   56): Create Player playertype=6D/MediaPlayerService(   56): new PVPlayer for MP3D/PVPlayer(   56): setDataSource(25, 0, 180143)D/MediaPlayerService(   56): MediaPlayerService::Client::setDataSource exitD/MediaPlayerService(   56): returned from setDataSource() in MediaPlayerService::createD/MediaPlayerService(   56): [23] prepareAsyncI/PlayerDriver(   56): OpenCore disable firewall payloadW/MediaPlayer(  743): info/warning (1, 26)E/PlayerDriver(   56): Command PLAYER_PREPARE completed with an error or info PVMFErrResourceE/MediaPlayer(  743): error (1, -17)E/RingtoneManager(  743): Failed to open ringtone content://settings/system/ringtoneE/RingtoneManager(  743): unable to find a usable ringtoneE/IncomingRinger(  743): Couldn't find a ringtone for URI: content://settings/system/ringtone</code></pre>","540461","","","","","2011-02-10 04:15:01","""RingtoneManager: unable to find a usable ringtone"" persistent error","<android><media-player><ringtone>","1","0","","",""
"4428643","1","4499955","","2010-12-13 12:07:45","0","782","<p>I'd like to examine stack traces from the last hours. I haven't found a proper <a href=""http://developer.android.com/guide/developing/tools/adb.html#logcat"" rel=""nofollow"">logcat</a> command. Does Android ""forget"" those logs? </p><p><em>First story:</em></p><p><em>When I find an unhandled exception in my co-workers Iphone App, he connects the iphone to his computer and reads the stack trace into x-code. X-Code also visualizes the exception in a nice way.Is there a smth. similar in Android?</em></p>","433718","","433718","","2010-12-21 13:10:37","2010-12-21 13:52:58","Examine logs from the past with logcat?","<android><debugging><logging><stack-trace><android-logcat>","2","0","1","",""
"4428703","1","","","2010-12-13 12:15:15","0","271","<p>Is it possible to disable my android device not to get detected in TV or PC if it is connected using USB ports ? I want to do it through programming using java or android.</p><p>Thanks,Senthil.M </p>","404196","","","","","2010-12-13 12:23:02","Prevent video output from Android Mobile to PC","<android><video><tv>","1","0","","",""
"4428711","1","4428744","","2010-12-13 12:17:23","0","1423","<p>i am using following code to show date picker in android</p><pre><code>DatePickerDialog dial= new DatePickerDialog(this.getContext(),0,mDateSetListener,thisYear,thisMonth,thisDay);            dial.setOnDismissListener(new OnDismissListener() {                @Override                public void onDismiss(DialogInterface arg0) {                    // dismiss it.                }            });dial.show();</code></pre><p>now i want to pick time too along with date any one guide me how to achieve this?</p>","249991","","","","","2010-12-13 13:34:42","how to show dialog to pick date and time togather?","<android>","2","0","","",""
"4428730","1","4758498","","2010-12-13 12:19:48","6","15196","<p>I am trying to replicate this feature of Maps in Android:<img src=""http://i.stack.imgur.com/IF99l.png"" alt=""Custom Map Overlay""></p><p>You can see that on the map, there's a Circle depicting the range that the user has selected.</p><p>In my application, I'll also want a dragger to reside on the perimeter of the circle, which can be dragged to redefine radius.</p><p>If someone could tell me how to draw custom drawable overlays and 2D graphics over map, I can do other things on my own.</p><p>Thanks!</p><p>The full application can be reached at <a href=""http://www.geochirp.com"">this link</a></p>","243709","","","","","2012-02-18 11:35:46","Creating Custom Overlay on the map","<android><android-sdk-2.1><android-maps>","3","0","20","",""
"4428802","1","","","2010-12-13 12:28:44","1","360","<p>I want to design my app. with more modularity. In my app most of the screens are <code>ListView</code>s, and with similar list items.</p><p>For eg. I have 3 <code>ListView</code>s, each for a different category. (Music list, Audi list, Video list) and 1 Main view, that list latest 2 list items of each category.</p><p>My Plan is to reuse the 3 inner <code>ListView</code>s on my Main view as as list items.</p>","540500","","119895","","2010-12-13 12:30:47","2010-12-13 12:34:44","Can I use a ListView inside another ListView","<android><listview>","2","0","","",""
"4428803","1","4428864","","2010-12-13 12:28:45","0","160","<p>I am totally new to android development....what piece of code shall I write to move back to the last activity from the current activity on a button click?I use intents to switch between the activities but is there anything specific to resume back on the last activity?Please advise...</p><p>Thanks,</p>","517234","","918472","","2012-12-24 13:52:22","2012-12-24 13:52:22","Resuming last activity","<android><activity>","3","0","","",""
"4428860","1","4428898","","2010-12-13 12:34:27","4","4237","<p>I have a handler that I am using as follows:</p><pre><code>handler.postDelayed(Play, 1000);</code></pre><p>when my application onPause() is called before this is done, I need to pause it and tell it not to perform the ""postDelayed"" until I resume.</p><p>is this possible, or is there an alternative way?</p><p>My problem is that when onPause() is called I pause the audio (SoundManager), but if this handler.postDelayed is called after that, the audio will not be paused and will continue to play with my application in the background.</p><pre><code>@Overridepublic void onPause(){  Soundmanager.autoPause()}</code></pre><p>but then the postDelayed after 1000ms starts the audio playing again.</p>","353674","","","","","2012-10-26 04:50:49","Android, pausing and resuming handler callbacks","<android><callback><handler>","2","0","1","",""
"4428866","1","4428960","","2010-12-13 12:34:51","0","915","<p>Hi <br>I am writing an Android application in which I want to retrieve the images stored in Gallery folder of Device/emulator. Can any one give me sample code regarding how to achieve this.<br>Thanks and Regards</p>","429501","","","","","2010-12-13 12:48:23","How to retrieve images stored in Gallery folder of Android device","<android>","2","0","","",""
"4428923","1","4429006","","2010-12-13 12:43:14","0","1049","<p>most of my application will not look so well on landscape, but that's the user choice as far as i'm concerned if to see the application on 'wide' screen.However i have an auto complete screen and that screen cannot function in landscape mode since when user input text and i bring the results into the list view on screen the user can't see the listview since the virtual keyboard covers it all.So i thought of defining in the manifest that this activity wont be used in landscape, but i CAN use it in landscape mode for devices with hardware keyboard that is open...</p><p>So either i can define it in the manifest (couldn't find how) or i need to do it melodramatically (discover the keyboard existence and open to support it, or disable the rotation otherwise).</p><p>Anyone knows how to do that ?:</p>","312288","","","","","2010-12-13 12:59:50","can i allow an android activity to change to landscape only on certain conditions?","<android><conditional><rotation>","2","0","","",""
"4429036","1","4429060","","2010-12-13 12:59:01","11","13339","<p>I am having <strong>2 String arrays</strong> inside First Activity - A , now i need to pass both the arrays to the second_activity - B, how do i do it ? </p><p>I know about the <strong><code>Intent</code></strong> kind of concept in Android and already passed just single variable value to another activity, but i haven't implement the concept of passing string arrays between activities, i have already surfed net for the same.</p><p>pls let me know about the possible solution.</p>","379693","","","","","2010-12-13 13:12:27","Passing string array between android activities","<android>","2","0","6","",""
"4429043","1","","","2010-12-13 12:59:35","17","23674","<pre><code>can anybody have any idea how to stop ASyncTask thread in android?.</code></pre><p>Actually i have a loop which creates threads and executes them. and when this loop will end i want to stop all that threads which have run.is there anyway to stop threads?</p><p>thanks alot.</p>","397901","","","","","2013-05-21 13:02:43","how to stop ASyncTask thread in android","<android><multithreading><android-asynctask>","2","1","4","",""
"4429196","1","","","2010-12-13 13:21:52","-1","778","<p>i have a fingerprint reader device for pc but now i want to connect that fingerprint reader to my android mobile ?anyone help me which is the usb connector for this???</p>","538626","","","","","2010-12-13 16:27:43","fingerprint reader","<android>","2","0","","2010-12-13 18:39:45",""
"4429278","1","","","2010-12-13 13:32:04","1","558","<p>I got a error when create a sample application for mapview..Couldn't get connection factory client.. Pls give me a resolution for tis..</p>","540560","","","","","2012-09-26 09:14:59","Android MapView","<android><android-mapview>","0","4","1","",""
"4429324","1","4496524","","2010-12-13 13:37:27","0","2500","<p>On Androids Facebook SDK there is a single login feature which I can't get to work.Done all the key hash thing but maybe there is something wrong with this method.What exactly should I pass on, or could somebody explain what this is supposed to do?</p><p><code>@Override</p><p>protected void onActivityResult(int requestCode, int resultCode, Intent data) {facebook.authorizeCallback(requestCode, resultCode, data);}</code></p>","525016","","","","","2011-03-31 09:27:57","Androids Facebook SDK, single sign on question?","<android><facebook>","3","0","2","",""
"4429600","1","4429660","","2010-12-13 14:07:18","1","641","<p>i am making an andriod application in which i need to go from one page to another on a button click. i have tried several things but nothing worked out.</p>","540592","","","","","2010-12-13 14:13:04","i want to know how to navigate from one XML page to another in Java AWT on button click","<java><android>","1","1","","",""
"4429605","1","4430334","","2010-12-13 14:07:31","2","3556","<p>I am working on app and it is almost finnished exept only one thing: i dont know how to get  link speed and place it in the status bar.I am new to Java so if somebody could help me i would be very greatful. P.S. Sorry for bad English.</p>","540598","","","","","2010-12-13 15:20:22","How to get link speed programmatically?","<java><android><networking>","3","4","6","",""
"4429775","1","","","2010-12-13 14:28:13","7","10106","<p>Is there a definitive method of creating either a PDF or a MS Word Doc file within the app and email it immediately (and possibly, also store it).</p><p>I have been trying for quite some time and have found out the JAVA libraries: apwlibrary and iText. But both of them dont provide any tutorials of sorts.</p><p>Could anyone point me in the right direction?</p><p>EDIT: Come to think of it, is could an online PDF generator be used, first by sending the data to the service, then retrieve the result and save it on the phone?</p>","450534","","948041","","2012-03-24 10:59:59","2013-02-08 09:22:49","Create PDF / Word (Doc) file within app","<android><pdf><ms-word><pdf-generation>","4","2","1","",""
"4429897","1","","","2010-12-13 14:38:54","0","905","<p>I'm currently using the following code to ask the user to choose an image from memory and to crop it, but it keeps crashing.</p><pre><code>      Intent i = new Intent(Intent.ACTION_PICK,         android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);  i.putExtra(""crop"", ""true"");         i.putExtra(""outputX"", 90);         i.putExtra(""outputY"", 90);         i.putExtra(""aspectX"", 1);         i.putExtra(""aspectY"", 1);         i.putExtra(""scale"", true);         startActivityForResult(i, 1); </code></pre><p>And then, inside ""onActivityResult"" I've found data.getData() is null (whether when I comment out the ""crop"" extra it contains the image Uri), and extras.getParcelable(""data"") is null as well. :S</p><p>Does anybody have any clue, please?</p>","531279","","","","","2010-12-13 21:54:37","Android Crop Image crash","<android>","1","0","","",""
"4429909","1","","","2010-12-13 14:40:13","0","1973","<p><strong>Update 1:</strong></p><p>I followed the directions provided by Archimedes below. Problem is that my API 9 ""drawable"" folder already has an XML doc titled ""btn_radio.xml"" and the code inside is exactly the same as you presented above. Now, when I go back to eclipse and tell it: </p><pre><code>`&lt;RadioButton android:background=""@drawable/btn_radio"" ... /&gt;`</code></pre><p>I get an error message in return saying Error: No resource found that matches the given name (at 'background' with value '@drawable/btn_radio_on').</p><p>So what I did instead is I went to the API 8 folder and looked found the drawable_hdpi and mdpi folders, did a search for btn_radio_off and btn_radio_on and copied those two images into the corresponding API 9 folders. This fixed the issue in Eclipse of radio button backgrounds not showing up. However, when I run my code, the virtual device still displays the old broken (transparent) image.* </p><p><strong>Original Post:</strong></p><p>Hi, I'm following a Gingerbread 2.3 (I'm running Win7/Eclipse) tutorial from this site and I'm looking at this image here: <a href=""http://www.vogella.de/articles/Android/images/first50.gif"" rel=""nofollow"">http://www.vogella.de/articles/Android/images/first50.gif</a> </p><p>Each time I add a new radio button to my graphical layout in Main.xml the silver part of the radio button is transparent. So regardless of the background color of the main window, I will only see the outline of a radio button and that radio button will be filled in with the color of the entire background.</p><p>If I create a grouped item and put two radio buttons in a group, I can get toggle between the two and the green indicator showing which one is toggled is available but the buttons themselves are transparent.</p><p>How do I make my radio button look like the one in the image above? It seems that no matter how many times I start a ""new"" project, the problem persists. The only thing that affects it is toggling another ""theme"" but that's not really a solution once I run the app.</p><p>Thanks for your help.</p>","540647","","540647","","2010-12-14 12:51:48","2010-12-14 12:51:48","My radio button background is transparent, how do I make it opaque?","<android><button><transparency><radio>","2","1","1","",""
"4429928","1","4431340","","2010-12-13 14:42:13","6","8634","<p>Can anybody help me...</p><p>I would like a actionbar above my tabinterface.. <br />How can I implement an actionbar in my main xml..</p><p>I can't find any tutorial with a actionbar and tabinterface..</p><p>Thanks in advance! </p>","468003","","","","","2014-03-12 14:27:44","Android: Actionbar","<java><android><xml><tabs><android-layout>","3","1","7","",""
"4429953","1","4430027","","2010-12-13 14:44:23","1","616","<p>Can I use my existing ListView as a sub-view in another view.</p><p>eg. I have a custom view, players list, I have implemented with a ListActivity and ArrayAdapter and is working fine. </p><p>Now I want a way to get this listview as View object so that I can add this view object as a child to another view.</p><p>I am thinking like, to build entire listview: my ListActivity is calling the ArrayAdapter iteratively by passing ArrayList item each time to build a list item view.</p><p>If I am correct, I need a way to call the same ArrayAdapter and need to prepare a ListView Object, right?</p><p>Can anybody plz help me.</p><p>Thanks in advance.vpapana</p>","540638","","540638","","2011-03-11 18:19:56","2011-03-11 18:19:56","How to reuse one custom listview activity in another activity?","<android><android-listview>","1","0","","",""
"4429971","1","4430197","","2010-12-13 14:46:27","1","1652","<p>I need to get the state the activity just came out of, for example, I need to run some code in my onResume(), but only after it is called following onPause() and not on following on Start().</p><p>If onResume() is called after onStop() then I need to run some different code.</p><p>How should I properly check this?</p>","353674","","","","","2010-12-13 15:08:20","Android, get previous state of activity?","<android><activity><state>","1","0","1","",""
"4430004","1","4432804","","2010-12-13 14:50:01","1","5589","<p>I'm developing an Android 2.2 application.</p><p>I want to add some big text files (4.5MB or more) to Android project.</p><p>First I don't know if I can add such kind of big files to assets folder. But, if I can, is it possible to compress them?</p><p>How can I compress files? and decompress?</p><p>Any other better way to add big text files to Android project?</p><p>Thanks.</p>","68571","","13070","","2010-12-13 14:54:50","2011-09-14 14:07:13","Adding a big text file to assets folder","<android><compression><embedded-resource>","5","1","","",""
"4430088","1","4435457","","2010-12-13 14:58:57","4","8082","<p>I'm trying to return the location selected by the user in the Google Maps Android application, but I can't seem to find information about how to achieve this task.</p><p>I created an Intent to open the GMaps Activity, but the user can't select a point on the map nor does the Activity return a point to my application when it is closed.</p><p>I'm using <code>startActiviyForResult</code>, since I'm expecting a result back from the Activity.</p>","114227","","854864","","2014-01-08 04:23:48","2014-03-20 10:34:34","Get selected location from Google Maps activity","<android><google-maps>","5","0","3","",""
"4430240","1","4431478","","2010-12-13 15:11:53","0","1340","<p>I try creating a standard android module in intellij idea v.9.0. I checked the ""Create Hello World"" option. I compiled everything. I created a AVD. I ran the sollution.I got the error ""Error loading preferences"" in a window that soon dissapeared afterwords. THe emulater started ok but without my application.</p><p>Any idea? Thanks in advance</p>","242721","","","","","2010-12-13 17:15:03","intellij android hello world doesn't work ""Error loading preferences""","<java><android><intellij-idea><hello-world>","1","0","1","",""
"4430418","1","","","2010-12-13 15:29:01","0","290","<p>Is there any class available within as3 to get the android device id in flash cs5?</p>","16458","","16458","","2010-12-13 20:54:38","2010-12-13 20:54:38","Android device id in flash","<android><flash><actionscript-3><cs5>","0","2","","",""
"4430492","1","4430911","","2010-12-13 15:37:21","1","597","<p>I just used the new ProGuard tool in eclipse to obfuscation my application.  The I decompiled it using <a href=""http://code.google.com/p/dex2jar/"" rel=""nofollow"">dex2Jar</a> and <a href=""http://java.decompiler.free.fr/"" rel=""nofollow"">JD-GUI</a> to inspect what happened.</p><p>I noticed that everything from the R class has been converted to a random number like the following.</p><pre><code>new SimpleCursorAdapter(localActivity, 2130903058, localCursor, arrayOfString, arrayOfInt);</code></pre><p>2130903058 was a layout file.  Strings an arrays get the same treatment.</p><p>There is no R class in the decompiled code, where has it gone?  Where are the references to the original strings?</p>","248521","","248521","","2010-12-13 15:44:45","2010-12-13 16:17:01","Android Strings turn to random number after proguard Obfuscation","<android><proguard>","1","0","1","",""
"4430563","1","4430787","","2010-12-13 15:43:19","2","6792","<p>i have a android timepicker, and i need to get his time in java code, and transform it into a string with this appereance: ""08:00:00"" (hours, mins, secs)</p><p>can someone help me to do it in a easy way?</p><p>code example will be appreciated</p>","479886","","479886","","2010-12-13 15:54:28","2013-12-02 11:08:06","How can i get the time of a TimePicker in this format -> ""08:00:00""?","<android><parsing><timepicker>","5","0","","",""
